ag-grid-community.noStyle.js 2.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057
  1. /**
  2. * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3. * @version v23.2.1
  4. * @link http://www.ag-grid.com/
  5. * @license MIT
  6. */
  7. // @ag-grid-community/all-modules v23.2.1
  8. (function webpackUniversalModuleDefinition(root, factory) {
  9. if(typeof exports === 'object' && typeof module === 'object')
  10. module.exports = factory();
  11. else if(typeof define === 'function' && define.amd)
  12. define([], factory);
  13. else if(typeof exports === 'object')
  14. exports["agGrid"] = factory();
  15. else
  16. root["agGrid"] = factory();
  17. })(window, function() {
  18. return /******/ (function(modules) { // webpackBootstrap
  19. /******/ // The module cache
  20. /******/ var installedModules = {};
  21. /******/
  22. /******/ // The require function
  23. /******/ function __webpack_require__(moduleId) {
  24. /******/
  25. /******/ // Check if module is in cache
  26. /******/ if(installedModules[moduleId]) {
  27. /******/ return installedModules[moduleId].exports;
  28. /******/ }
  29. /******/ // Create a new module (and put it into the cache)
  30. /******/ var module = installedModules[moduleId] = {
  31. /******/ i: moduleId,
  32. /******/ l: false,
  33. /******/ exports: {}
  34. /******/ };
  35. /******/
  36. /******/ // Execute the module function
  37. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  38. /******/
  39. /******/ // Flag the module as loaded
  40. /******/ module.l = true;
  41. /******/
  42. /******/ // Return the exports of the module
  43. /******/ return module.exports;
  44. /******/ }
  45. /******/
  46. /******/
  47. /******/ // expose the modules object (__webpack_modules__)
  48. /******/ __webpack_require__.m = modules;
  49. /******/
  50. /******/ // expose the module cache
  51. /******/ __webpack_require__.c = installedModules;
  52. /******/
  53. /******/ // define getter function for harmony exports
  54. /******/ __webpack_require__.d = function(exports, name, getter) {
  55. /******/ if(!__webpack_require__.o(exports, name)) {
  56. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  57. /******/ }
  58. /******/ };
  59. /******/
  60. /******/ // define __esModule on exports
  61. /******/ __webpack_require__.r = function(exports) {
  62. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  63. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  64. /******/ }
  65. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  66. /******/ };
  67. /******/
  68. /******/ // create a fake namespace object
  69. /******/ // mode & 1: value is a module id, require it
  70. /******/ // mode & 2: merge all properties of value into the ns
  71. /******/ // mode & 4: return value when already ns object
  72. /******/ // mode & 8|1: behave like require
  73. /******/ __webpack_require__.t = function(value, mode) {
  74. /******/ if(mode & 1) value = __webpack_require__(value);
  75. /******/ if(mode & 8) return value;
  76. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  77. /******/ var ns = Object.create(null);
  78. /******/ __webpack_require__.r(ns);
  79. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  80. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  81. /******/ return ns;
  82. /******/ };
  83. /******/
  84. /******/ // getDefaultExport function for compatibility with non-harmony modules
  85. /******/ __webpack_require__.n = function(module) {
  86. /******/ var getter = module && module.__esModule ?
  87. /******/ function getDefault() { return module['default']; } :
  88. /******/ function getModuleExports() { return module; };
  89. /******/ __webpack_require__.d(getter, 'a', getter);
  90. /******/ return getter;
  91. /******/ };
  92. /******/
  93. /******/ // Object.prototype.hasOwnProperty.call
  94. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  95. /******/
  96. /******/ // __webpack_public_path__
  97. /******/ __webpack_require__.p = "";
  98. /******/
  99. /******/
  100. /******/ // Load entry module and return exports
  101. /******/ return __webpack_require__(__webpack_require__.s = 0);
  102. /******/ })
  103. /************************************************************************/
  104. /******/ ([
  105. /* 0 */
  106. /***/ (function(module, exports, __webpack_require__) {
  107. /**
  108. * AUTOMATICALLY GENERATED FILE, DO NOT EDIT MANUALLY!
  109. * Update this file by running `lerna run webpack-updater` in the monorepo root folder.
  110. */
  111. var ClientSideRowModelModule = __webpack_require__(1);
  112. var GridCoreModule = __webpack_require__(3);
  113. var CsvExportModule = __webpack_require__(211);
  114. var InfiniteRowModelModule = __webpack_require__(218);
  115. var agGrid = __webpack_require__(223);
  116. Object.keys(agGrid).forEach(function(key) {
  117. exports[key] = agGrid[key];
  118. });
  119. agGrid.ModuleRegistry.register(ClientSideRowModelModule.ClientSideRowModelModule);
  120. agGrid.ModuleRegistry.register(CsvExportModule.CsvExportModule);
  121. agGrid.ModuleRegistry.register(InfiniteRowModelModule.InfiniteRowModelModule);
  122. /***/ }),
  123. /* 1 */
  124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125. "use strict";
  126. __webpack_require__.r(__webpack_exports__);
  127. /* harmony import */ var _clientSideRowModelModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
  128. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClientSideRowModelModule", function() { return _clientSideRowModelModule__WEBPACK_IMPORTED_MODULE_0__["ClientSideRowModelModule"]; });
  129. /***/ }),
  130. /* 2 */
  131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientSideRowModelModule", function() { return ClientSideRowModelModule; });
  135. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  136. /* harmony import */ var _clientSideRowModel_clientSideRowModel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203);
  137. /* harmony import */ var _clientSideRowModel_filterStage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(205);
  138. /* harmony import */ var _clientSideRowModel_sortStage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(206);
  139. /* harmony import */ var _clientSideRowModel_flattenStage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(207);
  140. /* harmony import */ var _clientSideRowModel_sortService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(208);
  141. /* harmony import */ var _clientSideRowModel_filterService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(209);
  142. /* harmony import */ var _clientSideRowModel_immutableService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(210);
  143. var ClientSideRowModelModule = {
  144. moduleName: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["ModuleNames"].ClientSideRowModelModule,
  145. beans: [_clientSideRowModel_filterStage__WEBPACK_IMPORTED_MODULE_2__["FilterStage"], _clientSideRowModel_sortStage__WEBPACK_IMPORTED_MODULE_3__["SortStage"], _clientSideRowModel_flattenStage__WEBPACK_IMPORTED_MODULE_4__["FlattenStage"], _clientSideRowModel_sortService__WEBPACK_IMPORTED_MODULE_5__["SortService"], _clientSideRowModel_filterService__WEBPACK_IMPORTED_MODULE_6__["FilterService"], _clientSideRowModel_immutableService__WEBPACK_IMPORTED_MODULE_7__["ImmutableService"]],
  146. rowModels: { clientSide: _clientSideRowModel_clientSideRowModel__WEBPACK_IMPORTED_MODULE_1__["ClientSideRowModel"] }
  147. };
  148. /***/ }),
  149. /* 3 */
  150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  151. "use strict";
  152. __webpack_require__.r(__webpack_exports__);
  153. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
  154. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnFactory", function() { return _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_0__["ColumnFactory"]; });
  155. /* harmony import */ var _columnController_columnController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42);
  156. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnController", function() { return _columnController_columnController__WEBPACK_IMPORTED_MODULE_1__["ColumnController"]; });
  157. /* harmony import */ var _columnController_columnKeyCreator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
  158. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnKeyCreator", function() { return _columnController_columnKeyCreator__WEBPACK_IMPORTED_MODULE_2__["ColumnKeyCreator"]; });
  159. /* harmony import */ var _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46);
  160. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnUtils", function() { return _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_3__["ColumnUtils"]; });
  161. /* harmony import */ var _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47);
  162. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DisplayedGroupCreator", function() { return _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_4__["DisplayedGroupCreator"]; });
  163. /* harmony import */ var _columnController_groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45);
  164. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupInstanceIdCreator", function() { return _columnController_groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__["GroupInstanceIdCreator"]; });
  165. /* harmony import */ var _components_componentUtil__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48);
  166. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ComponentUtil", function() { return _components_componentUtil__WEBPACK_IMPORTED_MODULE_6__["ComponentUtil"]; });
  167. /* harmony import */ var _components_colDefUtil__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(51);
  168. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColDefUtil", function() { return _components_colDefUtil__WEBPACK_IMPORTED_MODULE_7__["ColDefUtil"]; });
  169. /* harmony import */ var _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53);
  170. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserComponentRegistry", function() { return _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_8__["UserComponentRegistry"]; });
  171. /* harmony import */ var _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(74);
  172. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserComponentFactory", function() { return _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_9__["UserComponentFactory"]; });
  173. /* harmony import */ var _components_agGridNg1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(94);
  174. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithAngular1", function() { return _components_agGridNg1__WEBPACK_IMPORTED_MODULE_10__["initialiseAgGridWithAngular1"]; });
  175. /* harmony import */ var _components_agGridWebComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(193);
  176. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithWebComponents", function() { return _components_agGridWebComponent__WEBPACK_IMPORTED_MODULE_11__["initialiseAgGridWithWebComponents"]; });
  177. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(41);
  178. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BeanStub", function() { return _context_beanStub__WEBPACK_IMPORTED_MODULE_12__["BeanStub"]; });
  179. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(37);
  180. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Context"]; });
  181. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autowired", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Autowired"]; });
  182. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostConstruct", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["PostConstruct"]; });
  183. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreConstruct", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["PreConstruct"]; });
  184. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Optional"]; });
  185. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Bean", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Bean"]; });
  186. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Qualifier", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["Qualifier"]; });
  187. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreDestroy", function() { return _context_context__WEBPACK_IMPORTED_MODULE_13__["PreDestroy"]; });
  188. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57);
  189. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuerySelector", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["QuerySelector"]; });
  190. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GuiListener", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["GuiListener"]; });
  191. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RefSelector", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["RefSelector"]; });
  192. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridListener", function() { return _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_14__["GridListener"]; });
  193. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(104);
  194. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragAndDropService", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["DragAndDropService"]; });
  195. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragSourceType", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["DragSourceType"]; });
  196. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalDirection", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["HorizontalDirection"]; });
  197. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VerticalDirection", function() { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_15__["VerticalDirection"]; });
  198. /* harmony import */ var _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(139);
  199. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragService", function() { return _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_16__["DragService"]; });
  200. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(35);
  201. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return _entities_column__WEBPACK_IMPORTED_MODULE_17__["Column"]; });
  202. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(34);
  203. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnGroup", function() { return _entities_columnGroup__WEBPACK_IMPORTED_MODULE_18__["ColumnGroup"]; });
  204. /* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(33);
  205. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OriginalColumnGroup", function() { return _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_19__["OriginalColumnGroup"]; });
  206. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(68);
  207. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNode", function() { return _entities_rowNode__WEBPACK_IMPORTED_MODULE_20__["RowNode"]; });
  208. /* harmony import */ var _filter_filterManager__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(125);
  209. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FilterManager", function() { return _filter_filterManager__WEBPACK_IMPORTED_MODULE_21__["FilterManager"]; });
  210. /* harmony import */ var _filter_provided_providedFilter__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(62);
  211. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProvidedFilter", function() { return _filter_provided_providedFilter__WEBPACK_IMPORTED_MODULE_22__["ProvidedFilter"]; });
  212. /* harmony import */ var _filter_provided_simpleFilter__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(60);
  213. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleFilter", function() { return _filter_provided_simpleFilter__WEBPACK_IMPORTED_MODULE_23__["SimpleFilter"]; });
  214. /* harmony import */ var _filter_provided_scalarFilter__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(63);
  215. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScalarFilter", function() { return _filter_provided_scalarFilter__WEBPACK_IMPORTED_MODULE_24__["ScalarFilter"]; });
  216. /* harmony import */ var _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(83);
  217. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberFilter", function() { return _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_25__["NumberFilter"]; });
  218. /* harmony import */ var _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(90);
  219. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextFilter", function() { return _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_26__["TextFilter"]; });
  220. /* harmony import */ var _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(58);
  221. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateFilter", function() { return _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_27__["DateFilter"]; });
  222. /* harmony import */ var _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(127);
  223. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridPanel", function() { return _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_28__["GridPanel"]; });
  224. /* harmony import */ var _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(148);
  225. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScrollVisibleService", function() { return _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_29__["ScrollVisibleService"]; });
  226. /* harmony import */ var _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(142);
  227. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseEventService", function() { return _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_30__["MouseEventService"]; });
  228. /* harmony import */ var _headerRendering_bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(123);
  229. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyDropPivotTarget", function() { return _headerRendering_bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_31__["BodyDropPivotTarget"]; });
  230. /* harmony import */ var _headerRendering_bodyDropTarget__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(121);
  231. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyDropTarget", function() { return _headerRendering_bodyDropTarget__WEBPACK_IMPORTED_MODULE_32__["BodyDropTarget"]; });
  232. /* harmony import */ var _headerRendering_cssClassApplier__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(112);
  233. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CssClassApplier", function() { return _headerRendering_cssClassApplier__WEBPACK_IMPORTED_MODULE_33__["CssClassApplier"]; });
  234. /* harmony import */ var _headerRendering_headerContainer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(109);
  235. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderContainer", function() { return _headerRendering_headerContainer__WEBPACK_IMPORTED_MODULE_34__["HeaderContainer"]; });
  236. /* harmony import */ var _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(108);
  237. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRootComp", function() { return _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_35__["HeaderRootComp"]; });
  238. /* harmony import */ var _headerRendering_headerRowComp__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(110);
  239. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRowComp", function() { return _headerRendering_headerRowComp__WEBPACK_IMPORTED_MODULE_36__["HeaderRowComp"]; });
  240. /* harmony import */ var _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(136);
  241. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalResizeService", function() { return _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_37__["HorizontalResizeService"]; });
  242. /* harmony import */ var _headerRendering_moveColumnController__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(122);
  243. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MoveColumnController", function() { return _headerRendering_moveColumnController__WEBPACK_IMPORTED_MODULE_38__["MoveColumnController"]; });
  244. /* harmony import */ var _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(138);
  245. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StandardMenuFactory", function() { return _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_39__["StandardMenuFactory"]; });
  246. /* harmony import */ var _layout_tabbedLayout__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(194);
  247. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabbedLayout", function() { return _layout_tabbedLayout__WEBPACK_IMPORTED_MODULE_40__["TabbedLayout"]; });
  248. /* harmony import */ var _misc_simpleHttpRequest__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(195);
  249. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "simpleHttpRequest", function() { return _misc_simpleHttpRequest__WEBPACK_IMPORTED_MODULE_41__["simpleHttpRequest"]; });
  250. /* harmony import */ var _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(168);
  251. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserverService", function() { return _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_42__["ResizeObserverService"]; });
  252. /* harmony import */ var _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(82);
  253. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LargeTextCellEditor", function() { return _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_43__["LargeTextCellEditor"]; });
  254. /* harmony import */ var _rendering_cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(105);
  255. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupEditorWrapper", function() { return _rendering_cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_44__["PopupEditorWrapper"]; });
  256. /* harmony import */ var _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(81);
  257. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupSelectCellEditor", function() { return _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_45__["PopupSelectCellEditor"]; });
  258. /* harmony import */ var _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(80);
  259. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupTextCellEditor", function() { return _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_46__["PopupTextCellEditor"]; });
  260. /* harmony import */ var _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(79);
  261. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectCellEditor", function() { return _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_47__["SelectCellEditor"]; });
  262. /* harmony import */ var _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(54);
  263. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextCellEditor", function() { return _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_48__["TextCellEditor"]; });
  264. /* harmony import */ var _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(76);
  265. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimateShowChangeCellRenderer", function() { return _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_49__["AnimateShowChangeCellRenderer"]; });
  266. /* harmony import */ var _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(77);
  267. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimateSlideCellRenderer", function() { return _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_50__["AnimateSlideCellRenderer"]; });
  268. /* harmony import */ var _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(67);
  269. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupCellRenderer", function() { return _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_51__["GroupCellRenderer"]; });
  270. /* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(114);
  271. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SetLeftFeature", function() { return _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_52__["SetLeftFeature"]; });
  272. /* harmony import */ var _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(135);
  273. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoWidthCalculator", function() { return _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_53__["AutoWidthCalculator"]; });
  274. /* harmony import */ var _rendering_cellRendererFactory__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(144);
  275. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellRendererFactory", function() { return _rendering_cellRendererFactory__WEBPACK_IMPORTED_MODULE_54__["CellRendererFactory"]; });
  276. /* harmony import */ var _rendering_checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(69);
  277. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckboxSelectionComponent", function() { return _rendering_checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_55__["CheckboxSelectionComponent"]; });
  278. /* harmony import */ var _rendering_cellComp__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(101);
  279. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellComp", function() { return _rendering_cellComp__WEBPACK_IMPORTED_MODULE_56__["CellComp"]; });
  280. /* harmony import */ var _rendering_rowComp__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(100);
  281. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowComp", function() { return _rendering_rowComp__WEBPACK_IMPORTED_MODULE_57__["RowComp"]; });
  282. /* harmony import */ var _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(99);
  283. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowRenderer", function() { return _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_58__["RowRenderer"]; });
  284. /* harmony import */ var _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(145);
  285. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueFormatterService", function() { return _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_59__["ValueFormatterService"]; });
  286. /* harmony import */ var _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(188);
  287. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PinnedRowModel", function() { return _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_60__["PinnedRowModel"]; });
  288. /* harmony import */ var _utils_changedPath__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(97);
  289. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChangedPath", function() { return _utils_changedPath__WEBPACK_IMPORTED_MODULE_61__["ChangedPath"]; });
  290. /* harmony import */ var _modules_rowNodeCache_rowNodeBlock__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(196);
  291. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlock", function() { return _modules_rowNodeCache_rowNodeBlock__WEBPACK_IMPORTED_MODULE_62__["RowNodeBlock"]; });
  292. /* harmony import */ var _modules_rowNodeCache_rowNodeBlockLoader__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(197);
  293. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlockLoader", function() { return _modules_rowNodeCache_rowNodeBlockLoader__WEBPACK_IMPORTED_MODULE_63__["RowNodeBlockLoader"]; });
  294. /* harmony import */ var _modules_rowNodeCache_rowNodeCache__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(198);
  295. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeCache", function() { return _modules_rowNodeCache_rowNodeCache__WEBPACK_IMPORTED_MODULE_64__["RowNodeCache"]; });
  296. /* harmony import */ var _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(153);
  297. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PaginationProxy", function() { return _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_65__["PaginationProxy"]; });
  298. /* harmony import */ var _styling_stylingService__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(149);
  299. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylingService", function() { return _styling_stylingService__WEBPACK_IMPORTED_MODULE_66__["StylingService"]; });
  300. /* harmony import */ var _widgets_agAbstractField__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(72);
  301. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgAbstractField", function() { return _widgets_agAbstractField__WEBPACK_IMPORTED_MODULE_67__["AgAbstractField"]; });
  302. /* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(70);
  303. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgCheckbox", function() { return _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_68__["AgCheckbox"]; });
  304. /* harmony import */ var _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(146);
  305. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgRadioButton", function() { return _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_69__["AgRadioButton"]; });
  306. /* harmony import */ var _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(184);
  307. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgToggleButton", function() { return _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_70__["AgToggleButton"]; });
  308. /* harmony import */ var _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(173);
  309. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputTextField", function() { return _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_71__["AgInputTextField"]; });
  310. /* harmony import */ var _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(174);
  311. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputTextArea", function() { return _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_72__["AgInputTextArea"]; });
  312. /* harmony import */ var _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(179);
  313. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputNumberField", function() { return _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_73__["AgInputNumberField"]; });
  314. /* harmony import */ var _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(180);
  315. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputRange", function() { return _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_74__["AgInputRange"]; });
  316. /* harmony import */ var _widgets_agSelect__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(181);
  317. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgSelect", function() { return _widgets_agSelect__WEBPACK_IMPORTED_MODULE_75__["AgSelect"]; });
  318. /* harmony import */ var _widgets_agSlider__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(175);
  319. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgSlider", function() { return _widgets_agSlider__WEBPACK_IMPORTED_MODULE_76__["AgSlider"]; });
  320. /* harmony import */ var _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(183);
  321. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgAngleSelect", function() { return _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_77__["AgAngleSelect"]; });
  322. /* harmony import */ var _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(176);
  323. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgColorPicker", function() { return _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_78__["AgColorPicker"]; });
  324. /* harmony import */ var _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(170);
  325. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgGroupComponent", function() { return _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_79__["AgGroupComponent"]; });
  326. /* harmony import */ var _widgets_agDialog__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(171);
  327. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgDialog", function() { return _widgets_agDialog__WEBPACK_IMPORTED_MODULE_80__["AgDialog"]; });
  328. /* harmony import */ var _widgets_agPanel__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(172);
  329. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPanel", function() { return _widgets_agPanel__WEBPACK_IMPORTED_MODULE_81__["AgPanel"]; });
  330. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(56);
  331. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return _widgets_component__WEBPACK_IMPORTED_MODULE_82__["Component"]; });
  332. /* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(117);
  333. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManagedFocusComponent", function() { return _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_83__["ManagedFocusComponent"]; });
  334. /* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(55);
  335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_84__["PopupComponent"]; });
  336. /* harmony import */ var _widgets_popupService__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(133);
  337. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupService", function() { return _widgets_popupService__WEBPACK_IMPORTED_MODULE_85__["PopupService"]; });
  338. /* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(65);
  339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchListener", function() { return _widgets_touchListener__WEBPACK_IMPORTED_MODULE_86__["TouchListener"]; });
  340. /* harmony import */ var _widgets_virtualList__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(199);
  341. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualList", function() { return _widgets_virtualList__WEBPACK_IMPORTED_MODULE_87__["VirtualList"]; });
  342. /* harmony import */ var _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(102);
  343. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellRangeType", function() { return _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_88__["CellRangeType"]; });
  344. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionHandleType", function() { return _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_88__["SelectionHandleType"]; });
  345. /* harmony import */ var _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(147);
  346. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VanillaFrameworkOverrides", function() { return _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_89__["VanillaFrameworkOverrides"]; });
  347. /* harmony import */ var _cellNavigationService__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(143);
  348. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellNavigationService", function() { return _cellNavigationService__WEBPACK_IMPORTED_MODULE_90__["CellNavigationService"]; });
  349. /* harmony import */ var _alignedGridsService__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(157);
  350. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AlignedGridsService", function() { return _alignedGridsService__WEBPACK_IMPORTED_MODULE_91__["AlignedGridsService"]; });
  351. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(25);
  352. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Constants", function() { return _constants__WEBPACK_IMPORTED_MODULE_92__["Constants"]; });
  353. /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(95);
  354. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Grid", function() { return _grid__WEBPACK_IMPORTED_MODULE_93__["Grid"]; });
  355. /* harmony import */ var _gridApi__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(130);
  356. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridApi", function() { return _gridApi__WEBPACK_IMPORTED_MODULE_94__["GridApi"]; });
  357. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(44);
  358. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return _eventKeys__WEBPACK_IMPORTED_MODULE_95__["Events"]; });
  359. /* harmony import */ var _focusController__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(141);
  360. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusController", function() { return _focusController__WEBPACK_IMPORTED_MODULE_96__["FocusController"]; });
  361. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(200);
  362. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultGroupComparator", function() { return _functions__WEBPACK_IMPORTED_MODULE_97__["defaultGroupComparator"]; });
  363. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(50);
  364. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridOptionsWrapper", function() { return _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_98__["GridOptionsWrapper"]; });
  365. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(36);
  366. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EventService", function() { return _eventService__WEBPACK_IMPORTED_MODULE_99__["EventService"]; });
  367. /* harmony import */ var _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(165);
  368. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectableService", function() { return _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_100__["SelectableService"]; });
  369. /* harmony import */ var _gridCore__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(137);
  370. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridCore", function() { return _gridCore__WEBPACK_IMPORTED_MODULE_101__["GridCore"]; });
  371. /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(134);
  372. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return _logger__WEBPACK_IMPORTED_MODULE_102__["Logger"]; });
  373. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LoggerFactory", function() { return _logger__WEBPACK_IMPORTED_MODULE_102__["LoggerFactory"]; });
  374. /* harmony import */ var _selectionController__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(96);
  375. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionController", function() { return _selectionController__WEBPACK_IMPORTED_MODULE_103__["SelectionController"]; });
  376. /* harmony import */ var _sortController__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(140);
  377. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SortController", function() { return _sortController__WEBPACK_IMPORTED_MODULE_104__["SortController"]; });
  378. /* harmony import */ var _templateService__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(132);
  379. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TemplateService", function() { return _templateService__WEBPACK_IMPORTED_MODULE_105__["TemplateService"]; });
  380. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(7);
  381. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["Color"]; });
  382. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["stringToArray"]; });
  383. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["_"]; });
  384. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["NumberSequence"]; });
  385. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PromiseStatus", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["PromiseStatus"]; });
  386. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Promise", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["Promise"]; });
  387. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _utils__WEBPACK_IMPORTED_MODULE_106__["Timer"]; });
  388. /* harmony import */ var _valueService_valueService__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(126);
  389. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueService", function() { return _valueService_valueService__WEBPACK_IMPORTED_MODULE_107__["ValueService"]; });
  390. /* harmony import */ var _valueService_valueCache__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(155);
  391. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueCache", function() { return _valueService_valueCache__WEBPACK_IMPORTED_MODULE_108__["ValueCache"]; });
  392. /* harmony import */ var _valueService_expressionService__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(131);
  393. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExpressionService", function() { return _valueService_expressionService__WEBPACK_IMPORTED_MODULE_109__["ExpressionService"]; });
  394. /* harmony import */ var _entities_cellPosition__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(187);
  395. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellPositionUtils", function() { return _entities_cellPosition__WEBPACK_IMPORTED_MODULE_110__["CellPositionUtils"]; });
  396. /* harmony import */ var _entities_rowPosition__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(186);
  397. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowPositionUtils", function() { return _entities_rowPosition__WEBPACK_IMPORTED_MODULE_111__["RowPositionUtils"]; });
  398. /* harmony import */ var _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(192);
  399. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderPositionUtils", function() { return _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_112__["HeaderPositionUtils"]; });
  400. /* harmony import */ var _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(124);
  401. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationService", function() { return _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_113__["HeaderNavigationService"]; });
  402. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationDirection", function() { return _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_113__["HeaderNavigationDirection"]; });
  403. /* harmony import */ var _propertyKeys__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(49);
  404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyKeys", function() { return _propertyKeys__WEBPACK_IMPORTED_MODULE_114__["PropertyKeys"]; });
  405. /* harmony import */ var _columnController_columnApi__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(98);
  406. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnApi", function() { return _columnController_columnApi__WEBPACK_IMPORTED_MODULE_115__["ColumnApi"]; });
  407. /* harmony import */ var _components_framework_frameworkComponentWrapper__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(201);
  408. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseComponentWrapper", function() { return _components_framework_frameworkComponentWrapper__WEBPACK_IMPORTED_MODULE_116__["BaseComponentWrapper"]; });
  409. /* harmony import */ var _environment__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(161);
  410. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return _environment__WEBPACK_IMPORTED_MODULE_117__["Environment"]; });
  411. /* harmony import */ var _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(107);
  412. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipFeature", function() { return _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_118__["TooltipFeature"]; });
  413. /* harmony import */ var _interfaces_iChartOptions__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(202);
  414. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChartType", function() { return _interfaces_iChartOptions__WEBPACK_IMPORTED_MODULE_119__["ChartType"]; });
  415. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LegendPosition", function() { return _interfaces_iChartOptions__WEBPACK_IMPORTED_MODULE_119__["LegendPosition"]; });
  416. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(38);
  417. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleNames", function() { return _modules_moduleNames__WEBPACK_IMPORTED_MODULE_120__["ModuleNames"]; });
  418. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(39);
  419. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleRegistry", function() { return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_121__["ModuleRegistry"]; });
  420. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(43);
  421. /* empty/unused harmony star reexport *//**
  422. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  423. * @version v23.2.1
  424. * @link http://www.ag-grid.com/
  425. * @license MIT
  426. */
  427. var globalObj = typeof global === 'undefined' ? {} : global;
  428. globalObj.HTMLElement = typeof HTMLElement === 'undefined' ? {} : HTMLElement;
  429. globalObj.HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? {} : HTMLButtonElement;
  430. globalObj.HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? {} : HTMLSelectElement;
  431. globalObj.HTMLInputElement = typeof HTMLInputElement === 'undefined' ? {} : HTMLInputElement;
  432. globalObj.Node = typeof Node === 'undefined' ? {} : Node;
  433. globalObj.MouseEvent = typeof MouseEvent === 'undefined' ? {} : MouseEvent;
  434. // columnController
  435. // components
  436. // context
  437. // dragAndDrop
  438. // entities
  439. // filter
  440. // gridPanel
  441. // headerRendering
  442. // layout
  443. // misc
  444. // features
  445. // rendering
  446. // row models
  447. //styling
  448. // widgets
  449. // range
  450. // root
  451. // charts
  452. // events
  453. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))
  454. /***/ }),
  455. /* 4 */
  456. /***/ (function(module, exports) {
  457. var g;
  458. // This works in non-strict mode
  459. g = (function() {
  460. return this;
  461. })();
  462. try {
  463. // This works if eval is allowed (see CSP)
  464. g = g || new Function("return this")();
  465. } catch (e) {
  466. // This works if the window reference is available
  467. if (typeof window === "object") g = window;
  468. }
  469. // g can still be undefined, but nothing to do about it...
  470. // We return undefined, instead of nothing here, so it's
  471. // easier to handle this case. if(!global) { ...}
  472. module.exports = g;
  473. /***/ }),
  474. /* 5 */
  475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  476. "use strict";
  477. __webpack_require__.r(__webpack_exports__);
  478. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnFactory", function() { return ColumnFactory; });
  479. /* harmony import */ var _columnKeyCreator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
  480. /* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33);
  481. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35);
  482. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  483. /* harmony import */ var _entities_defaultColumnTypes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(40);
  484. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  485. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(41);
  486. /**
  487. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  488. * @version v23.2.1
  489. * @link http://www.ag-grid.com/
  490. * @license MIT
  491. */
  492. var __extends = (undefined && undefined.__extends) || (function () {
  493. var extendStatics = function (d, b) {
  494. extendStatics = Object.setPrototypeOf ||
  495. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  496. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  497. return extendStatics(d, b);
  498. };
  499. return function (d, b) {
  500. extendStatics(d, b);
  501. function __() { this.constructor = d; }
  502. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  503. };
  504. })();
  505. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  506. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  507. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  508. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  509. return c > 3 && r && Object.defineProperty(target, key, r), r;
  510. };
  511. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  512. return function (target, key) { decorator(target, key, paramIndex); }
  513. };
  514. // takes ColDefs and ColGroupDefs and turns them into Columns and OriginalGroups
  515. var ColumnFactory = /** @class */ (function (_super) {
  516. __extends(ColumnFactory, _super);
  517. function ColumnFactory() {
  518. return _super !== null && _super.apply(this, arguments) || this;
  519. }
  520. ColumnFactory.prototype.setBeans = function (loggerFactory) {
  521. this.logger = loggerFactory.create('ColumnFactory');
  522. };
  523. ColumnFactory.prototype.createColumnTree = function (defs, primaryColumns, existingColumns) {
  524. // column key creator dishes out unique column id's in a deterministic way,
  525. // so if we have two grids (that could be master/slave) with same column definitions,
  526. // then this ensures the two grids use identical id's.
  527. var columnKeyCreator = new _columnKeyCreator__WEBPACK_IMPORTED_MODULE_0__["ColumnKeyCreator"]();
  528. if (existingColumns) {
  529. var existingKeys = existingColumns.map(function (col) { return col.getId(); });
  530. columnKeyCreator.addExistingKeys(existingKeys);
  531. }
  532. // we take a copy of the columns as we are going to be removing from them
  533. var existingColsCopy = existingColumns ? existingColumns.slice() : null;
  534. // create am unbalanced tree that maps the provided definitions
  535. var unbalancedTree = this.recursivelyCreateColumns(defs, 0, primaryColumns, existingColsCopy, columnKeyCreator, null);
  536. var treeDept = this.findMaxDept(unbalancedTree, 0);
  537. this.logger.log('Number of levels for grouped columns is ' + treeDept);
  538. var columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);
  539. var deptFirstCallback = function (child, parent) {
  540. if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
  541. child.setupExpandable();
  542. }
  543. // we set the original parents at the end, rather than when we go along, as balancing the tree
  544. // adds extra levels into the tree. so we can only set parents when balancing is done.
  545. child.setOriginalParent(parent);
  546. };
  547. this.columnUtils.depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback);
  548. return {
  549. columnTree: columnTree,
  550. treeDept: treeDept
  551. };
  552. };
  553. ColumnFactory.prototype.createForAutoGroups = function (autoGroupCols, gridBalancedTree) {
  554. var _this = this;
  555. var autoColBalancedTree = [];
  556. autoGroupCols.forEach(function (col) {
  557. var fakeTreeItem = _this.createAutoGroupTreeItem(gridBalancedTree, col);
  558. autoColBalancedTree.push(fakeTreeItem);
  559. });
  560. return autoColBalancedTree;
  561. };
  562. ColumnFactory.prototype.createAutoGroupTreeItem = function (balancedColumnTree, column) {
  563. var dept = this.findDepth(balancedColumnTree);
  564. // at the end, this will be the top of the tree item.
  565. var nextChild = column;
  566. for (var i = dept - 1; i >= 0; i--) {
  567. var autoGroup = new _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"](null, "FAKE_PATH_" + column.getId() + "}_" + i, true, i);
  568. this.context.createBean(autoGroup);
  569. autoGroup.setChildren([nextChild]);
  570. nextChild.setOriginalParent(autoGroup);
  571. nextChild = autoGroup;
  572. }
  573. // at this point, the nextChild is the top most item in the tree
  574. return nextChild;
  575. };
  576. ColumnFactory.prototype.findDepth = function (balancedColumnTree) {
  577. var dept = 0;
  578. var pointer = balancedColumnTree;
  579. while (pointer && pointer[0] && pointer[0] instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
  580. dept++;
  581. pointer = pointer[0].getChildren();
  582. }
  583. return dept;
  584. };
  585. ColumnFactory.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) {
  586. var result = [];
  587. // go through each child, for groups, recurse a level deeper,
  588. // for columns we need to pad
  589. for (var i = 0; i < unbalancedTree.length; i++) {
  590. var child = unbalancedTree[i];
  591. if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
  592. // child is a group, all we do is go to the next level of recursion
  593. var originalGroup = child;
  594. var newChildren = this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);
  595. originalGroup.setChildren(newChildren);
  596. result.push(originalGroup);
  597. }
  598. else {
  599. // child is a column - so here we add in the padded column groups if needed
  600. var firstPaddedGroup = void 0;
  601. var currentPaddedGroup = void 0;
  602. // this for loop will NOT run any loops if no padded column groups are needed
  603. for (var j = columnDept - 1; j >= currentDept; j--) {
  604. var newColId = columnKeyCreator.getUniqueKey(null, null);
  605. var colGroupDefMerged = this.createMergedColGroupDef(null);
  606. var paddedGroup = new _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"](colGroupDefMerged, newColId, true, currentDept);
  607. this.context.createBean(paddedGroup);
  608. if (currentPaddedGroup) {
  609. currentPaddedGroup.setChildren([paddedGroup]);
  610. }
  611. currentPaddedGroup = paddedGroup;
  612. if (!firstPaddedGroup) {
  613. firstPaddedGroup = currentPaddedGroup;
  614. }
  615. }
  616. // likewise this if statement will not run if no padded groups
  617. if (firstPaddedGroup) {
  618. result.push(firstPaddedGroup);
  619. var hasGroups = unbalancedTree.some(function (child) { return child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]; });
  620. if (hasGroups) {
  621. currentPaddedGroup.setChildren([child]);
  622. continue;
  623. }
  624. else {
  625. currentPaddedGroup.setChildren(unbalancedTree);
  626. break;
  627. }
  628. }
  629. result.push(child);
  630. }
  631. }
  632. return result;
  633. };
  634. ColumnFactory.prototype.findMaxDept = function (treeChildren, dept) {
  635. var maxDeptThisLevel = dept;
  636. for (var i = 0; i < treeChildren.length; i++) {
  637. var abstractColumn = treeChildren[i];
  638. if (abstractColumn instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
  639. var originalGroup = abstractColumn;
  640. var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);
  641. if (maxDeptThisLevel < newDept) {
  642. maxDeptThisLevel = newDept;
  643. }
  644. }
  645. }
  646. return maxDeptThisLevel;
  647. };
  648. ColumnFactory.prototype.recursivelyCreateColumns = function (defs, level, primaryColumns, existingColsCopy, columnKeyCreator, parent) {
  649. var _this = this;
  650. var result = [];
  651. if (!defs) {
  652. return result;
  653. }
  654. defs.forEach(function (def) {
  655. var newGroupOrColumn;
  656. if (_this.isColumnGroup(def)) {
  657. newGroupOrColumn = _this.createColumnGroup(primaryColumns, def, level, existingColsCopy, columnKeyCreator, parent);
  658. }
  659. else {
  660. newGroupOrColumn = _this.createColumn(primaryColumns, def, existingColsCopy, columnKeyCreator, parent);
  661. }
  662. result.push(newGroupOrColumn);
  663. });
  664. return result;
  665. };
  666. ColumnFactory.prototype.createColumnGroup = function (primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, parent) {
  667. var colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);
  668. var groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId, null);
  669. var originalGroup = new _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"](colGroupDefMerged, groupId, false, level);
  670. this.context.createBean(originalGroup);
  671. var children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, originalGroup);
  672. originalGroup.setChildren(children);
  673. return originalGroup;
  674. };
  675. ColumnFactory.prototype.createMergedColGroupDef = function (colGroupDef) {
  676. var colGroupDefMerged = {};
  677. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].assign(colGroupDefMerged, this.gridOptionsWrapper.getDefaultColGroupDef());
  678. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].assign(colGroupDefMerged, colGroupDef);
  679. this.checkForDeprecatedItems(colGroupDefMerged);
  680. return colGroupDefMerged;
  681. };
  682. ColumnFactory.prototype.createColumn = function (primaryColumns, colDef, existingColsCopy, columnKeyCreator, parent) {
  683. var colDefMerged = this.mergeColDefs(colDef);
  684. this.checkForDeprecatedItems(colDefMerged);
  685. // see if column already exists
  686. var column = this.findExistingColumn(colDef, existingColsCopy);
  687. if (!column) {
  688. // no existing column, need to create one
  689. var colId = columnKeyCreator.getUniqueKey(colDefMerged.colId, colDefMerged.field);
  690. column = new _entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"](colDefMerged, colDef, colId, primaryColumns);
  691. this.context.createBean(column);
  692. }
  693. else {
  694. column.setColDef(colDefMerged, colDef);
  695. }
  696. return column;
  697. };
  698. ColumnFactory.prototype.findExistingColumn = function (colDef, existingColsCopy) {
  699. var res = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].find(existingColsCopy, function (col) {
  700. var oldColDef = col.getUserProvidedColDef();
  701. if (!oldColDef) {
  702. return false;
  703. }
  704. // first check object references
  705. if (oldColDef === colDef) {
  706. return true;
  707. }
  708. // second check id's
  709. var oldColHadId = oldColDef.colId !== null && oldColDef.colId !== undefined;
  710. if (oldColHadId) {
  711. return oldColDef.colId === colDef.colId;
  712. }
  713. return false;
  714. });
  715. // make sure we remove, so if user provided duplicate id, then we don't have more than
  716. // one column instance for colDef with common id
  717. if (res) {
  718. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].removeFromArray(existingColsCopy, res);
  719. }
  720. return res;
  721. };
  722. ColumnFactory.prototype.mergeColDefs = function (colDef) {
  723. // start with empty merged definition
  724. var colDefMerged = {};
  725. // merge properties from default column definitions
  726. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].assign(colDefMerged, this.gridOptionsWrapper.getDefaultColDef());
  727. // merge properties from column type properties
  728. if (colDef.type) {
  729. this.assignColumnTypes(colDef, colDefMerged);
  730. }
  731. // merge properties from column definitions
  732. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].assign(colDefMerged, colDef);
  733. return colDefMerged;
  734. };
  735. ColumnFactory.prototype.assignColumnTypes = function (colDef, colDefMerged) {
  736. var typeKeys;
  737. if (colDef.type instanceof Array) {
  738. var invalidArray = colDef.type.some(function (a) { return typeof a !== 'string'; });
  739. if (invalidArray) {
  740. console.warn("ag-grid: if colDef.type is supplied an array it should be of type 'string[]'");
  741. }
  742. else {
  743. typeKeys = colDef.type;
  744. }
  745. }
  746. else if (typeof colDef.type === 'string') {
  747. typeKeys = colDef.type.split(',');
  748. }
  749. else {
  750. console.warn("ag-grid: colDef.type should be of type 'string' | 'string[]'");
  751. return;
  752. }
  753. // merge user defined with default column types
  754. var allColumnTypes = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].assign({}, _entities_defaultColumnTypes__WEBPACK_IMPORTED_MODULE_4__["DefaultColumnTypes"]);
  755. var userTypes = this.gridOptionsWrapper.getColumnTypes() || {};
  756. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(userTypes, function (key, value) {
  757. if (key in allColumnTypes) {
  758. console.warn("ag-Grid: the column type '" + key + "' is a default column type and cannot be overridden.");
  759. }
  760. else {
  761. allColumnTypes[key] = value;
  762. }
  763. });
  764. typeKeys.forEach(function (t) {
  765. var typeColDef = allColumnTypes[t.trim()];
  766. if (typeColDef) {
  767. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].assign(colDefMerged, typeColDef);
  768. }
  769. else {
  770. console.warn("ag-grid: colDef.type '" + t + "' does not correspond to defined gridOptions.columnTypes");
  771. }
  772. });
  773. };
  774. ColumnFactory.prototype.checkForDeprecatedItems = function (colDef) {
  775. if (colDef) {
  776. var colDefNoType = colDef; // take out the type, so we can access attributes not defined in the type
  777. if (colDefNoType.group !== undefined) {
  778. console.warn('ag-grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3');
  779. }
  780. if (colDefNoType.headerGroup !== undefined) {
  781. console.warn('ag-grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3');
  782. }
  783. if (colDefNoType.headerGroupShow !== undefined) {
  784. console.warn('ag-grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3');
  785. }
  786. if (colDefNoType.suppressRowGroup !== undefined) {
  787. console.warn('ag-grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead');
  788. }
  789. if (colDefNoType.suppressAggregation !== undefined) {
  790. console.warn('ag-grid: colDef.suppressAggregation is deprecated, please use colDef.type instead');
  791. }
  792. if (colDefNoType.suppressRowGroup || colDefNoType.suppressAggregation) {
  793. console.warn('ag-grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead');
  794. }
  795. if (colDefNoType.displayName) {
  796. console.warn("ag-grid: Found displayName " + colDefNoType.displayName + ", please use headerName instead, displayName is deprecated.");
  797. colDefNoType.headerName = colDefNoType.displayName;
  798. }
  799. }
  800. };
  801. // if object has children, we assume it's a group
  802. ColumnFactory.prototype.isColumnGroup = function (abstractColDef) {
  803. return abstractColDef.children !== undefined;
  804. };
  805. __decorate([
  806. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('gridOptionsWrapper')
  807. ], ColumnFactory.prototype, "gridOptionsWrapper", void 0);
  808. __decorate([
  809. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnUtils')
  810. ], ColumnFactory.prototype, "columnUtils", void 0);
  811. __decorate([
  812. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Qualifier"])('loggerFactory'))
  813. ], ColumnFactory.prototype, "setBeans", null);
  814. ColumnFactory = __decorate([
  815. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Bean"])('columnFactory')
  816. ], ColumnFactory);
  817. return ColumnFactory;
  818. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_6__["BeanStub"]));
  819. /***/ }),
  820. /* 6 */
  821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  822. "use strict";
  823. __webpack_require__.r(__webpack_exports__);
  824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnKeyCreator", function() { return ColumnKeyCreator; });
  825. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  826. /**
  827. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  828. * @version v23.2.1
  829. * @link http://www.ag-grid.com/
  830. * @license MIT
  831. */
  832. // class returns a unique id to use for the column. it checks the existing columns, and if the requested
  833. // id is already taken, it will start appending numbers until it gets a unique id.
  834. // eg, if the col field is 'name', it will try ids: {name, name_1, name_2...}
  835. // if no field or id provided in the col, it will try the ids of natural numbers
  836. var ColumnKeyCreator = /** @class */ (function () {
  837. function ColumnKeyCreator() {
  838. this.existingKeys = {};
  839. }
  840. ColumnKeyCreator.prototype.addExistingKeys = function (keys) {
  841. for (var i = 0; i < keys.length; i++) {
  842. this.existingKeys[keys[i]] = true;
  843. }
  844. };
  845. ColumnKeyCreator.prototype.getUniqueKey = function (colId, colField) {
  846. // in case user passed in number for colId, convert to string
  847. colId = _utils__WEBPACK_IMPORTED_MODULE_0__["_"].toStringOrNull(colId);
  848. var count = 0;
  849. while (true) {
  850. var idToTry = void 0;
  851. if (colId) {
  852. idToTry = colId;
  853. if (count !== 0) {
  854. idToTry += '_' + count;
  855. }
  856. }
  857. else if (colField) {
  858. idToTry = colField;
  859. if (count !== 0) {
  860. idToTry += '_' + count;
  861. }
  862. }
  863. else {
  864. idToTry = '' + count;
  865. }
  866. if (!this.existingKeys[idToTry]) {
  867. this.existingKeys[idToTry] = true;
  868. return idToTry;
  869. }
  870. count++;
  871. }
  872. };
  873. return ColumnKeyCreator;
  874. }());
  875. /***/ }),
  876. /* 7 */
  877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  878. "use strict";
  879. __webpack_require__.r(__webpack_exports__);
  880. /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
  881. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _color__WEBPACK_IMPORTED_MODULE_0__["Color"]; });
  882. /* harmony import */ var _csv__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
  883. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return _csv__WEBPACK_IMPORTED_MODULE_1__["stringToArray"]; });
  884. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10);
  885. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _utils__WEBPACK_IMPORTED_MODULE_2__["_"]; });
  886. /* harmony import */ var _numberSequence__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30);
  887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return _numberSequence__WEBPACK_IMPORTED_MODULE_3__["NumberSequence"]; });
  888. /* harmony import */ var _promise__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31);
  889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PromiseStatus", function() { return _promise__WEBPACK_IMPORTED_MODULE_4__["PromiseStatus"]; });
  890. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Promise", function() { return _promise__WEBPACK_IMPORTED_MODULE_4__["Promise"]; });
  891. /* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32);
  892. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _timer__WEBPACK_IMPORTED_MODULE_5__["Timer"]; });
  893. /**
  894. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  895. * @version v23.2.1
  896. * @link http://www.ag-grid.com/
  897. * @license MIT
  898. */
  899. /***/ }),
  900. /* 8 */
  901. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  902. "use strict";
  903. __webpack_require__.r(__webpack_exports__);
  904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; });
  905. /**
  906. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  907. * @version v23.2.1
  908. * @link http://www.ag-grid.com/
  909. * @license MIT
  910. */
  911. var Color = /** @class */ (function () {
  912. /**
  913. * Every color component should be in the [0, 1] range.
  914. * Some easing functions (such as elastic easing) can overshoot the target value by some amount.
  915. * So, when animating colors, if the source or target color components are already near
  916. * or at the edge of the allowed [0, 1] range, it is possible for the intermediate color
  917. * component value to end up outside of that range mid-animation. For this reason the constructor
  918. * performs range checking/constraining.
  919. * @param r Red component.
  920. * @param g Green component.
  921. * @param b Blue component.
  922. * @param a Alpha (opacity) component.
  923. */
  924. function Color(r, g, b, a) {
  925. if (a === void 0) { a = 1; }
  926. // NaN is treated as 0.
  927. this.r = Math.min(1, Math.max(0, r || 0));
  928. this.g = Math.min(1, Math.max(0, g || 0));
  929. this.b = Math.min(1, Math.max(0, b || 0));
  930. this.a = Math.min(1, Math.max(0, a || 0));
  931. }
  932. /**
  933. * The given string can be in one of the following formats:
  934. * - #rgb
  935. * - #rrggbb
  936. * - rgb(r, g, b)
  937. * - rgba(r, g, b, a)
  938. * - CSS color name such as 'white', 'orange', 'cyan', etc.
  939. * @param str
  940. */
  941. Color.fromString = function (str) {
  942. // hexadecimal notation
  943. if (str.indexOf('#') >= 0) { // there can be some leading whitespace
  944. return Color.fromHexString(str);
  945. }
  946. // color name
  947. var hex = Color.nameToHex[str];
  948. if (hex) {
  949. return Color.fromHexString(hex);
  950. }
  951. // rgb(a) notation
  952. if (str.indexOf('rgb') >= 0) {
  953. return Color.fromRgbaString(str);
  954. }
  955. throw new Error("Invalid color string: '" + str + "'");
  956. };
  957. // Using separate RegExp for the short hex notation because strings like `#abcd`
  958. // are matched as ['#abcd', 'ab', 'c', 'd', undefined] when the `{1,2}` quantifier is used.
  959. Color.fromHexString = function (str) {
  960. var values = str.match(Color.hexRe);
  961. if (values) {
  962. var r = parseInt(values[1], 16);
  963. var g = parseInt(values[2], 16);
  964. var b = parseInt(values[3], 16);
  965. var a = values[4] !== undefined ? parseInt(values[4], 16) : 255;
  966. return new Color(r / 255, g / 255, b / 255, a / 255);
  967. }
  968. values = str.match(Color.shortHexRe);
  969. if (values) {
  970. var r = parseInt(values[1], 16);
  971. var g = parseInt(values[2], 16);
  972. var b = parseInt(values[3], 16);
  973. var a = values[4] !== undefined ? parseInt(values[4], 16) : 15;
  974. r += r * 16;
  975. g += g * 16;
  976. b += b * 16;
  977. a += a * 16;
  978. return new Color(r / 255, g / 255, b / 255, a / 255);
  979. }
  980. throw new Error("Malformed hexadecimal color string: '" + str + "'");
  981. };
  982. Color.fromRgbaString = function (str) {
  983. var values = str.match(Color.rgbRe);
  984. if (values) {
  985. return new Color(+values[1] / 255, +values[2] / 255, +values[3] / 255);
  986. }
  987. values = str.match(Color.rgbaRe);
  988. if (values) {
  989. return new Color(+values[1] / 255, +values[2] / 255, +values[3] / 255, +values[4]);
  990. }
  991. throw new Error("Malformed rgb/rgba color string: '" + str + "'");
  992. };
  993. Color.fromArray = function (arr) {
  994. if (arr.length === 4) {
  995. return new Color(arr[0], arr[1], arr[2], arr[3]);
  996. }
  997. if (arr.length === 3) {
  998. return new Color(arr[0], arr[1], arr[2]);
  999. }
  1000. throw new Error('The given array should contain 3 or 4 color components (numbers).');
  1001. };
  1002. /**
  1003. * Creates an instance of the Color class from the given HSB(A) components.
  1004. * @param h Hue in the [0, 360) range.
  1005. * @param s Saturation in the [0, 1] range.
  1006. * @param b Brightness in the [0, 1] range.
  1007. * @param alpha Opacity in the [0, 1] range. Defaults to 1 (completely opaque).
  1008. */
  1009. Color.fromHSB = function (h, s, b, alpha) {
  1010. if (alpha === void 0) { alpha = 1; }
  1011. var rgb = Color.HSBtoRGB(h, s, b);
  1012. return new Color(rgb[0], rgb[1], rgb[2], alpha);
  1013. };
  1014. Color.padHex = function (str) {
  1015. // Can't use `padStart(2, '0')` here because of IE.
  1016. return str.length === 1 ? '0' + str : str;
  1017. };
  1018. Color.prototype.toHexString = function () {
  1019. var hex = '#'
  1020. + Color.padHex(Math.round(this.r * 255).toString(16))
  1021. + Color.padHex(Math.round(this.g * 255).toString(16))
  1022. + Color.padHex(Math.round(this.b * 255).toString(16));
  1023. if (this.a < 1) {
  1024. hex += Color.padHex(Math.round(this.a * 255).toString(16));
  1025. }
  1026. return hex;
  1027. };
  1028. Color.prototype.toRgbaString = function (fractionDigits) {
  1029. if (fractionDigits === void 0) { fractionDigits = 3; }
  1030. var components = [
  1031. Math.round(this.r * 255),
  1032. Math.round(this.g * 255),
  1033. Math.round(this.b * 255)
  1034. ];
  1035. var k = Math.pow(10, fractionDigits);
  1036. if (this.a !== 1) {
  1037. components.push(Math.round(this.a * k) / k);
  1038. return "rgba(" + components.join(', ') + ")";
  1039. }
  1040. return "rgb(" + components.join(', ') + ")";
  1041. };
  1042. Color.prototype.toString = function () {
  1043. if (this.a === 1) {
  1044. return this.toHexString();
  1045. }
  1046. return this.toRgbaString();
  1047. };
  1048. Color.prototype.toHSB = function () {
  1049. return Color.RGBtoHSB(this.r, this.g, this.b);
  1050. };
  1051. /**
  1052. * Converts the given RGB triple to an array of HSB (HSV) components.
  1053. * The hue component will be `NaN` for achromatic colors.
  1054. */
  1055. Color.RGBtoHSB = function (r, g, b) {
  1056. var min = Math.min(r, g, b);
  1057. var max = Math.max(r, g, b);
  1058. var S = max !== 0 ? (max - min) / max : 0;
  1059. var H = NaN;
  1060. // min == max, means all components are the same
  1061. // and the color is a shade of gray with no hue (H is NaN)
  1062. if (min !== max) {
  1063. var delta = max - min;
  1064. var rc = (max - r) / delta;
  1065. var gc = (max - g) / delta;
  1066. var bc = (max - b) / delta;
  1067. if (r === max) {
  1068. H = bc - gc;
  1069. }
  1070. else if (g === max) {
  1071. H = 2.0 + rc - bc;
  1072. }
  1073. else {
  1074. H = 4.0 + gc - rc;
  1075. }
  1076. H /= 6.0;
  1077. if (H < 0) {
  1078. H = H + 1.0;
  1079. }
  1080. }
  1081. return [H * 360, S, max];
  1082. };
  1083. /**
  1084. * Converts the given HSB (HSV) triple to an array of RGB components.
  1085. */
  1086. Color.HSBtoRGB = function (H, S, B) {
  1087. if (isNaN(H)) {
  1088. H = 0;
  1089. }
  1090. H = (((H % 360) + 360) % 360) / 360; // normalize hue to [0, 360] interval, then scale to [0, 1]
  1091. var r = 0;
  1092. var g = 0;
  1093. var b = 0;
  1094. if (S === 0) {
  1095. r = g = b = B;
  1096. }
  1097. else {
  1098. var h = (H - Math.floor(H)) * 6;
  1099. var f = h - Math.floor(h);
  1100. var p = B * (1 - S);
  1101. var q = B * (1 - S * f);
  1102. var t = B * (1 - (S * (1 - f)));
  1103. switch (h >> 0) { // discard the floating point part of the number
  1104. case 0:
  1105. r = B;
  1106. g = t;
  1107. b = p;
  1108. break;
  1109. case 1:
  1110. r = q;
  1111. g = B;
  1112. b = p;
  1113. break;
  1114. case 2:
  1115. r = p;
  1116. g = B;
  1117. b = t;
  1118. break;
  1119. case 3:
  1120. r = p;
  1121. g = q;
  1122. b = B;
  1123. break;
  1124. case 4:
  1125. r = t;
  1126. g = p;
  1127. b = B;
  1128. break;
  1129. case 5:
  1130. r = B;
  1131. g = p;
  1132. b = q;
  1133. break;
  1134. }
  1135. }
  1136. return [r, g, b];
  1137. };
  1138. Color.prototype.derive = function (hueShift, saturationFactor, brightnessFactor, opacityFactor) {
  1139. var hsb = Color.RGBtoHSB(this.r, this.g, this.b);
  1140. var b = hsb[2];
  1141. if (b == 0 && brightnessFactor > 1.0) {
  1142. b = 0.05;
  1143. }
  1144. var h = (((hsb[0] + hueShift) % 360) + 360) % 360;
  1145. var s = Math.max(Math.min(hsb[1] * saturationFactor, 1.0), 0.0);
  1146. b = Math.max(Math.min(b * brightnessFactor, 1.0), 0.0);
  1147. var a = Math.max(Math.min(this.a * opacityFactor, 1.0), 0.0);
  1148. var rgba = Color.HSBtoRGB(h, s, b);
  1149. rgba.push(a);
  1150. return Color.fromArray(rgba);
  1151. };
  1152. Color.prototype.brighter = function () {
  1153. return this.derive(0, 1.0, 1.0 / 0.7, 1.0);
  1154. };
  1155. Color.prototype.darker = function () {
  1156. return this.derive(0, 1.0, 0.7, 1.0);
  1157. };
  1158. // See https://drafts.csswg.org/css-color/#hex-notation
  1159. Color.hexRe = /\s*#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?\s*$/;
  1160. Color.shortHexRe = /\s*#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?\s*$/;
  1161. Color.rgbRe = /\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)\s*/;
  1162. Color.rgbaRe = /\s*rgba\((\d+),\s*(\d+),\s*(\d+),\s*([.\d]+)\)\s*/;
  1163. /**
  1164. * CSS Color Module Level 4:
  1165. * https://drafts.csswg.org/css-color/#named-colors
  1166. */
  1167. Color.nameToHex = Object.freeze({
  1168. aliceblue: '#F0F8FF',
  1169. antiquewhite: '#FAEBD7',
  1170. aqua: '#00FFFF',
  1171. aquamarine: '#7FFFD4',
  1172. azure: '#F0FFFF',
  1173. beige: '#F5F5DC',
  1174. bisque: '#FFE4C4',
  1175. black: '#000000',
  1176. blanchedalmond: '#FFEBCD',
  1177. blue: '#0000FF',
  1178. blueviolet: '#8A2BE2',
  1179. brown: '#A52A2A',
  1180. burlywood: '#DEB887',
  1181. cadetblue: '#5F9EA0',
  1182. chartreuse: '#7FFF00',
  1183. chocolate: '#D2691E',
  1184. coral: '#FF7F50',
  1185. cornflowerblue: '#6495ED',
  1186. cornsilk: '#FFF8DC',
  1187. crimson: '#DC143C',
  1188. cyan: '#00FFFF',
  1189. darkblue: '#00008B',
  1190. darkcyan: '#008B8B',
  1191. darkgoldenrod: '#B8860B',
  1192. darkgray: '#A9A9A9',
  1193. darkgreen: '#006400',
  1194. darkgrey: '#A9A9A9',
  1195. darkkhaki: '#BDB76B',
  1196. darkmagenta: '#8B008B',
  1197. darkolivegreen: '#556B2F',
  1198. darkorange: '#FF8C00',
  1199. darkorchid: '#9932CC',
  1200. darkred: '#8B0000',
  1201. darksalmon: '#E9967A',
  1202. darkseagreen: '#8FBC8F',
  1203. darkslateblue: '#483D8B',
  1204. darkslategray: '#2F4F4F',
  1205. darkslategrey: '#2F4F4F',
  1206. darkturquoise: '#00CED1',
  1207. darkviolet: '#9400D3',
  1208. deeppink: '#FF1493',
  1209. deepskyblue: '#00BFFF',
  1210. dimgray: '#696969',
  1211. dimgrey: '#696969',
  1212. dodgerblue: '#1E90FF',
  1213. firebrick: '#B22222',
  1214. floralwhite: '#FFFAF0',
  1215. forestgreen: '#228B22',
  1216. fuchsia: '#FF00FF',
  1217. gainsboro: '#DCDCDC',
  1218. ghostwhite: '#F8F8FF',
  1219. gold: '#FFD700',
  1220. goldenrod: '#DAA520',
  1221. gray: '#808080',
  1222. green: '#008000',
  1223. greenyellow: '#ADFF2F',
  1224. grey: '#808080',
  1225. honeydew: '#F0FFF0',
  1226. hotpink: '#FF69B4',
  1227. indianred: '#CD5C5C',
  1228. indigo: '#4B0082',
  1229. ivory: '#FFFFF0',
  1230. khaki: '#F0E68C',
  1231. lavender: '#E6E6FA',
  1232. lavenderblush: '#FFF0F5',
  1233. lawngreen: '#7CFC00',
  1234. lemonchiffon: '#FFFACD',
  1235. lightblue: '#ADD8E6',
  1236. lightcoral: '#F08080',
  1237. lightcyan: '#E0FFFF',
  1238. lightgoldenrodyellow: '#FAFAD2',
  1239. lightgray: '#D3D3D3',
  1240. lightgreen: '#90EE90',
  1241. lightgrey: '#D3D3D3',
  1242. lightpink: '#FFB6C1',
  1243. lightsalmon: '#FFA07A',
  1244. lightseagreen: '#20B2AA',
  1245. lightskyblue: '#87CEFA',
  1246. lightslategray: '#778899',
  1247. lightslategrey: '#778899',
  1248. lightsteelblue: '#B0C4DE',
  1249. lightyellow: '#FFFFE0',
  1250. lime: '#00FF00',
  1251. limegreen: '#32CD32',
  1252. linen: '#FAF0E6',
  1253. magenta: '#FF00FF',
  1254. maroon: '#800000',
  1255. mediumaquamarine: '#66CDAA',
  1256. mediumblue: '#0000CD',
  1257. mediumorchid: '#BA55D3',
  1258. mediumpurple: '#9370DB',
  1259. mediumseagreen: '#3CB371',
  1260. mediumslateblue: '#7B68EE',
  1261. mediumspringgreen: '#00FA9A',
  1262. mediumturquoise: '#48D1CC',
  1263. mediumvioletred: '#C71585',
  1264. midnightblue: '#191970',
  1265. mintcream: '#F5FFFA',
  1266. mistyrose: '#FFE4E1',
  1267. moccasin: '#FFE4B5',
  1268. navajowhite: '#FFDEAD',
  1269. navy: '#000080',
  1270. oldlace: '#FDF5E6',
  1271. olive: '#808000',
  1272. olivedrab: '#6B8E23',
  1273. orange: '#FFA500',
  1274. orangered: '#FF4500',
  1275. orchid: '#DA70D6',
  1276. palegoldenrod: '#EEE8AA',
  1277. palegreen: '#98FB98',
  1278. paleturquoise: '#AFEEEE',
  1279. palevioletred: '#DB7093',
  1280. papayawhip: '#FFEFD5',
  1281. peachpuff: '#FFDAB9',
  1282. peru: '#CD853F',
  1283. pink: '#FFC0CB',
  1284. plum: '#DDA0DD',
  1285. powderblue: '#B0E0E6',
  1286. purple: '#800080',
  1287. rebeccapurple: '#663399',
  1288. red: '#FF0000',
  1289. rosybrown: '#BC8F8F',
  1290. royalblue: '#4169E1',
  1291. saddlebrown: '#8B4513',
  1292. salmon: '#FA8072',
  1293. sandybrown: '#F4A460',
  1294. seagreen: '#2E8B57',
  1295. seashell: '#FFF5EE',
  1296. sienna: '#A0522D',
  1297. silver: '#C0C0C0',
  1298. skyblue: '#87CEEB',
  1299. slateblue: '#6A5ACD',
  1300. slategray: '#708090',
  1301. slategrey: '#708090',
  1302. snow: '#FFFAFA',
  1303. springgreen: '#00FF7F',
  1304. steelblue: '#4682B4',
  1305. tan: '#D2B48C',
  1306. teal: '#008080',
  1307. thistle: '#D8BFD8',
  1308. tomato: '#FF6347',
  1309. turquoise: '#40E0D0',
  1310. violet: '#EE82EE',
  1311. wheat: '#F5DEB3',
  1312. white: '#FFFFFF',
  1313. whitesmoke: '#F5F5F5',
  1314. yellow: '#FFFF00',
  1315. yellowgreen: '#9ACD32'
  1316. });
  1317. return Color;
  1318. }());
  1319. /***/ }),
  1320. /* 9 */
  1321. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1322. "use strict";
  1323. __webpack_require__.r(__webpack_exports__);
  1324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return stringToArray; });
  1325. /**
  1326. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  1327. * @version v23.2.1
  1328. * @link http://www.ag-grid.com/
  1329. * @license MIT
  1330. */
  1331. // Based on https://stackoverflow.com/a/14991797
  1332. // This will parse a delimited string into an array of arrays.
  1333. function stringToArray(strData, delimiter) {
  1334. if (delimiter === void 0) { delimiter = ','; }
  1335. var data = [];
  1336. var isNewline = function (char) { return char === '\r' || char === '\n'; };
  1337. var insideQuotedField = false;
  1338. var _loop_1 = function (row, column, position) {
  1339. var previousChar = strData[position - 1];
  1340. var currentChar = strData[position];
  1341. var nextChar = strData[position + 1];
  1342. var ensureDataExists = function () {
  1343. if (!data[row]) {
  1344. // create row if it doesn't exist
  1345. data[row] = [];
  1346. }
  1347. if (!data[row][column]) {
  1348. // create column if it doesn't exist
  1349. data[row][column] = '';
  1350. }
  1351. };
  1352. ensureDataExists();
  1353. if (currentChar === '"') {
  1354. if (insideQuotedField) {
  1355. if (nextChar === '"') {
  1356. // unescape double quote
  1357. data[row][column] += '"';
  1358. position++;
  1359. }
  1360. else {
  1361. // exit quoted field
  1362. insideQuotedField = false;
  1363. }
  1364. return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
  1365. }
  1366. else if (previousChar === undefined || previousChar === delimiter || isNewline(previousChar)) {
  1367. // enter quoted field
  1368. insideQuotedField = true;
  1369. return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
  1370. }
  1371. }
  1372. if (!insideQuotedField) {
  1373. if (currentChar === delimiter) {
  1374. // move to next column
  1375. column++;
  1376. ensureDataExists();
  1377. return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
  1378. }
  1379. else if (isNewline(currentChar)) {
  1380. // move to next row
  1381. column = 0;
  1382. row++;
  1383. ensureDataExists();
  1384. if (currentChar === '\r' && nextChar === '\n') {
  1385. // skip over second newline character if it exists
  1386. position++;
  1387. }
  1388. return out_row_1 = row, out_column_1 = column, out_position_1 = position, "continue";
  1389. }
  1390. }
  1391. // add current character to current column
  1392. data[row][column] += currentChar;
  1393. out_row_1 = row;
  1394. out_column_1 = column;
  1395. out_position_1 = position;
  1396. };
  1397. var out_row_1, out_column_1, out_position_1;
  1398. // iterate over each character, keep track of current row and column (of the returned array)
  1399. for (var row = 0, column = 0, position = 0; position < strData.length; position++) {
  1400. _loop_1(row, column, position);
  1401. row = out_row_1;
  1402. column = out_column_1;
  1403. position = out_position_1;
  1404. }
  1405. return data;
  1406. }
  1407. /***/ }),
  1408. /* 10 */
  1409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1410. "use strict";
  1411. __webpack_require__.r(__webpack_exports__);
  1412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _; });
  1413. /* harmony import */ var _general__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
  1414. /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
  1415. /* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
  1416. /* harmony import */ var _csv__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
  1417. /* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(18);
  1418. /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);
  1419. /* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(20);
  1420. /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(21);
  1421. /* harmony import */ var _fuzzyMatch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22);
  1422. /* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(14);
  1423. /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23);
  1424. /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24);
  1425. /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(26);
  1426. /* harmony import */ var _mouse__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(27);
  1427. /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(19);
  1428. /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(16);
  1429. /* harmony import */ var _rowNode__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(28);
  1430. /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(29);
  1431. /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(15);
  1432. /**
  1433. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  1434. * @version v23.2.1
  1435. * @link http://www.ag-grid.com/
  1436. * @license MIT
  1437. */
  1438. var __assign = (undefined && undefined.__assign) || function () {
  1439. __assign = Object.assign || function(t) {
  1440. for (var s, i = 1, n = arguments.length; i < n; i++) {
  1441. s = arguments[i];
  1442. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  1443. t[p] = s[p];
  1444. }
  1445. return t;
  1446. };
  1447. return __assign.apply(this, arguments);
  1448. };
  1449. var utils = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, _general__WEBPACK_IMPORTED_MODULE_0__), _array__WEBPACK_IMPORTED_MODULE_1__), _browser__WEBPACK_IMPORTED_MODULE_2__), _csv__WEBPACK_IMPORTED_MODULE_3__), _date__WEBPACK_IMPORTED_MODULE_4__), _dom__WEBPACK_IMPORTED_MODULE_5__), _event__WEBPACK_IMPORTED_MODULE_6__), _function__WEBPACK_IMPORTED_MODULE_7__), _fuzzyMatch__WEBPACK_IMPORTED_MODULE_8__), _generic__WEBPACK_IMPORTED_MODULE_9__), _icon__WEBPACK_IMPORTED_MODULE_10__), _keyboard__WEBPACK_IMPORTED_MODULE_11__), _map__WEBPACK_IMPORTED_MODULE_12__), _mouse__WEBPACK_IMPORTED_MODULE_13__), _number__WEBPACK_IMPORTED_MODULE_14__), _object__WEBPACK_IMPORTED_MODULE_15__), _rowNode__WEBPACK_IMPORTED_MODULE_16__), _set__WEBPACK_IMPORTED_MODULE_17__), _string__WEBPACK_IMPORTED_MODULE_18__);
  1450. var _ = utils;
  1451. /***/ }),
  1452. /* 11 */
  1453. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1454. "use strict";
  1455. __webpack_require__.r(__webpack_exports__);
  1456. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNameOfClass", function() { return getNameOfClass; });
  1457. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findLineByLeastSquares", function() { return findLineByLeastSquares; });
  1458. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssStyleObjectToMarkup", function() { return cssStyleObjectToMarkup; });
  1459. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "message", function() { return message; });
  1460. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCellRendererToHtmlElement", function() { return bindCellRendererToHtmlElement; });
  1461. /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
  1462. /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
  1463. /* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
  1464. /**
  1465. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  1466. * @version v23.2.1
  1467. * @link http://www.ag-grid.com/
  1468. * @license MIT
  1469. */
  1470. /** @deprecated */
  1471. function getNameOfClass(theClass) {
  1472. var funcNameRegex = /function (.{1,})\(/;
  1473. var funcAsString = theClass.toString();
  1474. var results = funcNameRegex.exec(funcAsString);
  1475. return results && results.length > 1 ? results[1] : "";
  1476. }
  1477. function findLineByLeastSquares(values) {
  1478. var len = values.length;
  1479. var maxDecimals = 0;
  1480. if (len <= 1) {
  1481. return values;
  1482. }
  1483. for (var i = 0; i < values.length; i++) {
  1484. var value = values[i];
  1485. if (Math.floor(value) === value) {
  1486. continue;
  1487. }
  1488. maxDecimals = Math.max(maxDecimals, value.toString().split('.')[1].length);
  1489. }
  1490. var sum_x = 0;
  1491. var sum_y = 0;
  1492. var sum_xy = 0;
  1493. var sum_xx = 0;
  1494. var y = 0;
  1495. for (var x = 0; x < len; x++) {
  1496. y = values[x];
  1497. sum_x += x;
  1498. sum_y += y;
  1499. sum_xx += x * x;
  1500. sum_xy += x * y;
  1501. }
  1502. var m = (len * sum_xy - sum_x * sum_y) / (len * sum_xx - sum_x * sum_x);
  1503. var b = (sum_y / len) - (m * sum_x) / len;
  1504. var result = [];
  1505. for (var x = 0; x <= len; x++) {
  1506. result.push(parseFloat((x * m + b).toFixed(maxDecimals)));
  1507. }
  1508. return result;
  1509. }
  1510. /**
  1511. * Converts a CSS object into string
  1512. * @param {Object} stylesToUse an object eg: {color: 'black', top: '25px'}
  1513. * @return {string} A string like "color: black; top: 25px;" for html
  1514. */
  1515. function cssStyleObjectToMarkup(stylesToUse) {
  1516. if (!stylesToUse) {
  1517. return '';
  1518. }
  1519. var resParts = [];
  1520. Object(_object__WEBPACK_IMPORTED_MODULE_2__["iterateObject"])(stylesToUse, function (styleKey, styleValue) {
  1521. var styleKeyDashed = Object(_string__WEBPACK_IMPORTED_MODULE_1__["camelCaseToHyphen"])(styleKey);
  1522. resParts.push(styleKeyDashed + ": " + styleValue + ";");
  1523. });
  1524. return resParts.join(' ');
  1525. }
  1526. /**
  1527. * Displays a message to the browser. this is useful in iPad, where you can't easily see the console.
  1528. * so the javascript code can use this to give feedback. this is NOT intended to be called in production.
  1529. * it is intended the ag-Grid developer calls this to troubleshoot, but then takes out the calls before
  1530. * checking in.
  1531. * @param {string} msg
  1532. */
  1533. function message(msg) {
  1534. var eMessage = document.createElement('div');
  1535. var eBox = document.querySelector('#__ag__message');
  1536. eMessage.innerHTML = msg;
  1537. if (!eBox) {
  1538. var template = "<div id=\"__ag__message\" style=\"display: inline-block; position: absolute; top: 0px; left: 0px; color: white; background-color: black; z-index: 20; padding: 2px; border: 1px solid darkred; height: 200px; overflow-y: auto;\"></div>";
  1539. eBox = Object(_dom__WEBPACK_IMPORTED_MODULE_0__["loadTemplate"])(template);
  1540. if (document.body) {
  1541. document.body.appendChild(eBox);
  1542. }
  1543. }
  1544. eBox.insertBefore(eMessage, eBox.children[0]);
  1545. }
  1546. /**
  1547. * cell renderers are used in a few places. they bind to dom slightly differently to other cell renderes as they
  1548. * can return back strings (instead of html elemnt) in the getGui() method. common code placed here to handle that.
  1549. * @param {Promise<ICellRendererComp>} cellRendererPromise
  1550. * @param {HTMLElement} eTarget
  1551. */
  1552. function bindCellRendererToHtmlElement(cellRendererPromise, eTarget) {
  1553. cellRendererPromise.then(function (cellRenderer) {
  1554. var gui = cellRenderer.getGui();
  1555. if (gui != null) {
  1556. if (typeof gui === 'object') {
  1557. eTarget.appendChild(gui);
  1558. }
  1559. else {
  1560. eTarget.innerHTML = gui;
  1561. }
  1562. }
  1563. });
  1564. }
  1565. /***/ }),
  1566. /* 12 */
  1567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1568. "use strict";
  1569. __webpack_require__.r(__webpack_exports__);
  1570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addCssClass", function() { return addCssClass; });
  1571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCssClass", function() { return removeCssClass; });
  1572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addOrRemoveCssClass", function() { return addOrRemoveCssClass; });
  1573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "radioCssClass", function() { return radioCssClass; });
  1574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsClass", function() { return containsClass; });
  1575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDisplayed", function() { return setDisplayed; });
  1576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setVisible", function() { return setVisible; });
  1577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDisabled", function() { return setDisabled; });
  1578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementChildOfClass", function() { return isElementChildOfClass; });
  1579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementSize", function() { return getElementSize; });
  1580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInnerHeight", function() { return getInnerHeight; });
  1581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInnerWidth", function() { return getInnerWidth; });
  1582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAbsoluteHeight", function() { return getAbsoluteHeight; });
  1583. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAbsoluteWidth", function() { return getAbsoluteWidth; });
  1584. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollLeft", function() { return getScrollLeft; });
  1585. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setScrollLeft", function() { return setScrollLeft; });
  1586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearElement", function() { return clearElement; });
  1587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeElement", function() { return removeElement; });
  1588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromParent", function() { return removeFromParent; });
  1589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVisible", function() { return isVisible; });
  1590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadTemplate", function() { return loadTemplate; });
  1591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "appendHtml", function() { return appendHtml; });
  1592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementAttribute", function() { return getElementAttribute; });
  1593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "offsetHeight", function() { return offsetHeight; });
  1594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "offsetWidth", function() { return offsetWidth; });
  1595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureDomOrder", function() { return ensureDomOrder; });
  1596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDomChildOrder", function() { return setDomChildOrder; });
  1597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertTemplateWithDomOrder", function() { return insertTemplateWithDomOrder; });
  1598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prependDC", function() { return prependDC; });
  1599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addStylesToElement", function() { return addStylesToElement; });
  1600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHorizontalScrollShowing", function() { return isHorizontalScrollShowing; });
  1601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isVerticalScrollShowing", function() { return isVerticalScrollShowing; });
  1602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setElementWidth", function() { return setElementWidth; });
  1603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFixedWidth", function() { return setFixedWidth; });
  1604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setElementHeight", function() { return setElementHeight; });
  1605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setFixedHeight", function() { return setFixedHeight; });
  1606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatSize", function() { return formatSize; });
  1607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNode", function() { return isNode; });
  1608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return isElement; });
  1609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNodeOrElement", function() { return isNodeOrElement; });
  1610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyNodeList", function() { return copyNodeList; });
  1611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterateNamedNodeMap", function() { return iterateNamedNodeMap; });
  1612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCheckboxState", function() { return setCheckboxState; });
  1613. /* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
  1614. /* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
  1615. /* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15);
  1616. /**
  1617. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  1618. * @version v23.2.1
  1619. * @link http://www.ag-grid.com/
  1620. * @license MIT
  1621. */
  1622. function addCssClass(element, className) {
  1623. if (!className || className.length === 0) {
  1624. return;
  1625. }
  1626. if (className.indexOf(' ') >= 0) {
  1627. className.split(' ').forEach(function (value) { return addCssClass(element, value); });
  1628. return;
  1629. }
  1630. if (element.classList) {
  1631. element.classList.add(className);
  1632. }
  1633. else if (element.className && element.className.length > 0) {
  1634. var cssClasses = element.className.split(' ');
  1635. if (cssClasses.indexOf(className) < 0) {
  1636. cssClasses.push(className);
  1637. element.setAttribute('class', cssClasses.join(' '));
  1638. }
  1639. }
  1640. else {
  1641. // do not use element.classList = className here, it will cause
  1642. // a read-only assignment error on some browsers (IE/Edge).
  1643. element.setAttribute('class', className);
  1644. }
  1645. return element;
  1646. }
  1647. function removeCssClass(element, className) {
  1648. if (element.classList) {
  1649. element.classList.remove(className);
  1650. }
  1651. else if (element.className && element.className.length > 0) {
  1652. var newClassName = element.className.split(' ').filter(function (c) { return c !== className; }).join(' ');
  1653. element.setAttribute('class', newClassName);
  1654. }
  1655. }
  1656. function addOrRemoveCssClass(element, className, addOrRemove) {
  1657. if (addOrRemove) {
  1658. addCssClass(element, className);
  1659. }
  1660. else {
  1661. removeCssClass(element, className);
  1662. }
  1663. }
  1664. /**
  1665. * This method adds a class to an element and remove that class from all siblings.
  1666. * Useful for toggling state.
  1667. * @param {HTMLElement} element The element to receive the class
  1668. * @param {string} elementClass The class to be assigned to the element
  1669. * @param {boolean} otherElementClass The class to be assigned to siblings of the element, but not the element itself
  1670. */
  1671. function radioCssClass(element, elementClass, otherElementClass) {
  1672. var parent = element.parentElement;
  1673. var sibling = parent.firstChild;
  1674. while (sibling) {
  1675. if (elementClass) {
  1676. addOrRemoveCssClass(sibling, elementClass, sibling === element);
  1677. }
  1678. if (otherElementClass) {
  1679. addOrRemoveCssClass(sibling, otherElementClass, sibling !== element);
  1680. }
  1681. sibling = sibling.nextSibling;
  1682. }
  1683. }
  1684. function containsClass(element, className) {
  1685. if (element.classList) {
  1686. // for modern browsers
  1687. return element.classList.contains(className);
  1688. }
  1689. if (element.className) {
  1690. // for older browsers, check against the string of class names
  1691. // if only one class, can check for exact match
  1692. var onlyClass = element.className === className;
  1693. // if many classes, check for class name, we have to pad with ' ' to stop other
  1694. // class names that are a substring of this class
  1695. var contains = element.className.indexOf(' ' + className + ' ') >= 0;
  1696. // the padding above then breaks when it's the first or last class names
  1697. var startsWithClass = element.className.indexOf(className + ' ') === 0;
  1698. var endsWithClass = element.className.lastIndexOf(' ' + className) === (element.className.length - className.length - 1);
  1699. return onlyClass || contains || startsWithClass || endsWithClass;
  1700. }
  1701. // if item is not a node
  1702. return false;
  1703. }
  1704. function setDisplayed(element, displayed) {
  1705. addOrRemoveCssClass(element, 'ag-hidden', !displayed);
  1706. }
  1707. function setVisible(element, visible) {
  1708. addOrRemoveCssClass(element, 'ag-invisible', !visible);
  1709. }
  1710. function setDisabled(element, disabled) {
  1711. var attributeName = 'disabled';
  1712. if (disabled) {
  1713. element.setAttribute(attributeName, '');
  1714. }
  1715. else {
  1716. element.removeAttribute(attributeName);
  1717. }
  1718. }
  1719. function isElementChildOfClass(element, cls, maxNest) {
  1720. var counter = 0;
  1721. while (element) {
  1722. if (containsClass(element, cls)) {
  1723. return true;
  1724. }
  1725. element = element.parentElement;
  1726. if (maxNest && ++counter > maxNest) {
  1727. break;
  1728. }
  1729. }
  1730. return false;
  1731. }
  1732. function getElementSize(el) {
  1733. var _a = window.getComputedStyle(el), height = _a.height, width = _a.width, paddingTop = _a.paddingTop, paddingRight = _a.paddingRight, paddingBottom = _a.paddingBottom, paddingLeft = _a.paddingLeft, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, boxSizing = _a.boxSizing;
  1734. return {
  1735. height: parseFloat(height),
  1736. width: parseFloat(width),
  1737. paddingTop: parseFloat(paddingTop),
  1738. paddingRight: parseFloat(paddingRight),
  1739. paddingBottom: parseFloat(paddingBottom),
  1740. paddingLeft: parseFloat(paddingLeft),
  1741. marginTop: parseFloat(marginTop),
  1742. marginRight: parseFloat(marginRight),
  1743. marginBottom: parseFloat(marginBottom),
  1744. marginLeft: parseFloat(marginLeft),
  1745. boxSizing: boxSizing
  1746. };
  1747. }
  1748. function getInnerHeight(el) {
  1749. var size = getElementSize(el);
  1750. if (size.boxSizing === 'border-box') {
  1751. return size.height - size.paddingTop - size.paddingBottom;
  1752. }
  1753. return size.height;
  1754. }
  1755. function getInnerWidth(el) {
  1756. var size = getElementSize(el);
  1757. if (size.boxSizing === 'border-box') {
  1758. return size.width - size.paddingLeft - size.paddingRight;
  1759. }
  1760. return size.width;
  1761. }
  1762. function getAbsoluteHeight(el) {
  1763. var size = getElementSize(el);
  1764. var marginRight = size.marginBottom + size.marginTop;
  1765. return Math.ceil(el.offsetHeight + marginRight);
  1766. }
  1767. function getAbsoluteWidth(el) {
  1768. var size = getElementSize(el);
  1769. var marginWidth = size.marginLeft + size.marginRight;
  1770. return Math.ceil(el.offsetWidth + marginWidth);
  1771. }
  1772. function getScrollLeft(element, rtl) {
  1773. var scrollLeft = element.scrollLeft;
  1774. if (rtl) {
  1775. // Absolute value - for FF that reports RTL scrolls in negative numbers
  1776. scrollLeft = Math.abs(scrollLeft);
  1777. // Get Chrome to return the same value as well
  1778. if (Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserChrome"])()) {
  1779. scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft;
  1780. }
  1781. }
  1782. return scrollLeft;
  1783. }
  1784. function setScrollLeft(element, value, rtl) {
  1785. if (rtl) {
  1786. // Chrome and Safari when doing RTL have the END position of the scroll as zero, not the start
  1787. if (Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserSafari"])() || Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserChrome"])()) {
  1788. value = element.scrollWidth - element.clientWidth - value;
  1789. }
  1790. // Firefox uses negative numbers when doing RTL scrolling
  1791. if (Object(_browser__WEBPACK_IMPORTED_MODULE_0__["isBrowserFirefox"])()) {
  1792. value *= -1;
  1793. }
  1794. }
  1795. element.scrollLeft = value;
  1796. }
  1797. function clearElement(el) {
  1798. while (el && el.firstChild) {
  1799. el.removeChild(el.firstChild);
  1800. }
  1801. }
  1802. /** @deprecated */
  1803. function removeElement(parent, cssSelector) {
  1804. removeFromParent(parent.querySelector(cssSelector));
  1805. }
  1806. function removeFromParent(node) {
  1807. if (node && node.parentNode) {
  1808. node.parentNode.removeChild(node);
  1809. }
  1810. }
  1811. function isVisible(element) {
  1812. return element.offsetParent !== null;
  1813. }
  1814. /**
  1815. * Loads the template and returns it as an element. makes up for no simple way in
  1816. * the dom api to load html directly, eg we cannot do this: document.createElement(template)
  1817. * @param {string} template
  1818. * @returns {HTMLElement}
  1819. */
  1820. function loadTemplate(template) {
  1821. var tempDiv = document.createElement('div');
  1822. tempDiv.innerHTML = (template || '').trim();
  1823. return tempDiv.firstChild;
  1824. }
  1825. function appendHtml(eContainer, htmlTemplate) {
  1826. if (eContainer.lastChild) {
  1827. // https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML
  1828. // we put the items at the start, so new items appear underneath old items,
  1829. // so when expanding/collapsing groups, the new rows don't go on top of the
  1830. // rows below that are moving our of the way
  1831. eContainer.insertAdjacentHTML('afterbegin', htmlTemplate);
  1832. }
  1833. else {
  1834. eContainer.innerHTML = htmlTemplate;
  1835. }
  1836. }
  1837. /** @deprecated */
  1838. function getElementAttribute(element, attributeName) {
  1839. if (element.attributes && element.attributes[attributeName]) {
  1840. var attribute = element.attributes[attributeName];
  1841. return attribute.value;
  1842. }
  1843. return null;
  1844. }
  1845. function offsetHeight(element) {
  1846. return element && element.clientHeight ? element.clientHeight : 0;
  1847. }
  1848. function offsetWidth(element) {
  1849. return element && element.clientWidth ? element.clientWidth : 0;
  1850. }
  1851. function ensureDomOrder(eContainer, eChild, eChildBefore) {
  1852. // if already in right order, do nothing
  1853. if (eChildBefore && eChildBefore.nextSibling === eChild) {
  1854. return;
  1855. }
  1856. if (eChildBefore) {
  1857. if (eChildBefore.nextSibling) {
  1858. // insert between the eRowBefore and the row after it
  1859. eContainer.insertBefore(eChild, eChildBefore.nextSibling);
  1860. }
  1861. else {
  1862. // if nextSibling is missing, means other row is at end, so just append new row at the end
  1863. eContainer.appendChild(eChild);
  1864. }
  1865. }
  1866. else {
  1867. // otherwise put at start
  1868. if (eContainer.firstChild && eContainer.firstChild !== eChild) {
  1869. // insert it at the first location
  1870. eContainer.insertAdjacentElement('afterbegin', eChild);
  1871. }
  1872. }
  1873. }
  1874. function setDomChildOrder(eContainer, orderedChildren) {
  1875. for (var i = 0; i < orderedChildren.length; i++) {
  1876. var correctCellAtIndex = orderedChildren[i];
  1877. var actualCellAtIndex = eContainer.children[i];
  1878. if (actualCellAtIndex !== correctCellAtIndex) {
  1879. eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex);
  1880. }
  1881. }
  1882. }
  1883. function insertTemplateWithDomOrder(eContainer, htmlTemplate, eChildBefore) {
  1884. var res;
  1885. if (eChildBefore) {
  1886. // if previous element exists, just slot in after the previous element
  1887. eChildBefore.insertAdjacentHTML('afterend', htmlTemplate);
  1888. res = eChildBefore.nextSibling;
  1889. }
  1890. else {
  1891. if (eContainer.firstChild) {
  1892. // insert it at the first location
  1893. eContainer.insertAdjacentHTML('afterbegin', htmlTemplate);
  1894. }
  1895. else {
  1896. // otherwise eContainer is empty, so just append it
  1897. eContainer.innerHTML = htmlTemplate;
  1898. }
  1899. res = eContainer.firstChild;
  1900. }
  1901. return res;
  1902. }
  1903. /** @deprecated */
  1904. function prependDC(parent, documentFragment) {
  1905. if (Object(_generic__WEBPACK_IMPORTED_MODULE_1__["exists"])(parent.firstChild)) {
  1906. parent.insertBefore(documentFragment, parent.firstChild);
  1907. }
  1908. else {
  1909. parent.appendChild(documentFragment);
  1910. }
  1911. }
  1912. function addStylesToElement(eElement, styles) {
  1913. if (!styles) {
  1914. return;
  1915. }
  1916. Object.keys(styles).forEach(function (key) {
  1917. var keyCamelCase = Object(_string__WEBPACK_IMPORTED_MODULE_2__["hyphenToCamelCase"])(key);
  1918. if (keyCamelCase) {
  1919. eElement.style[keyCamelCase] = styles[key];
  1920. }
  1921. });
  1922. }
  1923. function isHorizontalScrollShowing(element) {
  1924. return element.clientWidth < element.scrollWidth;
  1925. }
  1926. function isVerticalScrollShowing(element) {
  1927. return element.clientHeight < element.scrollHeight;
  1928. }
  1929. function setElementWidth(element, width) {
  1930. if (width === 'flex') {
  1931. element.style.width = null;
  1932. element.style.minWidth = null;
  1933. element.style.maxWidth = null;
  1934. element.style.flex = '1 1 auto';
  1935. }
  1936. else {
  1937. setFixedWidth(element, width);
  1938. }
  1939. }
  1940. function setFixedWidth(element, width) {
  1941. width = formatSize(width);
  1942. element.style.width = width.toString();
  1943. element.style.maxWidth = width.toString();
  1944. element.style.minWidth = width.toString();
  1945. }
  1946. function setElementHeight(element, height) {
  1947. if (height === 'flex') {
  1948. element.style.height = null;
  1949. element.style.minHeight = null;
  1950. element.style.maxHeight = null;
  1951. element.style.flex = '1 1 auto';
  1952. }
  1953. else {
  1954. setFixedHeight(element, height);
  1955. }
  1956. }
  1957. function setFixedHeight(element, height) {
  1958. height = formatSize(height);
  1959. element.style.height = height.toString();
  1960. element.style.maxHeight = height.toString();
  1961. element.style.minHeight = height.toString();
  1962. }
  1963. function formatSize(size) {
  1964. if (typeof size === 'number') {
  1965. return size + "px";
  1966. }
  1967. return size;
  1968. }
  1969. /**
  1970. * Returns true if it is a DOM node
  1971. * taken from: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
  1972. * @param {any} o
  1973. * @return {boolean}
  1974. */
  1975. function isNode(o) {
  1976. return (typeof Node === 'function'
  1977. ? o instanceof Node
  1978. : o && typeof o === 'object' && typeof o.nodeType === 'number' && typeof o.nodeName === 'string');
  1979. }
  1980. //
  1981. /**
  1982. * Returns true if it is a DOM element
  1983. * taken from: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
  1984. * @param {any} o
  1985. * @returns {boolean}
  1986. */
  1987. function isElement(o) {
  1988. return (typeof HTMLElement === 'function'
  1989. ? o instanceof HTMLElement //DOM2
  1990. : o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string');
  1991. }
  1992. function isNodeOrElement(o) {
  1993. return isNode(o) || isElement(o);
  1994. }
  1995. /**
  1996. * Makes a copy of a node list into a list
  1997. * @param {NodeList} nodeList
  1998. * @returns {Node[]}
  1999. */
  2000. function copyNodeList(nodeList) {
  2001. var childCount = nodeList ? nodeList.length : 0;
  2002. var res = [];
  2003. for (var i = 0; i < childCount; i++) {
  2004. res.push(nodeList[i]);
  2005. }
  2006. return res;
  2007. }
  2008. function iterateNamedNodeMap(map, callback) {
  2009. if (!map) {
  2010. return;
  2011. }
  2012. for (var i = 0; i < map.length; i++) {
  2013. var attr = map[i];
  2014. callback(attr.name, attr.value);
  2015. }
  2016. }
  2017. /** @deprecated */
  2018. function setCheckboxState(eCheckbox, state) {
  2019. if (typeof state === 'boolean') {
  2020. eCheckbox.checked = state;
  2021. eCheckbox.indeterminate = false;
  2022. }
  2023. else {
  2024. // isNodeSelected returns back undefined if it's a group and the children
  2025. // are a mix of selected and unselected
  2026. eCheckbox.indeterminate = true;
  2027. }
  2028. }
  2029. /***/ }),
  2030. /* 13 */
  2031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2032. "use strict";
  2033. __webpack_require__.r(__webpack_exports__);
  2034. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserIE", function() { return isBrowserIE; });
  2035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserEdge", function() { return isBrowserEdge; });
  2036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserSafari", function() { return isBrowserSafari; });
  2037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserChrome", function() { return isBrowserChrome; });
  2038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBrowserFirefox", function() { return isBrowserFirefox; });
  2039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIOSUserAgent", function() { return isIOSUserAgent; });
  2040. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTabIndex", function() { return getTabIndex; });
  2041. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaxDivHeight", function() { return getMaxDivHeight; });
  2042. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getScrollbarWidth", function() { return getScrollbarWidth; });
  2043. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasOverflowScrolling", function() { return hasOverflowScrolling; });
  2044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBodyWidth", function() { return getBodyWidth; });
  2045. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBodyHeight", function() { return getBodyHeight; });
  2046. /**
  2047. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  2048. * @version v23.2.1
  2049. * @link http://www.ag-grid.com/
  2050. * @license MIT
  2051. */
  2052. /**
  2053. * These variables are lazy loaded, as otherwise they try and get initialised when we are loading
  2054. * unit tests and we don't have references to window or document in the unit tests
  2055. * from http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
  2056. */
  2057. var isSafari;
  2058. var isIE;
  2059. var isEdge;
  2060. var isChrome;
  2061. var isFirefox;
  2062. var isIOS;
  2063. function isBrowserIE() {
  2064. if (isIE === undefined) {
  2065. isIE = /*@cc_on!@*/ false || !!document.documentMode; // At least IE6
  2066. }
  2067. return isIE;
  2068. }
  2069. function isBrowserEdge() {
  2070. if (isEdge === undefined) {
  2071. isEdge = !isBrowserIE() && !!window.StyleMedia;
  2072. }
  2073. return isEdge;
  2074. }
  2075. function isBrowserSafari() {
  2076. if (isSafari === undefined) {
  2077. // taken from https://github.com/ag-grid/ag-grid/issues/550
  2078. var anyWindow = window;
  2079. var hasNotification = function (p) { return p && p.toString() === '[object SafariRemoteNotification]'; };
  2080. isSafari = Object.prototype.toString.call(anyWindow.HTMLElement).indexOf('Constructor') > 0
  2081. || hasNotification(anyWindow.safari && anyWindow.safari.pushNotification);
  2082. }
  2083. return isSafari;
  2084. }
  2085. function isBrowserChrome() {
  2086. if (isChrome === undefined) {
  2087. var win = window;
  2088. isChrome = (!!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime)) ||
  2089. (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor));
  2090. }
  2091. return isChrome;
  2092. }
  2093. function isBrowserFirefox() {
  2094. if (isFirefox === undefined) {
  2095. var win = window;
  2096. isFirefox = typeof win.InstallTrigger !== 'undefined';
  2097. }
  2098. return isFirefox;
  2099. }
  2100. function isIOSUserAgent() {
  2101. if (isIOS === undefined) {
  2102. // taken from https://stackoverflow.com/a/58064481/1388233
  2103. isIOS = (/iPad|iPhone|iPod/.test(navigator.platform) ||
  2104. // eslint-disable-next-line
  2105. (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
  2106. !window.MSStream;
  2107. }
  2108. return isIOS;
  2109. }
  2110. function getTabIndex(el) {
  2111. if (!el) {
  2112. return null;
  2113. }
  2114. var numberTabIndex = el.tabIndex;
  2115. var tabIndex = el.getAttribute('tabIndex');
  2116. if (isBrowserIE() && numberTabIndex === 0 && el.getAttribute('tabIndex') === null) {
  2117. var map = {
  2118. a: true,
  2119. body: true,
  2120. button: true,
  2121. frame: true,
  2122. iframe: true,
  2123. img: true,
  2124. input: true,
  2125. isindex: true,
  2126. object: true,
  2127. select: true,
  2128. textarea: true
  2129. };
  2130. return map[el.nodeName.toLowerCase()] === true ? '0' : null;
  2131. }
  2132. if (numberTabIndex === -1 && (tabIndex === null || (tabIndex === '' && !isBrowserFirefox()))) {
  2133. return null;
  2134. }
  2135. return numberTabIndex.toString();
  2136. }
  2137. function getMaxDivHeight() {
  2138. if (!document.body) {
  2139. return -1;
  2140. }
  2141. var res = 1000000;
  2142. // FF reports the height back but still renders blank after ~6M px
  2143. var testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000;
  2144. var div = document.createElement('div');
  2145. document.body.appendChild(div);
  2146. while (true) {
  2147. var test_1 = res * 2;
  2148. div.style.height = test_1 + 'px';
  2149. if (test_1 > testUpTo || div.clientHeight !== test_1) {
  2150. break;
  2151. }
  2152. else {
  2153. res = test_1;
  2154. }
  2155. }
  2156. document.body.removeChild(div);
  2157. return res;
  2158. }
  2159. function getScrollbarWidth() {
  2160. var body = document.body;
  2161. var div = document.createElement('div');
  2162. div.style.width = div.style.height = '100px';
  2163. div.style.opacity = '0';
  2164. div.style.overflow = 'scroll';
  2165. div.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
  2166. div.style.position = 'absolute';
  2167. body.appendChild(div);
  2168. var width = div.offsetWidth - div.clientWidth;
  2169. // remove divs
  2170. if (div.parentNode) {
  2171. div.parentNode.removeChild(div);
  2172. }
  2173. return width;
  2174. }
  2175. /** @deprecated */
  2176. function hasOverflowScrolling() {
  2177. var prefixes = ['webkit', 'moz', 'o', 'ms'];
  2178. var div = document.createElement('div');
  2179. var body = document.getElementsByTagName('body')[0];
  2180. var found = false;
  2181. var p;
  2182. body.appendChild(div);
  2183. div.setAttribute('style', prefixes.map(function (prefix) { return "-" + prefix + "-overflow-scrolling: touch"; }).concat('overflow-scrolling: touch').join(';'));
  2184. var computedStyle = window.getComputedStyle(div);
  2185. if (computedStyle.overflowScrolling === 'touch') {
  2186. found = true;
  2187. }
  2188. if (!found) {
  2189. for (var _i = 0, prefixes_1 = prefixes; _i < prefixes_1.length; _i++) {
  2190. p = prefixes_1[_i];
  2191. if (computedStyle[p + "OverflowScrolling"] === 'touch') {
  2192. found = true;
  2193. break;
  2194. }
  2195. }
  2196. }
  2197. if (div.parentNode) {
  2198. div.parentNode.removeChild(div);
  2199. }
  2200. return found;
  2201. }
  2202. /**
  2203. * Gets the document body width
  2204. * from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code
  2205. * @returns {number}
  2206. */
  2207. function getBodyWidth() {
  2208. if (document.body) {
  2209. return document.body.clientWidth;
  2210. }
  2211. if (window.innerHeight) {
  2212. return window.innerWidth;
  2213. }
  2214. if (document.documentElement && document.documentElement.clientWidth) {
  2215. return document.documentElement.clientWidth;
  2216. }
  2217. return -1;
  2218. }
  2219. /**
  2220. * Gets the body height
  2221. * from: http://stackoverflow.com/questions/1038727/how-to-get-browser-width-using-javascript-code
  2222. * @returns {number}
  2223. */
  2224. function getBodyHeight() {
  2225. if (document.body) {
  2226. return document.body.clientHeight;
  2227. }
  2228. if (window.innerHeight) {
  2229. return window.innerHeight;
  2230. }
  2231. if (document.documentElement && document.documentElement.clientHeight) {
  2232. return document.documentElement.clientHeight;
  2233. }
  2234. return -1;
  2235. }
  2236. /***/ }),
  2237. /* 14 */
  2238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2239. "use strict";
  2240. __webpack_require__.r(__webpack_exports__);
  2241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeNull", function() { return makeNull; });
  2242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exists", function() { return exists; });
  2243. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "missing", function() { return missing; });
  2244. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "missingOrEmpty", function() { return missingOrEmpty; });
  2245. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toStringOrNull", function() { return toStringOrNull; });
  2246. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "referenceCompare", function() { return referenceCompare; });
  2247. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsonEquals", function() { return jsonEquals; });
  2248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultComparator", function() { return defaultComparator; });
  2249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
  2250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return values; });
  2251. /**
  2252. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  2253. * @version v23.2.1
  2254. * @link http://www.ag-grid.com/
  2255. * @license MIT
  2256. */
  2257. /**
  2258. * If value is undefined, null or blank, returns null, otherwise returns the value
  2259. * @param {T} value
  2260. * @returns {T | null}
  2261. */
  2262. function makeNull(value) {
  2263. return value == null || value === '' ? null : value;
  2264. }
  2265. function exists(value, allowEmptyString) {
  2266. if (allowEmptyString === void 0) { allowEmptyString = false; }
  2267. return value != null && (allowEmptyString || value !== '');
  2268. }
  2269. function missing(value) {
  2270. return !exists(value);
  2271. }
  2272. function missingOrEmpty(value) {
  2273. return !value || missing(value) || value.length === 0;
  2274. }
  2275. function toStringOrNull(value) {
  2276. return exists(value) && value.toString ? value.toString() : null;
  2277. }
  2278. /** @deprecated */
  2279. function referenceCompare(left, right) {
  2280. if (left == null && right == null) {
  2281. return true;
  2282. }
  2283. if (left == null && right != null) {
  2284. return false;
  2285. }
  2286. if (left != null && right == null) {
  2287. return false;
  2288. }
  2289. return left === right;
  2290. }
  2291. function jsonEquals(val1, val2) {
  2292. var val1Json = val1 ? JSON.stringify(val1) : null;
  2293. var val2Json = val2 ? JSON.stringify(val2) : null;
  2294. return val1Json === val2Json;
  2295. }
  2296. function defaultComparator(valueA, valueB, accentedCompare) {
  2297. if (accentedCompare === void 0) { accentedCompare = false; }
  2298. var valueAMissing = valueA == null;
  2299. var valueBMissing = valueB == null;
  2300. // this is for aggregations sum and avg, where the result can be a number that is wrapped.
  2301. // if we didn't do this, then the toString() value would be used, which would result in
  2302. // the strings getting used instead of the numbers.
  2303. if (valueA && valueA.toNumber) {
  2304. valueA = valueA.toNumber();
  2305. }
  2306. if (valueB && valueB.toNumber) {
  2307. valueB = valueB.toNumber();
  2308. }
  2309. if (valueAMissing && valueBMissing) {
  2310. return 0;
  2311. }
  2312. if (valueAMissing) {
  2313. return -1;
  2314. }
  2315. if (valueBMissing) {
  2316. return 1;
  2317. }
  2318. function doQuickCompare(a, b) {
  2319. return (a > b ? 1 : (a < b ? -1 : 0));
  2320. }
  2321. if (typeof valueA === 'string') {
  2322. if (!accentedCompare) {
  2323. return doQuickCompare(valueA, valueB);
  2324. }
  2325. try {
  2326. // using local compare also allows chinese comparisons
  2327. return valueA.localeCompare(valueB);
  2328. }
  2329. catch (e) {
  2330. // if something wrong with localeCompare, eg not supported
  2331. // by browser, then just continue with the quick one
  2332. return doQuickCompare(valueA, valueB);
  2333. }
  2334. }
  2335. return doQuickCompare(valueA, valueB);
  2336. }
  2337. function find(collection, predicate, value) {
  2338. if (collection === null || collection === undefined) {
  2339. return null;
  2340. }
  2341. if (!Array.isArray(collection)) {
  2342. var objToArray = values(collection);
  2343. return find(objToArray, predicate, value);
  2344. }
  2345. var collectionAsArray = collection;
  2346. var firstMatchingItem = null;
  2347. for (var i = 0; i < collectionAsArray.length; i++) {
  2348. var item = collectionAsArray[i];
  2349. if (typeof predicate === 'string') {
  2350. if (item[predicate] === value) {
  2351. firstMatchingItem = item;
  2352. break;
  2353. }
  2354. }
  2355. else {
  2356. var callback = predicate;
  2357. if (callback(item)) {
  2358. firstMatchingItem = item;
  2359. break;
  2360. }
  2361. }
  2362. }
  2363. return firstMatchingItem;
  2364. }
  2365. function values(object) {
  2366. if (object instanceof Set || object instanceof Map) {
  2367. var values_1 = [];
  2368. object.forEach(function (value) { return values_1.push(value); });
  2369. return values_1;
  2370. }
  2371. return Object.keys(object).map(function (key) { return object[key]; });
  2372. }
  2373. /***/ }),
  2374. /* 15 */
  2375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2376. "use strict";
  2377. __webpack_require__.r(__webpack_exports__);
  2378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utf8_encode", function() { return utf8_encode; });
  2379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "camelCaseToHyphen", function() { return camelCaseToHyphen; });
  2380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hyphenToCamelCase", function() { return hyphenToCamelCase; });
  2381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "capitalise", function() { return capitalise; });
  2382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; });
  2383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "camelCaseToHumanText", function() { return camelCaseToHumanText; });
  2384. /**
  2385. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  2386. * @version v23.2.1
  2387. * @link http://www.ag-grid.com/
  2388. * @license MIT
  2389. */
  2390. var reUnescapedHtml = /[&<>"']/g;
  2391. /**
  2392. * HTML Escapes.
  2393. */
  2394. var HTML_ESCAPES = {
  2395. '&': '&amp;',
  2396. '<': '&lt;',
  2397. '>': '&gt;',
  2398. '"': '&quot;',
  2399. "'": '&#39;'
  2400. };
  2401. /**
  2402. * It encodes any string in UTF-8 format
  2403. * taken from https://github.com/mathiasbynens/utf8.js
  2404. * @param {string} s
  2405. * @returns {string}
  2406. */
  2407. function utf8_encode(s) {
  2408. var stringFromCharCode = String.fromCharCode;
  2409. function ucs2decode(string) {
  2410. var output = [];
  2411. var counter = 0;
  2412. var length = string.length;
  2413. var value;
  2414. var extra;
  2415. while (counter < length) {
  2416. value = string.charCodeAt(counter++);
  2417. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  2418. // high surrogate, and there is a next character
  2419. extra = string.charCodeAt(counter++);
  2420. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  2421. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  2422. }
  2423. else {
  2424. // unmatched surrogate; only append this code unit, in case the next
  2425. // code unit is the high surrogate of a surrogate pair
  2426. output.push(value);
  2427. counter--;
  2428. }
  2429. }
  2430. else {
  2431. output.push(value);
  2432. }
  2433. }
  2434. return output;
  2435. }
  2436. function checkScalarValue(codePoint) {
  2437. if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
  2438. throw Error('Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
  2439. ' is not a scalar value');
  2440. }
  2441. }
  2442. function createByte(codePoint, shift) {
  2443. return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
  2444. }
  2445. function encodeCodePoint(codePoint) {
  2446. if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
  2447. return stringFromCharCode(codePoint);
  2448. }
  2449. var symbol = '';
  2450. if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
  2451. symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
  2452. }
  2453. else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
  2454. checkScalarValue(codePoint);
  2455. symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
  2456. symbol += createByte(codePoint, 6);
  2457. }
  2458. else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
  2459. symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
  2460. symbol += createByte(codePoint, 12);
  2461. symbol += createByte(codePoint, 6);
  2462. }
  2463. symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
  2464. return symbol;
  2465. }
  2466. var codePoints = ucs2decode(s);
  2467. var length = codePoints.length;
  2468. var index = -1;
  2469. var codePoint;
  2470. var byteString = '';
  2471. while (++index < length) {
  2472. codePoint = codePoints[index];
  2473. byteString += encodeCodePoint(codePoint);
  2474. }
  2475. return byteString;
  2476. }
  2477. /**
  2478. * Converts a camelCase string into hyphenated string
  2479. * from https://gist.github.com/youssman/745578062609e8acac9f
  2480. * @param {string} str
  2481. * @return {string}
  2482. */
  2483. function camelCaseToHyphen(str) {
  2484. if (str === null || str === undefined) {
  2485. return null;
  2486. }
  2487. return str.replace(/([A-Z])/g, function (g) { return '-' + g[0].toLowerCase(); });
  2488. }
  2489. /**
  2490. * Converts a hyphenated string into camelCase string
  2491. * from https://stackoverflow.com/questions/6660977/convert-hyphens-to-camel-case-camelcase
  2492. * @param {string} str
  2493. * @return {string}
  2494. */
  2495. function hyphenToCamelCase(str) {
  2496. if (str === null || str === undefined) {
  2497. return null;
  2498. }
  2499. return str.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
  2500. }
  2501. function capitalise(str) {
  2502. return str[0].toUpperCase() + str.substr(1).toLowerCase();
  2503. }
  2504. function escape(toEscape) {
  2505. return toEscape == null || !toEscape.replace ? toEscape : toEscape.replace(reUnescapedHtml, function (chr) { return HTML_ESCAPES[chr]; });
  2506. }
  2507. /**
  2508. * Converts a camelCase string into regular text
  2509. * from: https://stackoverflow.com/questions/15369566/putting-space-in-camel-case-string-using-regular-expression
  2510. * @param {string} camelCase
  2511. * @return {string}
  2512. */
  2513. function camelCaseToHumanText(camelCase) {
  2514. if (!camelCase || camelCase == null) {
  2515. return null;
  2516. }
  2517. var rex = /([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;
  2518. var words = camelCase.replace(rex, '$1$4 $2$3$5').replace('.', ' ').split(' ');
  2519. return words.map(function (word) { return word.substring(0, 1).toUpperCase() + ((word.length > 1) ? word.substring(1, word.length) : ''); }).join(' ');
  2520. }
  2521. /***/ }),
  2522. /* 16 */
  2523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2524. "use strict";
  2525. __webpack_require__.r(__webpack_exports__);
  2526. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterateObject", function() { return iterateObject; });
  2527. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cloneObject", function() { return cloneObject; });
  2528. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepCloneObject", function() { return deepCloneObject; });
  2529. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProperty", function() { return getProperty; });
  2530. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setProperty", function() { return setProperty; });
  2531. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyPropertiesIfPresent", function() { return copyPropertiesIfPresent; });
  2532. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyPropertyIfPresent", function() { return copyPropertyIfPresent; });
  2533. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllKeysInObjects", function() { return getAllKeysInObjects; });
  2534. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeDeep", function() { return mergeDeep; });
  2535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return assign; });
  2536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "missingOrEmptyObject", function() { return missingOrEmptyObject; });
  2537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; });
  2538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
  2539. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deepFreeze", function() { return deepFreeze; });
  2540. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getValueUsingField", function() { return getValueUsingField; });
  2541. /* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
  2542. /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
  2543. /**
  2544. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  2545. * @version v23.2.1
  2546. * @link http://www.ag-grid.com/
  2547. * @license MIT
  2548. */
  2549. function iterateObject(object, callback) {
  2550. if (object == null) {
  2551. return;
  2552. }
  2553. if (Array.isArray(object)) {
  2554. Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(object, function (value, index) { return callback("" + index, value); });
  2555. }
  2556. else {
  2557. Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(Object.keys(object), function (key) { return callback(key, object[key]); });
  2558. }
  2559. }
  2560. function cloneObject(object) {
  2561. var copy = {};
  2562. var keys = Object.keys(object);
  2563. for (var i = 0; i < keys.length; i++) {
  2564. var key = keys[i];
  2565. var value = object[key];
  2566. copy[key] = value;
  2567. }
  2568. return copy;
  2569. }
  2570. function deepCloneObject(object) {
  2571. return JSON.parse(JSON.stringify(object));
  2572. }
  2573. function getProperty(object, key) {
  2574. return object[key];
  2575. }
  2576. function setProperty(object, key, value) {
  2577. object[key] = value;
  2578. }
  2579. /**
  2580. * Will copy the specified properties from `source` into the equivalent properties on `target`, ignoring properties with
  2581. * a value of `undefined`.
  2582. */
  2583. function copyPropertiesIfPresent(source, target) {
  2584. var properties = [];
  2585. for (var _i = 2; _i < arguments.length; _i++) {
  2586. properties[_i - 2] = arguments[_i];
  2587. }
  2588. Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(properties, function (p) { return copyPropertyIfPresent(source, target, p); });
  2589. }
  2590. /**
  2591. * Will copy the specified property from `source` into the equivalent property on `target`, unless the property has a
  2592. * value of `undefined`. If a transformation is provided, it will be applied to the value before being set on `target`.
  2593. */
  2594. function copyPropertyIfPresent(source, target, property, transform) {
  2595. var value = getProperty(source, property);
  2596. if (value !== undefined) {
  2597. setProperty(target, property, transform ? transform(value) : value);
  2598. }
  2599. }
  2600. function getAllKeysInObjects(objects) {
  2601. var allValues = {};
  2602. objects.filter(function (obj) { return obj != null; }).forEach(function (obj) {
  2603. Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(Object.keys(obj), function (key) { return allValues[key] = null; });
  2604. });
  2605. return Object.keys(allValues);
  2606. }
  2607. function mergeDeep(dest, source, copyUndefined) {
  2608. if (copyUndefined === void 0) { copyUndefined = true; }
  2609. if (!Object(_generic__WEBPACK_IMPORTED_MODULE_0__["exists"])(source)) {
  2610. return;
  2611. }
  2612. iterateObject(source, function (key, newValue) {
  2613. var oldValue = dest[key];
  2614. if (oldValue === newValue) {
  2615. return;
  2616. }
  2617. if (typeof oldValue === 'object' && typeof newValue === 'object' && !Array.isArray(oldValue)) {
  2618. mergeDeep(oldValue, newValue);
  2619. }
  2620. else if (copyUndefined || newValue !== undefined) {
  2621. dest[key] = newValue;
  2622. }
  2623. });
  2624. }
  2625. function assign(object) {
  2626. var sources = [];
  2627. for (var _i = 1; _i < arguments.length; _i++) {
  2628. sources[_i - 1] = arguments[_i];
  2629. }
  2630. Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(sources, function (source) { return iterateObject(source, function (key, value) { return object[key] = value; }); });
  2631. return object;
  2632. }
  2633. function missingOrEmptyObject(value) {
  2634. return Object(_generic__WEBPACK_IMPORTED_MODULE_0__["missing"])(value) || Object.keys(value).length === 0;
  2635. }
  2636. function get(source, expression, defaultValue) {
  2637. if (source == null) {
  2638. return defaultValue;
  2639. }
  2640. var keys = expression.split('.');
  2641. var objectToRead = source;
  2642. while (keys.length > 1) {
  2643. objectToRead = objectToRead[keys.shift()];
  2644. if (objectToRead == null) {
  2645. return defaultValue;
  2646. }
  2647. }
  2648. var value = objectToRead[keys[0]];
  2649. return value != null ? value : defaultValue;
  2650. }
  2651. function set(target, expression, value) {
  2652. if (target == null) {
  2653. return;
  2654. }
  2655. var keys = expression.split('.');
  2656. var objectToUpdate = target;
  2657. while (keys.length > 1) {
  2658. objectToUpdate = objectToUpdate[keys.shift()];
  2659. if (objectToUpdate == null) {
  2660. return;
  2661. }
  2662. }
  2663. objectToUpdate[keys[0]] = value;
  2664. }
  2665. function deepFreeze(object) {
  2666. Object.freeze(object);
  2667. Object(_array__WEBPACK_IMPORTED_MODULE_1__["forEach"])(Object(_generic__WEBPACK_IMPORTED_MODULE_0__["values"])(object), function (v) {
  2668. if (v != null && (typeof v === 'object' || typeof v === 'function')) {
  2669. deepFreeze(v);
  2670. }
  2671. });
  2672. return object;
  2673. }
  2674. function getValueUsingField(data, field, fieldContainsDots) {
  2675. if (!field || !data) {
  2676. return;
  2677. }
  2678. // if no '.', then it's not a deep value
  2679. if (!fieldContainsDots) {
  2680. return data[field];
  2681. }
  2682. // otherwise it is a deep value, so need to dig for it
  2683. var fields = field.split('.');
  2684. var currentObject = data;
  2685. for (var i = 0; i < fields.length; i++) {
  2686. currentObject = currentObject[fields[i]];
  2687. if (Object(_generic__WEBPACK_IMPORTED_MODULE_0__["missing"])(currentObject)) {
  2688. return null;
  2689. }
  2690. }
  2691. return currentObject;
  2692. }
  2693. /***/ }),
  2694. /* 17 */
  2695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2696. "use strict";
  2697. __webpack_require__.r(__webpack_exports__);
  2698. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstExistingValue", function() { return firstExistingValue; });
  2699. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anyExists", function() { return anyExists; });
  2700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "existsAndNotEmpty", function() { return existsAndNotEmpty; });
  2701. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; });
  2702. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areEqual", function() { return areEqual; });
  2703. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareArrays", function() { return compareArrays; });
  2704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shallowCompare", function() { return shallowCompare; });
  2705. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortNumerically", function() { return sortNumerically; });
  2706. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeRepeatsFromArray", function() { return removeRepeatsFromArray; });
  2707. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFromArray", function() { return removeFromArray; });
  2708. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllFromArray", function() { return removeAllFromArray; });
  2709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertIntoArray", function() { return insertIntoArray; });
  2710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrayIntoArray", function() { return insertArrayIntoArray; });
  2711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moveInArray", function() { return moveInArray; });
  2712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return includes; });
  2713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; });
  2714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushAll", function() { return pushAll; });
  2715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toStrings", function() { return toStrings; });
  2716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; });
  2717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; });
  2718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return some; });
  2719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
  2720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
  2721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; });
  2722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; });
  2723. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEachSnapshotFirst", function() { return forEachSnapshotFirst; });
  2724. /* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
  2725. /**
  2726. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  2727. * @version v23.2.1
  2728. * @link http://www.ag-grid.com/
  2729. * @license MIT
  2730. */
  2731. function firstExistingValue() {
  2732. var values = [];
  2733. for (var _i = 0; _i < arguments.length; _i++) {
  2734. values[_i] = arguments[_i];
  2735. }
  2736. for (var i = 0; i < values.length; i++) {
  2737. var value = values[i];
  2738. if (Object(_generic__WEBPACK_IMPORTED_MODULE_0__["exists"])(value)) {
  2739. return value;
  2740. }
  2741. }
  2742. return null;
  2743. }
  2744. /** @deprecated */
  2745. function anyExists(values) {
  2746. return values && firstExistingValue(values) != null;
  2747. }
  2748. function existsAndNotEmpty(value) {
  2749. return value != null && value.length > 0;
  2750. }
  2751. function last(arr) {
  2752. if (!arr || !arr.length) {
  2753. return undefined;
  2754. }
  2755. return arr[arr.length - 1];
  2756. }
  2757. function areEqual(a, b, comparator) {
  2758. if (a == null && b == null) {
  2759. return true;
  2760. }
  2761. return a != null &&
  2762. b != null &&
  2763. a.length === b.length &&
  2764. every(a, function (value, index) { return comparator ? comparator(value, b[index]) : b[index] === value; });
  2765. }
  2766. /** @deprecated */
  2767. function compareArrays(array1, array2) {
  2768. return areEqual(array1, array2);
  2769. }
  2770. /** @deprecated */
  2771. function shallowCompare(arr1, arr2) {
  2772. return areEqual(arr1, arr2);
  2773. }
  2774. function sortNumerically(array) {
  2775. return array.sort(function (a, b) { return a - b; });
  2776. }
  2777. function removeRepeatsFromArray(array, object) {
  2778. if (!array) {
  2779. return;
  2780. }
  2781. for (var index = array.length - 2; index >= 0; index--) {
  2782. var thisOneMatches = array[index] === object;
  2783. var nextOneMatches = array[index + 1] === object;
  2784. if (thisOneMatches && nextOneMatches) {
  2785. array.splice(index + 1, 1);
  2786. }
  2787. }
  2788. }
  2789. function removeFromArray(array, object) {
  2790. var index = array.indexOf(object);
  2791. if (index >= 0) {
  2792. array.splice(index, 1);
  2793. }
  2794. }
  2795. function removeAllFromArray(array, toRemove) {
  2796. forEach(toRemove, function (item) { return removeFromArray(array, item); });
  2797. }
  2798. function insertIntoArray(array, object, toIndex) {
  2799. array.splice(toIndex, 0, object);
  2800. }
  2801. function insertArrayIntoArray(dest, src, toIndex) {
  2802. if (dest == null || src == null) {
  2803. return;
  2804. }
  2805. // put items in backwards, otherwise inserted items end up in reverse order
  2806. for (var i = src.length - 1; i >= 0; i--) {
  2807. var item = src[i];
  2808. insertIntoArray(dest, item, toIndex);
  2809. }
  2810. }
  2811. function moveInArray(array, objectsToMove, toIndex) {
  2812. // first take out items from the array
  2813. removeAllFromArray(array, objectsToMove);
  2814. // now add the objects, in same order as provided to us, that means we start at the end
  2815. // as the objects will be pushed to the right as they are inserted
  2816. forEach(objectsToMove.slice().reverse(), function (obj) { return insertIntoArray(array, obj, toIndex); });
  2817. }
  2818. function includes(array, value) {
  2819. return array.indexOf(value) > -1;
  2820. }
  2821. function flatten(arrayOfArrays) {
  2822. return [].concat.apply([], arrayOfArrays);
  2823. }
  2824. function pushAll(target, source) {
  2825. if (source == null || target == null) {
  2826. return;
  2827. }
  2828. forEach(source, function (value) { return target.push(value); });
  2829. }
  2830. function toStrings(array) {
  2831. return map(array, _generic__WEBPACK_IMPORTED_MODULE_0__["toStringOrNull"]);
  2832. }
  2833. function findIndex(collection, predicate) {
  2834. for (var i = 0; i < collection.length; i++) {
  2835. if (predicate(collection[i], i, collection)) {
  2836. return i;
  2837. }
  2838. }
  2839. return -1;
  2840. }
  2841. /**
  2842. * The implementation of Array.prototype.every in browsers is always slower than just using a simple for loop, so
  2843. * use this for improved performance.
  2844. * https://jsbench.me/bek91dtit8/
  2845. */
  2846. function every(list, predicate) {
  2847. if (list == null) {
  2848. return true;
  2849. }
  2850. for (var i = 0; i < list.length; i++) {
  2851. if (!predicate(list[i], i)) {
  2852. return false;
  2853. }
  2854. }
  2855. return true;
  2856. }
  2857. /**
  2858. * The implementation of Array.prototype.some in browsers is always slower than just using a simple for loop, so
  2859. * use this for improved performance.
  2860. * https://jsbench.me/5dk91e4tmt/
  2861. */
  2862. function some(list, predicate) {
  2863. if (list == null) {
  2864. return false;
  2865. }
  2866. for (var i = 0; i < list.length; i++) {
  2867. if (predicate(list[i], i)) {
  2868. return true;
  2869. }
  2870. }
  2871. return false;
  2872. }
  2873. /**
  2874. * The implementation of Array.prototype.forEach in browsers is often slower than just using a simple for loop, so
  2875. * use this for improved performance.
  2876. * https://jsbench.me/apk91elt8a/
  2877. */
  2878. function forEach(list, action) {
  2879. if (list == null) {
  2880. return;
  2881. }
  2882. for (var i = 0; i < list.length; i++) {
  2883. action(list[i], i);
  2884. }
  2885. }
  2886. /**
  2887. * The implementation of Array.prototype.map in browsers is generally the same as just using a simple for loop. However,
  2888. * Firefox does exhibit some difference, and this performs no worse in other browsers, so use this if you want improved
  2889. * performance.
  2890. * https://jsbench.me/njk91ez8pc/
  2891. */
  2892. function map(list, process) {
  2893. if (list == null) {
  2894. return null;
  2895. }
  2896. var mapped = [];
  2897. for (var i = 0; i < list.length; i++) {
  2898. mapped.push(process(list[i], i));
  2899. }
  2900. return mapped;
  2901. }
  2902. /**
  2903. * The implementation of Array.prototype.filter in browsers is always slower than just using a simple for loop, so
  2904. * use this for improved performance.
  2905. * https://jsbench.me/7bk91fk08c/
  2906. */
  2907. function filter(list, predicate) {
  2908. if (list == null) {
  2909. return null;
  2910. }
  2911. var filtered = [];
  2912. for (var i = 0; i < list.length; i++) {
  2913. if (predicate(list[i], i)) {
  2914. filtered.push(list[i]);
  2915. }
  2916. }
  2917. return filtered;
  2918. }
  2919. /**
  2920. * The implementation of Array.prototype.reduce in browsers is generally the same as just using a simple for loop. However,
  2921. * Chrome does exhibit some difference, and this performs no worse in other browsers, so use this if you want improved
  2922. * performance.
  2923. * https://jsbench.me/7vk92n6u1f/
  2924. */
  2925. function reduce(list, step, initial) {
  2926. if (list == null || initial == null) {
  2927. return null;
  2928. }
  2929. var result = initial;
  2930. for (var i = 0; i < list.length; i++) {
  2931. result = step(result, list[i], i);
  2932. }
  2933. return result;
  2934. }
  2935. /** @deprecated */
  2936. function forEachSnapshotFirst(list, callback) {
  2937. if (!list) {
  2938. return;
  2939. }
  2940. var arrayCopy = list.slice(0);
  2941. arrayCopy.forEach(callback);
  2942. }
  2943. /***/ }),
  2944. /* 18 */
  2945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2946. "use strict";
  2947. __webpack_require__.r(__webpack_exports__);
  2948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serialiseDate", function() { return serialiseDate; });
  2949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDateTimeFromString", function() { return parseDateTimeFromString; });
  2950. /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
  2951. /**
  2952. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  2953. * @version v23.2.1
  2954. * @link http://www.ag-grid.com/
  2955. * @license MIT
  2956. */
  2957. /**
  2958. * Serialises a Date to a string of format `yyyy-MM-dd HH:mm:ss`.
  2959. * An alternative separator can be provided to be used instead of hyphens.
  2960. * @param date The date to serialise
  2961. * @param includeTime Whether to include the time in the serialised string
  2962. * @param separator The separator to use between date parts
  2963. */
  2964. function serialiseDate(date, includeTime, separator) {
  2965. if (includeTime === void 0) { includeTime = true; }
  2966. if (separator === void 0) { separator = '-'; }
  2967. if (!date) {
  2968. return null;
  2969. }
  2970. var serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(function (part) { return Object(_number__WEBPACK_IMPORTED_MODULE_0__["padStart"])(part, 2); }).join(separator);
  2971. if (includeTime) {
  2972. serialised += ' ' + [date.getHours(), date.getMinutes(), date.getSeconds()].map(function (part) { return Object(_number__WEBPACK_IMPORTED_MODULE_0__["padStart"])(part, 2); }).join(':');
  2973. }
  2974. return serialised;
  2975. }
  2976. /**
  2977. * Parses a date and time from a string in the format `yyyy-MM-dd HH:mm:ss`
  2978. */
  2979. function parseDateTimeFromString(value) {
  2980. if (!value) {
  2981. return null;
  2982. }
  2983. var _a = value.split(' '), dateStr = _a[0], timeStr = _a[1];
  2984. if (!dateStr) {
  2985. return null;
  2986. }
  2987. var fields = dateStr.split('-').map(function (f) { return parseInt(f, 10); });
  2988. if (fields.filter(function (f) { return !isNaN(f); }).length !== 3) {
  2989. return null;
  2990. }
  2991. var year = fields[0], month = fields[1], day = fields[2];
  2992. var date = new Date(year, month - 1, day);
  2993. if (date.getFullYear() !== year ||
  2994. date.getMonth() !== month - 1 ||
  2995. date.getDate() !== day) {
  2996. // date was not parsed as expected so must have been invalid
  2997. return null;
  2998. }
  2999. if (!timeStr || timeStr === '00:00:00') {
  3000. return date;
  3001. }
  3002. var _b = timeStr.split(':').map(function (part) { return parseInt(part, 10); }), hours = _b[0], minutes = _b[1], seconds = _b[2];
  3003. if (hours >= 0 && hours < 24) {
  3004. date.setHours(hours);
  3005. }
  3006. if (minutes >= 0 && minutes < 60) {
  3007. date.setMinutes(minutes);
  3008. }
  3009. if (seconds >= 0 && seconds < 60) {
  3010. date.setSeconds(seconds);
  3011. }
  3012. return date;
  3013. }
  3014. /***/ }),
  3015. /* 19 */
  3016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3017. "use strict";
  3018. __webpack_require__.r(__webpack_exports__);
  3019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return padStart; });
  3020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createArrayOfNumbers", function() { return createArrayOfNumbers; });
  3021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; });
  3022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMaxSafeInteger", function() { return getMaxSafeInteger; });
  3023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanNumber", function() { return cleanNumber; });
  3024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decToHex", function() { return decToHex; });
  3025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumberTwoDecimalPlacesAndCommas", function() { return formatNumberTwoDecimalPlacesAndCommas; });
  3026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumberCommas", function() { return formatNumberCommas; });
  3027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return sum; });
  3028. /**
  3029. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3030. * @version v23.2.1
  3031. * @link http://www.ag-grid.com/
  3032. * @license MIT
  3033. */
  3034. function padStart(value, totalStringSize) {
  3035. var asString = "" + value;
  3036. while (asString.length < totalStringSize) {
  3037. asString = "0" + asString;
  3038. }
  3039. return asString;
  3040. }
  3041. function createArrayOfNumbers(first, last) {
  3042. var result = [];
  3043. for (var i = first; i <= last; i++) {
  3044. result.push(i);
  3045. }
  3046. return result;
  3047. }
  3048. /**
  3049. * Check if a value is numeric
  3050. * from http://stackoverflow.com/questions/9716468/is-there-any-function-like-isnumeric-in-javascript-to-validate-numbers
  3051. * @param {any} value
  3052. * @return {boolean}
  3053. */
  3054. function isNumeric(value) {
  3055. return value !== '' && !isNaN(parseFloat(value)) && isFinite(value);
  3056. }
  3057. function getMaxSafeInteger() {
  3058. // eslint-disable-next-line
  3059. return Number.MAX_SAFE_INTEGER || 9007199254740991;
  3060. }
  3061. function cleanNumber(value) {
  3062. if (typeof value === 'string') {
  3063. value = parseInt(value, 10);
  3064. }
  3065. if (typeof value === 'number') {
  3066. return Math.floor(value);
  3067. }
  3068. else {
  3069. return null;
  3070. }
  3071. }
  3072. function decToHex(number, bytes) {
  3073. var hex = '';
  3074. for (var i = 0; i < bytes; i++) {
  3075. hex += String.fromCharCode(number & 0xff);
  3076. number >>>= 8;
  3077. }
  3078. return hex;
  3079. }
  3080. function formatNumberTwoDecimalPlacesAndCommas(value) {
  3081. if (typeof value !== 'number') {
  3082. return '';
  3083. }
  3084. return formatNumberCommas(Math.round(value * 100) / 100);
  3085. }
  3086. /**
  3087. * the native method number.toLocaleString(undefined, {minimumFractionDigits: 0})
  3088. * puts in decimal places in IE, so we use this method instead
  3089. * from: http://blog.tompawlak.org/number-currency-formatting-javascript
  3090. * @param {number} value
  3091. * @returns {string}
  3092. */
  3093. function formatNumberCommas(value) {
  3094. if (typeof value !== 'number') {
  3095. return '';
  3096. }
  3097. return value.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
  3098. }
  3099. function sum(values) {
  3100. return values == null ? null : values.reduce(function (total, value) { return total + value; }, 0);
  3101. }
  3102. /***/ }),
  3103. /* 20 */
  3104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3105. "use strict";
  3106. __webpack_require__.r(__webpack_exports__);
  3107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stopPropagationForAgGrid", function() { return stopPropagationForAgGrid; });
  3108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isStopPropagationForAgGrid", function() { return isStopPropagationForAgGrid; });
  3109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventSupported", function() { return isEventSupported; });
  3110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCellCompForEvent", function() { return getCellCompForEvent; });
  3111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addChangeListener", function() { return addChangeListener; });
  3112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTarget", function() { return getTarget; });
  3113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInEventPath", function() { return isElementInEventPath; });
  3114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEventPath", function() { return createEventPath; });
  3115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAgGridEventPath", function() { return addAgGridEventPath; });
  3116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventPath", function() { return getEventPath; });
  3117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSafePassiveEventListener", function() { return addSafePassiveEventListener; });
  3118. /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
  3119. /**
  3120. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3121. * @version v23.2.1
  3122. * @link http://www.ag-grid.com/
  3123. * @license MIT
  3124. */
  3125. var AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';
  3126. var PASSIVE_EVENTS = ['touchstart', 'touchend', 'touchmove', 'touchcancel'];
  3127. var OUTSIDE_ANGULAR_EVENTS = ['mouseover', 'mouseout', 'mouseenter', 'mouseleave'];
  3128. var supports = {};
  3129. /**
  3130. * a user once raised an issue - they said that when you opened a popup (eg context menu)
  3131. * and then clicked on a selection checkbox, the popup wasn't closed. this is because the
  3132. * popup listens for clicks on the body, however ag-grid WAS stopping propagation on the
  3133. * checkbox clicks (so the rows didn't pick them up as row selection selection clicks).
  3134. * to get around this, we have a pattern to stop propagation for the purposes of ag-Grid,
  3135. * but we still let the event pass back to the body.
  3136. * @param {Event} event
  3137. */
  3138. function stopPropagationForAgGrid(event) {
  3139. event[AG_GRID_STOP_PROPAGATION] = true;
  3140. }
  3141. function isStopPropagationForAgGrid(event) {
  3142. return event[AG_GRID_STOP_PROPAGATION] === true;
  3143. }
  3144. var isEventSupported = (function () {
  3145. var tags = {
  3146. select: 'input',
  3147. change: 'input',
  3148. submit: 'form',
  3149. reset: 'form',
  3150. error: 'img',
  3151. load: 'img',
  3152. abort: 'img'
  3153. };
  3154. var isEventSupported = function (eventName) {
  3155. if (typeof supports[eventName] === 'boolean') {
  3156. return supports[eventName];
  3157. }
  3158. var el = document.createElement(tags[eventName] || 'div');
  3159. eventName = 'on' + eventName;
  3160. var isSupported = (eventName in el);
  3161. if (!isSupported) {
  3162. el.setAttribute(eventName, 'return;');
  3163. isSupported = typeof el[eventName] == 'function';
  3164. }
  3165. el = null;
  3166. return supports[eventName] = isSupported;
  3167. };
  3168. return isEventSupported;
  3169. })();
  3170. function getCellCompForEvent(gridOptionsWrapper, event) {
  3171. var sourceElement = getTarget(event);
  3172. while (sourceElement) {
  3173. var renderedCell = gridOptionsWrapper.getDomData(sourceElement, 'cellComp');
  3174. if (renderedCell) {
  3175. return renderedCell;
  3176. }
  3177. sourceElement = sourceElement.parentElement;
  3178. }
  3179. return null;
  3180. }
  3181. /**
  3182. * @deprecated
  3183. * Adds all type of change listeners to an element, intended to be a text field
  3184. * @param {HTMLElement} element
  3185. * @param {EventListener} listener
  3186. */
  3187. function addChangeListener(element, listener) {
  3188. element.addEventListener('changed', listener);
  3189. element.addEventListener('paste', listener);
  3190. element.addEventListener('input', listener);
  3191. // IE doesn't fire changed for special keys (eg delete, backspace), so need to
  3192. // listen for this further ones
  3193. element.addEventListener('keydown', listener);
  3194. element.addEventListener('keyup', listener);
  3195. }
  3196. /**
  3197. * srcElement is only available in IE. In all other browsers it is target
  3198. * http://stackoverflow.com/questions/5301643/how-can-i-make-event-srcelement-work-in-firefox-and-what-does-it-mean
  3199. * @param {Event} event
  3200. * @returns {Element}
  3201. */
  3202. function getTarget(event) {
  3203. var eventNoType = event;
  3204. return eventNoType.target || eventNoType.srcElement;
  3205. }
  3206. function isElementInEventPath(element, event) {
  3207. if (!event || !element) {
  3208. return false;
  3209. }
  3210. return getEventPath(event).indexOf(element) >= 0;
  3211. }
  3212. function createEventPath(event) {
  3213. var res = [];
  3214. var pointer = getTarget(event);
  3215. while (pointer) {
  3216. res.push(pointer);
  3217. pointer = pointer.parentElement;
  3218. }
  3219. return res;
  3220. }
  3221. /**
  3222. * firefox doesn't have event.path set, or any alternative to it, so we hack
  3223. * it in. this is needed as it's to late to work out the path when the item is
  3224. * removed from the dom. used by MouseEventService, where it works out if a click
  3225. * was from the current grid, or a detail grid (master / detail).
  3226. * @param {Event} event
  3227. */
  3228. function addAgGridEventPath(event) {
  3229. event.__agGridEventPath = getEventPath(event);
  3230. }
  3231. /**
  3232. * Gets the path for an Event.
  3233. * https://stackoverflow.com/questions/39245488/event-path-undefined-with-firefox-and-vue-js
  3234. * https://developer.mozilla.org/en-US/docs/Web/API/Event
  3235. * @param {Event} event
  3236. * @returns {EventTarget[]}
  3237. */
  3238. function getEventPath(event) {
  3239. var eventNoType = event;
  3240. if (eventNoType.deepPath) {
  3241. // IE supports deep path
  3242. return eventNoType.deepPath();
  3243. }
  3244. if (eventNoType.path) {
  3245. // Chrome supports path
  3246. return eventNoType.path;
  3247. }
  3248. if (eventNoType.composedPath) {
  3249. // Firefox supports composePath
  3250. return eventNoType.composedPath();
  3251. }
  3252. if (eventNoType.__agGridEventPath) {
  3253. // Firefox supports composePath
  3254. return eventNoType.__agGridEventPath;
  3255. }
  3256. // and finally, if none of the above worked,
  3257. // we create the path ourselves
  3258. return createEventPath(event);
  3259. }
  3260. function addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) {
  3261. var isPassive = Object(_array__WEBPACK_IMPORTED_MODULE_0__["includes"])(PASSIVE_EVENTS, event);
  3262. var isOutsideAngular = Object(_array__WEBPACK_IMPORTED_MODULE_0__["includes"])(OUTSIDE_ANGULAR_EVENTS, event);
  3263. var options = isPassive ? { passive: true } : undefined;
  3264. if (isOutsideAngular) {
  3265. // this happens in certain scenarios where I believe the user must be destroying the grid somehow but continuing
  3266. // for it to be used
  3267. // don't fall through to the else part either - just don't add the listener
  3268. if (frameworkOverrides && frameworkOverrides.addEventListenerOutsideAngular) {
  3269. frameworkOverrides.addEventListenerOutsideAngular(eElement, event, listener, options);
  3270. }
  3271. }
  3272. else {
  3273. eElement.addEventListener(event, listener, options);
  3274. }
  3275. }
  3276. /***/ }),
  3277. /* 21 */
  3278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3279. "use strict";
  3280. __webpack_require__.r(__webpack_exports__);
  3281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doOnce", function() { return doOnce; });
  3282. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFunctionParameters", function() { return getFunctionParameters; });
  3283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
  3284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "executeInAWhile", function() { return executeInAWhile; });
  3285. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "executeNextVMTurn", function() { return executeNextVMTurn; });
  3286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "executeAfter", function() { return executeAfter; });
  3287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
  3288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
  3289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "callIfPresent", function() { return callIfPresent; });
  3290. /**
  3291. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3292. * @version v23.2.1
  3293. * @link http://www.ag-grid.com/
  3294. * @license MIT
  3295. */
  3296. var FUNCTION_STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
  3297. var FUNCTION_ARGUMENT_NAMES = /([^\s,]+)/g;
  3298. var doOnceFlags = {};
  3299. /**
  3300. * If the key was passed before, then doesn't execute the func
  3301. * @param {Function} func
  3302. * @param {string} key
  3303. */
  3304. function doOnce(func, key) {
  3305. if (doOnceFlags[key]) {
  3306. return;
  3307. }
  3308. func();
  3309. doOnceFlags[key] = true;
  3310. }
  3311. /** @deprecated */
  3312. function getFunctionParameters(func) {
  3313. var fnStr = func.toString().replace(FUNCTION_STRIP_COMMENTS, '');
  3314. return fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(FUNCTION_ARGUMENT_NAMES) || [];
  3315. }
  3316. function isFunction(val) {
  3317. return !!(val && val.constructor && val.call && val.apply);
  3318. }
  3319. function executeInAWhile(funcs) {
  3320. executeAfter(funcs, 400);
  3321. }
  3322. function executeNextVMTurn(funcs) {
  3323. executeAfter(funcs, 0);
  3324. }
  3325. function executeAfter(funcs, milliseconds) {
  3326. if (milliseconds === void 0) { milliseconds = 0; }
  3327. if (funcs.length > 0) {
  3328. window.setTimeout(function () { return funcs.forEach(function (func) { return func(); }); }, milliseconds);
  3329. }
  3330. }
  3331. /**
  3332. * from https://stackoverflow.com/questions/24004791/can-someone-explain-the-debounce-function-in-javascript
  3333. * @param {Function} func The function to be debounced
  3334. * @param {number} wait The time in ms to debounce
  3335. * @param {boolean} immediate If it should run immediately or wait for the initial debounce delay
  3336. * @return {Function} The debounced function
  3337. */
  3338. function debounce(func, wait, immediate) {
  3339. if (immediate === void 0) { immediate = false; }
  3340. // 'private' variable for instance
  3341. // The returned function will be able to reference this due to closure.
  3342. // Each call to the returned function will share this common timer.
  3343. var timeout;
  3344. // Calling debounce returns a new anonymous function
  3345. return function () {
  3346. var args = [];
  3347. for (var _i = 0; _i < arguments.length; _i++) {
  3348. args[_i] = arguments[_i];
  3349. }
  3350. // reference the context and args for the setTimeout function
  3351. var context = this;
  3352. // Should the function be called now? If immediate is true
  3353. // and not already in a timeout then the answer is: Yes
  3354. var callNow = immediate && !timeout;
  3355. // This is the basic debounce behaviour where you can call this
  3356. // function several times, but it will only execute once
  3357. // [before or after imposing a delay].
  3358. // Each time the returned function is called, the timer starts over.
  3359. window.clearTimeout(timeout);
  3360. // Set the new timeout
  3361. timeout = window.setTimeout(function () {
  3362. // Inside the timeout function, clear the timeout variable
  3363. // which will let the next execution run when in 'immediate' mode
  3364. timeout = null;
  3365. // Check if the function already ran with the immediate flag
  3366. if (!immediate) {
  3367. // Call the original function with apply
  3368. // apply lets you define the 'this' object as well as the arguments
  3369. // (both captured before setTimeout)
  3370. func.apply(context, args);
  3371. }
  3372. }, wait);
  3373. // Immediate mode and no wait timer? Execute the function..
  3374. if (callNow) {
  3375. func.apply(context, args);
  3376. }
  3377. };
  3378. }
  3379. function compose() {
  3380. var fns = [];
  3381. for (var _i = 0; _i < arguments.length; _i++) {
  3382. fns[_i] = arguments[_i];
  3383. }
  3384. return function (arg) { return fns.reduce(function (composed, f) { return f(composed); }, arg); };
  3385. }
  3386. function callIfPresent(func) {
  3387. if (func) {
  3388. func();
  3389. }
  3390. }
  3391. /***/ }),
  3392. /* 22 */
  3393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3394. "use strict";
  3395. __webpack_require__.r(__webpack_exports__);
  3396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fuzzyCheckStrings", function() { return fuzzyCheckStrings; });
  3397. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fuzzySuggestions", function() { return fuzzySuggestions; });
  3398. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get_bigrams", function() { return get_bigrams; });
  3399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "string_distances", function() { return string_distances; });
  3400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "string_weighted_distances", function() { return string_weighted_distances; });
  3401. /**
  3402. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3403. * @version v23.2.1
  3404. * @link http://www.ag-grid.com/
  3405. * @license MIT
  3406. */
  3407. function fuzzyCheckStrings(inputValues, validValues, allSuggestions) {
  3408. var fuzzyMatches = {};
  3409. var invalidInputs = inputValues.filter(function (inputValue) {
  3410. return !validValues.some(function (validValue) { return validValue === inputValue; });
  3411. });
  3412. if (invalidInputs.length > 0) {
  3413. invalidInputs.forEach(function (invalidInput) {
  3414. return fuzzyMatches[invalidInput] = fuzzySuggestions(invalidInput, allSuggestions);
  3415. });
  3416. }
  3417. return fuzzyMatches;
  3418. }
  3419. /**
  3420. *
  3421. * @param {String} inputValue The value to be compared against a list of strings
  3422. * @param allSuggestions The list of strings to be compared against
  3423. * @param hideIrrelevant By default, fuzzy suggestions will just sort the allSuggestions list, set this to true
  3424. * to filter out the irrelevant values
  3425. * @param weighted Set this to true, to make letters matched in the order they were typed have priority in the results.
  3426. */
  3427. function fuzzySuggestions(inputValue, allSuggestions, hideIrrelevant, weighted) {
  3428. var search = weighted ? string_weighted_distances : string_distances;
  3429. var thisSuggestions = allSuggestions.map(function (text) { return ({
  3430. value: text,
  3431. relevance: search(inputValue.toLowerCase(), text.toLocaleLowerCase())
  3432. }); });
  3433. thisSuggestions.sort(function (a, b) { return b.relevance - a.relevance; });
  3434. if (hideIrrelevant) {
  3435. thisSuggestions = thisSuggestions.filter(function (suggestion) { return suggestion.relevance !== 0; });
  3436. }
  3437. return thisSuggestions.map(function (suggestion) { return suggestion.value; });
  3438. }
  3439. /**
  3440. * Algorithm to do fuzzy search
  3441. * from https://stackoverflow.com/questions/23305000/javascript-fuzzy-search-that-makes-sense
  3442. * @param {string} from
  3443. * @return {[]}
  3444. */
  3445. function get_bigrams(from) {
  3446. var s = from.toLowerCase();
  3447. var v = new Array(s.length - 1);
  3448. var i;
  3449. var j;
  3450. var ref;
  3451. for (i = j = 0, ref = v.length; j <= ref; i = j += 1) {
  3452. v[i] = s.slice(i, i + 2);
  3453. }
  3454. return v;
  3455. }
  3456. function string_distances(str1, str2) {
  3457. if (str1.length === 0 && str2.length === 0) {
  3458. return 0;
  3459. }
  3460. var pairs1 = get_bigrams(str1);
  3461. var pairs2 = get_bigrams(str2);
  3462. var union = pairs1.length + pairs2.length;
  3463. var hit_count = 0;
  3464. var j;
  3465. var len;
  3466. for (j = 0, len = pairs1.length; j < len; j++) {
  3467. var x = pairs1[j];
  3468. var k = void 0;
  3469. var len1 = void 0;
  3470. for (k = 0, len1 = pairs2.length; k < len1; k++) {
  3471. var y = pairs2[k];
  3472. if (x === y) {
  3473. hit_count++;
  3474. }
  3475. }
  3476. }
  3477. return hit_count > 0 ? (2 * hit_count) / union : 0;
  3478. }
  3479. function string_weighted_distances(str1, str2) {
  3480. var a = str1.replace(/\s/g, '');
  3481. var b = str2.replace(/\s/g, '');
  3482. var weight = 0;
  3483. var lastIndex = 0;
  3484. for (var i = 0; i < a.length; i++) {
  3485. var idx = b.indexOf(a[i]);
  3486. if (idx === -1) {
  3487. continue;
  3488. }
  3489. lastIndex = idx;
  3490. weight += ((b.length - lastIndex) * 100) / b.length;
  3491. weight *= weight;
  3492. }
  3493. return weight;
  3494. }
  3495. /***/ }),
  3496. /* 23 */
  3497. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3498. "use strict";
  3499. __webpack_require__.r(__webpack_exports__);
  3500. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iconNameClassMap", function() { return iconNameClassMap; });
  3501. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIcon", function() { return createIcon; });
  3502. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIconNoSpan", function() { return createIconNoSpan; });
  3503. /* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
  3504. /**
  3505. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3506. * @version v23.2.1
  3507. * @link http://www.ag-grid.com/
  3508. * @license MIT
  3509. */
  3510. //
  3511. // IMPORTANT NOTE!
  3512. //
  3513. // If you change the list below, copy/paste the new content into the docs page javascript-grid-icons
  3514. //
  3515. var iconNameClassMap = {
  3516. // header column group shown when expanded (click to contract)
  3517. columnGroupOpened: 'expanded',
  3518. // header column group shown when contracted (click to expand)
  3519. columnGroupClosed: 'contracted',
  3520. // tool panel column group contracted (click to expand)
  3521. columnSelectClosed: 'tree-closed',
  3522. // tool panel column group expanded (click to contract)
  3523. columnSelectOpen: 'tree-open',
  3524. // column tool panel header expand/collapse all button, shown when some children are expanded and
  3525. // others are collapsed
  3526. columnSelectIndeterminate: 'tree-indeterminate',
  3527. // shown on ghost icon while dragging column to the side of the grid to pin
  3528. columnMovePin: 'pin',
  3529. // shown on ghost icon while dragging over part of the page that is not a drop zone
  3530. columnMoveHide: 'eye-slash',
  3531. // shown on ghost icon while dragging columns to reorder
  3532. columnMoveMove: 'arrows',
  3533. // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling
  3534. columnMoveLeft: 'left',
  3535. // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling
  3536. columnMoveRight: 'right',
  3537. // shown on ghost icon while dragging over Row Groups drop zone
  3538. columnMoveGroup: 'group',
  3539. // shown on ghost icon while dragging over Values drop zone
  3540. columnMoveValue: 'aggregation',
  3541. // shown on ghost icon while dragging over pivot drop zone
  3542. columnMovePivot: 'pivot',
  3543. // shown on ghost icon while dragging over drop zone that doesn't support it, e.g.
  3544. // string column over aggregation drop zone
  3545. dropNotAllowed: 'not-allowed',
  3546. // shown on row group when contracted (click to expand)
  3547. groupContracted: 'tree-closed',
  3548. // shown on row group when expanded (click to contract)
  3549. groupExpanded: 'tree-open',
  3550. // context menu chart item
  3551. chart: 'chart',
  3552. // chart window title bar
  3553. close: 'cross',
  3554. // X (remove) on column 'pill' after adding it to a drop zone list
  3555. cancel: 'cancel',
  3556. // indicates the currently active pin state in the "Pin column" sub-menu of the column menu
  3557. check: 'tick',
  3558. // "go to first" button in pagination controls
  3559. first: 'first',
  3560. // "go to previous" button in pagination controls
  3561. previous: 'previous',
  3562. // "go to next" button in pagination controls
  3563. next: 'next',
  3564. // "go to last" button in pagination controls
  3565. last: 'last',
  3566. // shown on top right of chart when chart is linked to range data (click to unlink)
  3567. linked: 'linked',
  3568. // shown on top right of chart when chart is not linked to range data (click to link)
  3569. unlinked: 'unlinked',
  3570. // "Choose colour" button on chart settings tab
  3571. colorPicker: 'color-picker',
  3572. // rotating spinner shown by the loading cell renderer
  3573. groupLoading: 'loading',
  3574. // button to launch enterprise column menu
  3575. menu: 'menu',
  3576. // filter tool panel tab
  3577. filter: 'filter',
  3578. // column tool panel tab
  3579. columns: 'columns',
  3580. // button in chart regular size window title bar (click to maximise)
  3581. maximize: 'maximize',
  3582. // button in chart maximised window title bar (click to make regular size)
  3583. minimize: 'minimize',
  3584. // "Pin column" item in column header menu
  3585. menuPin: 'pin',
  3586. // "Value aggregation" column menu item (shown on numeric columns when grouping is active)"
  3587. menuValue: 'aggregation',
  3588. // "Group by {column-name}" item in column header menu
  3589. menuAddRowGroup: 'group',
  3590. // "Un-Group by {column-name}" item in column header menu
  3591. menuRemoveRowGroup: 'group',
  3592. // context menu copy item
  3593. clipboardCopy: 'copy',
  3594. // context menu paste item
  3595. clipboardPaste: 'paste',
  3596. // identifies the pivot drop zone
  3597. pivotPanel: 'pivot',
  3598. // "Row groups" drop zone in column tool panel
  3599. rowGroupPanel: 'group',
  3600. // columns tool panel Values drop zone
  3601. valuePanel: 'aggregation',
  3602. // drag handle used to pick up draggable columns
  3603. columnDrag: 'grip',
  3604. // drag handle used to pick up draggable rows
  3605. rowDrag: 'grip',
  3606. // context menu export item
  3607. save: 'save',
  3608. // icon on dropdown editors
  3609. smallDown: 'small-down',
  3610. // version of small-right used in RTL mode
  3611. smallLeft: 'small-left',
  3612. // separater between column 'pills' when you add multiple columns to the header drop zone
  3613. smallRight: 'small-right',
  3614. smallUp: 'small-up',
  3615. // show on column header when column is sorted ascending
  3616. sortAscending: 'asc',
  3617. // show on column header when column is sorted descending
  3618. sortDescending: 'desc',
  3619. // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true
  3620. sortUnSort: 'none'
  3621. };
  3622. /**
  3623. * If icon provided, use this (either a string, or a function callback).
  3624. * if not, then use the default icon from the theme
  3625. * @param {string} iconName
  3626. * @param {GridOptionsWrapper} gridOptionsWrapper
  3627. * @param {Column | null} [column]
  3628. * @returns {HTMLElement}
  3629. */
  3630. function createIcon(iconName, gridOptionsWrapper, column) {
  3631. var iconContents = createIconNoSpan(iconName, gridOptionsWrapper, column);
  3632. if (iconContents.className.indexOf('ag-icon') > -1) {
  3633. return iconContents;
  3634. }
  3635. var eResult = document.createElement('span');
  3636. eResult.appendChild(iconContents);
  3637. return eResult;
  3638. }
  3639. function createIconNoSpan(iconName, gridOptionsWrapper, column, forceCreate) {
  3640. var userProvidedIcon = null;
  3641. // check col for icon first
  3642. var icons = column && column.getColDef().icons;
  3643. if (icons) {
  3644. userProvidedIcon = icons[iconName];
  3645. }
  3646. // if not in col, try grid options
  3647. if (gridOptionsWrapper && !userProvidedIcon) {
  3648. var optionsIcons = gridOptionsWrapper.getIcons();
  3649. if (optionsIcons) {
  3650. userProvidedIcon = optionsIcons[iconName];
  3651. }
  3652. }
  3653. // now if user provided, use it
  3654. if (userProvidedIcon) {
  3655. var rendererResult = void 0;
  3656. if (typeof userProvidedIcon === 'function') {
  3657. rendererResult = userProvidedIcon();
  3658. }
  3659. else if (typeof userProvidedIcon === 'string') {
  3660. rendererResult = userProvidedIcon;
  3661. }
  3662. else {
  3663. throw new Error('icon from grid options needs to be a string or a function');
  3664. }
  3665. if (typeof rendererResult === 'string') {
  3666. return Object(_dom__WEBPACK_IMPORTED_MODULE_0__["loadTemplate"])(rendererResult);
  3667. }
  3668. else if (Object(_dom__WEBPACK_IMPORTED_MODULE_0__["isNodeOrElement"])(rendererResult)) {
  3669. return rendererResult;
  3670. }
  3671. else {
  3672. console.warn('ag-Grid: iconRenderer should return back a string or a dom object');
  3673. }
  3674. }
  3675. else {
  3676. var span = document.createElement('span');
  3677. var cssClass = iconNameClassMap[iconName];
  3678. if (!cssClass) {
  3679. if (!forceCreate) {
  3680. console.warn("ag-Grid: Did not find icon " + iconName);
  3681. cssClass = '';
  3682. }
  3683. else {
  3684. cssClass = iconName;
  3685. }
  3686. }
  3687. span.setAttribute('class', "ag-icon ag-icon-" + cssClass);
  3688. span.setAttribute("unselectable", "on");
  3689. return span;
  3690. }
  3691. }
  3692. /***/ }),
  3693. /* 24 */
  3694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3695. "use strict";
  3696. __webpack_require__.r(__webpack_exports__);
  3697. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyPressed", function() { return isKeyPressed; });
  3698. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCharacterKey", function() { return isCharacterKey; });
  3699. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEventFromPrintableCharacter", function() { return isEventFromPrintableCharacter; });
  3700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUserSuppressingKeyboardEvent", function() { return isUserSuppressingKeyboardEvent; });
  3701. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
  3702. /* harmony import */ var _generic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
  3703. /* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
  3704. /**
  3705. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3706. * @version v23.2.1
  3707. * @link http://www.ag-grid.com/
  3708. * @license MIT
  3709. */
  3710. var PRINTABLE_CHARACTERS = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!"£$%^&*()_+-=[];\'#,./\\|<>?:@~{}';
  3711. var NUMPAD_DEL_NUMLOCK_ON_KEY = 'Del';
  3712. var NUMPAD_DEL_NUMLOCK_ON_CHARCODE = 46;
  3713. function isKeyPressed(event, keyToCheck) {
  3714. return (event.which || event.keyCode) === keyToCheck;
  3715. }
  3716. function isCharacterKey(event) {
  3717. // from: https://stackoverflow.com/questions/4179708/how-to-detect-if-the-pressed-key-will-produce-a-character-inside-an-input-text
  3718. var which = event.which;
  3719. if (typeof which === 'number' && which) {
  3720. return !event.ctrlKey && !event.metaKey && !event.altKey && event.which !== 8 && event.which !== 16;
  3721. }
  3722. return which === undefined;
  3723. }
  3724. function isEventFromPrintableCharacter(event) {
  3725. var pressedChar = String.fromCharCode(event.charCode);
  3726. // newline is an exception, as it counts as a printable character, but we don't
  3727. // want to start editing when it is pressed. without this check, if user is in chrome
  3728. // and editing a cell, and they press ctrl+enter, the cell stops editing, and then
  3729. // starts editing again with a blank value (two 'key down' events are fired). to
  3730. // test this, remove the line below, edit a cell in chrome and hit ctrl+enter while editing.
  3731. // https://ag-grid.atlassian.net/browse/AG-605
  3732. if (isKeyPressed(event, _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_NEW_LINE)) {
  3733. return false;
  3734. }
  3735. // no allowed printable chars have alt or ctrl key combinations
  3736. if (event.altKey || event.ctrlKey) {
  3737. return false;
  3738. }
  3739. if (Object(_generic__WEBPACK_IMPORTED_MODULE_1__["exists"])(event.key)) {
  3740. // modern browser will implement key, so we return if key is length 1, eg if it is 'a' for the
  3741. // a key, or '2' for the '2' key. non-printable characters have names, eg 'Enter' or 'Backspace'.
  3742. var printableCharacter = event.key.length === 1;
  3743. // IE11 & Edge treat the numpad del key differently - with numlock on we get "Del" for key,
  3744. // so this addition checks if its IE11/Edge and handles that specific case the same was as all other browsers
  3745. var numpadDelWithNumlockOnForEdgeOrIe = isNumpadDelWithNumlockOnForEdgeOrIe(event);
  3746. return printableCharacter || numpadDelWithNumlockOnForEdgeOrIe;
  3747. }
  3748. // otherwise, for older browsers, we test against a list of characters, which doesn't include
  3749. // accents for non-English, but don't care much, as most users are on modern browsers
  3750. return PRINTABLE_CHARACTERS.indexOf(pressedChar) >= 0;
  3751. }
  3752. /**
  3753. * Allows user to tell the grid to skip specific keyboard events
  3754. * @param {GridOptionsWrapper} gridOptionsWrapper
  3755. * @param {KeyboardEvent} keyboardEvent
  3756. * @param {RowNode} rowNode
  3757. * @param {Column} column
  3758. * @param {boolean} editing
  3759. * @returns {boolean}
  3760. */
  3761. function isUserSuppressingKeyboardEvent(gridOptionsWrapper, keyboardEvent, rowNode, column, editing) {
  3762. var gridOptionsFunc = gridOptionsWrapper.getSuppressKeyboardEventFunc();
  3763. var colDefFunc = column.getColDef().suppressKeyboardEvent;
  3764. // if no callbacks provided by user, then do nothing
  3765. if (!gridOptionsFunc && !colDefFunc) {
  3766. return false;
  3767. }
  3768. var params = {
  3769. event: keyboardEvent,
  3770. editing: editing,
  3771. column: column,
  3772. api: gridOptionsWrapper.getApi(),
  3773. node: rowNode,
  3774. data: rowNode.data,
  3775. colDef: column.getColDef(),
  3776. context: gridOptionsWrapper.getContext(),
  3777. columnApi: gridOptionsWrapper.getColumnApi()
  3778. };
  3779. // colDef get first preference on suppressing events
  3780. if (colDefFunc) {
  3781. var colDefFuncResult = colDefFunc(params);
  3782. // if colDef func suppressed, then return now, no need to call gridOption func
  3783. if (colDefFuncResult) {
  3784. return true;
  3785. }
  3786. }
  3787. if (gridOptionsFunc) {
  3788. // if gridOption func, return the result
  3789. return gridOptionsFunc(params);
  3790. }
  3791. // otherwise return false, don't suppress, as colDef didn't suppress and no func on gridOptions
  3792. return false;
  3793. }
  3794. function isNumpadDelWithNumlockOnForEdgeOrIe(event) {
  3795. return (Object(_browser__WEBPACK_IMPORTED_MODULE_2__["isBrowserEdge"])() || Object(_browser__WEBPACK_IMPORTED_MODULE_2__["isBrowserIE"])()) &&
  3796. event.key === NUMPAD_DEL_NUMLOCK_ON_KEY &&
  3797. event.charCode === NUMPAD_DEL_NUMLOCK_ON_CHARCODE;
  3798. }
  3799. /***/ }),
  3800. /* 25 */
  3801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3802. "use strict";
  3803. __webpack_require__.r(__webpack_exports__);
  3804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Constants", function() { return Constants; });
  3805. /**
  3806. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3807. * @version v23.2.1
  3808. * @link http://www.ag-grid.com/
  3809. * @license MIT
  3810. */
  3811. var Constants = /** @class */ (function () {
  3812. function Constants() {
  3813. }
  3814. Constants.STEP_EVERYTHING = 0;
  3815. Constants.STEP_FILTER = 1;
  3816. Constants.STEP_SORT = 2;
  3817. Constants.STEP_MAP = 3;
  3818. Constants.STEP_AGGREGATE = 4;
  3819. Constants.STEP_PIVOT = 5;
  3820. Constants.ROW_BUFFER_SIZE = 10;
  3821. Constants.LAYOUT_INTERVAL = 500;
  3822. Constants.BATCH_WAIT_MILLIS = 50;
  3823. Constants.EXPORT_TYPE_DRAG_COPY = 'dragCopy';
  3824. Constants.EXPORT_TYPE_CLIPBOARD = 'clipboard';
  3825. Constants.EXPORT_TYPE_EXCEL = 'excel';
  3826. Constants.EXPORT_TYPE_CSV = 'csv';
  3827. Constants.KEY_BACKSPACE = 8;
  3828. Constants.KEY_TAB = 9;
  3829. Constants.KEY_NEW_LINE = 10;
  3830. Constants.KEY_ENTER = 13;
  3831. Constants.KEY_SHIFT = 16;
  3832. Constants.KEY_ESCAPE = 27;
  3833. Constants.KEY_SPACE = 32;
  3834. Constants.KEY_LEFT = 37;
  3835. Constants.KEY_UP = 38;
  3836. Constants.KEY_RIGHT = 39;
  3837. Constants.KEY_DOWN = 40;
  3838. Constants.KEY_DELETE = 46;
  3839. Constants.KEY_A = 65;
  3840. Constants.KEY_C = 67;
  3841. Constants.KEY_V = 86;
  3842. Constants.KEY_D = 68;
  3843. Constants.KEY_Z = 90;
  3844. Constants.KEY_Y = 89;
  3845. Constants.KEY_F2 = 113;
  3846. Constants.KEY_PAGE_UP = 33;
  3847. Constants.KEY_PAGE_DOWN = 34;
  3848. Constants.KEY_PAGE_HOME = 36;
  3849. Constants.KEY_PAGE_END = 35;
  3850. Constants.ROW_MODEL_TYPE_INFINITE = 'infinite';
  3851. Constants.ROW_MODEL_TYPE_VIEWPORT = 'viewport';
  3852. Constants.ROW_MODEL_TYPE_CLIENT_SIDE = 'clientSide';
  3853. Constants.ROW_MODEL_TYPE_SERVER_SIDE = 'serverSide';
  3854. Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL = 'normal';
  3855. Constants.ALWAYS = 'always';
  3856. Constants.ONLY_WHEN_GROUPING = 'onlyWhenGrouping';
  3857. Constants.PINNED_TOP = 'top';
  3858. Constants.PINNED_BOTTOM = 'bottom';
  3859. Constants.DOM_LAYOUT_NORMAL = 'normal';
  3860. Constants.DOM_LAYOUT_PRINT = 'print';
  3861. Constants.DOM_LAYOUT_AUTO_HEIGHT = 'autoHeight';
  3862. Constants.GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn';
  3863. Constants.SOURCE_PASTE = 'paste';
  3864. Constants.PINNED_RIGHT = 'right';
  3865. Constants.PINNED_LEFT = 'left';
  3866. Constants.SORT_ASC = 'asc';
  3867. Constants.SORT_DESC = 'desc';
  3868. return Constants;
  3869. }());
  3870. /***/ }),
  3871. /* 26 */
  3872. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3873. "use strict";
  3874. __webpack_require__.r(__webpack_exports__);
  3875. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; });
  3876. /**
  3877. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3878. * @version v23.2.1
  3879. * @link http://www.ag-grid.com/
  3880. * @license MIT
  3881. */
  3882. function keys(map) {
  3883. var keys = [];
  3884. map.forEach(function (_, key) { return keys.push(key); });
  3885. return keys;
  3886. }
  3887. /***/ }),
  3888. /* 27 */
  3889. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3890. "use strict";
  3891. __webpack_require__.r(__webpack_exports__);
  3892. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeWheel", function() { return normalizeWheel; });
  3893. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLeftClick", function() { return isLeftClick; });
  3894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areEventsNear", function() { return areEventsNear; });
  3895. /**
  3896. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  3897. * @version v23.2.1
  3898. * @link http://www.ag-grid.com/
  3899. * @license MIT
  3900. */
  3901. /**
  3902. * @deprecated
  3903. * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
  3904. * complicated, thus this doc is long and (hopefully) detailed enough to answer
  3905. * your questions.
  3906. *
  3907. * If you need to react to the mouse wheel in a predictable way, this code is
  3908. * like your bestest friend. * hugs *
  3909. *
  3910. * As of today, there are 4 DOM event types you can listen to:
  3911. *
  3912. * 'wheel' -- Chrome(31+), FF(17+), IE(9+)
  3913. * 'mousewheel' -- Chrome, IE(6+), Opera, Safari
  3914. * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
  3915. * 'DOMMouseScroll' -- FF(0.9.7+) since 2003
  3916. *
  3917. * So what to do? The is the best:
  3918. *
  3919. * normalizeWheel.getEventType();
  3920. *
  3921. * In your event callback, use this code to get sane interpretation of the
  3922. * deltas. This code will return an object with properties:
  3923. *
  3924. * spinX -- normalized spin speed (use for zoom) - x plane
  3925. * spinY -- " - y plane
  3926. * pixelX -- normalized distance (to pixels) - x plane
  3927. * pixelY -- " - y plane
  3928. *
  3929. * Wheel values are provided by the browser assuming you are using the wheel to
  3930. * scroll a web page by a number of lines or pixels (or pages). Values can vary
  3931. * significantly on different platforms and browsers, forgetting that you can
  3932. * scroll at different speeds. Some devices (like trackpads) emit more events
  3933. * at smaller increments with fine granularity, and some emit massive jumps with
  3934. * linear speed or acceleration.
  3935. *
  3936. * This code does its best to normalize the deltas for you:
  3937. *
  3938. * - spin is trying to normalize how far the wheel was spun (or trackpad
  3939. * dragged). This is super useful for zoom support where you want to
  3940. * throw away the chunky scroll steps on the PC and make those equal to
  3941. * the slow and smooth tiny steps on the Mac. Key data: This code tries to
  3942. * resolve a single slow step on a wheel to 1.
  3943. *
  3944. * - pixel is normalizing the desired scroll delta in pixel units. You'll
  3945. * get the crazy differences between browsers, but at least it'll be in
  3946. * pixels!
  3947. *
  3948. * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
  3949. * should translate to positive value zooming IN, negative zooming OUT.
  3950. * This matches the newer 'wheel' event.
  3951. *
  3952. * Why are there spinX, spinY (or pixels)?
  3953. *
  3954. * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
  3955. * with a mouse. It results in side-scrolling in the browser by default.
  3956. *
  3957. * - spinY is what you expect -- it's the classic axis of a mouse wheel.
  3958. *
  3959. * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
  3960. * probably is by browsers in conjunction with fancy 3D controllers .. but
  3961. * you know.
  3962. *
  3963. * Implementation info:
  3964. *
  3965. * Examples of 'wheel' event if you scroll slowly (down) by one step with an
  3966. * average mouse:
  3967. *
  3968. * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
  3969. * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
  3970. * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
  3971. * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
  3972. * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
  3973. *
  3974. * On the trackpad:
  3975. *
  3976. * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
  3977. * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
  3978. *
  3979. * On other/older browsers.. it's more complicated as there can be multiple and
  3980. * also missing delta values.
  3981. *
  3982. * The 'wheel' event is more standard:
  3983. *
  3984. * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
  3985. *
  3986. * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
  3987. * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
  3988. * backward compatibility with older events. Those other values help us
  3989. * better normalize spin speed. Example of what the browsers provide:
  3990. *
  3991. * | event.wheelDelta | event.detail
  3992. * ------------------+------------------+--------------
  3993. * Safari v5/OS X | -120 | 0
  3994. * Safari v5/Win7 | -120 | 0
  3995. * Chrome v17/OS X | -120 | 0
  3996. * Chrome v17/Win7 | -120 | 0
  3997. * IE9/Win7 | -120 | undefined
  3998. * Firefox v4/OS X | undefined | 1
  3999. * Firefox v4/Win7 | undefined | 3
  4000. *
  4001. * from: https://github.com/facebook/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
  4002. * @param {any} event
  4003. * @return {any}
  4004. */
  4005. function normalizeWheel(event) {
  4006. var PIXEL_STEP = 10;
  4007. var LINE_HEIGHT = 40;
  4008. var PAGE_HEIGHT = 800;
  4009. // spinX, spinY
  4010. var sX = 0;
  4011. var sY = 0;
  4012. // pixelX, pixelY
  4013. var pX = 0;
  4014. var pY = 0;
  4015. // Legacy
  4016. if ('detail' in event) {
  4017. sY = event.detail;
  4018. }
  4019. if ('wheelDelta' in event) {
  4020. sY = -event.wheelDelta / 120;
  4021. }
  4022. if ('wheelDeltaY' in event) {
  4023. sY = -event.wheelDeltaY / 120;
  4024. }
  4025. if ('wheelDeltaX' in event) {
  4026. sX = -event.wheelDeltaX / 120;
  4027. }
  4028. // side scrolling on FF with DOMMouseScroll
  4029. if ('axis' in event && event.axis === event.HORIZONTAL_AXIS) {
  4030. sX = sY;
  4031. sY = 0;
  4032. }
  4033. pX = sX * PIXEL_STEP;
  4034. pY = sY * PIXEL_STEP;
  4035. if ('deltaY' in event) {
  4036. pY = event.deltaY;
  4037. }
  4038. if ('deltaX' in event) {
  4039. pX = event.deltaX;
  4040. }
  4041. if ((pX || pY) && event.deltaMode) {
  4042. if (event.deltaMode == 1) { // delta in LINE units
  4043. pX *= LINE_HEIGHT;
  4044. pY *= LINE_HEIGHT;
  4045. }
  4046. else { // delta in PAGE units
  4047. pX *= PAGE_HEIGHT;
  4048. pY *= PAGE_HEIGHT;
  4049. }
  4050. }
  4051. // Fall-back if spin cannot be determined
  4052. if (pX && !sX) {
  4053. sX = (pX < 1) ? -1 : 1;
  4054. }
  4055. if (pY && !sY) {
  4056. sY = (pY < 1) ? -1 : 1;
  4057. }
  4058. return {
  4059. spinX: sX,
  4060. spinY: sY,
  4061. pixelX: pX,
  4062. pixelY: pY
  4063. };
  4064. }
  4065. /**
  4066. * @deprecated
  4067. * Checks if event was issued by a left click
  4068. * from https://stackoverflow.com/questions/3944122/detect-left-mouse-button-press
  4069. * @param {MouseEvent} mouseEvent
  4070. * @returns {boolean}
  4071. */
  4072. function isLeftClick(mouseEvent) {
  4073. if ('buttons' in mouseEvent) {
  4074. return mouseEvent.buttons == 1;
  4075. }
  4076. var button = mouseEvent.which || mouseEvent.button;
  4077. return button == 1;
  4078. }
  4079. /**
  4080. * `True` if the event is close to the original event by X pixels either vertically or horizontally.
  4081. * we only start dragging after X pixels so this allows us to know if we should start dragging yet.
  4082. * @param {MouseEvent | TouchEvent} e1
  4083. * @param {MouseEvent | TouchEvent} e2
  4084. * @param {number} pixelCount
  4085. * @returns {boolean}
  4086. */
  4087. function areEventsNear(e1, e2, pixelCount) {
  4088. // by default, we wait 4 pixels before starting the drag
  4089. if (pixelCount === 0) {
  4090. return false;
  4091. }
  4092. var diffX = Math.abs(e1.clientX - e2.clientX);
  4093. var diffY = Math.abs(e1.clientY - e2.clientY);
  4094. return Math.max(diffX, diffY) <= pixelCount;
  4095. }
  4096. /***/ }),
  4097. /* 28 */
  4098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4099. "use strict";
  4100. __webpack_require__.r(__webpack_exports__);
  4101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortRowNodesByOrder", function() { return sortRowNodesByOrder; });
  4102. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "traverseNodesWithKey", function() { return traverseNodesWithKey; });
  4103. /**
  4104. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4105. * @version v23.2.1
  4106. * @link http://www.ag-grid.com/
  4107. * @license MIT
  4108. */
  4109. /**
  4110. * Gets called by: a) ClientSideNodeManager and b) GroupStage to do sorting.
  4111. * when in ClientSideNodeManager we always have indexes (as this sorts the items the
  4112. * user provided) but when in GroupStage, the nodes can contain filler nodes that
  4113. * don't have order id's
  4114. * @param {RowNode[]} rowNodes
  4115. * @param {Object} rowNodeOrder
  4116. */
  4117. function sortRowNodesByOrder(rowNodes, rowNodeOrder) {
  4118. if (!rowNodes) {
  4119. return;
  4120. }
  4121. var comparator = function (nodeA, nodeB) {
  4122. var positionA = rowNodeOrder[nodeA.id];
  4123. var positionB = rowNodeOrder[nodeB.id];
  4124. var aHasIndex = positionA !== undefined;
  4125. var bHasIndex = positionB !== undefined;
  4126. var bothNodesAreUserNodes = aHasIndex && bHasIndex;
  4127. var bothNodesAreFillerNodes = !aHasIndex && !bHasIndex;
  4128. if (bothNodesAreUserNodes) {
  4129. // when comparing two nodes the user has provided, they always
  4130. // have indexes
  4131. return positionA - positionB;
  4132. }
  4133. if (bothNodesAreFillerNodes) {
  4134. // when comparing two filler nodes, we have no index to compare them
  4135. // against, however we want this sorting to be deterministic, so that
  4136. // the rows don't jump around as the user does delta updates. so we
  4137. // want the same sort result. so we use the __objectId - which doesn't make sense
  4138. // from a sorting point of view, but does give consistent behaviour between
  4139. // calls. otherwise groups jump around as delta updates are done.
  4140. // note: previously here we used nodeId, however this gave a strange order
  4141. // as string ordering of numbers is wrong, so using id based on creation order
  4142. // as least gives better looking order.
  4143. return nodeA.__objectId - nodeB.__objectId;
  4144. }
  4145. if (aHasIndex) {
  4146. return 1;
  4147. }
  4148. return -1;
  4149. };
  4150. // check if the list first needs sorting
  4151. var rowNodeA;
  4152. var rowNodeB;
  4153. var atLeastOneOutOfOrder = false;
  4154. for (var i = 0; i < rowNodes.length - 1; i++) {
  4155. rowNodeA = rowNodes[i];
  4156. rowNodeB = rowNodes[i + 1];
  4157. if (comparator(rowNodeA, rowNodeB) > 0) {
  4158. atLeastOneOutOfOrder = true;
  4159. break;
  4160. }
  4161. }
  4162. if (atLeastOneOutOfOrder) {
  4163. rowNodes.sort(comparator);
  4164. }
  4165. }
  4166. function traverseNodesWithKey(nodes, callback) {
  4167. var keyParts = [];
  4168. recursiveSearchNodes(nodes);
  4169. function recursiveSearchNodes(currentNodes) {
  4170. currentNodes.forEach(function (node) {
  4171. // also checking for children for tree data
  4172. if (node.group || node.hasChildren()) {
  4173. keyParts.push(node.key);
  4174. var key = keyParts.join('|');
  4175. callback(node, key);
  4176. recursiveSearchNodes(node.childrenAfterGroup);
  4177. keyParts.pop();
  4178. }
  4179. });
  4180. }
  4181. }
  4182. /***/ }),
  4183. /* 29 */
  4184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4185. "use strict";
  4186. __webpack_require__.r(__webpack_exports__);
  4187. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToSet", function() { return convertToSet; });
  4188. /**
  4189. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4190. * @version v23.2.1
  4191. * @link http://www.ag-grid.com/
  4192. * @license MIT
  4193. */
  4194. function convertToSet(list) {
  4195. var set = new Set();
  4196. list.forEach(function (x) { return set.add(x); });
  4197. return set;
  4198. }
  4199. /***/ }),
  4200. /* 30 */
  4201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4202. "use strict";
  4203. __webpack_require__.r(__webpack_exports__);
  4204. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return NumberSequence; });
  4205. /**
  4206. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4207. * @version v23.2.1
  4208. * @link http://www.ag-grid.com/
  4209. * @license MIT
  4210. */
  4211. var NumberSequence = /** @class */ (function () {
  4212. function NumberSequence(initValue, step) {
  4213. if (initValue === void 0) { initValue = 0; }
  4214. if (step === void 0) { step = 1; }
  4215. this.nextValue = initValue;
  4216. this.step = step;
  4217. }
  4218. NumberSequence.prototype.next = function () {
  4219. var valToReturn = this.nextValue;
  4220. this.nextValue += this.step;
  4221. return valToReturn;
  4222. };
  4223. NumberSequence.prototype.peek = function () {
  4224. return this.nextValue;
  4225. };
  4226. NumberSequence.prototype.skip = function (count) {
  4227. this.nextValue += count;
  4228. };
  4229. return NumberSequence;
  4230. }());
  4231. /***/ }),
  4232. /* 31 */
  4233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4234. "use strict";
  4235. __webpack_require__.r(__webpack_exports__);
  4236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PromiseStatus", function() { return PromiseStatus; });
  4237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Promise", function() { return Promise; });
  4238. /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
  4239. /**
  4240. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4241. * @version v23.2.1
  4242. * @link http://www.ag-grid.com/
  4243. * @license MIT
  4244. */
  4245. var PromiseStatus;
  4246. (function (PromiseStatus) {
  4247. PromiseStatus[PromiseStatus["IN_PROGRESS"] = 0] = "IN_PROGRESS";
  4248. PromiseStatus[PromiseStatus["RESOLVED"] = 1] = "RESOLVED";
  4249. })(PromiseStatus || (PromiseStatus = {}));
  4250. var Promise = /** @class */ (function () {
  4251. function Promise(callback) {
  4252. var _this = this;
  4253. this.status = PromiseStatus.IN_PROGRESS;
  4254. this.resolution = null;
  4255. this.waiters = [];
  4256. callback(function (value) { return _this.onDone(value); }, function (params) { return _this.onReject(params); });
  4257. }
  4258. Promise.all = function (promises) {
  4259. return new Promise(function (resolve) {
  4260. var remainingToResolve = promises.length;
  4261. var combinedValues = new Array(remainingToResolve);
  4262. Object(_array__WEBPACK_IMPORTED_MODULE_0__["forEach"])(promises, function (promise, index) {
  4263. promise.then(function (value) {
  4264. combinedValues[index] = value;
  4265. remainingToResolve--;
  4266. if (remainingToResolve === 0) {
  4267. resolve(combinedValues);
  4268. }
  4269. });
  4270. });
  4271. });
  4272. };
  4273. Promise.resolve = function (value) {
  4274. if (value === void 0) { value = null; }
  4275. return new Promise(function (resolve) { return resolve(value); });
  4276. };
  4277. Promise.prototype.then = function (func) {
  4278. var _this = this;
  4279. return new Promise(function (resolve) {
  4280. if (_this.status === PromiseStatus.RESOLVED) {
  4281. resolve(func(_this.resolution));
  4282. }
  4283. else {
  4284. _this.waiters.push(function (value) { return resolve(func(value)); });
  4285. }
  4286. });
  4287. };
  4288. Promise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) {
  4289. return this.status === PromiseStatus.RESOLVED ? ifResolved(this.resolution) : ifNotResolvedValue;
  4290. };
  4291. Promise.prototype.onDone = function (value) {
  4292. this.status = PromiseStatus.RESOLVED;
  4293. this.resolution = value;
  4294. Object(_array__WEBPACK_IMPORTED_MODULE_0__["forEach"])(this.waiters, function (waiter) { return waiter(value); });
  4295. };
  4296. Promise.prototype.onReject = function (params) {
  4297. console.warn('TBI');
  4298. };
  4299. return Promise;
  4300. }());
  4301. /***/ }),
  4302. /* 32 */
  4303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4304. "use strict";
  4305. __webpack_require__.r(__webpack_exports__);
  4306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return Timer; });
  4307. /**
  4308. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4309. * @version v23.2.1
  4310. * @link http://www.ag-grid.com/
  4311. * @license MIT
  4312. */
  4313. /**
  4314. * A Util Class only used when debugging for printing time to console
  4315. */
  4316. var Timer = /** @class */ (function () {
  4317. function Timer() {
  4318. this.timestamp = new Date().getTime();
  4319. }
  4320. Timer.prototype.print = function (msg) {
  4321. var duration = (new Date().getTime()) - this.timestamp;
  4322. console.info(msg + " = " + duration);
  4323. this.timestamp = new Date().getTime();
  4324. };
  4325. return Timer;
  4326. }());
  4327. /***/ }),
  4328. /* 33 */
  4329. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4330. "use strict";
  4331. __webpack_require__.r(__webpack_exports__);
  4332. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OriginalColumnGroup", function() { return OriginalColumnGroup; });
  4333. /* harmony import */ var _columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
  4334. /* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
  4335. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36);
  4336. /**
  4337. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4338. * @version v23.2.1
  4339. * @link http://www.ag-grid.com/
  4340. * @license MIT
  4341. */
  4342. var OriginalColumnGroup = /** @class */ (function () {
  4343. function OriginalColumnGroup(colGroupDef, groupId, padding, level) {
  4344. this.localEventService = new _eventService__WEBPACK_IMPORTED_MODULE_2__["EventService"]();
  4345. this.expandable = false;
  4346. this.colGroupDef = colGroupDef;
  4347. this.groupId = groupId;
  4348. this.expanded = colGroupDef && !!colGroupDef.openByDefault;
  4349. this.padding = padding;
  4350. this.level = level;
  4351. }
  4352. OriginalColumnGroup.prototype.setOriginalParent = function (originalParent) {
  4353. this.originalParent = originalParent;
  4354. };
  4355. OriginalColumnGroup.prototype.getOriginalParent = function () {
  4356. return this.originalParent;
  4357. };
  4358. OriginalColumnGroup.prototype.getLevel = function () {
  4359. return this.level;
  4360. };
  4361. OriginalColumnGroup.prototype.isVisible = function () {
  4362. // return true if at least one child is visible
  4363. if (this.children) {
  4364. return this.children.some(function (child) { return child.isVisible(); });
  4365. }
  4366. return false;
  4367. };
  4368. OriginalColumnGroup.prototype.isPadding = function () {
  4369. return this.padding;
  4370. };
  4371. OriginalColumnGroup.prototype.setExpanded = function (expanded) {
  4372. this.expanded = expanded === undefined ? false : expanded;
  4373. var event = {
  4374. type: OriginalColumnGroup.EVENT_EXPANDED_CHANGED
  4375. };
  4376. this.localEventService.dispatchEvent(event);
  4377. };
  4378. OriginalColumnGroup.prototype.isExpandable = function () {
  4379. return this.expandable;
  4380. };
  4381. OriginalColumnGroup.prototype.isExpanded = function () {
  4382. return this.expanded;
  4383. };
  4384. OriginalColumnGroup.prototype.getGroupId = function () {
  4385. return this.groupId;
  4386. };
  4387. OriginalColumnGroup.prototype.getId = function () {
  4388. return this.getGroupId();
  4389. };
  4390. OriginalColumnGroup.prototype.setChildren = function (children) {
  4391. this.children = children;
  4392. };
  4393. OriginalColumnGroup.prototype.getChildren = function () {
  4394. return this.children;
  4395. };
  4396. OriginalColumnGroup.prototype.getColGroupDef = function () {
  4397. return this.colGroupDef;
  4398. };
  4399. OriginalColumnGroup.prototype.getLeafColumns = function () {
  4400. var result = [];
  4401. this.addLeafColumns(result);
  4402. return result;
  4403. };
  4404. OriginalColumnGroup.prototype.addLeafColumns = function (leafColumns) {
  4405. if (!this.children) {
  4406. return;
  4407. }
  4408. this.children.forEach(function (child) {
  4409. if (child instanceof _column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
  4410. leafColumns.push(child);
  4411. }
  4412. else if (child instanceof OriginalColumnGroup) {
  4413. child.addLeafColumns(leafColumns);
  4414. }
  4415. });
  4416. };
  4417. OriginalColumnGroup.prototype.getColumnGroupShow = function () {
  4418. return this.padding ? _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_PADDING : this.colGroupDef.columnGroupShow;
  4419. };
  4420. // need to check that this group has at least one col showing when both expanded and contracted.
  4421. // if not, then we don't allow expanding and contracting on this group
  4422. OriginalColumnGroup.prototype.setupExpandable = function () {
  4423. var _this = this;
  4424. this.setExpandable();
  4425. // note - we should be removing this event listener
  4426. this.getLeafColumns().forEach(function (col) { return col.addEventListener(_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_VISIBLE_CHANGED, _this.onColumnVisibilityChanged.bind(_this)); });
  4427. };
  4428. OriginalColumnGroup.prototype.setExpandable = function () {
  4429. if (this.isPadding()) {
  4430. return;
  4431. }
  4432. // want to make sure the group doesn't disappear when it's open
  4433. var atLeastOneShowingWhenOpen = false;
  4434. // want to make sure the group doesn't disappear when it's closed
  4435. var atLeastOneShowingWhenClosed = false;
  4436. // want to make sure the group has something to show / hide
  4437. var atLeastOneChangeable = false;
  4438. var children = this.findChildren();
  4439. for (var i = 0, j = children.length; i < j; i++) {
  4440. var abstractColumn = children[i];
  4441. if (!abstractColumn.isVisible()) {
  4442. continue;
  4443. }
  4444. // if the abstractColumn is a grid generated group, there will be no colDef
  4445. var headerGroupShow = abstractColumn.getColumnGroupShow();
  4446. if (headerGroupShow === _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_SHOW_OPEN) {
  4447. atLeastOneShowingWhenOpen = true;
  4448. atLeastOneChangeable = true;
  4449. }
  4450. else if (headerGroupShow === _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_SHOW_CLOSED) {
  4451. atLeastOneShowingWhenClosed = true;
  4452. atLeastOneChangeable = true;
  4453. }
  4454. else {
  4455. atLeastOneShowingWhenOpen = true;
  4456. atLeastOneShowingWhenClosed = true;
  4457. if (headerGroupShow === _columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"].HEADER_GROUP_PADDING) {
  4458. var column = abstractColumn;
  4459. atLeastOneChangeable = atLeastOneChangeable || column.children.some(function (child) { return child.getColumnGroupShow() !== undefined; });
  4460. }
  4461. }
  4462. }
  4463. var expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;
  4464. if (this.expandable !== expandable) {
  4465. this.expandable = expandable;
  4466. var event_1 = {
  4467. type: OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED
  4468. };
  4469. this.localEventService.dispatchEvent(event_1);
  4470. }
  4471. };
  4472. OriginalColumnGroup.prototype.findChildren = function () {
  4473. var children = this.children;
  4474. var firstChild = children[0];
  4475. if (firstChild && (!firstChild.isPadding || !firstChild.isPadding())) {
  4476. return children;
  4477. }
  4478. while (children.length === 1 && children[0] instanceof OriginalColumnGroup) {
  4479. children = children[0].children;
  4480. }
  4481. return children;
  4482. };
  4483. OriginalColumnGroup.prototype.onColumnVisibilityChanged = function () {
  4484. this.setExpandable();
  4485. };
  4486. OriginalColumnGroup.prototype.addEventListener = function (eventType, listener) {
  4487. this.localEventService.addEventListener(eventType, listener);
  4488. };
  4489. OriginalColumnGroup.prototype.removeEventListener = function (eventType, listener) {
  4490. this.localEventService.removeEventListener(eventType, listener);
  4491. };
  4492. OriginalColumnGroup.EVENT_EXPANDED_CHANGED = 'expandedChanged';
  4493. OriginalColumnGroup.EVENT_EXPANDABLE_CHANGED = 'expandableChanged';
  4494. return OriginalColumnGroup;
  4495. }());
  4496. /***/ }),
  4497. /* 34 */
  4498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4499. "use strict";
  4500. __webpack_require__.r(__webpack_exports__);
  4501. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnGroup", function() { return ColumnGroup; });
  4502. /* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
  4503. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
  4504. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  4505. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  4506. /**
  4507. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4508. * @version v23.2.1
  4509. * @link http://www.ag-grid.com/
  4510. * @license MIT
  4511. */
  4512. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  4513. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  4514. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  4515. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  4516. return c > 3 && r && Object.defineProperty(target, key, r), r;
  4517. };
  4518. var ColumnGroup = /** @class */ (function () {
  4519. function ColumnGroup(originalColumnGroup, groupId, instanceId, pinned) {
  4520. // depends on the open/closed state of the group, only displaying columns are stored here
  4521. this.displayedChildren = [];
  4522. this.localEventService = new _eventService__WEBPACK_IMPORTED_MODULE_1__["EventService"]();
  4523. this.groupId = groupId;
  4524. this.instanceId = instanceId;
  4525. this.originalColumnGroup = originalColumnGroup;
  4526. this.pinned = pinned;
  4527. }
  4528. // this is static, a it is used outside of this class
  4529. ColumnGroup.createUniqueId = function (groupId, instanceId) {
  4530. return groupId + '_' + instanceId;
  4531. };
  4532. // as the user is adding and removing columns, the groups are recalculated.
  4533. // this reset clears out all children, ready for children to be added again
  4534. ColumnGroup.prototype.reset = function () {
  4535. this.parent = null;
  4536. this.children = null;
  4537. this.displayedChildren = null;
  4538. };
  4539. ColumnGroup.prototype.getParent = function () {
  4540. return this.parent;
  4541. };
  4542. ColumnGroup.prototype.setParent = function (parent) {
  4543. this.parent = parent;
  4544. };
  4545. ColumnGroup.prototype.getUniqueId = function () {
  4546. return ColumnGroup.createUniqueId(this.groupId, this.instanceId);
  4547. };
  4548. ColumnGroup.prototype.isEmptyGroup = function () {
  4549. return this.displayedChildren.length === 0;
  4550. };
  4551. ColumnGroup.prototype.isMoving = function () {
  4552. var allLeafColumns = this.getOriginalColumnGroup().getLeafColumns();
  4553. if (!allLeafColumns || allLeafColumns.length === 0) {
  4554. return false;
  4555. }
  4556. return allLeafColumns.every(function (col) { return col.isMoving(); });
  4557. };
  4558. ColumnGroup.prototype.checkLeft = function () {
  4559. // first get all children to setLeft, as it impacts our decision below
  4560. this.displayedChildren.forEach(function (child) {
  4561. if (child instanceof ColumnGroup) {
  4562. child.checkLeft();
  4563. }
  4564. });
  4565. // set our left based on first displayed column
  4566. if (this.displayedChildren.length > 0) {
  4567. if (this.gridOptionsWrapper.isEnableRtl()) {
  4568. var lastChild = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].last(this.displayedChildren);
  4569. var lastChildLeft = lastChild.getLeft();
  4570. this.setLeft(lastChildLeft);
  4571. }
  4572. else {
  4573. var firstChildLeft = this.displayedChildren[0].getLeft();
  4574. this.setLeft(firstChildLeft);
  4575. }
  4576. }
  4577. else {
  4578. // this should never happen, as if we have no displayed columns, then
  4579. // this groups should not even exist.
  4580. this.setLeft(null);
  4581. }
  4582. };
  4583. ColumnGroup.prototype.getLeft = function () {
  4584. return this.left;
  4585. };
  4586. ColumnGroup.prototype.getOldLeft = function () {
  4587. return this.oldLeft;
  4588. };
  4589. ColumnGroup.prototype.setLeft = function (left) {
  4590. this.oldLeft = left;
  4591. if (this.left !== left) {
  4592. this.left = left;
  4593. this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED));
  4594. }
  4595. };
  4596. ColumnGroup.prototype.getPinned = function () {
  4597. return this.pinned;
  4598. };
  4599. ColumnGroup.prototype.createAgEvent = function (type) {
  4600. return { type: type };
  4601. };
  4602. ColumnGroup.prototype.addEventListener = function (eventType, listener) {
  4603. this.localEventService.addEventListener(eventType, listener);
  4604. };
  4605. ColumnGroup.prototype.removeEventListener = function (eventType, listener) {
  4606. this.localEventService.removeEventListener(eventType, listener);
  4607. };
  4608. ColumnGroup.prototype.getGroupId = function () {
  4609. return this.groupId;
  4610. };
  4611. ColumnGroup.prototype.getInstanceId = function () {
  4612. return this.instanceId;
  4613. };
  4614. ColumnGroup.prototype.isChildInThisGroupDeepSearch = function (wantedChild) {
  4615. var result = false;
  4616. this.children.forEach(function (foundChild) {
  4617. if (wantedChild === foundChild) {
  4618. result = true;
  4619. }
  4620. if (foundChild instanceof ColumnGroup) {
  4621. if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) {
  4622. result = true;
  4623. }
  4624. }
  4625. });
  4626. return result;
  4627. };
  4628. ColumnGroup.prototype.getActualWidth = function () {
  4629. var groupActualWidth = 0;
  4630. if (this.displayedChildren) {
  4631. this.displayedChildren.forEach(function (child) {
  4632. groupActualWidth += child.getActualWidth();
  4633. });
  4634. }
  4635. return groupActualWidth;
  4636. };
  4637. ColumnGroup.prototype.isResizable = function () {
  4638. if (!this.displayedChildren) {
  4639. return false;
  4640. }
  4641. // if at least one child is resizable, then the group is resizable
  4642. var result = false;
  4643. this.displayedChildren.forEach(function (child) {
  4644. if (child.isResizable()) {
  4645. result = true;
  4646. }
  4647. });
  4648. return result;
  4649. };
  4650. ColumnGroup.prototype.getMinWidth = function () {
  4651. var result = 0;
  4652. this.displayedChildren.forEach(function (groupChild) {
  4653. result += groupChild.getMinWidth();
  4654. });
  4655. return result;
  4656. };
  4657. ColumnGroup.prototype.addChild = function (child) {
  4658. if (!this.children) {
  4659. this.children = [];
  4660. }
  4661. this.children.push(child);
  4662. };
  4663. ColumnGroup.prototype.getDisplayedChildren = function () {
  4664. return this.displayedChildren;
  4665. };
  4666. ColumnGroup.prototype.getLeafColumns = function () {
  4667. var result = [];
  4668. this.addLeafColumns(result);
  4669. return result;
  4670. };
  4671. ColumnGroup.prototype.getDisplayedLeafColumns = function () {
  4672. var result = [];
  4673. this.addDisplayedLeafColumns(result);
  4674. return result;
  4675. };
  4676. // why two methods here doing the same thing?
  4677. ColumnGroup.prototype.getDefinition = function () {
  4678. return this.originalColumnGroup.getColGroupDef();
  4679. };
  4680. ColumnGroup.prototype.getColGroupDef = function () {
  4681. return this.originalColumnGroup.getColGroupDef();
  4682. };
  4683. ColumnGroup.prototype.isPadding = function () {
  4684. return this.originalColumnGroup.isPadding();
  4685. };
  4686. ColumnGroup.prototype.isExpandable = function () {
  4687. return this.originalColumnGroup.isExpandable();
  4688. };
  4689. ColumnGroup.prototype.isExpanded = function () {
  4690. return this.originalColumnGroup.isExpanded();
  4691. };
  4692. ColumnGroup.prototype.setExpanded = function (expanded) {
  4693. this.originalColumnGroup.setExpanded(expanded);
  4694. };
  4695. ColumnGroup.prototype.addDisplayedLeafColumns = function (leafColumns) {
  4696. this.displayedChildren.forEach(function (child) {
  4697. if (child instanceof _column__WEBPACK_IMPORTED_MODULE_0__["Column"]) {
  4698. leafColumns.push(child);
  4699. }
  4700. else if (child instanceof ColumnGroup) {
  4701. child.addDisplayedLeafColumns(leafColumns);
  4702. }
  4703. });
  4704. };
  4705. ColumnGroup.prototype.addLeafColumns = function (leafColumns) {
  4706. this.children.forEach(function (child) {
  4707. if (child instanceof _column__WEBPACK_IMPORTED_MODULE_0__["Column"]) {
  4708. leafColumns.push(child);
  4709. }
  4710. else if (child instanceof ColumnGroup) {
  4711. child.addLeafColumns(leafColumns);
  4712. }
  4713. });
  4714. };
  4715. ColumnGroup.prototype.getChildren = function () {
  4716. return this.children;
  4717. };
  4718. ColumnGroup.prototype.getColumnGroupShow = function () {
  4719. return this.originalColumnGroup.getColumnGroupShow();
  4720. };
  4721. ColumnGroup.prototype.getOriginalColumnGroup = function () {
  4722. return this.originalColumnGroup;
  4723. };
  4724. ColumnGroup.prototype.getPaddingLevel = function () {
  4725. var parent = this.getParent();
  4726. if (!this.isPadding() || !parent || !parent.isPadding()) {
  4727. return 0;
  4728. }
  4729. return 1 + parent.getPaddingLevel();
  4730. };
  4731. ColumnGroup.prototype.calculateDisplayedColumns = function () {
  4732. var _this = this;
  4733. // clear out last time we calculated
  4734. this.displayedChildren = [];
  4735. var topLevelGroup = this;
  4736. // find the column group that is controlling expandable. this is relevant when we have padding (empty)
  4737. // groups, where the expandable is actually the first parent that is not a padding group.
  4738. if (this.isPadding()) {
  4739. while (topLevelGroup.getParent() && topLevelGroup.isPadding()) {
  4740. topLevelGroup = topLevelGroup.getParent();
  4741. }
  4742. }
  4743. var isExpandable = topLevelGroup.originalColumnGroup.isExpandable();
  4744. // it not expandable, everything is visible
  4745. if (!isExpandable) {
  4746. this.displayedChildren = this.children;
  4747. }
  4748. else {
  4749. // Add cols based on columnGroupShow
  4750. // Note - the below also adds padding groups, these are always added because they never have
  4751. // colDef.columnGroupShow set.
  4752. this.children.forEach(function (abstractColumn) {
  4753. var headerGroupShow = abstractColumn.getColumnGroupShow();
  4754. switch (headerGroupShow) {
  4755. case ColumnGroup.HEADER_GROUP_SHOW_OPEN:
  4756. // when set to open, only show col if group is open
  4757. if (topLevelGroup.originalColumnGroup.isExpanded()) {
  4758. _this.displayedChildren.push(abstractColumn);
  4759. }
  4760. break;
  4761. case ColumnGroup.HEADER_GROUP_SHOW_CLOSED:
  4762. // when set to open, only show col if group is open
  4763. if (!topLevelGroup.originalColumnGroup.isExpanded()) {
  4764. _this.displayedChildren.push(abstractColumn);
  4765. }
  4766. break;
  4767. default:
  4768. // if this abstractColumn is padding, we just want to add it
  4769. // to the displayedChildren list if it has displayedChildren itself.
  4770. if (!(abstractColumn instanceof ColumnGroup &&
  4771. abstractColumn.isPadding() &&
  4772. !abstractColumn.displayedChildren.length)) {
  4773. _this.displayedChildren.push(abstractColumn);
  4774. }
  4775. break;
  4776. }
  4777. });
  4778. }
  4779. this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));
  4780. };
  4781. ColumnGroup.HEADER_GROUP_SHOW_OPEN = 'open';
  4782. ColumnGroup.HEADER_GROUP_SHOW_CLOSED = 'closed';
  4783. ColumnGroup.HEADER_GROUP_PADDING = 'padding';
  4784. ColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged';
  4785. ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED = 'displayedChildrenChanged';
  4786. __decorate([
  4787. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  4788. ], ColumnGroup.prototype, "gridOptionsWrapper", void 0);
  4789. return ColumnGroup;
  4790. }());
  4791. /***/ }),
  4792. /* 35 */
  4793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4794. "use strict";
  4795. __webpack_require__.r(__webpack_exports__);
  4796. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return Column; });
  4797. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
  4798. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  4799. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  4800. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  4801. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38);
  4802. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);
  4803. /**
  4804. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  4805. * @version v23.2.1
  4806. * @link http://www.ag-grid.com/
  4807. * @license MIT
  4808. */
  4809. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  4810. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  4811. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  4812. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  4813. return c > 3 && r && Object.defineProperty(target, key, r), r;
  4814. };
  4815. // Wrapper around a user provide column definition. The grid treats the column definition as ready only.
  4816. // This class contains all the runtime information about a column, plus some logic (the definition has no logic).
  4817. // This class implements both interfaces ColumnGroupChild and OriginalColumnGroupChild as the class can
  4818. // appear as a child of either the original tree or the displayed tree. However the relevant group classes
  4819. // for each type only implements one, as each group can only appear in it's associated tree (eg OriginalColumnGroup
  4820. // can only appear in OriginalColumn tree).
  4821. var Column = /** @class */ (function () {
  4822. function Column(colDef, userProvidedColDef, colId, primary) {
  4823. this.moving = false;
  4824. this.menuVisible = false;
  4825. this.filterActive = false;
  4826. this.eventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
  4827. this.rowGroupActive = false;
  4828. this.pivotActive = false;
  4829. this.aggregationActive = false;
  4830. this.colDef = colDef;
  4831. this.userProvidedColDef = userProvidedColDef;
  4832. this.visible = !colDef.hide;
  4833. this.sort = colDef.sort;
  4834. this.sortedAt = colDef.sortedAt;
  4835. this.colId = colId;
  4836. this.primary = primary;
  4837. }
  4838. // gets called when user provides an alternative colDef, eg
  4839. Column.prototype.setColDef = function (colDef, userProvidedColDef) {
  4840. this.colDef = colDef;
  4841. this.userProvidedColDef = userProvidedColDef;
  4842. };
  4843. Column.prototype.getUserProvidedColDef = function () {
  4844. return this.userProvidedColDef;
  4845. };
  4846. Column.prototype.setParent = function (parent) {
  4847. this.parent = parent;
  4848. };
  4849. Column.prototype.getParent = function () {
  4850. return this.parent;
  4851. };
  4852. Column.prototype.setOriginalParent = function (originalParent) {
  4853. this.originalParent = originalParent;
  4854. };
  4855. Column.prototype.getOriginalParent = function () {
  4856. return this.originalParent;
  4857. };
  4858. // this is done after constructor as it uses gridOptionsWrapper
  4859. Column.prototype.initialise = function () {
  4860. this.setPinned(this.colDef.pinned);
  4861. var minColWidth = this.gridOptionsWrapper.getMinColWidth();
  4862. var maxColWidth = this.gridOptionsWrapper.getMaxColWidth();
  4863. if (this.colDef.minWidth) {
  4864. this.minWidth = this.colDef.minWidth;
  4865. }
  4866. else {
  4867. this.minWidth = minColWidth;
  4868. }
  4869. if (this.colDef.maxWidth) {
  4870. this.maxWidth = this.colDef.maxWidth;
  4871. }
  4872. else {
  4873. this.maxWidth = maxColWidth;
  4874. }
  4875. if (this.colDef.flex) {
  4876. this.flex = this.colDef.flex;
  4877. }
  4878. this.resetActualWidth();
  4879. var suppressDotNotation = this.gridOptionsWrapper.isSuppressFieldDotNotation();
  4880. this.fieldContainsDots = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation;
  4881. this.tooltipFieldContainsDots = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation;
  4882. this.validate();
  4883. };
  4884. Column.prototype.resetActualWidth = function () {
  4885. this.actualWidth = this.columnUtils.calculateColInitialWidth(this.colDef);
  4886. };
  4887. Column.prototype.isEmptyGroup = function () {
  4888. return false;
  4889. };
  4890. Column.prototype.isRowGroupDisplayed = function (colId) {
  4891. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].missing(this.colDef) || _utils__WEBPACK_IMPORTED_MODULE_1__["_"].missing(this.colDef.showRowGroup)) {
  4892. return false;
  4893. }
  4894. var showingAllGroups = this.colDef.showRowGroup === true;
  4895. var showingThisGroup = this.colDef.showRowGroup === colId;
  4896. return showingAllGroups || showingThisGroup;
  4897. };
  4898. Column.prototype.getUniqueId = function () {
  4899. return this.getId();
  4900. };
  4901. Column.prototype.isPrimary = function () {
  4902. return this.primary;
  4903. };
  4904. Column.prototype.isFilterAllowed = function () {
  4905. // filter defined means it's a string, class or true.
  4906. // if its false, null or undefined then it's false.
  4907. var filterDefined = !!this.colDef.filter || !!this.colDef.filterFramework;
  4908. return this.primary && filterDefined;
  4909. };
  4910. Column.prototype.isFieldContainsDots = function () {
  4911. return this.fieldContainsDots;
  4912. };
  4913. Column.prototype.isTooltipFieldContainsDots = function () {
  4914. return this.tooltipFieldContainsDots;
  4915. };
  4916. Column.prototype.validate = function () {
  4917. var colDefAny = this.colDef;
  4918. function warnOnce(msg, key, obj) {
  4919. _utils__WEBPACK_IMPORTED_MODULE_1__["_"].doOnce(function () {
  4920. if (obj) {
  4921. console.warn(msg, obj);
  4922. }
  4923. else {
  4924. _utils__WEBPACK_IMPORTED_MODULE_1__["_"].doOnce(function () { return console.warn(msg); }, key);
  4925. }
  4926. }, key);
  4927. }
  4928. if (!_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RowGroupingModule)) {
  4929. var rowGroupingItems = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'enableValue', 'pivot', 'pivotIndex', 'aggFunc'];
  4930. rowGroupingItems.forEach(function (item) {
  4931. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(colDefAny[item])) {
  4932. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isPackageBased()) {
  4933. warnOnce("ag-Grid: " + item + " is only valid in ag-grid-enterprise, your column definition should not have " + item, 'ColumnRowGroupingMissing' + item);
  4934. }
  4935. else {
  4936. warnOnce("ag-Grid: " + item + " is only valid with ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RowGroupingModule + " - your column definition should not have " + item, 'ColumnRowGroupingMissing' + item);
  4937. }
  4938. }
  4939. });
  4940. }
  4941. if (!_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RichSelectModule)) {
  4942. if (this.colDef.cellEditor === 'agRichSelect' || this.colDef.cellEditor === 'agRichSelectCellEditor') {
  4943. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isPackageBased()) {
  4944. warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-grid-enterprise", 'ColumnRichSelectMissing');
  4945. }
  4946. else {
  4947. warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RichSelectModule, 'ColumnRichSelectMissing');
  4948. }
  4949. }
  4950. }
  4951. if (!_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].DateTimeCellEditorModule)) {
  4952. if (this.colDef.cellEditor === 'agRichSelect' || this.colDef.cellEditor === 'agDateTimeCellEditor') {
  4953. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isPackageBased()) {
  4954. warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-grid-enterprise", 'ColumnDateTimeMissing');
  4955. }
  4956. else {
  4957. warnOnce("ag-Grid: " + this.colDef.cellEditor + " can only be used with ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].DateTimeCellEditorModule, 'ColumnDateTimeMissing');
  4958. }
  4959. }
  4960. }
  4961. if (this.gridOptionsWrapper.isTreeData()) {
  4962. var itemsNotAllowedWithTreeData = ['rowGroup', 'rowGroupIndex', 'pivot', 'pivotIndex'];
  4963. itemsNotAllowedWithTreeData.forEach(function (item) {
  4964. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(colDefAny[item])) {
  4965. warnOnce("ag-Grid: " + item + " is not possible when doing tree data, your column definition should not have " + item, 'TreeDataCannotRowGroup');
  4966. }
  4967. });
  4968. }
  4969. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(this.colDef.width) && typeof this.colDef.width !== 'number') {
  4970. warnOnce('ag-Grid: colDef.width should be a number, not ' + typeof this.colDef.width, 'ColumnCheck_asdfawef');
  4971. }
  4972. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].get(this, 'colDef.cellRendererParams.restrictToOneGroup', null)) {
  4973. warnOnce('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.restrictToOneGroup is deprecated. You should use showRowGroup', 'ColumnCheck_sksldjf');
  4974. }
  4975. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].get(this, 'colDef.cellRendererParams.keyMap', null)) {
  4976. warnOnce('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator', 'ColumnCheck_ieiruhgdf');
  4977. }
  4978. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].get(this, 'colDef.cellRendererParams.keyMap', null)) {
  4979. warnOnce('ag-Grid: Since ag-grid 11.0.0 cellRendererParams.keyMap is deprecated. You should use colDef.keyCreator', 'ColumnCheck_uitolghj');
  4980. }
  4981. if (colDefAny.floatingCellRenderer) {
  4982. warnOnce('ag-Grid: since v11, floatingCellRenderer is now pinnedRowCellRenderer', 'ColumnCheck_soihwewe');
  4983. this.colDef.pinnedRowCellRenderer = colDefAny.floatingCellRenderer;
  4984. }
  4985. if (colDefAny.floatingRendererFramework) {
  4986. warnOnce('ag-Grid: since v11, floatingRendererFramework is now pinnedRowCellRendererFramework', 'ColumnCheck_zdkiouhwer');
  4987. this.colDef.pinnedRowCellRendererFramework = colDefAny.floatingRendererFramework;
  4988. }
  4989. if (colDefAny.floatingRendererParams) {
  4990. console.warn('ag-Grid: since v11, floatingRendererParams is now pinnedRowCellRendererParams', 'ColumnCheck_retiuhjs');
  4991. this.colDef.pinnedRowCellRendererParams = colDefAny.floatingRendererParams;
  4992. }
  4993. if (colDefAny.floatingValueFormatter) {
  4994. warnOnce('ag-Grid: since v11, floatingValueFormatter is now pinnedRowValueFormatter', 'ColumnCheck_qwroeihjdf');
  4995. this.colDef.pinnedRowValueFormatter = colDefAny.floatingValueFormatter;
  4996. }
  4997. if (colDefAny.cellFormatter) {
  4998. warnOnce('ag-Grid: since v12, cellFormatter is now valueFormatter', 'ColumnCheck_eoireknml');
  4999. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].missing(this.colDef.valueFormatter)) {
  5000. this.colDef.valueFormatter = colDefAny.cellFormatter;
  5001. }
  5002. }
  5003. if (colDefAny.headerCellTemplate) {
  5004. warnOnce('ag-Grid: since v15, headerCellTemplate is gone, use header component instead.', 'ColumnCheck_eroihxcm');
  5005. }
  5006. if (colDefAny.headerCellRenderer) {
  5007. warnOnce('ag-Grid: since v15, headerCellRenderer is gone, use header component instead.', 'ColumnCheck_terteuh');
  5008. }
  5009. if (colDefAny.volatile) {
  5010. warnOnce('ag-Grid: since v16, colDef.volatile is gone, please check refresh docs on how to refresh specific cells.', 'ColumnCheck_weoihjxcv');
  5011. }
  5012. if (colDefAny.suppressSorting) {
  5013. warnOnce("ag-Grid: since v20, colDef.suppressSorting is gone, instead use colDef.sortable=false.", 'ColumnCheck_43ljrer', this.colDef);
  5014. this.colDef.sortable = false;
  5015. }
  5016. if (colDefAny.suppressFilter) {
  5017. warnOnce("ag-Grid: since v20, colDef.suppressFilter is gone, instead use colDef.filter=false.", 'ColumnCheck_erlkhfdm', this.colDef);
  5018. this.colDef.filter = false;
  5019. }
  5020. if (colDefAny.suppressResize) {
  5021. warnOnce("ag-Grid: since v20, colDef.suppressResize is gone, instead use colDef.resizable=false.", 'ColumnCheck_weoihjxcv', this.colDef);
  5022. this.colDef.resizable = false;
  5023. }
  5024. if (colDefAny.tooltip) {
  5025. warnOnce("ag-Grid: since v20.1, colDef.tooltip is gone, instead use colDef.tooltipValueGetter.", 'ColumnCheck_adslknjwef', this.colDef);
  5026. this.colDef.tooltipValueGetter = colDefAny.tooltip;
  5027. }
  5028. if (colDefAny.suppressToolPanel) {
  5029. warnOnce("ag-Grid: since v22, colDef.suppressToolPanel is gone, instead use suppressColumnsToolPanel / suppressFiltersToolPanel.", 'ColumnCheck_weihjlsjkdf', this.colDef);
  5030. this.colDef.suppressColumnsToolPanel = true;
  5031. }
  5032. };
  5033. Column.prototype.addEventListener = function (eventType, listener) {
  5034. this.eventService.addEventListener(eventType, listener);
  5035. };
  5036. Column.prototype.removeEventListener = function (eventType, listener) {
  5037. this.eventService.removeEventListener(eventType, listener);
  5038. };
  5039. Column.prototype.createIsColumnFuncParams = function (rowNode) {
  5040. return {
  5041. node: rowNode,
  5042. data: rowNode.data,
  5043. column: this,
  5044. colDef: this.colDef,
  5045. context: this.gridOptionsWrapper.getContext(),
  5046. api: this.gridOptionsWrapper.getApi(),
  5047. columnApi: this.gridOptionsWrapper.getColumnApi()
  5048. };
  5049. };
  5050. Column.prototype.isSuppressNavigable = function (rowNode) {
  5051. // if boolean set, then just use it
  5052. if (typeof this.colDef.suppressNavigable === 'boolean') {
  5053. return this.colDef.suppressNavigable;
  5054. }
  5055. // if function, then call the function to find out
  5056. if (typeof this.colDef.suppressNavigable === 'function') {
  5057. var params = this.createIsColumnFuncParams(rowNode);
  5058. var userFunc = this.colDef.suppressNavigable;
  5059. return userFunc(params);
  5060. }
  5061. return false;
  5062. };
  5063. Column.prototype.isCellEditable = function (rowNode) {
  5064. // only allow editing of groups if the user has this option enabled
  5065. if (rowNode.group && !this.gridOptionsWrapper.isEnableGroupEdit()) {
  5066. return false;
  5067. }
  5068. return this.isColumnFunc(rowNode, this.colDef.editable);
  5069. };
  5070. Column.prototype.isRowDrag = function (rowNode) {
  5071. return this.isColumnFunc(rowNode, this.colDef.rowDrag);
  5072. };
  5073. Column.prototype.isDndSource = function (rowNode) {
  5074. return this.isColumnFunc(rowNode, this.colDef.dndSource);
  5075. };
  5076. Column.prototype.isCellCheckboxSelection = function (rowNode) {
  5077. return this.isColumnFunc(rowNode, this.colDef.checkboxSelection);
  5078. };
  5079. Column.prototype.isSuppressPaste = function (rowNode) {
  5080. return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null);
  5081. };
  5082. Column.prototype.isResizable = function () {
  5083. return this.colDef.resizable === true;
  5084. };
  5085. Column.prototype.isColumnFunc = function (rowNode, value) {
  5086. // if boolean set, then just use it
  5087. if (typeof value === 'boolean') {
  5088. return value;
  5089. }
  5090. // if function, then call the function to find out
  5091. if (typeof value === 'function') {
  5092. var params = this.createIsColumnFuncParams(rowNode);
  5093. var editableFunc = value;
  5094. return editableFunc(params);
  5095. }
  5096. return false;
  5097. };
  5098. Column.prototype.setMoving = function (moving, source) {
  5099. if (source === void 0) { source = "api"; }
  5100. this.moving = moving;
  5101. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_MOVING_CHANGED, source));
  5102. };
  5103. Column.prototype.createColumnEvent = function (type, source) {
  5104. return {
  5105. api: this.gridApi,
  5106. columnApi: this.columnApi,
  5107. type: type,
  5108. column: this,
  5109. columns: [this],
  5110. source: source
  5111. };
  5112. };
  5113. Column.prototype.isMoving = function () {
  5114. return this.moving;
  5115. };
  5116. Column.prototype.getSort = function () {
  5117. return this.sort;
  5118. };
  5119. Column.prototype.setSort = function (sort, source) {
  5120. if (source === void 0) { source = "api"; }
  5121. if (this.sort !== sort) {
  5122. this.sort = sort;
  5123. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_SORT_CHANGED, source));
  5124. }
  5125. };
  5126. Column.prototype.setMenuVisible = function (visible, source) {
  5127. if (source === void 0) { source = "api"; }
  5128. if (this.menuVisible !== visible) {
  5129. this.menuVisible = visible;
  5130. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_MENU_VISIBLE_CHANGED, source));
  5131. }
  5132. };
  5133. Column.prototype.isMenuVisible = function () {
  5134. return this.menuVisible;
  5135. };
  5136. Column.prototype.isSortAscending = function () {
  5137. return this.sort === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].SORT_ASC;
  5138. };
  5139. Column.prototype.isSortDescending = function () {
  5140. return this.sort === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].SORT_DESC;
  5141. };
  5142. Column.prototype.isSortNone = function () {
  5143. return _utils__WEBPACK_IMPORTED_MODULE_1__["_"].missing(this.sort);
  5144. };
  5145. Column.prototype.isSorting = function () {
  5146. return _utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(this.sort);
  5147. };
  5148. Column.prototype.getSortedAt = function () {
  5149. return this.sortedAt;
  5150. };
  5151. Column.prototype.setSortedAt = function (sortedAt) {
  5152. this.sortedAt = sortedAt;
  5153. };
  5154. Column.prototype.setAggFunc = function (aggFunc) {
  5155. this.aggFunc = aggFunc;
  5156. };
  5157. Column.prototype.getAggFunc = function () {
  5158. return this.aggFunc;
  5159. };
  5160. Column.prototype.getLeft = function () {
  5161. return this.left;
  5162. };
  5163. Column.prototype.getOldLeft = function () {
  5164. return this.oldLeft;
  5165. };
  5166. Column.prototype.getRight = function () {
  5167. return this.left + this.actualWidth;
  5168. };
  5169. Column.prototype.setLeft = function (left, source) {
  5170. if (source === void 0) { source = "api"; }
  5171. this.oldLeft = this.left;
  5172. if (this.left !== left) {
  5173. this.left = left;
  5174. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_LEFT_CHANGED, source));
  5175. }
  5176. };
  5177. Column.prototype.isFilterActive = function () {
  5178. return this.filterActive;
  5179. };
  5180. // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event
  5181. Column.prototype.setFilterActive = function (active, source, additionalEventAttributes) {
  5182. if (source === void 0) { source = "api"; }
  5183. if (this.filterActive !== active) {
  5184. this.filterActive = active;
  5185. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FILTER_ACTIVE_CHANGED, source));
  5186. }
  5187. var filterChangedEvent = this.createColumnEvent(Column.EVENT_FILTER_CHANGED, source);
  5188. if (additionalEventAttributes) {
  5189. _utils__WEBPACK_IMPORTED_MODULE_1__["_"].mergeDeep(filterChangedEvent, additionalEventAttributes);
  5190. }
  5191. this.eventService.dispatchEvent(filterChangedEvent);
  5192. };
  5193. Column.prototype.setPinned = function (pinned) {
  5194. if (pinned === true || pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_LEFT) {
  5195. this.pinned = _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_LEFT;
  5196. }
  5197. else if (pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_RIGHT) {
  5198. this.pinned = _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_RIGHT;
  5199. }
  5200. else {
  5201. this.pinned = null;
  5202. }
  5203. };
  5204. Column.prototype.setFirstRightPinned = function (firstRightPinned, source) {
  5205. if (source === void 0) { source = "api"; }
  5206. if (this.firstRightPinned !== firstRightPinned) {
  5207. this.firstRightPinned = firstRightPinned;
  5208. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_FIRST_RIGHT_PINNED_CHANGED, source));
  5209. }
  5210. };
  5211. Column.prototype.setLastLeftPinned = function (lastLeftPinned, source) {
  5212. if (source === void 0) { source = "api"; }
  5213. if (this.lastLeftPinned !== lastLeftPinned) {
  5214. this.lastLeftPinned = lastLeftPinned;
  5215. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_LAST_LEFT_PINNED_CHANGED, source));
  5216. }
  5217. };
  5218. Column.prototype.isFirstRightPinned = function () {
  5219. return this.firstRightPinned;
  5220. };
  5221. Column.prototype.isLastLeftPinned = function () {
  5222. return this.lastLeftPinned;
  5223. };
  5224. Column.prototype.isPinned = function () {
  5225. return this.pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_LEFT || this.pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_RIGHT;
  5226. };
  5227. Column.prototype.isPinnedLeft = function () {
  5228. return this.pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_LEFT;
  5229. };
  5230. Column.prototype.isPinnedRight = function () {
  5231. return this.pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_RIGHT;
  5232. };
  5233. Column.prototype.getPinned = function () {
  5234. return this.pinned;
  5235. };
  5236. Column.prototype.setVisible = function (visible, source) {
  5237. if (source === void 0) { source = "api"; }
  5238. var newValue = visible === true;
  5239. if (this.visible !== newValue) {
  5240. this.visible = newValue;
  5241. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_VISIBLE_CHANGED, source));
  5242. }
  5243. };
  5244. Column.prototype.isVisible = function () {
  5245. return this.visible;
  5246. };
  5247. Column.prototype.getColDef = function () {
  5248. return this.colDef;
  5249. };
  5250. Column.prototype.getColumnGroupShow = function () {
  5251. return this.colDef.columnGroupShow;
  5252. };
  5253. Column.prototype.getColId = function () {
  5254. return this.colId;
  5255. };
  5256. Column.prototype.getId = function () {
  5257. return this.getColId();
  5258. };
  5259. Column.prototype.getDefinition = function () {
  5260. return this.colDef;
  5261. };
  5262. Column.prototype.getActualWidth = function () {
  5263. return this.actualWidth;
  5264. };
  5265. Column.prototype.createBaseColDefParams = function (rowNode) {
  5266. var params = {
  5267. node: rowNode,
  5268. data: rowNode.data,
  5269. colDef: this.colDef,
  5270. column: this,
  5271. api: this.gridOptionsWrapper.getApi(),
  5272. columnApi: this.gridOptionsWrapper.getColumnApi(),
  5273. context: this.gridOptionsWrapper.getContext()
  5274. };
  5275. return params;
  5276. };
  5277. Column.prototype.getColSpan = function (rowNode) {
  5278. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].missing(this.colDef.colSpan)) {
  5279. return 1;
  5280. }
  5281. var params = this.createBaseColDefParams(rowNode);
  5282. var colSpan = this.colDef.colSpan(params);
  5283. // colSpan must be number equal to or greater than 1
  5284. return Math.max(colSpan, 1);
  5285. };
  5286. Column.prototype.getRowSpan = function (rowNode) {
  5287. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].missing(this.colDef.rowSpan)) {
  5288. return 1;
  5289. }
  5290. var params = this.createBaseColDefParams(rowNode);
  5291. var rowSpan = this.colDef.rowSpan(params);
  5292. // rowSpan must be number equal to or greater than 1
  5293. return Math.max(rowSpan, 1);
  5294. };
  5295. Column.prototype.setActualWidth = function (actualWidth, source) {
  5296. if (source === void 0) { source = "api"; }
  5297. if (this.minWidth != null) {
  5298. actualWidth = Math.max(actualWidth, this.minWidth);
  5299. }
  5300. if (this.maxWidth != null) {
  5301. actualWidth = Math.min(actualWidth, this.maxWidth);
  5302. }
  5303. if (this.actualWidth !== actualWidth) {
  5304. // disable flex for this column if it was manually resized.
  5305. if (this.flex && source !== 'flex') {
  5306. this.flex = 0;
  5307. }
  5308. this.actualWidth = actualWidth;
  5309. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_WIDTH_CHANGED, source));
  5310. }
  5311. };
  5312. Column.prototype.isGreaterThanMax = function (width) {
  5313. if (this.maxWidth != null) {
  5314. return width > this.maxWidth;
  5315. }
  5316. return false;
  5317. };
  5318. Column.prototype.getMinWidth = function () {
  5319. return this.minWidth;
  5320. };
  5321. Column.prototype.getMaxWidth = function () {
  5322. return this.maxWidth;
  5323. };
  5324. Column.prototype.getFlex = function () {
  5325. return this.flex || 0;
  5326. };
  5327. // this method should only be used by the columnController to
  5328. // change flex when required by the setColumnState method.
  5329. Column.prototype.setFlex = function (flex) {
  5330. if (this.flex !== flex) {
  5331. this.flex = flex;
  5332. }
  5333. };
  5334. Column.prototype.setMinimum = function (source) {
  5335. if (source === void 0) { source = "api"; }
  5336. this.setActualWidth(this.minWidth, source);
  5337. };
  5338. Column.prototype.setRowGroupActive = function (rowGroup, source) {
  5339. if (source === void 0) { source = "api"; }
  5340. if (this.rowGroupActive !== rowGroup) {
  5341. this.rowGroupActive = rowGroup;
  5342. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_ROW_GROUP_CHANGED, source));
  5343. }
  5344. };
  5345. Column.prototype.isRowGroupActive = function () {
  5346. return this.rowGroupActive;
  5347. };
  5348. Column.prototype.setPivotActive = function (pivot, source) {
  5349. if (source === void 0) { source = "api"; }
  5350. if (this.pivotActive !== pivot) {
  5351. this.pivotActive = pivot;
  5352. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_PIVOT_CHANGED, source));
  5353. }
  5354. };
  5355. Column.prototype.isPivotActive = function () {
  5356. return this.pivotActive;
  5357. };
  5358. Column.prototype.isAnyFunctionActive = function () {
  5359. return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();
  5360. };
  5361. Column.prototype.isAnyFunctionAllowed = function () {
  5362. return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();
  5363. };
  5364. Column.prototype.setValueActive = function (value, source) {
  5365. if (source === void 0) { source = "api"; }
  5366. if (this.aggregationActive !== value) {
  5367. this.aggregationActive = value;
  5368. this.eventService.dispatchEvent(this.createColumnEvent(Column.EVENT_VALUE_CHANGED, source));
  5369. }
  5370. };
  5371. Column.prototype.isValueActive = function () {
  5372. return this.aggregationActive;
  5373. };
  5374. Column.prototype.isAllowPivot = function () {
  5375. return this.colDef.enablePivot === true;
  5376. };
  5377. Column.prototype.isAllowValue = function () {
  5378. return this.colDef.enableValue === true;
  5379. };
  5380. Column.prototype.isAllowRowGroup = function () {
  5381. return this.colDef.enableRowGroup === true;
  5382. };
  5383. Column.prototype.getMenuTabs = function (defaultValues) {
  5384. var menuTabs = this.getColDef().menuTabs;
  5385. if (menuTabs == null) {
  5386. menuTabs = defaultValues;
  5387. }
  5388. return menuTabs;
  5389. };
  5390. // this used to be needed, as previous version of ag-grid had lockPosition as column state,
  5391. // so couldn't depend on colDef version.
  5392. Column.prototype.isLockPosition = function () {
  5393. console.warn('ag-Grid: since v21, col.isLockPosition() should not be used, please use col.getColDef().lockPosition instead.');
  5394. return this.colDef ? !!this.colDef.lockPosition : false;
  5395. };
  5396. // this used to be needed, as previous version of ag-grid had lockVisible as column state,
  5397. // so couldn't depend on colDef version.
  5398. Column.prototype.isLockVisible = function () {
  5399. console.warn('ag-Grid: since v21, col.isLockVisible() should not be used, please use col.getColDef().lockVisible instead.');
  5400. return this.colDef ? !!this.colDef.lockVisible : false;
  5401. };
  5402. // this used to be needed, as previous version of ag-grid had lockPinned as column state,
  5403. // so couldn't depend on colDef version.
  5404. Column.prototype.isLockPinned = function () {
  5405. console.warn('ag-Grid: since v21, col.isLockPinned() should not be used, please use col.getColDef().lockPinned instead.');
  5406. return this.colDef ? !!this.colDef.lockPinned : false;
  5407. };
  5408. // + renderedHeaderCell - for making header cell transparent when moving
  5409. Column.EVENT_MOVING_CHANGED = 'movingChanged';
  5410. // + renderedCell - changing left position
  5411. Column.EVENT_LEFT_CHANGED = 'leftChanged';
  5412. // + renderedCell - changing width
  5413. Column.EVENT_WIDTH_CHANGED = 'widthChanged';
  5414. // + renderedCell - for changing pinned classes
  5415. Column.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged';
  5416. Column.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged';
  5417. // + renderedColumn - for changing visibility icon
  5418. Column.EVENT_VISIBLE_CHANGED = 'visibleChanged';
  5419. // + every time the filter changes, used in the floating filters
  5420. Column.EVENT_FILTER_CHANGED = 'filterChanged';
  5421. // + renderedHeaderCell - marks the header with filter icon
  5422. Column.EVENT_FILTER_ACTIVE_CHANGED = 'filterActiveChanged';
  5423. // + renderedHeaderCell - marks the header with sort icon
  5424. Column.EVENT_SORT_CHANGED = 'sortChanged';
  5425. Column.EVENT_MENU_VISIBLE_CHANGED = 'menuVisibleChanged';
  5426. // + toolpanel, for gui updates
  5427. Column.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
  5428. // + toolpanel, for gui updates
  5429. Column.EVENT_PIVOT_CHANGED = 'columnPivotChanged';
  5430. // + toolpanel, for gui updates
  5431. Column.EVENT_VALUE_CHANGED = 'columnValueChanged';
  5432. __decorate([
  5433. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  5434. ], Column.prototype, "gridOptionsWrapper", void 0);
  5435. __decorate([
  5436. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnUtils')
  5437. ], Column.prototype, "columnUtils", void 0);
  5438. __decorate([
  5439. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
  5440. ], Column.prototype, "columnApi", void 0);
  5441. __decorate([
  5442. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
  5443. ], Column.prototype, "gridApi", void 0);
  5444. __decorate([
  5445. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('context')
  5446. ], Column.prototype, "context", void 0);
  5447. __decorate([
  5448. _context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
  5449. ], Column.prototype, "initialise", null);
  5450. return Column;
  5451. }());
  5452. /***/ }),
  5453. /* 36 */
  5454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5455. "use strict";
  5456. __webpack_require__.r(__webpack_exports__);
  5457. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventService", function() { return EventService; });
  5458. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  5459. /**
  5460. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  5461. * @version v23.2.1
  5462. * @link http://www.ag-grid.com/
  5463. * @license MIT
  5464. */
  5465. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  5466. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  5467. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  5468. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  5469. return c > 3 && r && Object.defineProperty(target, key, r), r;
  5470. };
  5471. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  5472. return function (target, key) { decorator(target, key, paramIndex); }
  5473. };
  5474. var EventService = /** @class */ (function () {
  5475. function EventService() {
  5476. this.allSyncListeners = new Map();
  5477. this.allAsyncListeners = new Map();
  5478. this.globalSyncListeners = new Set();
  5479. this.globalAsyncListeners = new Set();
  5480. this.asyncFunctionsQueue = [];
  5481. this.scheduled = false;
  5482. // using an object performs better than a Set for the number of different events we have
  5483. this.firedEvents = {};
  5484. }
  5485. // because this class is used both inside the context and outside the context, we do not
  5486. // use autowired attributes, as that would be confusing, as sometimes the attributes
  5487. // would be wired, and sometimes not.
  5488. //
  5489. // the global event servers used by ag-Grid is autowired by the context once, and this
  5490. // setBeans method gets called once.
  5491. //
  5492. // the times when this class is used outside of the context (eg RowNode has an instance of this
  5493. // class) then it is not a bean, and this setBeans method is not called.
  5494. EventService.prototype.setBeans = function (loggerFactory, gridOptionsWrapper, globalEventListener) {
  5495. if (globalEventListener === void 0) { globalEventListener = null; }
  5496. this.logger = loggerFactory.create('EventService');
  5497. if (globalEventListener) {
  5498. var async = gridOptionsWrapper.useAsyncEvents();
  5499. this.addGlobalListener(globalEventListener, async);
  5500. }
  5501. };
  5502. EventService.prototype.getListeners = function (eventType, async) {
  5503. var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;
  5504. var listeners = listenerMap.get(eventType);
  5505. if (!listeners) {
  5506. listeners = new Set();
  5507. listenerMap.set(eventType, listeners);
  5508. }
  5509. return listeners;
  5510. };
  5511. EventService.prototype.addEventListener = function (eventType, listener, async) {
  5512. if (async === void 0) { async = false; }
  5513. this.getListeners(eventType, async).add(listener);
  5514. };
  5515. EventService.prototype.removeEventListener = function (eventType, listener, async) {
  5516. if (async === void 0) { async = false; }
  5517. this.getListeners(eventType, async).delete(listener);
  5518. };
  5519. EventService.prototype.addGlobalListener = function (listener, async) {
  5520. if (async === void 0) { async = false; }
  5521. (async ? this.globalAsyncListeners : this.globalSyncListeners).add(listener);
  5522. };
  5523. EventService.prototype.removeGlobalListener = function (listener, async) {
  5524. if (async === void 0) { async = false; }
  5525. (async ? this.globalAsyncListeners : this.globalSyncListeners).delete(listener);
  5526. };
  5527. EventService.prototype.dispatchEvent = function (event) {
  5528. this.dispatchToListeners(event, true);
  5529. this.dispatchToListeners(event, false);
  5530. this.firedEvents[event.type] = true;
  5531. };
  5532. EventService.prototype.dispatchEventOnce = function (event) {
  5533. if (!this.firedEvents[event.type]) {
  5534. this.dispatchEvent(event);
  5535. }
  5536. };
  5537. EventService.prototype.dispatchToListeners = function (event, async) {
  5538. var _this = this;
  5539. var eventType = event.type;
  5540. var processEventListeners = function (listeners) { return listeners.forEach(function (listener) {
  5541. if (async) {
  5542. _this.dispatchAsync(function () { return listener(event); });
  5543. }
  5544. else {
  5545. listener(event);
  5546. }
  5547. }); };
  5548. processEventListeners(this.getListeners(eventType, async));
  5549. var globalListeners = async ? this.globalAsyncListeners : this.globalSyncListeners;
  5550. globalListeners.forEach(function (listener) {
  5551. if (async) {
  5552. _this.dispatchAsync(function () { return listener(eventType, event); });
  5553. }
  5554. else {
  5555. listener(eventType, event);
  5556. }
  5557. });
  5558. };
  5559. // this gets called inside the grid's thread, for each event that it
  5560. // wants to set async. the grid then batches the events into one setTimeout()
  5561. // because setTimeout() is an expensive operation. ideally we would have
  5562. // each event in it's own setTimeout(), but we batch for performance.
  5563. EventService.prototype.dispatchAsync = function (func) {
  5564. // add to the queue for executing later in the next VM turn
  5565. this.asyncFunctionsQueue.push(func);
  5566. // check if timeout is already scheduled. the first time the grid calls
  5567. // this within it's thread turn, this should be false, so it will schedule
  5568. // the 'flush queue' method the first time it comes here. then the flag is
  5569. // set to 'true' so it will know it's already scheduled for subsequent calls.
  5570. if (!this.scheduled) {
  5571. // if not scheduled, schedule one
  5572. window.setTimeout(this.flushAsyncQueue.bind(this), 0);
  5573. // mark that it is scheduled
  5574. this.scheduled = true;
  5575. }
  5576. };
  5577. // this happens in the next VM turn only, and empties the queue of events
  5578. EventService.prototype.flushAsyncQueue = function () {
  5579. this.scheduled = false;
  5580. // we take a copy, because the event listener could be using
  5581. // the grid, which would cause more events, which would be potentially
  5582. // added to the queue, so safe to take a copy, the new events will
  5583. // get executed in a later VM turn rather than risk updating the
  5584. // queue as we are flushing it.
  5585. var queueCopy = this.asyncFunctionsQueue.slice();
  5586. this.asyncFunctionsQueue = [];
  5587. // execute the queue
  5588. queueCopy.forEach(function (func) { return func(); });
  5589. };
  5590. __decorate([
  5591. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory')),
  5592. __param(1, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('gridOptionsWrapper')),
  5593. __param(2, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('globalEventListener'))
  5594. ], EventService.prototype, "setBeans", null);
  5595. EventService = __decorate([
  5596. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('eventService')
  5597. ], EventService);
  5598. return EventService;
  5599. }());
  5600. /***/ }),
  5601. /* 37 */
  5602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5603. "use strict";
  5604. __webpack_require__.r(__webpack_exports__);
  5605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; });
  5606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreConstruct", function() { return PreConstruct; });
  5607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostConstruct", function() { return PostConstruct; });
  5608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PreDestroy", function() { return PreDestroy; });
  5609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bean", function() { return Bean; });
  5610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Autowired", function() { return Autowired; });
  5611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return Optional; });
  5612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Qualifier", function() { return Qualifier; });
  5613. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  5614. /**
  5615. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  5616. * @version v23.2.1
  5617. * @link http://www.ag-grid.com/
  5618. * @license MIT
  5619. */
  5620. var Context = /** @class */ (function () {
  5621. function Context(params, logger) {
  5622. this.beanWrappers = {};
  5623. this.destroyed = false;
  5624. if (!params || !params.beanClasses) {
  5625. return;
  5626. }
  5627. this.contextParams = params;
  5628. this.logger = logger;
  5629. this.logger.log(">> creating ag-Application Context");
  5630. this.createBeans();
  5631. var beanInstances = this.getBeanInstances();
  5632. this.wireBeans(beanInstances);
  5633. this.logger.log(">> ag-Application Context ready - component is alive");
  5634. }
  5635. Context.prototype.getBeanInstances = function () {
  5636. return _utils__WEBPACK_IMPORTED_MODULE_0__["_"].values(this.beanWrappers).map(function (beanEntry) { return beanEntry.beanInstance; });
  5637. };
  5638. Context.prototype.createBean = function (bean, afterPreCreateCallback) {
  5639. if (!bean) {
  5640. throw Error("Can't wire to bean since it is null");
  5641. }
  5642. this.wireBeans([bean], afterPreCreateCallback);
  5643. return bean;
  5644. };
  5645. Context.prototype.wireBeans = function (beanInstances, afterPreCreateCallback) {
  5646. this.autoWireBeans(beanInstances);
  5647. this.methodWireBeans(beanInstances);
  5648. this.callLifeCycleMethods(beanInstances, 'preConstructMethods');
  5649. // the callback sets the attributes, so the component has access to attributes
  5650. // before postConstruct methods in the component are executed
  5651. if (_utils__WEBPACK_IMPORTED_MODULE_0__["_"].exists(afterPreCreateCallback)) {
  5652. beanInstances.forEach(afterPreCreateCallback);
  5653. }
  5654. this.callLifeCycleMethods(beanInstances, 'postConstructMethods');
  5655. };
  5656. Context.prototype.createBeans = function () {
  5657. var _this = this;
  5658. // register all normal beans
  5659. this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this));
  5660. // register override beans, these will overwrite beans above of same name
  5661. // instantiate all beans - overridden beans will be left out
  5662. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].iterateObject(this.beanWrappers, function (key, beanEntry) {
  5663. var constructorParamsMeta;
  5664. if (beanEntry.bean.__agBeanMetaData && beanEntry.bean.__agBeanMetaData.autowireMethods && beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor) {
  5665. constructorParamsMeta = beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor;
  5666. }
  5667. var constructorParams = _this.getBeansForParameters(constructorParamsMeta, beanEntry.bean.name);
  5668. var newInstance = applyToConstructor(beanEntry.bean, constructorParams);
  5669. beanEntry.beanInstance = newInstance;
  5670. });
  5671. var createdBeanNames = Object.keys(this.beanWrappers).join(', ');
  5672. this.logger.log("created beans: " + createdBeanNames);
  5673. };
  5674. // tslint:disable-next-line
  5675. Context.prototype.createBeanWrapper = function (Bean) {
  5676. var metaData = Bean.__agBeanMetaData;
  5677. if (!metaData) {
  5678. var beanName = void 0;
  5679. if (Bean.prototype.constructor) {
  5680. beanName = Bean.prototype.constructor.name;
  5681. }
  5682. else {
  5683. beanName = "" + Bean;
  5684. }
  5685. console.error("context item " + beanName + " is not a bean");
  5686. return;
  5687. }
  5688. var beanEntry = {
  5689. bean: Bean,
  5690. beanInstance: null,
  5691. beanName: metaData.beanName
  5692. };
  5693. this.beanWrappers[metaData.beanName] = beanEntry;
  5694. };
  5695. Context.prototype.autoWireBeans = function (beanInstances) {
  5696. var _this = this;
  5697. beanInstances.forEach(function (beanInstance) {
  5698. _this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) {
  5699. var attributes = metaData.agClassAttributes;
  5700. if (!attributes) {
  5701. return;
  5702. }
  5703. attributes.forEach(function (attribute) {
  5704. var otherBean = _this.lookupBeanInstance(beanName, attribute.beanName, attribute.optional);
  5705. beanInstance[attribute.attributeName] = otherBean;
  5706. });
  5707. });
  5708. });
  5709. };
  5710. Context.prototype.methodWireBeans = function (beanInstances) {
  5711. var _this = this;
  5712. beanInstances.forEach(function (beanInstance) {
  5713. _this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) {
  5714. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].iterateObject(metaData.autowireMethods, function (methodName, wireParams) {
  5715. // skip constructor, as this is dealt with elsewhere
  5716. if (methodName === "agConstructor") {
  5717. return;
  5718. }
  5719. var initParams = _this.getBeansForParameters(wireParams, beanName);
  5720. beanInstance[methodName].apply(beanInstance, initParams);
  5721. });
  5722. });
  5723. });
  5724. };
  5725. Context.prototype.forEachMetaDataInHierarchy = function (beanInstance, callback) {
  5726. var prototype = Object.getPrototypeOf(beanInstance);
  5727. while (prototype != null) {
  5728. var constructor = prototype.constructor;
  5729. if (constructor.hasOwnProperty('__agBeanMetaData')) {
  5730. var metaData = constructor.__agBeanMetaData;
  5731. var beanName = this.getBeanName(constructor);
  5732. callback(metaData, beanName);
  5733. }
  5734. prototype = Object.getPrototypeOf(prototype);
  5735. }
  5736. };
  5737. Context.prototype.getBeanName = function (constructor) {
  5738. if (constructor.__agBeanMetaData && constructor.__agBeanMetaData.beanName) {
  5739. return constructor.__agBeanMetaData.beanName;
  5740. }
  5741. var constructorString = constructor.toString();
  5742. var beanName = constructorString.substring(9, constructorString.indexOf("("));
  5743. return beanName;
  5744. };
  5745. Context.prototype.getBeansForParameters = function (parameters, beanName) {
  5746. var _this = this;
  5747. var beansList = [];
  5748. if (parameters) {
  5749. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].iterateObject(parameters, function (paramIndex, otherBeanName) {
  5750. var otherBean = _this.lookupBeanInstance(beanName, otherBeanName);
  5751. beansList[Number(paramIndex)] = otherBean;
  5752. });
  5753. }
  5754. return beansList;
  5755. };
  5756. Context.prototype.lookupBeanInstance = function (wiringBean, beanName, optional) {
  5757. if (optional === void 0) { optional = false; }
  5758. if (beanName === "context") {
  5759. return this;
  5760. }
  5761. else if (this.contextParams.providedBeanInstances && this.contextParams.providedBeanInstances.hasOwnProperty(beanName)) {
  5762. return this.contextParams.providedBeanInstances[beanName];
  5763. }
  5764. else {
  5765. var beanEntry = this.beanWrappers[beanName];
  5766. if (beanEntry) {
  5767. return beanEntry.beanInstance;
  5768. }
  5769. if (!optional) {
  5770. console.error("ag-Grid: unable to find bean reference " + beanName + " while initialising " + wiringBean);
  5771. }
  5772. return null;
  5773. }
  5774. };
  5775. Context.prototype.callLifeCycleMethods = function (beanInstances, lifeCycleMethod) {
  5776. var _this = this;
  5777. beanInstances.forEach(function (beanInstance) {
  5778. _this.callLifeCycleMethodsOneBean(beanInstance, lifeCycleMethod);
  5779. });
  5780. };
  5781. Context.prototype.callLifeCycleMethodsOneBean = function (beanInstance, lifeCycleMethod, methodToIgnore) {
  5782. // putting all methods into a map removes duplicates
  5783. var allMethods = {};
  5784. // dump methods from each level of the metadata hierarchy
  5785. this.forEachMetaDataInHierarchy(beanInstance, function (metaData) {
  5786. var methods = metaData[lifeCycleMethod];
  5787. if (methods) {
  5788. methods.forEach(function (methodName) {
  5789. if (methodName != methodToIgnore) {
  5790. allMethods[methodName] = true;
  5791. }
  5792. });
  5793. }
  5794. });
  5795. var allMethodsList = Object.keys(allMethods);
  5796. allMethodsList.forEach(function (methodName) { return beanInstance[methodName](); });
  5797. };
  5798. Context.prototype.getBean = function (name) {
  5799. return this.lookupBeanInstance("getBean", name, true);
  5800. };
  5801. Context.prototype.destroy = function () {
  5802. // should only be able to destroy once
  5803. if (this.destroyed) {
  5804. return;
  5805. }
  5806. this.logger.log(">> Shutting down ag-Application Context");
  5807. var beanInstances = this.getBeanInstances();
  5808. this.destroyBeans(beanInstances);
  5809. this.contextParams.providedBeanInstances = null;
  5810. this.destroyed = true;
  5811. this.logger.log(">> ag-Application Context shut down - component is dead");
  5812. };
  5813. Context.prototype.destroyBean = function (bean) {
  5814. if (!bean) {
  5815. return undefined;
  5816. }
  5817. this.destroyBeans([bean]);
  5818. return undefined;
  5819. };
  5820. Context.prototype.destroyBeans = function (beans) {
  5821. var _this = this;
  5822. if (!beans) {
  5823. return [];
  5824. }
  5825. beans.forEach(function (bean) {
  5826. _this.callLifeCycleMethodsOneBean(bean, 'preDestroyMethods', 'destroy');
  5827. // call destroy() explicitly if it exists
  5828. if (bean.destroy) {
  5829. bean.destroy();
  5830. }
  5831. });
  5832. return [];
  5833. };
  5834. return Context;
  5835. }());
  5836. // taken from: http://stackoverflow.com/questions/3362471/how-can-i-call-a-javascript-constructor-using-call-or-apply
  5837. // allows calling 'apply' on a constructor
  5838. function applyToConstructor(constructor, argArray) {
  5839. var args = [null].concat(argArray);
  5840. var factoryFunction = constructor.bind.apply(constructor, args);
  5841. return new factoryFunction();
  5842. }
  5843. function PreConstruct(target, methodName, descriptor) {
  5844. var props = getOrCreateProps(target.constructor);
  5845. if (!props.preConstructMethods) {
  5846. props.preConstructMethods = [];
  5847. }
  5848. props.preConstructMethods.push(methodName);
  5849. }
  5850. function PostConstruct(target, methodName, descriptor) {
  5851. var props = getOrCreateProps(target.constructor);
  5852. if (!props.postConstructMethods) {
  5853. props.postConstructMethods = [];
  5854. }
  5855. props.postConstructMethods.push(methodName);
  5856. }
  5857. function PreDestroy(target, methodName, descriptor) {
  5858. var props = getOrCreateProps(target.constructor);
  5859. if (!props.preDestroyMethods) {
  5860. props.preDestroyMethods = [];
  5861. }
  5862. props.preDestroyMethods.push(methodName);
  5863. }
  5864. function Bean(beanName) {
  5865. return function (classConstructor) {
  5866. var props = getOrCreateProps(classConstructor);
  5867. props.beanName = beanName;
  5868. };
  5869. }
  5870. function Autowired(name) {
  5871. return function (target, propertyKey, descriptor) {
  5872. autowiredFunc(target, name, false, target, propertyKey, null);
  5873. };
  5874. }
  5875. function Optional(name) {
  5876. return function (target, propertyKey, descriptor) {
  5877. autowiredFunc(target, name, true, target, propertyKey, null);
  5878. };
  5879. }
  5880. function autowiredFunc(target, name, optional, classPrototype, methodOrAttributeName, index) {
  5881. if (name === null) {
  5882. console.error("ag-Grid: Autowired name should not be null");
  5883. return;
  5884. }
  5885. if (typeof index === "number") {
  5886. console.error("ag-Grid: Autowired should be on an attribute");
  5887. return;
  5888. }
  5889. // it's an attribute on the class
  5890. var props = getOrCreateProps(target.constructor);
  5891. if (!props.agClassAttributes) {
  5892. props.agClassAttributes = [];
  5893. }
  5894. props.agClassAttributes.push({
  5895. attributeName: methodOrAttributeName,
  5896. beanName: name,
  5897. optional: optional
  5898. });
  5899. }
  5900. function Qualifier(name) {
  5901. return function (classPrototype, methodOrAttributeName, index) {
  5902. var constructor = typeof classPrototype == "function" ? classPrototype : classPrototype.constructor;
  5903. var props;
  5904. if (typeof index === "number") {
  5905. // it's a parameter on a method
  5906. var methodName = void 0;
  5907. if (methodOrAttributeName) {
  5908. props = getOrCreateProps(constructor);
  5909. methodName = methodOrAttributeName;
  5910. }
  5911. else {
  5912. props = getOrCreateProps(constructor);
  5913. methodName = "agConstructor";
  5914. }
  5915. if (!props.autowireMethods) {
  5916. props.autowireMethods = {};
  5917. }
  5918. if (!props.autowireMethods[methodName]) {
  5919. props.autowireMethods[methodName] = {};
  5920. }
  5921. props.autowireMethods[methodName][index] = name;
  5922. }
  5923. };
  5924. }
  5925. function getOrCreateProps(target) {
  5926. if (!target.hasOwnProperty("__agBeanMetaData")) {
  5927. target.__agBeanMetaData = {};
  5928. }
  5929. return target.__agBeanMetaData;
  5930. }
  5931. /***/ }),
  5932. /* 38 */
  5933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5934. "use strict";
  5935. __webpack_require__.r(__webpack_exports__);
  5936. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleNames", function() { return ModuleNames; });
  5937. /**
  5938. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  5939. * @version v23.2.1
  5940. * @link http://www.ag-grid.com/
  5941. * @license MIT
  5942. */
  5943. var ModuleNames;
  5944. (function (ModuleNames) {
  5945. // when using modules, user references this
  5946. ModuleNames["CommunityCoreModule"] = "@ag-grid-community/core";
  5947. // when not using modules, user references this
  5948. ModuleNames["CommunityAllModules"] = "@ag-grid-community/all";
  5949. // community modules
  5950. ModuleNames["InfiniteRowModelModule"] = "@ag-grid-community/infinite-row-model";
  5951. ModuleNames["ClientSideRowModelModule"] = "@ag-grid-community/client-side-row-model";
  5952. ModuleNames["CsvExportModule"] = "@ag-grid-community/csv-export";
  5953. ModuleNames["RowNodeCache"] = "@ag-grid-community/row-node-cache";
  5954. // enterprise core - users never import on this, but other enterprise modules do
  5955. ModuleNames["EnterpriseCoreModule"] = "@ag-grid-enterprise/core";
  5956. // when not using modules, user references this
  5957. ModuleNames["EnterpriseAllModules"] = "@ag-grid-enterprise/all";
  5958. // enterprise modules
  5959. ModuleNames["RowGroupingModule"] = "@ag-grid-enterprise/row-grouping";
  5960. ModuleNames["ColumnToolPanelModule"] = "@ag-grid-enterprise/column-tool-panel";
  5961. ModuleNames["FiltersToolPanelModule"] = "@ag-grid-enterprise/filters-tool-panel";
  5962. ModuleNames["MenuModule"] = "@ag-grid-enterprise/menu";
  5963. ModuleNames["SetFilterModule"] = "@ag-grid-enterprise/set-filter";
  5964. ModuleNames["StatusBarModule"] = "@ag-grid-enterprise/status-bar";
  5965. ModuleNames["SideBarModule"] = "@ag-grid-enterprise/side-bar";
  5966. ModuleNames["RangeSelectionModule"] = "@ag-grid-enterprise/range-selection";
  5967. ModuleNames["MasterDetailModule"] = "@ag-grid-enterprise/master-detail";
  5968. ModuleNames["RichSelectModule"] = "@ag-grid-enterprise/rich-select";
  5969. ModuleNames["GridChartsModule"] = "@ag-grid-enterprise/charts";
  5970. ModuleNames["ViewportRowModelModule"] = "@ag-grid-enterprise/viewport-row-model";
  5971. ModuleNames["ServerSideRowModelModule"] = "@ag-grid-enterprise/server-side-row-model";
  5972. ModuleNames["ExcelExportModule"] = "@ag-grid-enterprise/excel-export";
  5973. ModuleNames["ClipboardModule"] = "@ag-grid-enterprise/clipboard";
  5974. ModuleNames["DateTimeCellEditorModule"] = "@ag-grid-enterprise/date-time-cell-editor";
  5975. // framework wrappers currently don't provide beans, comps etc, so no need to be modules,
  5976. // however i argue they should be as in theory they 'could' provide beans etc
  5977. ModuleNames["AngularModule"] = "@ag-grid-community/angular";
  5978. ModuleNames["ReactModule"] = "@ag-grid-community/react";
  5979. ModuleNames["VueModule"] = "@ag-grid-community/vue";
  5980. ModuleNames["PolymerModule"] = "@ag-grid-community/polymer";
  5981. // and then this, which is definitely not a grid module, as it should not have any dependency
  5982. // on the grid (ie shouldn't even reference the Module interface)
  5983. // ChartsModule = "@ag-grid-community/charts-core",
  5984. })(ModuleNames || (ModuleNames = {}));
  5985. /***/ }),
  5986. /* 39 */
  5987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5988. "use strict";
  5989. __webpack_require__.r(__webpack_exports__);
  5990. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModuleRegistry", function() { return ModuleRegistry; });
  5991. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  5992. /**
  5993. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  5994. * @version v23.2.1
  5995. * @link http://www.ag-grid.com/
  5996. * @license MIT
  5997. */
  5998. var ModuleRegistry = /** @class */ (function () {
  5999. function ModuleRegistry() {
  6000. }
  6001. ModuleRegistry.register = function (module, moduleBased) {
  6002. if (moduleBased === void 0) { moduleBased = true; }
  6003. ModuleRegistry.modulesMap[module.moduleName] = module;
  6004. if (ModuleRegistry.moduleBased === undefined) {
  6005. ModuleRegistry.moduleBased = moduleBased;
  6006. }
  6007. else {
  6008. if (ModuleRegistry.moduleBased !== moduleBased) {
  6009. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].doOnce(function () {
  6010. console.warn("ag-Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms.");
  6011. console.warn('Please see https://www.ag-grid.com/javascript-grid-packages-modules/ for more information.');
  6012. }, 'ModulePackageCheck');
  6013. }
  6014. }
  6015. };
  6016. // noinspection JSUnusedGlobalSymbols
  6017. ModuleRegistry.registerModules = function (modules, moduleBased) {
  6018. if (moduleBased === void 0) { moduleBased = true; }
  6019. if (!modules) {
  6020. return;
  6021. }
  6022. modules.forEach(function (module) { return ModuleRegistry.register(module, moduleBased); });
  6023. };
  6024. ModuleRegistry.assertRegistered = function (moduleName, reason) {
  6025. if (this.isRegistered(moduleName)) {
  6026. return true;
  6027. }
  6028. var warningKey = reason + moduleName;
  6029. var warningMessage = "ag-Grid: unable to use " + reason + " as module " + moduleName + " is not present. Please see: https://www.ag-grid.com/javascript-grid-modules/";
  6030. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].doOnce(function () {
  6031. console.warn(warningMessage);
  6032. }, warningKey);
  6033. return false;
  6034. };
  6035. ModuleRegistry.isRegistered = function (moduleName) {
  6036. return !!ModuleRegistry.modulesMap[moduleName];
  6037. };
  6038. ModuleRegistry.getRegisteredModules = function () {
  6039. return _utils__WEBPACK_IMPORTED_MODULE_0__["_"].values(ModuleRegistry.modulesMap);
  6040. };
  6041. ModuleRegistry.isPackageBased = function () {
  6042. return !ModuleRegistry.moduleBased;
  6043. };
  6044. // having in a map a) removes duplicates and b) allows fast lookup
  6045. ModuleRegistry.modulesMap = {};
  6046. return ModuleRegistry;
  6047. }());
  6048. /***/ }),
  6049. /* 40 */
  6050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6051. "use strict";
  6052. __webpack_require__.r(__webpack_exports__);
  6053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultColumnTypes", function() { return DefaultColumnTypes; });
  6054. /**
  6055. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  6056. * @version v23.2.1
  6057. * @link http://www.ag-grid.com/
  6058. * @license MIT
  6059. */
  6060. var DefaultColumnTypes = {
  6061. numericColumn: {
  6062. headerClass: 'ag-right-aligned-header',
  6063. cellClass: 'ag-right-aligned-cell'
  6064. },
  6065. rightAligned: {
  6066. headerClass: 'ag-right-aligned-header',
  6067. cellClass: 'ag-right-aligned-cell'
  6068. }
  6069. };
  6070. /***/ }),
  6071. /* 41 */
  6072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6073. "use strict";
  6074. __webpack_require__.r(__webpack_exports__);
  6075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BeanStub", function() { return BeanStub; });
  6076. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
  6077. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  6078. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  6079. /**
  6080. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  6081. * @version v23.2.1
  6082. * @link http://www.ag-grid.com/
  6083. * @license MIT
  6084. */
  6085. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  6086. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  6087. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  6088. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  6089. return c > 3 && r && Object.defineProperty(target, key, r), r;
  6090. };
  6091. var BeanStub = /** @class */ (function () {
  6092. function BeanStub() {
  6093. var _this = this;
  6094. this.destroyFunctions = [];
  6095. this.destroyed = false;
  6096. this.getContext = function () { return _this.context; };
  6097. this.isAlive = function () { return !_this.destroyed; };
  6098. }
  6099. // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are
  6100. // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed
  6101. // points to a bean or component that was not properly disposed of.
  6102. // constructor() {
  6103. // setTimeout(()=> {
  6104. // if (this.isAlive()) {
  6105. // let prototype: any = Object.getPrototypeOf(this);
  6106. // const constructor: any = prototype.constructor;
  6107. // const constructorString = constructor.toString();
  6108. // const beanName = constructorString.substring(9, constructorString.indexOf("("));
  6109. // console.log('is alive ' + beanName);
  6110. // }
  6111. // }, 5000);
  6112. // }
  6113. // CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean
  6114. BeanStub.prototype.getFrameworkOverrides = function () {
  6115. return this.frameworkOverrides;
  6116. };
  6117. BeanStub.prototype.destroy = function () {
  6118. // let prototype: any = Object.getPrototypeOf(this);
  6119. // const constructor: any = prototype.constructor;
  6120. // const constructorString = constructor.toString();
  6121. // const beanName = constructorString.substring(9, constructorString.indexOf("("));
  6122. this.destroyFunctions.forEach(function (func) { return func(); });
  6123. this.destroyFunctions.length = 0;
  6124. this.destroyed = true;
  6125. this.dispatchEvent({ type: BeanStub.EVENT_DESTROYED });
  6126. };
  6127. BeanStub.prototype.addEventListener = function (eventType, listener) {
  6128. if (!this.localEventService) {
  6129. this.localEventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
  6130. }
  6131. this.localEventService.addEventListener(eventType, listener);
  6132. };
  6133. BeanStub.prototype.removeEventListener = function (eventType, listener) {
  6134. if (this.localEventService) {
  6135. this.localEventService.removeEventListener(eventType, listener);
  6136. }
  6137. };
  6138. BeanStub.prototype.dispatchEventAsync = function (event) {
  6139. var _this = this;
  6140. window.setTimeout(function () { return _this.dispatchEvent(event); }, 0);
  6141. };
  6142. BeanStub.prototype.dispatchEvent = function (event) {
  6143. if (this.localEventService) {
  6144. this.localEventService.dispatchEvent(event);
  6145. }
  6146. };
  6147. BeanStub.prototype.addManagedListener = function (object, event, listener) {
  6148. var _this = this;
  6149. if (this.destroyed) {
  6150. return;
  6151. }
  6152. if (object instanceof HTMLElement) {
  6153. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addSafePassiveEventListener(this.getFrameworkOverrides(), object, event, listener);
  6154. }
  6155. else {
  6156. object.addEventListener(event, listener);
  6157. }
  6158. var destroyFunc = function () {
  6159. object.removeEventListener(event, listener);
  6160. _this.destroyFunctions = _this.destroyFunctions.filter(function (fn) { return fn !== destroyFunc; });
  6161. return null;
  6162. };
  6163. this.destroyFunctions.push(destroyFunc);
  6164. return destroyFunc;
  6165. };
  6166. BeanStub.prototype.addDestroyFunc = function (func) {
  6167. // if we are already destroyed, we execute the func now
  6168. if (this.isAlive()) {
  6169. this.destroyFunctions.push(func);
  6170. }
  6171. else {
  6172. func();
  6173. }
  6174. };
  6175. BeanStub.prototype.createManagedBean = function (bean, context) {
  6176. var res = this.createBean(bean, context);
  6177. this.addDestroyFunc(this.destroyBean.bind(this, bean, context));
  6178. return res;
  6179. };
  6180. BeanStub.prototype.createBean = function (bean, context, afterPreCreateCallback) {
  6181. return (context || this.getContext()).createBean(bean, afterPreCreateCallback);
  6182. };
  6183. BeanStub.prototype.destroyBean = function (bean, context) {
  6184. return (context || this.getContext()).destroyBean(bean);
  6185. };
  6186. BeanStub.prototype.destroyBeans = function (beans, context) {
  6187. var _this = this;
  6188. if (beans) {
  6189. beans.forEach(function (bean) { return _this.destroyBean(bean, context); });
  6190. }
  6191. return [];
  6192. };
  6193. BeanStub.EVENT_DESTROYED = 'destroyed';
  6194. __decorate([
  6195. Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('frameworkOverrides')
  6196. ], BeanStub.prototype, "frameworkOverrides", void 0);
  6197. __decorate([
  6198. Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('context')
  6199. ], BeanStub.prototype, "context", void 0);
  6200. __decorate([
  6201. Object(_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('eventService')
  6202. ], BeanStub.prototype, "eventService", void 0);
  6203. __decorate([
  6204. _context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
  6205. ], BeanStub.prototype, "destroy", null);
  6206. return BeanStub;
  6207. }());
  6208. /***/ }),
  6209. /* 42 */
  6210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6211. "use strict";
  6212. __webpack_require__.r(__webpack_exports__);
  6213. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnController", function() { return ColumnController; });
  6214. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
  6215. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
  6216. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  6217. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  6218. /* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33);
  6219. /* harmony import */ var _groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45);
  6220. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37);
  6221. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25);
  6222. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17);
  6223. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
  6224. /**
  6225. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  6226. * @version v23.2.1
  6227. * @link http://www.ag-grid.com/
  6228. * @license MIT
  6229. */
  6230. var __extends = (undefined && undefined.__extends) || (function () {
  6231. var extendStatics = function (d, b) {
  6232. extendStatics = Object.setPrototypeOf ||
  6233. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6234. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  6235. return extendStatics(d, b);
  6236. };
  6237. return function (d, b) {
  6238. extendStatics(d, b);
  6239. function __() { this.constructor = d; }
  6240. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6241. };
  6242. })();
  6243. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  6244. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  6245. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  6246. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  6247. return c > 3 && r && Object.defineProperty(target, key, r), r;
  6248. };
  6249. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  6250. return function (target, key) { decorator(target, key, paramIndex); }
  6251. };
  6252. var ColumnController = /** @class */ (function (_super) {
  6253. __extends(ColumnController, _super);
  6254. function ColumnController() {
  6255. var _this = _super !== null && _super.apply(this, arguments) || this;
  6256. // header row count, based on user provided columns
  6257. _this.primaryHeaderRowCount = 0;
  6258. _this.secondaryHeaderRowCount = 0;
  6259. _this.secondaryColumnsPresent = false;
  6260. // header row count, either above, or based on pivoting if we are pivoting
  6261. _this.gridHeaderRowCount = 0;
  6262. // these are the lists used by the rowRenderer to render nodes. almost the leaf nodes of the above
  6263. // displayed trees, however it also takes into account if the groups are open or not.
  6264. _this.displayedLeftColumns = [];
  6265. _this.displayedRightColumns = [];
  6266. _this.displayedCenterColumns = [];
  6267. // all three lists above combined
  6268. _this.allDisplayedColumns = [];
  6269. // same as above, except trimmed down to only columns within the viewport
  6270. _this.allDisplayedVirtualColumns = [];
  6271. _this.allDisplayedCenterVirtualColumns = [];
  6272. _this.rowGroupColumns = [];
  6273. _this.valueColumns = [];
  6274. _this.pivotColumns = [];
  6275. _this.ready = false;
  6276. _this.autoGroupsNeedBuilding = false;
  6277. _this.forceRecreateAutoGroups = false;
  6278. _this.pivotMode = false;
  6279. _this.bodyWidth = 0;
  6280. _this.leftWidth = 0;
  6281. _this.rightWidth = 0;
  6282. _this.bodyWidthDirty = true;
  6283. _this.flexActive = false;
  6284. return _this;
  6285. }
  6286. ColumnController.prototype.init = function () {
  6287. this.suppressColumnVirtualisation = this.gridOptionsWrapper.isSuppressColumnVirtualisation();
  6288. var pivotMode = this.gridOptionsWrapper.isPivotMode();
  6289. if (this.isPivotSettingAllowed(pivotMode)) {
  6290. this.pivotMode = pivotMode;
  6291. }
  6292. this.usingTreeData = this.gridOptionsWrapper.isTreeData();
  6293. this.addManagedListener(this.gridOptionsWrapper, 'autoGroupColumnDef', this.onAutoGroupColumnDefChanged.bind(this));
  6294. };
  6295. ColumnController.prototype.onAutoGroupColumnDefChanged = function () {
  6296. this.autoGroupsNeedBuilding = true;
  6297. this.forceRecreateAutoGroups = true;
  6298. this.updateGridColumns();
  6299. this.updateDisplayedColumns('gridOptionsChanged');
  6300. };
  6301. ColumnController.prototype.setColumnDefs = function (columnDefs, source) {
  6302. if (source === void 0) { source = 'api'; }
  6303. var colsPreviouslyExisted = !!this.columnDefs;
  6304. this.columnDefs = columnDefs;
  6305. // always invalidate cache on changing columns, as the column id's for the new columns
  6306. // could overlap with the old id's, so the cache would return old values for new columns.
  6307. this.valueCache.expire();
  6308. // NOTE ==================
  6309. // we should be destroying the existing columns and groups if they exist, for example, the original column
  6310. // group adds a listener to the columns, it should be also removing the listeners
  6311. this.autoGroupsNeedBuilding = true;
  6312. var oldPrimaryColumns = this.primaryColumns;
  6313. var balancedTreeResult = this.columnFactory.createColumnTree(columnDefs, true, oldPrimaryColumns);
  6314. this.primaryColumnTree = balancedTreeResult.columnTree;
  6315. this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;
  6316. this.primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);
  6317. this.extractRowGroupColumns(source, oldPrimaryColumns);
  6318. this.extractPivotColumns(source, oldPrimaryColumns);
  6319. this.createValueColumns(source, oldPrimaryColumns);
  6320. this.ready = true;
  6321. this.updateGridColumns();
  6322. this.updateDisplayedColumns(source);
  6323. this.checkDisplayedVirtualColumns();
  6324. if (this.gridOptionsWrapper.isImmutableColumns() && colsPreviouslyExisted) {
  6325. this.resetColumnState(true, source);
  6326. }
  6327. var eventEverythingChanged = {
  6328. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED,
  6329. api: this.gridApi,
  6330. columnApi: this.columnApi,
  6331. source: source
  6332. };
  6333. this.eventService.dispatchEvent(eventEverythingChanged);
  6334. var newColumnsLoadedEvent = {
  6335. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED,
  6336. api: this.gridApi,
  6337. columnApi: this.columnApi
  6338. };
  6339. this.eventService.dispatchEvent(newColumnsLoadedEvent);
  6340. this.flexActive = this.getDisplayedCenterColumns().some(function (col) { return !!col.getFlex(); });
  6341. };
  6342. ColumnController.prototype.isAutoRowHeightActive = function () {
  6343. return this.autoRowHeightColumns && this.autoRowHeightColumns.length > 0;
  6344. };
  6345. ColumnController.prototype.getAllAutoRowHeightCols = function () {
  6346. return this.autoRowHeightColumns;
  6347. };
  6348. ColumnController.prototype.setVirtualViewportLeftAndRight = function () {
  6349. if (this.gridOptionsWrapper.isEnableRtl()) {
  6350. this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth;
  6351. this.viewportRight = this.bodyWidth - this.scrollPosition;
  6352. }
  6353. else {
  6354. this.viewportLeft = this.scrollPosition;
  6355. this.viewportRight = this.scrollWidth + this.scrollPosition;
  6356. }
  6357. };
  6358. // used by clipboard service, to know what columns to paste into
  6359. ColumnController.prototype.getDisplayedColumnsStartingAt = function (column) {
  6360. var currentColumn = column;
  6361. var columns = [];
  6362. while (currentColumn != null) {
  6363. columns.push(currentColumn);
  6364. currentColumn = this.getDisplayedColAfter(currentColumn);
  6365. }
  6366. return columns;
  6367. };
  6368. // checks what columns are currently displayed due to column virtualisation. fires an event
  6369. // if the list of columns has changed.
  6370. // + setColumnWidth(), setVirtualViewportPosition(), setColumnDefs(), sizeColumnsToFit()
  6371. ColumnController.prototype.checkDisplayedVirtualColumns = function () {
  6372. // check displayCenterColumnTree exists first, as it won't exist when grid is initialising
  6373. if (this.displayedCenterColumns == null) {
  6374. return;
  6375. }
  6376. var hashBefore = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#');
  6377. this.updateVirtualSets();
  6378. var hashAfter = this.allDisplayedVirtualColumns.map(function (column) { return column.getId(); }).join('#');
  6379. if (hashBefore !== hashAfter) {
  6380. var event_1 = {
  6381. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED,
  6382. api: this.gridApi,
  6383. columnApi: this.columnApi
  6384. };
  6385. this.eventService.dispatchEvent(event_1);
  6386. }
  6387. };
  6388. ColumnController.prototype.setVirtualViewportPosition = function (scrollWidth, scrollPosition) {
  6389. if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) {
  6390. this.scrollWidth = scrollWidth;
  6391. this.scrollPosition = scrollPosition;
  6392. // we need to call setVirtualViewportLeftAndRight() at least once after the body width changes,
  6393. // as the viewport can stay the same, but in RTL, if body width changes, we need to work out the
  6394. // virtual columns again
  6395. this.bodyWidthDirty = true;
  6396. this.setVirtualViewportLeftAndRight();
  6397. if (this.ready) {
  6398. this.checkDisplayedVirtualColumns();
  6399. }
  6400. }
  6401. };
  6402. ColumnController.prototype.isPivotMode = function () {
  6403. return this.pivotMode;
  6404. };
  6405. ColumnController.prototype.isPivotSettingAllowed = function (pivot) {
  6406. if (pivot && this.gridOptionsWrapper.isTreeData()) {
  6407. console.warn("ag-Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'");
  6408. return false;
  6409. }
  6410. return true;
  6411. };
  6412. ColumnController.prototype.setPivotMode = function (pivotMode, source) {
  6413. if (source === void 0) { source = 'api'; }
  6414. if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) {
  6415. return;
  6416. }
  6417. this.pivotMode = pivotMode;
  6418. // we need to update grid columns to cover the scenario where user has groupSuppressAutoColumn=true, as
  6419. // this means we don't use auto group column UNLESS we are in pivot mode (it's mandatory in pivot mode),
  6420. // so need to updateGridColumn() to check it autoGroupCol needs to be added / removed
  6421. this.autoGroupsNeedBuilding = true;
  6422. this.updateGridColumns();
  6423. this.updateDisplayedColumns(source);
  6424. var event = {
  6425. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED,
  6426. api: this.gridApi,
  6427. columnApi: this.columnApi
  6428. };
  6429. this.eventService.dispatchEvent(event);
  6430. };
  6431. ColumnController.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) {
  6432. if (!this.secondaryColumnsPresent || !this.secondaryColumns) {
  6433. return null;
  6434. }
  6435. var valueColumnToFind = this.getPrimaryColumn(valueColKey);
  6436. var foundColumn = null;
  6437. this.secondaryColumns.forEach(function (column) {
  6438. var thisPivotKeys = column.getColDef().pivotKeys;
  6439. var pivotValueColumn = column.getColDef().pivotValueColumn;
  6440. var pivotKeyMatches = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["areEqual"])(thisPivotKeys, pivotKeys);
  6441. var pivotValueMatches = pivotValueColumn === valueColumnToFind;
  6442. if (pivotKeyMatches && pivotValueMatches) {
  6443. foundColumn = column;
  6444. }
  6445. });
  6446. return foundColumn;
  6447. };
  6448. ColumnController.prototype.setBeans = function (loggerFactory) {
  6449. this.logger = loggerFactory.create('ColumnController');
  6450. };
  6451. ColumnController.prototype.setFirstRightAndLastLeftPinned = function (source) {
  6452. var lastLeft;
  6453. var firstRight;
  6454. if (this.gridOptionsWrapper.isEnableRtl()) {
  6455. lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[0] : null;
  6456. firstRight = this.displayedRightColumns ? _utils__WEBPACK_IMPORTED_MODULE_9__["_"].last(this.displayedRightColumns) : null;
  6457. }
  6458. else {
  6459. lastLeft = this.displayedLeftColumns ? _utils__WEBPACK_IMPORTED_MODULE_9__["_"].last(this.displayedLeftColumns) : null;
  6460. firstRight = this.displayedRightColumns ? this.displayedRightColumns[0] : null;
  6461. }
  6462. this.gridColumns.forEach(function (column) {
  6463. column.setLastLeftPinned(column === lastLeft, source);
  6464. column.setFirstRightPinned(column === firstRight, source);
  6465. });
  6466. };
  6467. ColumnController.prototype.autoSizeColumns = function (keys, skipHeader, source) {
  6468. // because of column virtualisation, we can only do this function on columns that are
  6469. // actually rendered, as non-rendered columns (outside the viewport and not rendered
  6470. // due to column virtualisation) are not present. this can result in all rendered columns
  6471. // getting narrowed, which in turn introduces more rendered columns on the RHS which
  6472. // did not get autosized in the original run, leaving the visible grid with columns on
  6473. // the LHS sized, but RHS no. so we keep looping through the visible columns until
  6474. // no more cols are available (rendered) to be resized
  6475. var _this = this;
  6476. if (source === void 0) { source = "api"; }
  6477. // we autosize after animation frames finish in case any cell renderers need to complete first. this can
  6478. // happen eg if client code is calling api.autoSizeAllColumns() straight after grid is initialised, but grid
  6479. // hasn't fully drawn out all the cells yet (due to cell renderers in animation frames).
  6480. this.animationFrameService.flushAllFrames();
  6481. // keep track of which cols we have resized in here
  6482. var columnsAutosized = [];
  6483. // initialise with anything except 0 so that while loop executes at least once
  6484. var changesThisTimeAround = -1;
  6485. if (skipHeader == null) {
  6486. skipHeader = this.gridOptionsWrapper.isSkipHeaderOnAutoSize();
  6487. }
  6488. while (changesThisTimeAround !== 0) {
  6489. changesThisTimeAround = 0;
  6490. this.actionOnGridColumns(keys, function (column) {
  6491. // if already autosized, skip it
  6492. if (columnsAutosized.indexOf(column) >= 0) {
  6493. return false;
  6494. }
  6495. // get how wide this col should be
  6496. var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column, skipHeader);
  6497. // preferredWidth = -1 if this col is not on the screen
  6498. if (preferredWidth > 0) {
  6499. var newWidth = _this.normaliseColumnWidth(column, preferredWidth);
  6500. column.setActualWidth(newWidth, source);
  6501. columnsAutosized.push(column);
  6502. changesThisTimeAround++;
  6503. }
  6504. return true;
  6505. }, source);
  6506. }
  6507. if (columnsAutosized.length) {
  6508. var event_2 = {
  6509. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED,
  6510. columns: columnsAutosized,
  6511. column: columnsAutosized.length === 1 ? columnsAutosized[0] : null,
  6512. finished: true,
  6513. api: this.gridApi,
  6514. columnApi: this.columnApi,
  6515. source: "autosizeColumns"
  6516. };
  6517. this.eventService.dispatchEvent(event_2);
  6518. }
  6519. };
  6520. ColumnController.prototype.autoSizeColumn = function (key, skipHeader, source) {
  6521. if (source === void 0) { source = "api"; }
  6522. if (key) {
  6523. this.autoSizeColumns([key], skipHeader, source);
  6524. }
  6525. };
  6526. ColumnController.prototype.autoSizeAllColumns = function (skipHeader, source) {
  6527. if (source === void 0) { source = "api"; }
  6528. var allDisplayedColumns = this.getAllDisplayedColumns();
  6529. this.autoSizeColumns(allDisplayedColumns, skipHeader, source);
  6530. };
  6531. ColumnController.prototype.getColumnsFromTree = function (rootColumns) {
  6532. var result = [];
  6533. var recursiveFindColumns = function (childColumns) {
  6534. for (var i = 0; i < childColumns.length; i++) {
  6535. var child = childColumns[i];
  6536. if (child instanceof _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
  6537. result.push(child);
  6538. }
  6539. else if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
  6540. recursiveFindColumns(child.getChildren());
  6541. }
  6542. }
  6543. };
  6544. recursiveFindColumns(rootColumns);
  6545. return result;
  6546. };
  6547. ColumnController.prototype.getAllDisplayedColumnGroups = function () {
  6548. if (this.displayedLeftColumnTree && this.displayedRightColumnTree && this.displayedCentreColumnTree) {
  6549. return this.displayedLeftColumnTree
  6550. .concat(this.displayedCentreColumnTree)
  6551. .concat(this.displayedRightColumnTree);
  6552. }
  6553. return null;
  6554. };
  6555. // + columnSelectPanel
  6556. ColumnController.prototype.getPrimaryColumnTree = function () {
  6557. return this.primaryColumnTree;
  6558. };
  6559. // + gridPanel -> for resizing the body and setting top margin
  6560. ColumnController.prototype.getHeaderRowCount = function () {
  6561. return this.gridHeaderRowCount;
  6562. };
  6563. // + headerRenderer -> setting pinned body width
  6564. ColumnController.prototype.getLeftDisplayedColumnGroups = function () {
  6565. return this.displayedLeftColumnTree;
  6566. };
  6567. // + headerRenderer -> setting pinned body width
  6568. ColumnController.prototype.getRightDisplayedColumnGroups = function () {
  6569. return this.displayedRightColumnTree;
  6570. };
  6571. // + headerRenderer -> setting pinned body width
  6572. ColumnController.prototype.getCenterDisplayedColumnGroups = function () {
  6573. return this.displayedCentreColumnTree;
  6574. };
  6575. ColumnController.prototype.getDisplayedColumnGroups = function (type) {
  6576. switch (type) {
  6577. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
  6578. return this.getLeftDisplayedColumnGroups();
  6579. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT:
  6580. return this.getRightDisplayedColumnGroups();
  6581. default:
  6582. return this.getCenterDisplayedColumnGroups();
  6583. }
  6584. };
  6585. // gridPanel -> ensureColumnVisible
  6586. ColumnController.prototype.isColumnDisplayed = function (column) {
  6587. return this.getAllDisplayedColumns().indexOf(column) >= 0;
  6588. };
  6589. // + csvCreator
  6590. ColumnController.prototype.getAllDisplayedColumns = function () {
  6591. return this.allDisplayedColumns;
  6592. };
  6593. ColumnController.prototype.getAllDisplayedVirtualColumns = function () {
  6594. return this.allDisplayedVirtualColumns;
  6595. };
  6596. ColumnController.prototype.getDisplayedLeftColumnsForRow = function (rowNode) {
  6597. if (!this.colSpanActive) {
  6598. return this.displayedLeftColumns;
  6599. }
  6600. return this.getDisplayedColumnsForRow(rowNode, this.displayedLeftColumns);
  6601. };
  6602. ColumnController.prototype.getDisplayedRightColumnsForRow = function (rowNode) {
  6603. if (!this.colSpanActive) {
  6604. return this.displayedRightColumns;
  6605. }
  6606. return this.getDisplayedColumnsForRow(rowNode, this.displayedRightColumns);
  6607. };
  6608. ColumnController.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {
  6609. var result = [];
  6610. var lastConsideredCol = null;
  6611. var _loop_1 = function (i) {
  6612. var col = displayedColumns[i];
  6613. var maxAllowedColSpan = displayedColumns.length - i;
  6614. var colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);
  6615. var columnsToCheckFilter = [col];
  6616. if (colSpan > 1) {
  6617. var colsToRemove = colSpan - 1;
  6618. for (var j = 1; j <= colsToRemove; j++) {
  6619. columnsToCheckFilter.push(displayedColumns[i + j]);
  6620. }
  6621. i += colsToRemove;
  6622. }
  6623. // see which cols we should take out for column virtualisation
  6624. var filterPasses;
  6625. if (filterCallback) {
  6626. // if user provided a callback, means some columns may not be in the viewport.
  6627. // the user will NOT provide a callback if we are talking about pinned areas,
  6628. // as pinned areas have no horizontal scroll and do not virtualise the columns.
  6629. // if lots of columns, that means column spanning, and we set filterPasses = true
  6630. // if one or more of the columns spanned pass the filter.
  6631. filterPasses = false;
  6632. columnsToCheckFilter.forEach(function (colForFilter) {
  6633. if (filterCallback(colForFilter)) {
  6634. filterPasses = true;
  6635. }
  6636. });
  6637. }
  6638. else {
  6639. filterPasses = true;
  6640. }
  6641. if (filterPasses) {
  6642. if (result.length === 0 && lastConsideredCol) {
  6643. var gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;
  6644. if (gapBeforeColumn) {
  6645. result.push(lastConsideredCol);
  6646. }
  6647. }
  6648. result.push(col);
  6649. }
  6650. lastConsideredCol = col;
  6651. out_i_1 = i;
  6652. };
  6653. var out_i_1;
  6654. for (var i = 0; i < displayedColumns.length; i++) {
  6655. _loop_1(i);
  6656. i = out_i_1;
  6657. }
  6658. return result;
  6659. };
  6660. // + rowRenderer
  6661. // if we are not column spanning, this just returns back the virtual centre columns,
  6662. // however if we are column spanning, then different rows can have different virtual
  6663. // columns, so we have to work out the list for each individual row.
  6664. ColumnController.prototype.getAllDisplayedCenterVirtualColumnsForRow = function (rowNode) {
  6665. var _this = this;
  6666. if (!this.colSpanActive) {
  6667. return this.allDisplayedCenterVirtualColumns;
  6668. }
  6669. var emptySpaceBeforeColumn = function (col) { return col.getLeft() > _this.viewportLeft; };
  6670. // if doing column virtualisation, then we filter based on the viewport.
  6671. var filterCallback = this.suppressColumnVirtualisation ? null : this.isColumnInViewport.bind(this);
  6672. return this.getDisplayedColumnsForRow(rowNode, this.displayedCenterColumns, filterCallback, emptySpaceBeforeColumn);
  6673. };
  6674. ColumnController.prototype.isColumnInViewport = function (col) {
  6675. var columnLeft = col.getLeft();
  6676. var columnRight = col.getLeft() + col.getActualWidth();
  6677. // adding 200 for buffer size, so some cols off viewport are rendered.
  6678. // this helps horizontal scrolling so user rarely sees white space (unless
  6679. // they scroll horizontally fast). however we are conservative, as the more
  6680. // buffer the slower the vertical redraw speed
  6681. var leftBounds = this.viewportLeft - 200;
  6682. var rightBounds = this.viewportRight + 200;
  6683. var columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;
  6684. var columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;
  6685. return !columnToMuchLeft && !columnToMuchRight;
  6686. };
  6687. // used by:
  6688. // + angularGrid -> setting pinned body width
  6689. // note: this should be cached
  6690. ColumnController.prototype.getPinnedLeftContainerWidth = function () {
  6691. return this.getWidthOfColsInList(this.displayedLeftColumns);
  6692. };
  6693. // note: this should be cached
  6694. ColumnController.prototype.getPinnedRightContainerWidth = function () {
  6695. return this.getWidthOfColsInList(this.displayedRightColumns);
  6696. };
  6697. ColumnController.prototype.updatePrimaryColumnList = function (keys, masterList, actionIsAdd, columnCallback, eventType, source) {
  6698. var _this = this;
  6699. if (source === void 0) { source = "api"; }
  6700. if (!keys || _utils__WEBPACK_IMPORTED_MODULE_9__["_"].missingOrEmpty(keys)) {
  6701. return;
  6702. }
  6703. var atLeastOne = false;
  6704. keys.forEach(function (key) {
  6705. var columnToAdd = _this.getPrimaryColumn(key);
  6706. if (!columnToAdd) {
  6707. return;
  6708. }
  6709. if (actionIsAdd) {
  6710. if (masterList.indexOf(columnToAdd) >= 0) {
  6711. return;
  6712. }
  6713. masterList.push(columnToAdd);
  6714. }
  6715. else {
  6716. if (masterList.indexOf(columnToAdd) < 0) {
  6717. return;
  6718. }
  6719. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].removeFromArray(masterList, columnToAdd);
  6720. }
  6721. columnCallback(columnToAdd);
  6722. atLeastOne = true;
  6723. });
  6724. if (!atLeastOne) {
  6725. return;
  6726. }
  6727. if (this.autoGroupsNeedBuilding) {
  6728. this.updateGridColumns();
  6729. }
  6730. this.updateDisplayedColumns(source);
  6731. var event = {
  6732. type: eventType,
  6733. columns: masterList,
  6734. column: masterList.length === 1 ? masterList[0] : null,
  6735. api: this.gridApi,
  6736. columnApi: this.columnApi,
  6737. source: source
  6738. };
  6739. this.eventService.dispatchEvent(event);
  6740. };
  6741. ColumnController.prototype.setRowGroupColumns = function (colKeys, source) {
  6742. if (source === void 0) { source = "api"; }
  6743. this.autoGroupsNeedBuilding = true;
  6744. this.setPrimaryColumnList(colKeys, this.rowGroupColumns, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.setRowGroupActive.bind(this), source);
  6745. };
  6746. ColumnController.prototype.setRowGroupActive = function (active, column, source) {
  6747. if (active === column.isRowGroupActive()) {
  6748. return;
  6749. }
  6750. column.setRowGroupActive(active, source);
  6751. if (!active && !this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()) {
  6752. column.setVisible(true, source);
  6753. }
  6754. };
  6755. ColumnController.prototype.addRowGroupColumn = function (key, source) {
  6756. if (source === void 0) { source = "api"; }
  6757. if (key) {
  6758. this.addRowGroupColumns([key], source);
  6759. }
  6760. };
  6761. ColumnController.prototype.addRowGroupColumns = function (keys, source) {
  6762. if (source === void 0) { source = "api"; }
  6763. this.autoGroupsNeedBuilding = true;
  6764. this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, source);
  6765. };
  6766. ColumnController.prototype.removeRowGroupColumns = function (keys, source) {
  6767. if (source === void 0) { source = "api"; }
  6768. this.autoGroupsNeedBuilding = true;
  6769. this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, source);
  6770. };
  6771. ColumnController.prototype.removeRowGroupColumn = function (key, source) {
  6772. if (source === void 0) { source = "api"; }
  6773. if (key) {
  6774. this.removeRowGroupColumns([key], source);
  6775. }
  6776. };
  6777. ColumnController.prototype.addPivotColumns = function (keys, source) {
  6778. if (source === void 0) { source = "api"; }
  6779. this.updatePrimaryColumnList(keys, this.pivotColumns, true, function (column) { return column.setPivotActive(true, source); }, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_CHANGED, source);
  6780. };
  6781. ColumnController.prototype.setPivotColumns = function (colKeys, source) {
  6782. if (source === void 0) { source = "api"; }
  6783. this.setPrimaryColumnList(colKeys, this.pivotColumns, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_CHANGED, function (added, column) {
  6784. column.setPivotActive(added, source);
  6785. }, source);
  6786. };
  6787. ColumnController.prototype.addPivotColumn = function (key, source) {
  6788. if (source === void 0) { source = "api"; }
  6789. this.addPivotColumns([key], source);
  6790. };
  6791. ColumnController.prototype.removePivotColumns = function (keys, source) {
  6792. if (source === void 0) { source = "api"; }
  6793. this.updatePrimaryColumnList(keys, this.pivotColumns, false, function (column) { return column.setPivotActive(false, source); }, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_CHANGED, source);
  6794. };
  6795. ColumnController.prototype.removePivotColumn = function (key, source) {
  6796. if (source === void 0) { source = "api"; }
  6797. this.removePivotColumns([key], source);
  6798. };
  6799. ColumnController.prototype.setPrimaryColumnList = function (colKeys, masterList, eventName, columnCallback, source) {
  6800. var _this = this;
  6801. masterList.length = 0;
  6802. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(colKeys)) {
  6803. colKeys.forEach(function (key) {
  6804. var column = _this.getPrimaryColumn(key);
  6805. if (column) {
  6806. masterList.push(column);
  6807. }
  6808. });
  6809. }
  6810. this.primaryColumns.forEach(function (column) {
  6811. var added = masterList.indexOf(column) >= 0;
  6812. columnCallback(added, column);
  6813. });
  6814. if (this.autoGroupsNeedBuilding) {
  6815. this.updateGridColumns();
  6816. }
  6817. this.updateDisplayedColumns(source);
  6818. var event = {
  6819. type: eventName,
  6820. columns: masterList,
  6821. column: masterList.length === 1 ? masterList[0] : null,
  6822. api: this.gridApi,
  6823. columnApi: this.columnApi,
  6824. source: source
  6825. };
  6826. this.eventService.dispatchEvent(event);
  6827. };
  6828. ColumnController.prototype.setValueColumns = function (colKeys, source) {
  6829. if (source === void 0) { source = "api"; }
  6830. this.setPrimaryColumnList(colKeys, this.valueColumns, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED, this.setValueActive.bind(this), source);
  6831. };
  6832. ColumnController.prototype.setValueActive = function (active, column, source) {
  6833. if (active === column.isValueActive()) {
  6834. return;
  6835. }
  6836. column.setValueActive(active, source);
  6837. if (active && !column.getAggFunc()) {
  6838. var defaultAggFunc = this.aggFuncService.getDefaultAggFunc(column);
  6839. column.setAggFunc(defaultAggFunc);
  6840. }
  6841. };
  6842. ColumnController.prototype.addValueColumns = function (keys, source) {
  6843. if (source === void 0) { source = "api"; }
  6844. this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED, source);
  6845. };
  6846. ColumnController.prototype.addValueColumn = function (colKey, source) {
  6847. if (source === void 0) { source = "api"; }
  6848. if (colKey) {
  6849. this.addValueColumns([colKey], source);
  6850. }
  6851. };
  6852. ColumnController.prototype.removeValueColumn = function (colKey, source) {
  6853. if (source === void 0) { source = "api"; }
  6854. this.removeValueColumns([colKey], source);
  6855. };
  6856. ColumnController.prototype.removeValueColumns = function (keys, source) {
  6857. if (source === void 0) { source = "api"; }
  6858. this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED, source);
  6859. };
  6860. // returns the width we can set to this col, taking into consideration min and max widths
  6861. ColumnController.prototype.normaliseColumnWidth = function (column, newWidth) {
  6862. if (newWidth < column.getMinWidth()) {
  6863. newWidth = column.getMinWidth();
  6864. }
  6865. if (column.isGreaterThanMax(newWidth)) {
  6866. newWidth = column.getMaxWidth();
  6867. }
  6868. return newWidth;
  6869. };
  6870. ColumnController.prototype.getPrimaryOrGridColumn = function (key) {
  6871. var column = this.getPrimaryColumn(key);
  6872. return column || this.getGridColumn(key);
  6873. };
  6874. ColumnController.prototype.setColumnWidths = function (columnWidths, shiftKey, // @takeFromAdjacent - if user has 'shift' pressed, then pixels are taken from adjacent column
  6875. finished, // @finished - ends up in the event, tells the user if more events are to come
  6876. source) {
  6877. var _this = this;
  6878. if (source === void 0) { source = "api"; }
  6879. var sets = [];
  6880. columnWidths.forEach(function (columnWidth) {
  6881. var col = _this.getPrimaryOrGridColumn(columnWidth.key);
  6882. if (!col) {
  6883. return;
  6884. }
  6885. sets.push({
  6886. width: columnWidth.newWidth,
  6887. ratios: [1],
  6888. columns: [col]
  6889. });
  6890. // if user wants to do shift resize by default, then we invert the shift operation
  6891. var defaultIsShift = _this.gridOptionsWrapper.getColResizeDefault() === 'shift';
  6892. if (defaultIsShift) {
  6893. shiftKey = !shiftKey;
  6894. }
  6895. if (shiftKey) {
  6896. var otherCol = _this.getDisplayedColAfter(col);
  6897. if (!otherCol) {
  6898. return;
  6899. }
  6900. var widthDiff = col.getActualWidth() - columnWidth.newWidth;
  6901. var otherColWidth = otherCol.getActualWidth() + widthDiff;
  6902. sets.push({
  6903. width: otherColWidth,
  6904. ratios: [1],
  6905. columns: [otherCol]
  6906. });
  6907. }
  6908. });
  6909. if (sets.length === 0) {
  6910. return;
  6911. }
  6912. this.resizeColumnSets(sets, finished, source);
  6913. if (this.flexActive) {
  6914. this.refreshFlexedColumns();
  6915. }
  6916. };
  6917. ColumnController.prototype.checkMinAndMaxWidthsForSet = function (columnResizeSet) {
  6918. var columns = columnResizeSet.columns, width = columnResizeSet.width;
  6919. // every col has a min width, so sum them all up and see if we have enough room
  6920. // for all the min widths
  6921. var minWidthAccumulated = 0;
  6922. var maxWidthAccumulated = 0;
  6923. var maxWidthActive = true;
  6924. columns.forEach(function (col) {
  6925. minWidthAccumulated += col.getMinWidth();
  6926. if (col.getMaxWidth() > 0) {
  6927. maxWidthAccumulated += col.getMaxWidth();
  6928. }
  6929. else {
  6930. // if at least one columns has no max width, it means the group of columns
  6931. // then has no max width, as at least one column can take as much width as possible
  6932. maxWidthActive = false;
  6933. }
  6934. });
  6935. var minWidthPasses = width >= minWidthAccumulated;
  6936. var maxWidthPasses = !maxWidthActive || (width <= maxWidthAccumulated);
  6937. return minWidthPasses && maxWidthPasses;
  6938. };
  6939. // method takes sets of columns and resizes them. either all sets will be resized, or nothing
  6940. // be resized. this is used for example when user tries to resize a group and holds shift key,
  6941. // then both the current group (grows), and the adjacent group (shrinks), will get resized,
  6942. // so that's two sets for this method.
  6943. ColumnController.prototype.resizeColumnSets = function (resizeSets, finished, source) {
  6944. var passMinMaxCheck = !resizeSets || resizeSets.every(this.checkMinAndMaxWidthsForSet.bind(this));
  6945. if (!passMinMaxCheck) {
  6946. // even though we are not going to resize beyond min/max size, we still need to raise event when finished
  6947. if (finished) {
  6948. var columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;
  6949. var event_3 = {
  6950. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED,
  6951. columns: columns,
  6952. column: columns && columns.length === 1 ? columns[0] : null,
  6953. finished: finished,
  6954. api: this.gridApi,
  6955. columnApi: this.columnApi,
  6956. source: source
  6957. };
  6958. this.eventService.dispatchEvent(event_3);
  6959. }
  6960. return; // don't resize!
  6961. }
  6962. var changedCols = [];
  6963. var allCols = [];
  6964. resizeSets.forEach(function (set) {
  6965. var width = set.width, columns = set.columns, ratios = set.ratios;
  6966. // keep track of pixels used, and last column gets the remaining,
  6967. // to cater for rounding errors, and min width adjustments
  6968. var newWidths = {};
  6969. var finishedCols = {};
  6970. columns.forEach(function (col) { return allCols.push(col); });
  6971. // the loop below goes through each col. if a col exceeds it's min/max width,
  6972. // it then gets set to its min/max width and the column is removed marked as 'finished'
  6973. // and the calculation is done again leaving this column out. take for example columns
  6974. // {A, width: 50, maxWidth: 100}
  6975. // {B, width: 50}
  6976. // {C, width: 50}
  6977. // and then the set is set to width 600 - on the first pass the grid tries to set each column
  6978. // to 200. it checks A and sees 200 > 100 and so sets the width to 100. col A is then marked
  6979. // as 'finished' and the calculation is done again with the remaining cols B and C, which end up
  6980. // splitting the remaining 500 pixels.
  6981. var finishedColsGrew = true;
  6982. var loopCount = 0;
  6983. var _loop_2 = function () {
  6984. loopCount++;
  6985. if (loopCount > 1000) {
  6986. // this should never happen, but in the future, someone might introduce a bug here,
  6987. // so we stop the browser from hanging and report bug properly
  6988. console.error('ag-Grid: infinite loop in resizeColumnSets');
  6989. return "break";
  6990. }
  6991. finishedColsGrew = false;
  6992. var subsetCols = [];
  6993. var subsetRatios = [];
  6994. var subsetRatioTotal = 0;
  6995. var pixelsToDistribute = width;
  6996. columns.forEach(function (col, index) {
  6997. var thisColFinished = finishedCols[col.getId()];
  6998. if (thisColFinished) {
  6999. pixelsToDistribute -= newWidths[col.getId()];
  7000. }
  7001. else {
  7002. subsetCols.push(col);
  7003. var ratioThisCol = ratios[index];
  7004. subsetRatioTotal += ratioThisCol;
  7005. subsetRatios.push(ratioThisCol);
  7006. }
  7007. });
  7008. // because we are not using all of the ratios (cols can be missing),
  7009. // we scale the ratio. if all columns are included, then subsetRatioTotal=1,
  7010. // and so the ratioScale will be 1.
  7011. var ratioScale = 1 / subsetRatioTotal;
  7012. subsetCols.forEach(function (col, index) {
  7013. var lastCol = index === (subsetCols.length - 1);
  7014. var colNewWidth;
  7015. if (lastCol) {
  7016. colNewWidth = pixelsToDistribute;
  7017. }
  7018. else {
  7019. colNewWidth = Math.round(ratios[index] * width * ratioScale);
  7020. pixelsToDistribute -= colNewWidth;
  7021. }
  7022. if (colNewWidth < col.getMinWidth()) {
  7023. colNewWidth = col.getMinWidth();
  7024. finishedCols[col.getId()] = true;
  7025. finishedColsGrew = true;
  7026. }
  7027. else if (col.getMaxWidth() > 0 && colNewWidth > col.getMaxWidth()) {
  7028. colNewWidth = col.getMaxWidth();
  7029. finishedCols[col.getId()] = true;
  7030. finishedColsGrew = true;
  7031. }
  7032. newWidths[col.getId()] = colNewWidth;
  7033. });
  7034. };
  7035. while (finishedColsGrew) {
  7036. var state_1 = _loop_2();
  7037. if (state_1 === "break")
  7038. break;
  7039. }
  7040. columns.forEach(function (col) {
  7041. var newWidth = newWidths[col.getId()];
  7042. if (col.getActualWidth() !== newWidth) {
  7043. col.setActualWidth(newWidth, source);
  7044. changedCols.push(col);
  7045. }
  7046. });
  7047. });
  7048. // if no cols changed, then no need to update more or send event.
  7049. var atLeastOneColChanged = changedCols.length > 0;
  7050. if (atLeastOneColChanged) {
  7051. this.setLeftValues(source);
  7052. this.updateBodyWidths();
  7053. this.checkDisplayedVirtualColumns();
  7054. }
  7055. // check for change first, to avoid unnecessary firing of events
  7056. // however we always fire 'finished' events. this is important
  7057. // when groups are resized, as if the group is changing slowly,
  7058. // eg 1 pixel at a time, then each change will fire change events
  7059. // in all the columns in the group, but only one with get the pixel.
  7060. if (atLeastOneColChanged || finished) {
  7061. var event_4 = {
  7062. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED,
  7063. columns: allCols,
  7064. column: allCols.length === 1 ? allCols[0] : null,
  7065. finished: finished,
  7066. api: this.gridApi,
  7067. columnApi: this.columnApi,
  7068. source: source
  7069. };
  7070. this.eventService.dispatchEvent(event_4);
  7071. }
  7072. };
  7073. ColumnController.prototype.setColumnAggFunc = function (column, aggFunc, source) {
  7074. if (source === void 0) { source = "api"; }
  7075. if (!column) {
  7076. return;
  7077. }
  7078. column.setAggFunc(aggFunc);
  7079. var event = {
  7080. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED,
  7081. columns: [column],
  7082. column: column,
  7083. api: this.gridApi,
  7084. columnApi: this.columnApi,
  7085. source: source
  7086. };
  7087. this.eventService.dispatchEvent(event);
  7088. };
  7089. ColumnController.prototype.moveRowGroupColumn = function (fromIndex, toIndex, source) {
  7090. if (source === void 0) { source = "api"; }
  7091. var column = this.rowGroupColumns[fromIndex];
  7092. this.rowGroupColumns.splice(fromIndex, 1);
  7093. this.rowGroupColumns.splice(toIndex, 0, column);
  7094. var event = {
  7095. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED,
  7096. columns: this.rowGroupColumns,
  7097. column: this.rowGroupColumns.length === 1 ? this.rowGroupColumns[0] : null,
  7098. api: this.gridApi,
  7099. columnApi: this.columnApi,
  7100. source: source
  7101. };
  7102. this.eventService.dispatchEvent(event);
  7103. };
  7104. ColumnController.prototype.moveColumns = function (columnsToMoveKeys, toIndex, source) {
  7105. if (source === void 0) { source = "api"; }
  7106. this.columnAnimationService.start();
  7107. if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {
  7108. console.warn('ag-Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);
  7109. console.warn('ag-Grid: remember that you should not count the moving columns when calculating the new index');
  7110. return;
  7111. }
  7112. // we want to pull all the columns out first and put them into an ordered list
  7113. var columnsToMove = this.getGridColumns(columnsToMoveKeys);
  7114. var failedRules = !this.doesMovePassRules(columnsToMove, toIndex);
  7115. if (failedRules) {
  7116. return;
  7117. }
  7118. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].moveInArray(this.gridColumns, columnsToMove, toIndex);
  7119. this.updateDisplayedColumns(source);
  7120. var event = {
  7121. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_MOVED,
  7122. columns: columnsToMove,
  7123. column: columnsToMove.length === 1 ? columnsToMove[0] : null,
  7124. toIndex: toIndex,
  7125. api: this.gridApi,
  7126. columnApi: this.columnApi,
  7127. source: source
  7128. };
  7129. this.eventService.dispatchEvent(event);
  7130. this.columnAnimationService.finish();
  7131. };
  7132. ColumnController.prototype.doesMovePassRules = function (columnsToMove, toIndex) {
  7133. // make a copy of what the grid columns would look like after the move
  7134. var proposedColumnOrder = this.gridColumns.slice();
  7135. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].moveInArray(proposedColumnOrder, columnsToMove, toIndex);
  7136. // then check that the new proposed order of the columns passes all rules
  7137. if (!this.doesMovePassMarryChildren(proposedColumnOrder)) {
  7138. return false;
  7139. }
  7140. if (!this.doesMovePassLockedPositions(proposedColumnOrder)) {
  7141. return false;
  7142. }
  7143. return true;
  7144. };
  7145. ColumnController.prototype.doesMovePassLockedPositions = function (proposedColumnOrder) {
  7146. var foundNonLocked = false;
  7147. var rulePassed = true;
  7148. // go though the cols, see if any non-locked appear before any locked
  7149. proposedColumnOrder.forEach(function (col) {
  7150. if (col.getColDef().lockPosition) {
  7151. if (foundNonLocked) {
  7152. rulePassed = false;
  7153. }
  7154. }
  7155. else {
  7156. foundNonLocked = true;
  7157. }
  7158. });
  7159. return rulePassed;
  7160. };
  7161. ColumnController.prototype.doesMovePassMarryChildren = function (allColumnsCopy) {
  7162. var rulePassed = true;
  7163. this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (child) {
  7164. if (!(child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"])) {
  7165. return;
  7166. }
  7167. var columnGroup = child;
  7168. var marryChildren = columnGroup.getColGroupDef() && columnGroup.getColGroupDef().marryChildren;
  7169. if (!marryChildren) {
  7170. return;
  7171. }
  7172. var newIndexes = [];
  7173. columnGroup.getLeafColumns().forEach(function (col) {
  7174. var newColIndex = allColumnsCopy.indexOf(col);
  7175. newIndexes.push(newColIndex);
  7176. });
  7177. var maxIndex = Math.max.apply(Math, newIndexes);
  7178. var minIndex = Math.min.apply(Math, newIndexes);
  7179. // spread is how far the first column in this group is away from the last column
  7180. var spread = maxIndex - minIndex;
  7181. var maxSpread = columnGroup.getLeafColumns().length - 1;
  7182. // if the columns
  7183. if (spread > maxSpread) {
  7184. rulePassed = false;
  7185. }
  7186. // console.log(`maxIndex = ${maxIndex}, minIndex = ${minIndex}, spread = ${spread}, maxSpread = ${maxSpread}, fail = ${spread > (count-1)}`)
  7187. // console.log(allColumnsCopy.map( col => col.getColDef().field).join(','));
  7188. });
  7189. return rulePassed;
  7190. };
  7191. ColumnController.prototype.moveColumn = function (key, toIndex, source) {
  7192. if (source === void 0) { source = "api"; }
  7193. this.moveColumns([key], toIndex, source);
  7194. };
  7195. ColumnController.prototype.moveColumnByIndex = function (fromIndex, toIndex, source) {
  7196. if (source === void 0) { source = "api"; }
  7197. var column = this.gridColumns[fromIndex];
  7198. this.moveColumn(column, toIndex, source);
  7199. };
  7200. // used by:
  7201. // + angularGrid -> for setting body width
  7202. // + rowController -> setting main row widths (when inserting and resizing)
  7203. // need to cache this
  7204. ColumnController.prototype.getBodyContainerWidth = function () {
  7205. return this.bodyWidth;
  7206. };
  7207. ColumnController.prototype.getContainerWidth = function (pinned) {
  7208. switch (pinned) {
  7209. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
  7210. return this.leftWidth;
  7211. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT:
  7212. return this.rightWidth;
  7213. default:
  7214. return this.bodyWidth;
  7215. }
  7216. };
  7217. // after setColumnWidth or updateGroupsAndDisplayedColumns
  7218. ColumnController.prototype.updateBodyWidths = function () {
  7219. var newBodyWidth = this.getWidthOfColsInList(this.displayedCenterColumns);
  7220. var newLeftWidth = this.getWidthOfColsInList(this.displayedLeftColumns);
  7221. var newRightWidth = this.getWidthOfColsInList(this.displayedRightColumns);
  7222. // this is used by virtual col calculation, for RTL only, as a change to body width can impact displayed
  7223. // columns, due to RTL inverting the y coordinates
  7224. this.bodyWidthDirty = this.bodyWidth !== newBodyWidth;
  7225. var atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;
  7226. if (atLeastOneChanged) {
  7227. this.bodyWidth = newBodyWidth;
  7228. this.leftWidth = newLeftWidth;
  7229. this.rightWidth = newRightWidth;
  7230. // when this fires, it is picked up by the gridPanel, which ends up in
  7231. // gridPanel calling setWidthAndScrollPosition(), which in turn calls setVirtualViewportPosition()
  7232. var event_5 = {
  7233. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,
  7234. api: this.gridApi,
  7235. columnApi: this.columnApi
  7236. };
  7237. this.eventService.dispatchEvent(event_5);
  7238. }
  7239. };
  7240. // + rowController
  7241. ColumnController.prototype.getValueColumns = function () {
  7242. return this.valueColumns ? this.valueColumns : [];
  7243. };
  7244. // + rowController
  7245. ColumnController.prototype.getPivotColumns = function () {
  7246. return this.pivotColumns ? this.pivotColumns : [];
  7247. };
  7248. // + clientSideRowModel
  7249. ColumnController.prototype.isPivotActive = function () {
  7250. return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode;
  7251. };
  7252. // + toolPanel
  7253. ColumnController.prototype.getRowGroupColumns = function () {
  7254. return this.rowGroupColumns ? this.rowGroupColumns : [];
  7255. };
  7256. // + rowController -> while inserting rows
  7257. ColumnController.prototype.getDisplayedCenterColumns = function () {
  7258. return this.displayedCenterColumns;
  7259. };
  7260. // + rowController -> while inserting rows
  7261. ColumnController.prototype.getDisplayedLeftColumns = function () {
  7262. return this.displayedLeftColumns;
  7263. };
  7264. ColumnController.prototype.getDisplayedRightColumns = function () {
  7265. return this.displayedRightColumns;
  7266. };
  7267. ColumnController.prototype.getDisplayedColumns = function (type) {
  7268. switch (type) {
  7269. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
  7270. return this.getDisplayedLeftColumns();
  7271. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT:
  7272. return this.getDisplayedRightColumns();
  7273. default:
  7274. return this.getDisplayedCenterColumns();
  7275. }
  7276. };
  7277. // used by:
  7278. // + clientSideRowController -> sorting, building quick filter text
  7279. // + headerRenderer -> sorting (clearing icon)
  7280. ColumnController.prototype.getAllPrimaryColumns = function () {
  7281. return this.primaryColumns ? this.primaryColumns.slice() : null;
  7282. };
  7283. ColumnController.prototype.getSecondaryColumns = function () {
  7284. return this.secondaryColumns ? this.secondaryColumns.slice() : null;
  7285. };
  7286. ColumnController.prototype.getAllColumnsForQuickFilter = function () {
  7287. return this.columnsForQuickFilter;
  7288. };
  7289. // + moveColumnController
  7290. ColumnController.prototype.getAllGridColumns = function () {
  7291. return this.gridColumns;
  7292. };
  7293. ColumnController.prototype.isEmpty = function () {
  7294. return _utils__WEBPACK_IMPORTED_MODULE_9__["_"].missingOrEmpty(this.gridColumns);
  7295. };
  7296. ColumnController.prototype.isRowGroupEmpty = function () {
  7297. return _utils__WEBPACK_IMPORTED_MODULE_9__["_"].missingOrEmpty(this.rowGroupColumns);
  7298. };
  7299. ColumnController.prototype.setColumnVisible = function (key, visible, source) {
  7300. if (source === void 0) { source = "api"; }
  7301. this.setColumnsVisible([key], visible, source);
  7302. };
  7303. ColumnController.prototype.setColumnsVisible = function (keys, visible, source) {
  7304. var _this = this;
  7305. if (source === void 0) { source = "api"; }
  7306. this.columnAnimationService.start();
  7307. this.actionOnGridColumns(keys, function (column) {
  7308. if (column.isVisible() !== visible) {
  7309. column.setVisible(visible, source);
  7310. return true;
  7311. }
  7312. return false;
  7313. }, source, function () {
  7314. var event = {
  7315. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VISIBLE,
  7316. visible: visible,
  7317. column: null,
  7318. columns: null,
  7319. api: _this.gridApi,
  7320. columnApi: _this.columnApi,
  7321. source: source
  7322. };
  7323. return event;
  7324. });
  7325. this.columnAnimationService.finish();
  7326. };
  7327. ColumnController.prototype.setColumnPinned = function (key, pinned, source) {
  7328. if (source === void 0) { source = "api"; }
  7329. if (key) {
  7330. this.setColumnsPinned([key], pinned, source);
  7331. }
  7332. };
  7333. ColumnController.prototype.setColumnsPinned = function (keys, pinned, source) {
  7334. var _this = this;
  7335. if (source === void 0) { source = "api"; }
  7336. if (this.gridOptionsWrapper.getDomLayout() === 'print') {
  7337. console.warn("Changing the column pinning status is not allowed with domLayout='print'");
  7338. return;
  7339. }
  7340. this.columnAnimationService.start();
  7341. var actualPinned;
  7342. if (pinned === true || pinned === _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT) {
  7343. actualPinned = _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT;
  7344. }
  7345. else if (pinned === _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT) {
  7346. actualPinned = _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT;
  7347. }
  7348. else {
  7349. actualPinned = null;
  7350. }
  7351. this.actionOnGridColumns(keys, function (col) {
  7352. if (col.getPinned() !== actualPinned) {
  7353. col.setPinned(actualPinned);
  7354. return true;
  7355. }
  7356. return false;
  7357. }, source, function () {
  7358. var event = {
  7359. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PINNED,
  7360. pinned: actualPinned,
  7361. column: null,
  7362. columns: null,
  7363. api: _this.gridApi,
  7364. columnApi: _this.columnApi,
  7365. source: source
  7366. };
  7367. return event;
  7368. });
  7369. this.columnAnimationService.finish();
  7370. };
  7371. // does an action on a set of columns. provides common functionality for looking up the
  7372. // columns based on key, getting a list of effected columns, and then updated the event
  7373. // with either one column (if it was just one col) or a list of columns
  7374. // used by: autoResize, setVisible, setPinned
  7375. ColumnController.prototype.actionOnGridColumns = function (// the column keys this action will be on
  7376. keys,
  7377. // the action to do - if this returns false, the column was skipped
  7378. // and won't be included in the event
  7379. action,
  7380. // should return back a column event of the right type
  7381. source, createEvent) {
  7382. var _this = this;
  7383. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missingOrEmpty(keys)) {
  7384. return;
  7385. }
  7386. var updatedColumns = [];
  7387. keys.forEach(function (key) {
  7388. var column = _this.getGridColumn(key);
  7389. if (!column) {
  7390. return;
  7391. }
  7392. // need to check for false with type (ie !== instead of !=)
  7393. // as not returning anything (undefined) would also be false
  7394. var resultOfAction = action(column);
  7395. if (resultOfAction !== false) {
  7396. updatedColumns.push(column);
  7397. }
  7398. });
  7399. if (!updatedColumns.length) {
  7400. return;
  7401. }
  7402. this.updateDisplayedColumns(source);
  7403. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(createEvent) && createEvent) {
  7404. var event_6 = createEvent();
  7405. event_6.columns = updatedColumns;
  7406. event_6.column = updatedColumns.length === 1 ? updatedColumns[0] : null;
  7407. this.eventService.dispatchEvent(event_6);
  7408. }
  7409. };
  7410. ColumnController.prototype.getDisplayedColBefore = function (col) {
  7411. var allDisplayedColumns = this.getAllDisplayedColumns();
  7412. var oldIndex = allDisplayedColumns.indexOf(col);
  7413. if (oldIndex > 0) {
  7414. return allDisplayedColumns[oldIndex - 1];
  7415. }
  7416. return null;
  7417. };
  7418. // used by:
  7419. // + rowRenderer -> for navigation
  7420. ColumnController.prototype.getDisplayedColAfter = function (col) {
  7421. var allDisplayedColumns = this.getAllDisplayedColumns();
  7422. var oldIndex = allDisplayedColumns.indexOf(col);
  7423. if (oldIndex < (allDisplayedColumns.length - 1)) {
  7424. return allDisplayedColumns[oldIndex + 1];
  7425. }
  7426. return null;
  7427. };
  7428. ColumnController.prototype.getDisplayedGroupAfter = function (columnGroup) {
  7429. return this.getDisplayedGroupAtDirection(columnGroup, 'After');
  7430. };
  7431. ColumnController.prototype.getDisplayedGroupBefore = function (columnGroup) {
  7432. return this.getDisplayedGroupAtDirection(columnGroup, 'Before');
  7433. };
  7434. ColumnController.prototype.getDisplayedGroupAtDirection = function (columnGroup, direction) {
  7435. // pick the last displayed column in this group
  7436. var requiredLevel = columnGroup.getOriginalColumnGroup().getLevel() + columnGroup.getPaddingLevel();
  7437. var colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();
  7438. var col = direction === 'After' ? _utils__WEBPACK_IMPORTED_MODULE_9__["_"].last(colGroupLeafColumns) : colGroupLeafColumns[0];
  7439. var getDisplayColMethod = "getDisplayedCol" + direction;
  7440. while (true) {
  7441. // keep moving to the next col, until we get to another group
  7442. var column = this[getDisplayColMethod](col);
  7443. if (!column) {
  7444. return null;
  7445. }
  7446. var groupPointer = this.getColumnGroupAtLevel(column, requiredLevel);
  7447. if (groupPointer !== columnGroup) {
  7448. return groupPointer;
  7449. }
  7450. }
  7451. };
  7452. ColumnController.prototype.getColumnGroupAtLevel = function (column, level) {
  7453. // get group at same level as the one we are looking for
  7454. var groupPointer = column.getParent();
  7455. var originalGroupLevel;
  7456. var groupPointerLevel;
  7457. while (true) {
  7458. var groupPointerOriginalColumnGroup = groupPointer.getOriginalColumnGroup();
  7459. originalGroupLevel = groupPointerOriginalColumnGroup.getLevel();
  7460. groupPointerLevel = groupPointer.getPaddingLevel();
  7461. if (originalGroupLevel + groupPointerLevel <= level) {
  7462. break;
  7463. }
  7464. groupPointer = groupPointer.getParent();
  7465. }
  7466. return groupPointer;
  7467. };
  7468. ColumnController.prototype.isPinningLeft = function () {
  7469. return this.displayedLeftColumns.length > 0;
  7470. };
  7471. ColumnController.prototype.isPinningRight = function () {
  7472. return this.displayedRightColumns.length > 0;
  7473. };
  7474. ColumnController.prototype.getPrimaryAndSecondaryAndAutoColumns = function () {
  7475. var result = this.primaryColumns ? this.primaryColumns.slice(0) : [];
  7476. if (this.groupAutoColumns && _utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(this.groupAutoColumns)) {
  7477. this.groupAutoColumns.forEach(function (col) { return result.push(col); });
  7478. }
  7479. if (this.secondaryColumnsPresent && this.secondaryColumns) {
  7480. this.secondaryColumns.forEach(function (column) { return result.push(column); });
  7481. }
  7482. return result;
  7483. };
  7484. ColumnController.prototype.createStateItemFromColumn = function (column) {
  7485. var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null;
  7486. var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null;
  7487. var aggFunc = column.isValueActive() ? column.getAggFunc() : null;
  7488. return {
  7489. colId: column.getColId(),
  7490. hide: !column.isVisible(),
  7491. aggFunc: aggFunc,
  7492. width: column.getActualWidth(),
  7493. pivotIndex: pivotIndex,
  7494. pinned: column.getPinned(),
  7495. rowGroupIndex: rowGroupIndex,
  7496. flex: column.getFlex()
  7497. };
  7498. };
  7499. ColumnController.prototype.getColumnState = function () {
  7500. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(this.primaryColumns)) {
  7501. return [];
  7502. }
  7503. var primaryColumnState = this.primaryColumns.map(this.createStateItemFromColumn.bind(this));
  7504. var groupAutoColumnState = this.groupAutoColumns
  7505. // if groupAutoCols, then include them
  7506. ? this.groupAutoColumns.map(this.createStateItemFromColumn.bind(this))
  7507. // otherwise no
  7508. : [];
  7509. var columnStateList = groupAutoColumnState.concat(primaryColumnState);
  7510. if (!this.pivotMode) {
  7511. this.orderColumnStateList(columnStateList);
  7512. }
  7513. return columnStateList;
  7514. };
  7515. ColumnController.prototype.orderColumnStateList = function (columnStateList) {
  7516. var gridColumnIds = this.gridColumns.map(function (column) { return column.getColId(); });
  7517. columnStateList.sort(function (itemA, itemB) {
  7518. var posA = gridColumnIds.indexOf(itemA.colId);
  7519. var posB = gridColumnIds.indexOf(itemB.colId);
  7520. return posA - posB;
  7521. });
  7522. };
  7523. ColumnController.prototype.resetColumnState = function (suppressEverythingEvent, source) {
  7524. // NOTE = there is one bug here that no customer has noticed - if a column has colDef.lockPosition,
  7525. // this is ignored below when ordering the cols. to work, we should always put lockPosition cols first.
  7526. // As a work around, developers should just put lockPosition columns first in their colDef list.
  7527. if (suppressEverythingEvent === void 0) { suppressEverythingEvent = false; }
  7528. if (source === void 0) { source = "api"; }
  7529. // we can't use 'allColumns' as the order might of messed up, so get the primary ordered list
  7530. var primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);
  7531. var columnStates = [];
  7532. // we start at 1000, so if user has mix of rowGroup and group specified, it will work with both.
  7533. // eg IF user has ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=true,
  7534. // THEN result will be ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=1000
  7535. var letRowGroupIndex = 1000;
  7536. var letPivotIndex = 1000;
  7537. if (primaryColumns) {
  7538. primaryColumns.forEach(function (column) {
  7539. var rowGroupIndex = column.getColDef().rowGroupIndex;
  7540. var rowGroup = column.getColDef().rowGroup;
  7541. var pivotIndex = column.getColDef().pivotIndex;
  7542. var pivot = column.getColDef().pivot;
  7543. var stateItem = {
  7544. colId: column.getColId(),
  7545. aggFunc: column.getColDef().aggFunc,
  7546. hide: column.getColDef().hide,
  7547. pinned: column.getColDef().pinned,
  7548. rowGroupIndex: rowGroupIndex,
  7549. pivotIndex: column.getColDef().pivotIndex,
  7550. width: column.getColDef().width
  7551. };
  7552. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(rowGroupIndex) && rowGroup) {
  7553. stateItem.rowGroupIndex = letRowGroupIndex++;
  7554. }
  7555. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(pivotIndex) && pivot) {
  7556. stateItem.pivotIndex = letPivotIndex++;
  7557. }
  7558. columnStates.push(stateItem);
  7559. });
  7560. }
  7561. this.setColumnState(columnStates, suppressEverythingEvent, source);
  7562. };
  7563. ColumnController.prototype.setColumnState = function (columnStates, suppressEverythingEvent, source) {
  7564. var _this = this;
  7565. if (suppressEverythingEvent === void 0) { suppressEverythingEvent = false; }
  7566. if (source === void 0) { source = "api"; }
  7567. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missingOrEmpty(this.primaryColumns)) {
  7568. return false;
  7569. }
  7570. var columnStateBefore = this.getColumnState();
  7571. this.autoGroupsNeedBuilding = true;
  7572. // at the end below, this list will have all columns we got no state for
  7573. var columnsWithNoState = this.primaryColumns.slice();
  7574. this.rowGroupColumns = [];
  7575. this.valueColumns = [];
  7576. this.pivotColumns = [];
  7577. var success = true;
  7578. var rowGroupIndexes = {};
  7579. var pivotIndexes = {};
  7580. var autoGroupColumnStates = [];
  7581. if (columnStates) {
  7582. columnStates.forEach(function (state) {
  7583. // auto group columns are re-created so deferring syncing with ColumnState
  7584. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(_this.getAutoColumn(state.colId))) {
  7585. autoGroupColumnStates.push(state);
  7586. return;
  7587. }
  7588. var column = _this.getPrimaryColumn(state.colId);
  7589. if (!column) {
  7590. console.warn('ag-grid: column ' + state.colId + ' not found');
  7591. success = false;
  7592. }
  7593. else {
  7594. _this.syncColumnWithStateItem(column, state, rowGroupIndexes, pivotIndexes, source);
  7595. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].removeFromArray(columnsWithNoState, column);
  7596. }
  7597. });
  7598. if (this.flexActive) {
  7599. this.refreshFlexedColumns(undefined, undefined, true);
  7600. }
  7601. }
  7602. // anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden
  7603. columnsWithNoState.forEach(this.syncColumnWithNoState.bind(this));
  7604. // sort the lists according to the indexes that were provided
  7605. this.rowGroupColumns.sort(this.sortColumnListUsingIndexes.bind(this, rowGroupIndexes));
  7606. this.pivotColumns.sort(this.sortColumnListUsingIndexes.bind(this, pivotIndexes));
  7607. this.updateGridColumns();
  7608. // sync newly created auto group columns with ColumnState
  7609. autoGroupColumnStates.forEach(function (stateItem) {
  7610. var autoCol = _this.getAutoColumn(stateItem.colId);
  7611. _this.syncColumnWithStateItem(autoCol, stateItem, rowGroupIndexes, pivotIndexes, source);
  7612. });
  7613. if (columnStates) {
  7614. var orderOfColIds_1 = columnStates.map(function (stateItem) { return stateItem.colId; });
  7615. this.gridColumns.sort(function (colA, colB) {
  7616. var indexA = orderOfColIds_1.indexOf(colA.getId());
  7617. var indexB = orderOfColIds_1.indexOf(colB.getId());
  7618. return indexA - indexB;
  7619. });
  7620. }
  7621. // this is already done in updateGridColumns, however we changed the order above (to match the order of the state
  7622. // columns) so we need to do it again. we could of put logic into the order above to take into account fixed
  7623. // columns, however if we did then we would have logic for updating fixed columns twice. reusing the logic here
  7624. // is less sexy for the code here, but it keeps consistency.
  7625. this.putFixedColumnsFirst();
  7626. this.updateDisplayedColumns(source);
  7627. if (!suppressEverythingEvent) {
  7628. var event_7 = {
  7629. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED,
  7630. api: this.gridApi,
  7631. columnApi: this.columnApi,
  7632. source: source
  7633. };
  7634. this.eventService.dispatchEvent(event_7);
  7635. }
  7636. this.raiseColumnEvents(columnStateBefore, source);
  7637. return success;
  7638. };
  7639. ColumnController.prototype.raiseColumnEvents = function (columnStateBefore, source) {
  7640. var _this = this;
  7641. if (this.gridOptionsWrapper.isSuppressSetColumnStateEvents()) {
  7642. return;
  7643. }
  7644. var columnStateAfter = this.getColumnState();
  7645. // raises generic ColumnEvents where all columns are returned rather than what has changed
  7646. var raiseEventWithAllColumns = function (eventType, idMapper, columns) {
  7647. var unchanged = Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["areEqual"])(columnStateBefore.map(idMapper).sort(), columnStateAfter.map(idMapper).sort());
  7648. if (unchanged) {
  7649. return;
  7650. }
  7651. // returning all columns rather than what has changed!
  7652. var event = {
  7653. type: eventType,
  7654. columns: columns,
  7655. column: columns.length === 1 ? columns[0] : null,
  7656. api: _this.gridApi,
  7657. columnApi: _this.columnApi,
  7658. source: source
  7659. };
  7660. _this.eventService.dispatchEvent(event);
  7661. };
  7662. // determines which columns have changed according to supplied predicate
  7663. var getChangedColumns = function (changedPredicate) {
  7664. var changedColumns = [];
  7665. var columnStateBeforeMap = {};
  7666. columnStateBefore.forEach(function (col) {
  7667. columnStateBeforeMap[col.colId] = col;
  7668. });
  7669. _this.gridColumns.forEach(function (column) {
  7670. var colStateBefore = columnStateBeforeMap[column.getColId()];
  7671. if (!colStateBefore || changedPredicate(colStateBefore, column)) {
  7672. changedColumns.push(column);
  7673. }
  7674. });
  7675. return changedColumns;
  7676. };
  7677. // generic ColumnEvents which return current column list
  7678. var valueColumnIdMapper = function (cs) { return cs.colId + '-' + cs.aggFunc; };
  7679. raiseEventWithAllColumns(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VALUE_CHANGED, valueColumnIdMapper, this.valueColumns);
  7680. var pivotColumnIdMapper = function (cs) { return cs.colId + '-' + cs.pivotIndex; };
  7681. raiseEventWithAllColumns(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_CHANGED, pivotColumnIdMapper, this.pivotColumns);
  7682. var rowGroupColumnIdMapper = function (cs) { return cs.colId + '-' + cs.rowGroupIndex; };
  7683. raiseEventWithAllColumns(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, rowGroupColumnIdMapper, this.rowGroupColumns);
  7684. // specific ColumnEvents which return what's changed
  7685. var pinnedChangePredicate = function (cs, c) { return cs.pinned !== c.getPinned(); };
  7686. this.raiseColumnPinnedEvent(getChangedColumns(pinnedChangePredicate), source);
  7687. var visibilityChangePredicate = function (cs, c) { return cs.hide === c.isVisible(); };
  7688. var cols = getChangedColumns(visibilityChangePredicate);
  7689. this.raiseColumnVisibleEvent(cols, source);
  7690. var resizeChangePredicate = function (cs, c) { return cs.width !== c.getActualWidth(); };
  7691. this.raiseColumnResizeEvent(getChangedColumns(resizeChangePredicate), source);
  7692. // special handling for moved column events
  7693. this.raiseColumnMovedEvent(columnStateBefore, source);
  7694. };
  7695. ColumnController.prototype.raiseColumnPinnedEvent = function (changedColumns, source) {
  7696. if (!changedColumns.length) {
  7697. return;
  7698. }
  7699. var event = {
  7700. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PINNED,
  7701. pinned: null,
  7702. columns: changedColumns,
  7703. column: null,
  7704. api: this.gridApi,
  7705. columnApi: this.columnApi,
  7706. source: source
  7707. };
  7708. this.eventService.dispatchEvent(event);
  7709. };
  7710. ColumnController.prototype.raiseColumnVisibleEvent = function (changedColumns, source) {
  7711. if (!changedColumns.length) {
  7712. return;
  7713. }
  7714. var event = {
  7715. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_VISIBLE,
  7716. visible: undefined,
  7717. columns: changedColumns,
  7718. column: null,
  7719. api: this.gridApi,
  7720. columnApi: this.columnApi,
  7721. source: source
  7722. };
  7723. this.eventService.dispatchEvent(event);
  7724. };
  7725. ColumnController.prototype.raiseColumnResizeEvent = function (changedColumns, source) {
  7726. if (!changedColumns.length) {
  7727. return;
  7728. }
  7729. var event = {
  7730. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED,
  7731. columns: changedColumns,
  7732. column: null,
  7733. finished: true,
  7734. api: this.gridApi,
  7735. columnApi: this.columnApi,
  7736. source: source
  7737. };
  7738. this.eventService.dispatchEvent(event);
  7739. };
  7740. ColumnController.prototype.raiseColumnMovedEvent = function (columnStateBefore, source) {
  7741. var movedColumns = [];
  7742. var columnStateAfter = this.getColumnState();
  7743. var _loop_3 = function (i) {
  7744. var before = columnStateBefore[i];
  7745. var after = columnStateAfter[i];
  7746. // don't consider column if reintroduced or hidden
  7747. if (!before || after.hide) {
  7748. return "continue";
  7749. }
  7750. if (before.colId !== after.colId) {
  7751. var predicate = function (column) { return column.getColId() === after.colId; };
  7752. var movedColumn = _utils__WEBPACK_IMPORTED_MODULE_9__["_"].find(this_1.allDisplayedColumns, predicate);
  7753. movedColumns.push(movedColumn);
  7754. }
  7755. };
  7756. var this_1 = this;
  7757. for (var i = 0; i < columnStateAfter.length; i++) {
  7758. _loop_3(i);
  7759. }
  7760. if (!movedColumns.length) {
  7761. return;
  7762. }
  7763. var event = {
  7764. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_MOVED,
  7765. columns: movedColumns,
  7766. column: null,
  7767. toIndex: undefined,
  7768. api: this.gridApi,
  7769. columnApi: this.columnApi,
  7770. source: source
  7771. };
  7772. this.eventService.dispatchEvent(event);
  7773. };
  7774. ColumnController.prototype.sortColumnListUsingIndexes = function (indexes, colA, colB) {
  7775. var indexA = indexes[colA.getId()];
  7776. var indexB = indexes[colB.getId()];
  7777. return indexA - indexB;
  7778. };
  7779. ColumnController.prototype.syncColumnWithNoState = function (column, source) {
  7780. column.setVisible(false, source);
  7781. column.setAggFunc(null);
  7782. column.setPinned(null);
  7783. column.setRowGroupActive(false, source);
  7784. column.setPivotActive(false, source);
  7785. column.setValueActive(false, source);
  7786. };
  7787. ColumnController.prototype.syncColumnWithStateItem = function (column, stateItem, rowGroupIndexes, pivotIndexes, source) {
  7788. if (!column) {
  7789. return;
  7790. }
  7791. // following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true
  7792. column.setVisible(!stateItem.hide, source);
  7793. // sets pinned to 'left' or 'right'
  7794. column.setPinned(stateItem.pinned);
  7795. // if width provided and valid, use it, otherwise stick with the old width
  7796. var minColWidth = this.gridOptionsWrapper.getMinColWidth();
  7797. if (stateItem.flex != null) {
  7798. column.setFlex(stateItem.flex);
  7799. if (!this.flexActive && stateItem.flex) {
  7800. this.flexActive = true;
  7801. }
  7802. }
  7803. if (stateItem.width && minColWidth &&
  7804. (stateItem.width >= minColWidth)) {
  7805. column.setActualWidth(stateItem.width, source);
  7806. }
  7807. if (typeof stateItem.aggFunc === 'string') {
  7808. column.setAggFunc(stateItem.aggFunc);
  7809. column.setValueActive(true, source);
  7810. this.valueColumns.push(column);
  7811. }
  7812. else {
  7813. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(stateItem.aggFunc)) {
  7814. console.warn('ag-Grid: stateItem.aggFunc must be a string. if using your own aggregation ' +
  7815. 'functions, register the functions first before using them in get/set state. This is because it is ' +
  7816. 'intended for the column state to be stored and retrieved as simple JSON.');
  7817. }
  7818. column.setAggFunc(null);
  7819. column.setValueActive(false, source);
  7820. }
  7821. if (typeof stateItem.rowGroupIndex === 'number') {
  7822. this.rowGroupColumns.push(column);
  7823. column.setRowGroupActive(true, source);
  7824. rowGroupIndexes[column.getId()] = stateItem.rowGroupIndex;
  7825. }
  7826. else {
  7827. column.setRowGroupActive(false, source);
  7828. }
  7829. if (typeof stateItem.pivotIndex === 'number') {
  7830. this.pivotColumns.push(column);
  7831. column.setPivotActive(true, source);
  7832. pivotIndexes[column.getId()] = stateItem.pivotIndex;
  7833. }
  7834. else {
  7835. column.setPivotActive(false, source);
  7836. }
  7837. };
  7838. ColumnController.prototype.getGridColumns = function (keys) {
  7839. return this.getColumns(keys, this.getGridColumn.bind(this));
  7840. };
  7841. ColumnController.prototype.getColumns = function (keys, columnLookupCallback) {
  7842. var foundColumns = [];
  7843. if (keys) {
  7844. keys.forEach(function (key) {
  7845. var column = columnLookupCallback(key);
  7846. if (column) {
  7847. foundColumns.push(column);
  7848. }
  7849. });
  7850. }
  7851. return foundColumns;
  7852. };
  7853. // used by growGroupPanel
  7854. ColumnController.prototype.getColumnWithValidation = function (key) {
  7855. if (key == null) {
  7856. return null;
  7857. }
  7858. var column = this.getGridColumn(key);
  7859. if (!column) {
  7860. console.warn('ag-Grid: could not find column ' + key);
  7861. }
  7862. return column;
  7863. };
  7864. ColumnController.prototype.getPrimaryColumn = function (key) {
  7865. return this.getColumn(key, this.primaryColumns);
  7866. };
  7867. ColumnController.prototype.getGridColumn = function (key) {
  7868. return this.getColumn(key, this.gridColumns);
  7869. };
  7870. ColumnController.prototype.getColumn = function (key, columnList) {
  7871. if (!key) {
  7872. return null;
  7873. }
  7874. for (var i = 0; i < columnList.length; i++) {
  7875. if (this.columnsMatch(columnList[i], key)) {
  7876. return columnList[i];
  7877. }
  7878. }
  7879. return this.getAutoColumn(key);
  7880. };
  7881. ColumnController.prototype.getAutoColumn = function (key) {
  7882. var _this = this;
  7883. if (!this.groupAutoColumns ||
  7884. !_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(this.groupAutoColumns) ||
  7885. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(this.groupAutoColumns)) {
  7886. return null;
  7887. }
  7888. return _utils__WEBPACK_IMPORTED_MODULE_9__["_"].find(this.groupAutoColumns, function (groupCol) { return _this.columnsMatch(groupCol, key); });
  7889. };
  7890. ColumnController.prototype.columnsMatch = function (column, key) {
  7891. var columnMatches = column === key;
  7892. var colDefMatches = column.getColDef() === key;
  7893. var idMatches = column.getColId() == key;
  7894. return columnMatches || colDefMatches || idMatches;
  7895. };
  7896. ColumnController.prototype.getDisplayNameForColumn = function (column, location, includeAggFunc) {
  7897. if (includeAggFunc === void 0) { includeAggFunc = false; }
  7898. if (!column) {
  7899. return null;
  7900. }
  7901. var headerName = this.getHeaderName(column.getColDef(), column, null, null, location);
  7902. if (includeAggFunc) {
  7903. return this.wrapHeaderNameWithAggFunc(column, headerName);
  7904. }
  7905. return headerName;
  7906. };
  7907. ColumnController.prototype.getDisplayNameForOriginalColumnGroup = function (columnGroup, originalColumnGroup, location) {
  7908. var colGroupDef = originalColumnGroup ? originalColumnGroup.getColGroupDef() : null;
  7909. if (colGroupDef) {
  7910. return this.getHeaderName(colGroupDef, null, columnGroup, originalColumnGroup, location);
  7911. }
  7912. return null;
  7913. };
  7914. ColumnController.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) {
  7915. return this.getDisplayNameForOriginalColumnGroup(columnGroup, columnGroup.getOriginalColumnGroup(), location);
  7916. };
  7917. // location is where the column is going to appear, ie who is calling us
  7918. ColumnController.prototype.getHeaderName = function (colDef, column, columnGroup, originalColumnGroup, location) {
  7919. var headerValueGetter = colDef.headerValueGetter;
  7920. if (headerValueGetter) {
  7921. var params = {
  7922. colDef: colDef,
  7923. column: column,
  7924. columnGroup: columnGroup,
  7925. originalColumnGroup: originalColumnGroup,
  7926. location: location,
  7927. api: this.gridOptionsWrapper.getApi(),
  7928. context: this.gridOptionsWrapper.getContext()
  7929. };
  7930. if (typeof headerValueGetter === 'function') {
  7931. // valueGetter is a function, so just call it
  7932. return headerValueGetter(params);
  7933. }
  7934. else if (typeof headerValueGetter === 'string') {
  7935. // valueGetter is an expression, so execute the expression
  7936. return this.expressionService.evaluate(headerValueGetter, params);
  7937. }
  7938. console.warn('ag-grid: headerValueGetter must be a function or a string');
  7939. return '';
  7940. }
  7941. else if (colDef.headerName != null) {
  7942. return colDef.headerName;
  7943. }
  7944. else if (colDef.field) {
  7945. return _utils__WEBPACK_IMPORTED_MODULE_9__["_"].camelCaseToHumanText(colDef.field);
  7946. }
  7947. return '';
  7948. };
  7949. /*
  7950. private getHeaderGroupName(columnGroup: ColumnGroup): string {
  7951. let colGroupDef = columnGroup.getOriginalColumnGroup().getColGroupDef();
  7952. let headerValueGetter = colGroupDef.headerValueGetter;
  7953. if (headerValueGetter) {
  7954. let params = {
  7955. columnGroup: columnGroup,
  7956. colDef: colGroupDef,
  7957. api: this.gridOptionsWrapper.getApi(),
  7958. context: this.gridOptionsWrapper.getContext()
  7959. };
  7960. if (typeof headerValueGetter === 'function') {
  7961. // valueGetter is a function, so just call it
  7962. return headerValueGetter(params);
  7963. } else if (typeof headerValueGetter === 'string') {
  7964. // valueGetter is an expression, so execute the expression
  7965. return this.expressionService.evaluate(headerValueGetter, params);
  7966. } else {
  7967. console.warn('ag-grid: headerValueGetter must be a function or a string');
  7968. return '';
  7969. }
  7970. } else {
  7971. return colGroupDef.headerName;
  7972. }
  7973. }
  7974. */
  7975. ColumnController.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) {
  7976. if (this.gridOptionsWrapper.isSuppressAggFuncInHeader()) {
  7977. return headerName;
  7978. }
  7979. // only columns with aggregation active can have aggregations
  7980. var pivotValueColumn = column.getColDef().pivotValueColumn;
  7981. var pivotActiveOnThisColumn = _utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(pivotValueColumn);
  7982. var aggFunc = null;
  7983. var aggFuncFound;
  7984. // otherwise we have a measure that is active, and we are doing aggregation on it
  7985. if (pivotActiveOnThisColumn) {
  7986. aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null;
  7987. aggFuncFound = true;
  7988. }
  7989. else {
  7990. var measureActive = column.isValueActive();
  7991. var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty();
  7992. if (measureActive && aggregationPresent) {
  7993. aggFunc = column.getAggFunc();
  7994. aggFuncFound = true;
  7995. }
  7996. else {
  7997. aggFuncFound = false;
  7998. }
  7999. }
  8000. if (aggFuncFound) {
  8001. var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func';
  8002. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  8003. var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);
  8004. return aggFuncStringTranslated + "(" + headerName + ")";
  8005. }
  8006. return headerName;
  8007. };
  8008. // returns the group with matching colId and instanceId. If instanceId is missing,
  8009. // matches only on the colId.
  8010. ColumnController.prototype.getColumnGroup = function (colId, instanceId) {
  8011. if (!colId) {
  8012. return null;
  8013. }
  8014. if (colId instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  8015. return colId;
  8016. }
  8017. var allColumnGroups = this.getAllDisplayedColumnGroups();
  8018. var checkInstanceId = typeof instanceId === 'number';
  8019. var result = null;
  8020. this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {
  8021. if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  8022. var columnGroup = child;
  8023. var matched = void 0;
  8024. if (checkInstanceId) {
  8025. matched = colId === columnGroup.getGroupId() && instanceId === columnGroup.getInstanceId();
  8026. }
  8027. else {
  8028. matched = colId === columnGroup.getGroupId();
  8029. }
  8030. if (matched) {
  8031. result = columnGroup;
  8032. }
  8033. }
  8034. });
  8035. return result;
  8036. };
  8037. ColumnController.prototype.isReady = function () {
  8038. return this.ready;
  8039. };
  8040. ColumnController.prototype.createValueColumns = function (source, oldPrimaryColumns) {
  8041. this.valueColumns = this.extractColumns(oldPrimaryColumns, this.valueColumns, function (col, flag) { return col.setValueActive(flag, source); },
  8042. // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null
  8043. function () { return null; },
  8044. // aggFunc is a string, so return it's existence
  8045. function (colDef) { return !!colDef.aggFunc; });
  8046. // all new columns added will have aggFunc missing, so set it to what is in the colDef
  8047. this.valueColumns.forEach(function (col) {
  8048. if (!col.getAggFunc()) {
  8049. col.setAggFunc(col.getColDef().aggFunc);
  8050. }
  8051. });
  8052. };
  8053. ColumnController.prototype.extractRowGroupColumns = function (source, oldPrimaryColumns) {
  8054. this.rowGroupColumns = this.extractColumns(oldPrimaryColumns, this.rowGroupColumns, function (col, flag) { return col.setRowGroupActive(flag, source); }, function (colDef) { return colDef.rowGroupIndex; }, function (colDef) { return colDef.rowGroup; });
  8055. };
  8056. ColumnController.prototype.extractColumns = function (oldPrimaryColumns, previousCols, setFlagFunc, getIndexFunc, getValueFunc) {
  8057. var _this = this;
  8058. if (!previousCols) {
  8059. previousCols = [];
  8060. }
  8061. // remove cols that no longer exist
  8062. var colPresentInPrimaryFunc = function (col) { return _this.primaryColumns.indexOf(col) >= 0; };
  8063. var colMissingFromPrimaryFunc = function (col) { return _this.primaryColumns.indexOf(col) < 0; };
  8064. var colNewFunc = function (col) { return !oldPrimaryColumns || oldPrimaryColumns.indexOf(col) < 0; };
  8065. var removedCols = previousCols.filter(colMissingFromPrimaryFunc);
  8066. var existingCols = previousCols.filter(colPresentInPrimaryFunc);
  8067. var newPrimaryCols = this.primaryColumns.filter(colNewFunc);
  8068. removedCols.forEach(function (col) { return setFlagFunc(col, false); });
  8069. var newCols = [];
  8070. // we only want to work on new columns, as old columns already got processed first time around
  8071. // pull out items with xxxIndex
  8072. newPrimaryCols.forEach(function (col) {
  8073. var index = getIndexFunc(col.getColDef());
  8074. if (typeof index === 'number') {
  8075. newCols.push(col);
  8076. }
  8077. });
  8078. // then sort them
  8079. newCols.sort(function (colA, colB) {
  8080. var indexA = getIndexFunc(colA.getColDef());
  8081. var indexB = getIndexFunc(colB.getColDef());
  8082. if (indexA === indexB) {
  8083. return 0;
  8084. }
  8085. else if (indexA < indexB) {
  8086. return -1;
  8087. }
  8088. return 1;
  8089. });
  8090. // now just pull out items xxx (boolean value), they will be added at the end
  8091. // after the indexed ones, but in the order the columns appear
  8092. newPrimaryCols.forEach(function (col) {
  8093. var booleanValue = getValueFunc(col.getColDef());
  8094. if (booleanValue) {
  8095. // if user already specified xxxIndex then we skip it as this col already included
  8096. if (newCols.indexOf(col) >= 0) {
  8097. return;
  8098. }
  8099. newCols.push(col);
  8100. }
  8101. });
  8102. newCols.forEach(function (col) { return setFlagFunc(col, true); });
  8103. var res = existingCols.concat(newCols);
  8104. return res;
  8105. };
  8106. ColumnController.prototype.extractPivotColumns = function (source, oldPrimaryColumns) {
  8107. this.pivotColumns = this.extractColumns(oldPrimaryColumns, this.pivotColumns, function (col, flag) { return col.setPivotActive(flag, source); }, function (colDef) { return colDef.pivotIndex; }, function (colDef) { return colDef.pivot; });
  8108. };
  8109. ColumnController.prototype.resetColumnGroupState = function (source) {
  8110. if (source === void 0) { source = "api"; }
  8111. var stateItems = [];
  8112. this.columnUtils.depthFirstOriginalTreeSearch(null, this.primaryColumnTree, function (child) {
  8113. if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
  8114. var groupState = {
  8115. groupId: child.getGroupId(),
  8116. open: child.getColGroupDef().openByDefault
  8117. };
  8118. stateItems.push(groupState);
  8119. }
  8120. });
  8121. this.setColumnGroupState(stateItems, source);
  8122. };
  8123. ColumnController.prototype.getColumnGroupState = function () {
  8124. var columnGroupState = [];
  8125. this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) {
  8126. if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
  8127. var originalColumnGroup = node;
  8128. columnGroupState.push({
  8129. groupId: originalColumnGroup.getGroupId(),
  8130. open: originalColumnGroup.isExpanded()
  8131. });
  8132. }
  8133. });
  8134. return columnGroupState;
  8135. };
  8136. ColumnController.prototype.setColumnGroupState = function (stateItems, source) {
  8137. var _this = this;
  8138. if (source === void 0) { source = "api"; }
  8139. this.columnAnimationService.start();
  8140. var impactedGroups = [];
  8141. stateItems.forEach(function (stateItem) {
  8142. var groupKey = stateItem.groupId;
  8143. var newValue = stateItem.open;
  8144. var originalColumnGroup = _this.getOriginalColumnGroup(groupKey);
  8145. if (!originalColumnGroup) {
  8146. return;
  8147. }
  8148. if (originalColumnGroup.isExpanded() === newValue) {
  8149. return;
  8150. }
  8151. _this.logger.log('columnGroupOpened(' + originalColumnGroup.getGroupId() + ',' + newValue + ')');
  8152. originalColumnGroup.setExpanded(newValue);
  8153. impactedGroups.push(originalColumnGroup);
  8154. });
  8155. this.updateGroupsAndDisplayedColumns(source);
  8156. this.setFirstRightAndLastLeftPinned(source);
  8157. impactedGroups.forEach(function (originalColumnGroup) {
  8158. var event = {
  8159. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_GROUP_OPENED,
  8160. columnGroup: originalColumnGroup,
  8161. api: _this.gridApi,
  8162. columnApi: _this.columnApi
  8163. };
  8164. _this.eventService.dispatchEvent(event);
  8165. });
  8166. this.columnAnimationService.finish();
  8167. };
  8168. // called by headerRenderer - when a header is opened or closed
  8169. ColumnController.prototype.setColumnGroupOpened = function (key, newValue, source) {
  8170. if (source === void 0) { source = "api"; }
  8171. var keyAsString;
  8172. if (key instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
  8173. keyAsString = key.getId();
  8174. }
  8175. else {
  8176. keyAsString = key;
  8177. }
  8178. this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);
  8179. };
  8180. ColumnController.prototype.getOriginalColumnGroup = function (key) {
  8181. if (key instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
  8182. return key;
  8183. }
  8184. if (typeof key !== 'string') {
  8185. console.error('ag-Grid: group key must be a string');
  8186. }
  8187. // otherwise, search for the column group by id
  8188. var res = null;
  8189. this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) {
  8190. if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"]) {
  8191. var originalColumnGroup = node;
  8192. if (originalColumnGroup.getId() === key) {
  8193. res = originalColumnGroup;
  8194. }
  8195. }
  8196. });
  8197. return res;
  8198. };
  8199. ColumnController.prototype.calculateColumnsForDisplay = function () {
  8200. var _this = this;
  8201. var columnsForDisplay;
  8202. if (this.pivotMode && !this.secondaryColumnsPresent) {
  8203. // pivot mode is on, but we are not pivoting, so we only
  8204. // show columns we are aggregating on
  8205. columnsForDisplay = this.gridColumns.filter(function (column) {
  8206. var isAutoGroupCol = _this.groupAutoColumns && _utils__WEBPACK_IMPORTED_MODULE_9__["_"].includes(_this.groupAutoColumns, column);
  8207. var isValueCol = _this.valueColumns && _utils__WEBPACK_IMPORTED_MODULE_9__["_"].includes(_this.valueColumns, column);
  8208. return isAutoGroupCol || isValueCol;
  8209. });
  8210. }
  8211. else {
  8212. // otherwise continue as normal. this can be working on the primary
  8213. // or secondary columns, whatever the gridColumns are set to
  8214. columnsForDisplay = this.gridColumns.filter(function (column) {
  8215. // keep col if a) it's auto-group or b) it's visible
  8216. var isAutoGroupCol = _this.groupAutoColumns && _utils__WEBPACK_IMPORTED_MODULE_9__["_"].includes(_this.groupAutoColumns, column);
  8217. return isAutoGroupCol || column.isVisible();
  8218. });
  8219. }
  8220. return columnsForDisplay;
  8221. };
  8222. ColumnController.prototype.checkColSpanActiveInCols = function (columns) {
  8223. var result = false;
  8224. columns.forEach(function (col) {
  8225. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(col.getColDef().colSpan)) {
  8226. result = true;
  8227. }
  8228. });
  8229. return result;
  8230. };
  8231. ColumnController.prototype.calculateColumnsForGroupDisplay = function () {
  8232. var _this = this;
  8233. this.groupDisplayColumns = [];
  8234. var checkFunc = function (col) {
  8235. var colDef = col.getColDef();
  8236. if (colDef && _utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(colDef.showRowGroup)) {
  8237. _this.groupDisplayColumns.push(col);
  8238. }
  8239. };
  8240. this.gridColumns.forEach(checkFunc);
  8241. if (this.groupAutoColumns) {
  8242. this.groupAutoColumns.forEach(checkFunc);
  8243. }
  8244. };
  8245. ColumnController.prototype.getGroupDisplayColumns = function () {
  8246. return this.groupDisplayColumns;
  8247. };
  8248. ColumnController.prototype.updateDisplayedColumns = function (source) {
  8249. var columnsForDisplay = this.calculateColumnsForDisplay();
  8250. this.buildDisplayedTrees(columnsForDisplay);
  8251. this.calculateColumnsForGroupDisplay();
  8252. // also called when group opened/closed
  8253. this.updateGroupsAndDisplayedColumns(source);
  8254. // also called when group opened/closed
  8255. this.setFirstRightAndLastLeftPinned(source);
  8256. };
  8257. ColumnController.prototype.isSecondaryColumnsPresent = function () {
  8258. return this.secondaryColumnsPresent;
  8259. };
  8260. ColumnController.prototype.setSecondaryColumns = function (colDefs, source) {
  8261. if (source === void 0) { source = "api"; }
  8262. var newColsPresent = colDefs && colDefs.length > 0;
  8263. // if not cols passed, and we had to cols anyway, then do nothing
  8264. if (!newColsPresent && !this.secondaryColumnsPresent) {
  8265. return;
  8266. }
  8267. if (newColsPresent) {
  8268. this.processSecondaryColumnDefinitions(colDefs);
  8269. var balancedTreeResult = this.columnFactory.createColumnTree(colDefs, false);
  8270. this.secondaryBalancedTree = balancedTreeResult.columnTree;
  8271. this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1;
  8272. this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree);
  8273. this.secondaryColumnsPresent = true;
  8274. }
  8275. else {
  8276. this.secondaryBalancedTree = null;
  8277. this.secondaryHeaderRowCount = -1;
  8278. this.secondaryColumns = null;
  8279. this.secondaryColumnsPresent = false;
  8280. }
  8281. this.updateGridColumns();
  8282. this.updateDisplayedColumns(source);
  8283. };
  8284. ColumnController.prototype.processSecondaryColumnDefinitions = function (colDefs) {
  8285. var columnCallback = this.gridOptionsWrapper.getProcessSecondaryColDefFunc();
  8286. var groupCallback = this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc();
  8287. if (!columnCallback && !groupCallback) {
  8288. return undefined;
  8289. }
  8290. var searchForColDefs = function (colDefs2) {
  8291. colDefs2.forEach(function (abstractColDef) {
  8292. var isGroup = _utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(abstractColDef.children);
  8293. if (isGroup) {
  8294. var colGroupDef = abstractColDef;
  8295. if (groupCallback) {
  8296. groupCallback(colGroupDef);
  8297. }
  8298. searchForColDefs(colGroupDef.children);
  8299. }
  8300. else {
  8301. var colDef = abstractColDef;
  8302. if (columnCallback) {
  8303. columnCallback(colDef);
  8304. }
  8305. }
  8306. });
  8307. };
  8308. if (colDefs) {
  8309. searchForColDefs(colDefs);
  8310. }
  8311. };
  8312. // called from: setColumnState, setColumnDefs, setSecondaryColumns
  8313. ColumnController.prototype.updateGridColumns = function () {
  8314. if (this.gridColsArePrimary) {
  8315. this.lastPrimaryOrder = this.gridColumns;
  8316. }
  8317. if (this.secondaryColumns && this.secondaryBalancedTree) {
  8318. this.gridBalancedTree = this.secondaryBalancedTree.slice();
  8319. this.gridHeaderRowCount = this.secondaryHeaderRowCount;
  8320. this.gridColumns = this.secondaryColumns.slice();
  8321. this.gridColsArePrimary = false;
  8322. }
  8323. else {
  8324. this.gridBalancedTree = this.primaryColumnTree.slice();
  8325. this.gridHeaderRowCount = this.primaryHeaderRowCount;
  8326. this.gridColumns = this.primaryColumns.slice();
  8327. this.gridColsArePrimary = true;
  8328. // updateGridColumns gets called after user adds a row group. we want to maintain the order of the columns
  8329. // when this happens (eg if user moved a column) rather than revert back to the original column order.
  8330. // likewise if changing in/out of pivot mode, we want to maintain the order of the primary cols
  8331. this.orderGridColsLikeLastPrimary();
  8332. }
  8333. this.addAutoGroupToGridColumns();
  8334. this.autoRowHeightColumns = this.gridColumns.filter(function (col) { return col.getColDef().autoHeight; });
  8335. this.putFixedColumnsFirst();
  8336. this.setupQuickFilterColumns();
  8337. this.clearDisplayedColumns();
  8338. this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns);
  8339. var event = {
  8340. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_GRID_COLUMNS_CHANGED,
  8341. api: this.gridApi,
  8342. columnApi: this.columnApi
  8343. };
  8344. this.eventService.dispatchEvent(event);
  8345. };
  8346. ColumnController.prototype.orderGridColsLikeLastPrimary = function () {
  8347. var _this = this;
  8348. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(this.lastPrimaryOrder)) {
  8349. return;
  8350. }
  8351. // only do the sort if at least one column is accounted for. columns will be not accounted for
  8352. // if changing from secondary to primary columns
  8353. var noColsFound = true;
  8354. this.gridColumns.forEach(function (col) {
  8355. if (_this.lastPrimaryOrder.indexOf(col) >= 0) {
  8356. noColsFound = false;
  8357. }
  8358. });
  8359. if (noColsFound) {
  8360. return;
  8361. }
  8362. // order cols in the same order as before. we need to make sure that all
  8363. // cols still exists, so filter out any that no longer exist.
  8364. var oldColsOrdered = this.lastPrimaryOrder.filter(function (col) { return _this.gridColumns.indexOf(col) >= 0; });
  8365. var newColsOrdered = this.gridColumns.filter(function (col) { return oldColsOrdered.indexOf(col) < 0; });
  8366. // add in the new columns, at the end (if no group), or at the end of the group (if a group)
  8367. var newGridColumns = oldColsOrdered.slice();
  8368. newColsOrdered.forEach(function (newCol) {
  8369. var parent = newCol.getOriginalParent();
  8370. // if no parent, means we are not grouping, so just add the column to the end
  8371. if (!parent) {
  8372. newGridColumns.push(newCol);
  8373. return;
  8374. }
  8375. // find the group the column belongs to. if no siblings at the current level (eg col in group on it's
  8376. // own) then go up one level and look for siblings there.
  8377. var siblings = [];
  8378. while (!siblings.length && parent) {
  8379. var leafCols = parent.getLeafColumns();
  8380. leafCols.forEach(function (leafCol) {
  8381. var presentInNewGriColumns = newGridColumns.indexOf(leafCol) >= 0;
  8382. var noYetInSiblings = siblings.indexOf(leafCol) < 0;
  8383. if (presentInNewGriColumns && noYetInSiblings) {
  8384. siblings.push(leafCol);
  8385. }
  8386. });
  8387. parent = parent.getOriginalParent();
  8388. }
  8389. // if no siblings exist at any level, this means the col is in a group (or parent groups) on it's own
  8390. if (!siblings.length) {
  8391. newGridColumns.push(newCol);
  8392. return;
  8393. }
  8394. // find index of last column in the group
  8395. var indexes = siblings.map(function (col) { return newGridColumns.indexOf(col); });
  8396. var lastIndex = Math.max.apply(Math, indexes);
  8397. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].insertIntoArray(newGridColumns, newCol, lastIndex + 1);
  8398. });
  8399. this.gridColumns = newGridColumns;
  8400. };
  8401. ColumnController.prototype.isPrimaryColumnGroupsPresent = function () {
  8402. return this.primaryHeaderRowCount > 1;
  8403. };
  8404. // if we are using autoGroupCols, then they should be included for quick filter. this covers the
  8405. // following scenarios:
  8406. // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on
  8407. // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this
  8408. // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)
  8409. ColumnController.prototype.setupQuickFilterColumns = function () {
  8410. if (this.groupAutoColumns) {
  8411. this.columnsForQuickFilter = this.primaryColumns.concat(this.groupAutoColumns);
  8412. }
  8413. else {
  8414. this.columnsForQuickFilter = this.primaryColumns;
  8415. }
  8416. };
  8417. ColumnController.prototype.putFixedColumnsFirst = function () {
  8418. var locked = this.gridColumns.filter(function (c) { return c.getColDef().lockPosition; });
  8419. var unlocked = this.gridColumns.filter(function (c) { return !c.getColDef().lockPosition; });
  8420. this.gridColumns = locked.concat(unlocked);
  8421. };
  8422. ColumnController.prototype.addAutoGroupToGridColumns = function () {
  8423. // add in auto-group here
  8424. this.createGroupAutoColumnsIfNeeded();
  8425. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(this.groupAutoColumns)) {
  8426. return;
  8427. }
  8428. this.gridColumns = this.groupAutoColumns ? this.groupAutoColumns.concat(this.gridColumns) : this.gridColumns;
  8429. var autoColBalancedTree = this.columnFactory.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree);
  8430. this.gridBalancedTree = autoColBalancedTree.concat(this.gridBalancedTree);
  8431. };
  8432. // gets called after we copy down grid columns, to make sure any part of the gui
  8433. // that tries to draw, eg the header, it will get empty lists of columns rather
  8434. // than stale columns. for example, the header will received gridColumnsChanged
  8435. // event, so will try and draw, but it will draw successfully when it acts on the
  8436. // virtualColumnsChanged event
  8437. ColumnController.prototype.clearDisplayedColumns = function () {
  8438. this.displayedLeftColumnTree = [];
  8439. this.displayedRightColumnTree = [];
  8440. this.displayedCentreColumnTree = [];
  8441. this.displayedLeftHeaderRows = {};
  8442. this.displayedRightHeaderRows = {};
  8443. this.displayedCentreHeaderRows = {};
  8444. this.displayedLeftColumns = [];
  8445. this.displayedRightColumns = [];
  8446. this.displayedCenterColumns = [];
  8447. this.allDisplayedColumns = [];
  8448. this.allDisplayedVirtualColumns = [];
  8449. };
  8450. ColumnController.prototype.updateGroupsAndDisplayedColumns = function (source) {
  8451. this.updateOpenClosedVisibilityInColumnGroups();
  8452. this.updateDisplayedColumnsFromTrees(source);
  8453. this.updateVirtualSets();
  8454. this.refreshFlexedColumns(undefined, undefined, true);
  8455. this.updateBodyWidths();
  8456. // this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display
  8457. var event = {
  8458. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED,
  8459. api: this.gridApi,
  8460. columnApi: this.columnApi
  8461. };
  8462. this.eventService.dispatchEvent(event);
  8463. };
  8464. ColumnController.prototype.updateDisplayedColumnsFromTrees = function (source) {
  8465. this.addToDisplayedColumns(this.displayedLeftColumnTree, this.displayedLeftColumns);
  8466. this.addToDisplayedColumns(this.displayedCentreColumnTree, this.displayedCenterColumns);
  8467. this.addToDisplayedColumns(this.displayedRightColumnTree, this.displayedRightColumns);
  8468. this.setupAllDisplayedColumns();
  8469. this.setLeftValues(source);
  8470. };
  8471. ColumnController.prototype.setupAllDisplayedColumns = function () {
  8472. if (this.gridOptionsWrapper.isEnableRtl()) {
  8473. this.allDisplayedColumns = this.displayedRightColumns
  8474. .concat(this.displayedCenterColumns)
  8475. .concat(this.displayedLeftColumns);
  8476. }
  8477. else {
  8478. this.allDisplayedColumns = this.displayedLeftColumns
  8479. .concat(this.displayedCenterColumns)
  8480. .concat(this.displayedRightColumns);
  8481. }
  8482. };
  8483. // sets the left pixel position of each column
  8484. ColumnController.prototype.setLeftValues = function (source) {
  8485. this.setLeftValuesOfColumns(source);
  8486. this.setLeftValuesOfGroups();
  8487. };
  8488. ColumnController.prototype.setLeftValuesOfColumns = function (source) {
  8489. var _this = this;
  8490. // go through each list of displayed columns
  8491. var allColumns = this.primaryColumns.slice(0);
  8492. // let totalColumnWidth = this.getWidthOfColsInList()
  8493. var doingRtl = this.gridOptionsWrapper.isEnableRtl();
  8494. [
  8495. this.displayedLeftColumns,
  8496. this.displayedRightColumns,
  8497. this.displayedCenterColumns
  8498. ].forEach(function (columns) {
  8499. if (doingRtl) {
  8500. // when doing RTL, we start at the top most pixel (ie RHS) and work backwards
  8501. var left_1 = _this.getWidthOfColsInList(columns);
  8502. columns.forEach(function (column) {
  8503. left_1 -= column.getActualWidth();
  8504. column.setLeft(left_1, source);
  8505. });
  8506. }
  8507. else {
  8508. // otherwise normal LTR, we start at zero
  8509. var left_2 = 0;
  8510. columns.forEach(function (column) {
  8511. column.setLeft(left_2, source);
  8512. left_2 += column.getActualWidth();
  8513. });
  8514. }
  8515. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].removeAllFromArray(allColumns, columns);
  8516. });
  8517. // items left in allColumns are columns not displayed, so remove the left position. this is
  8518. // important for the rows, as if a col is made visible, then taken out, then made visible again,
  8519. // we don't want the animation of the cell floating in from the old position, whatever that was.
  8520. allColumns.forEach(function (column) {
  8521. column.setLeft(null, source);
  8522. });
  8523. };
  8524. ColumnController.prototype.setLeftValuesOfGroups = function () {
  8525. // a groups left value is the lest left value of it's children
  8526. [
  8527. this.displayedLeftColumnTree,
  8528. this.displayedRightColumnTree,
  8529. this.displayedCentreColumnTree
  8530. ].forEach(function (columns) {
  8531. columns.forEach(function (column) {
  8532. if (column instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  8533. var columnGroup = column;
  8534. columnGroup.checkLeft();
  8535. }
  8536. });
  8537. });
  8538. };
  8539. ColumnController.prototype.addToDisplayedColumns = function (displayedColumnTree, displayedColumns) {
  8540. displayedColumns.length = 0;
  8541. this.columnUtils.depthFirstDisplayedColumnTreeSearch(displayedColumnTree, function (child) {
  8542. if (child instanceof _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
  8543. displayedColumns.push(child);
  8544. }
  8545. });
  8546. };
  8547. ColumnController.prototype.updateDisplayedCenterVirtualColumns = function () {
  8548. if (this.suppressColumnVirtualisation) {
  8549. // no virtualisation, so don't filter
  8550. this.allDisplayedCenterVirtualColumns = this.displayedCenterColumns;
  8551. }
  8552. else {
  8553. // filter out what should be visible
  8554. this.allDisplayedCenterVirtualColumns = this.filterOutColumnsWithinViewport();
  8555. }
  8556. this.allDisplayedVirtualColumns = this.allDisplayedCenterVirtualColumns
  8557. .concat(this.displayedLeftColumns)
  8558. .concat(this.displayedRightColumns);
  8559. // return map of virtual col id's, for easy lookup when building the groups.
  8560. // the map will be colId=>true, ie col id's mapping to 'true'.
  8561. var result = {};
  8562. this.allDisplayedVirtualColumns.forEach(function (col) {
  8563. result[col.getId()] = true;
  8564. });
  8565. return result;
  8566. };
  8567. ColumnController.prototype.getVirtualHeaderGroupRow = function (type, dept) {
  8568. var result;
  8569. switch (type) {
  8570. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT:
  8571. result = this.displayedLeftHeaderRows[dept];
  8572. break;
  8573. case _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT:
  8574. result = this.displayedRightHeaderRows[dept];
  8575. break;
  8576. default:
  8577. result = this.displayedCentreHeaderRows[dept];
  8578. break;
  8579. }
  8580. if (_utils__WEBPACK_IMPORTED_MODULE_9__["_"].missing(result)) {
  8581. result = [];
  8582. }
  8583. return result;
  8584. };
  8585. ColumnController.prototype.updateDisplayedVirtualGroups = function (virtualColIds) {
  8586. // go through each group, see if any of it's cols are displayed, and if yes,
  8587. // then this group is included
  8588. this.displayedLeftHeaderRows = {};
  8589. this.displayedRightHeaderRows = {};
  8590. this.displayedCentreHeaderRows = {};
  8591. var testGroup = function (children, result, dept) {
  8592. var returnValue = false;
  8593. for (var i = 0; i < children.length; i++) {
  8594. // see if this item is within viewport
  8595. var child = children[i];
  8596. var addThisItem = void 0;
  8597. if (child instanceof _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"]) {
  8598. // for column, test if column is included
  8599. addThisItem = virtualColIds[child.getId()] === true;
  8600. }
  8601. else {
  8602. // if group, base decision on children
  8603. var columnGroup = child;
  8604. addThisItem = testGroup(columnGroup.getDisplayedChildren(), result, dept + 1);
  8605. }
  8606. if (addThisItem) {
  8607. returnValue = true;
  8608. if (!result[dept]) {
  8609. result[dept] = [];
  8610. }
  8611. result[dept].push(child);
  8612. }
  8613. }
  8614. return returnValue;
  8615. };
  8616. testGroup(this.displayedLeftColumnTree, this.displayedLeftHeaderRows, 0);
  8617. testGroup(this.displayedRightColumnTree, this.displayedRightHeaderRows, 0);
  8618. testGroup(this.displayedCentreColumnTree, this.displayedCentreHeaderRows, 0);
  8619. };
  8620. ColumnController.prototype.updateVirtualSets = function () {
  8621. var virtualColIds = this.updateDisplayedCenterVirtualColumns();
  8622. this.updateDisplayedVirtualGroups(virtualColIds);
  8623. };
  8624. ColumnController.prototype.filterOutColumnsWithinViewport = function () {
  8625. return this.displayedCenterColumns.filter(this.isColumnInViewport.bind(this));
  8626. };
  8627. ColumnController.prototype.refreshFlexedColumns = function (updatedFlexViewportWidth, source, silent) {
  8628. if (source === void 0) { source = 'flex'; }
  8629. if (!this.flexActive) {
  8630. return;
  8631. }
  8632. this.flexViewportWidth = updatedFlexViewportWidth || this.flexViewportWidth;
  8633. if (!this.flexViewportWidth) {
  8634. return;
  8635. }
  8636. // If the grid has left-over space, divide it between flexing columns in proportion to their flex value.
  8637. // A "flexing column" is one that has a 'flex' value set and is not currently being constrained by its
  8638. // minWidth or maxWidth rules.
  8639. var knownWidthColumns = this.displayedCenterColumns.filter(function (col) { return !col.getFlex(); });
  8640. var flexingColumns = this.displayedCenterColumns.filter(function (col) { return col.getFlex(); });
  8641. if (!flexingColumns.length) {
  8642. this.flexActive = false;
  8643. return;
  8644. }
  8645. var flexingColumnSizes = [];
  8646. var spaceForFlexingColumns;
  8647. outer: while (true) {
  8648. var totalFlex = flexingColumns.reduce(function (count, col) { return count + col.getFlex(); }, 0);
  8649. spaceForFlexingColumns = this.flexViewportWidth - this.getWidthOfColsInList(knownWidthColumns);
  8650. for (var i = 0; i < flexingColumns.length; i++) {
  8651. var col = flexingColumns[i];
  8652. var widthByFlexRule = spaceForFlexingColumns * col.getFlex() / totalFlex;
  8653. var constrainedWidth = void 0;
  8654. if (widthByFlexRule < col.getMinWidth()) {
  8655. constrainedWidth = col.getMinWidth();
  8656. }
  8657. else if (col.getMaxWidth() != null && widthByFlexRule > col.getMaxWidth()) {
  8658. constrainedWidth = col.getMaxWidth();
  8659. }
  8660. if (constrainedWidth) {
  8661. // This column is not in fact flexing as it is being constrained to a specific size
  8662. // so remove it from the list of flexing columns and start again
  8663. col.setActualWidth(constrainedWidth, source);
  8664. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].removeFromArray(flexingColumns, col);
  8665. knownWidthColumns.push(col);
  8666. continue outer;
  8667. }
  8668. flexingColumnSizes[i] = Math.round(widthByFlexRule);
  8669. }
  8670. break;
  8671. }
  8672. var remainingSpace = spaceForFlexingColumns;
  8673. flexingColumns.forEach(function (col, i) {
  8674. col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source);
  8675. remainingSpace -= flexingColumnSizes[i];
  8676. });
  8677. this.setLeftValues(source);
  8678. if (!silent) {
  8679. this.updateBodyWidths();
  8680. this.fireResizedEventForColumns(flexingColumns, source);
  8681. }
  8682. };
  8683. // called from api
  8684. ColumnController.prototype.sizeColumnsToFit = function (gridWidth, source, silent) {
  8685. if (source === void 0) { source = "sizeColumnsToFit"; }
  8686. // avoid divide by zero
  8687. var allDisplayedColumns = this.getAllDisplayedColumns();
  8688. if (gridWidth <= 0 || !allDisplayedColumns.length) {
  8689. return;
  8690. }
  8691. var colsToSpread = [];
  8692. var colsToNotSpread = [];
  8693. allDisplayedColumns.forEach(function (column) {
  8694. if (column.getColDef().suppressSizeToFit === true) {
  8695. colsToNotSpread.push(column);
  8696. }
  8697. else {
  8698. colsToSpread.push(column);
  8699. }
  8700. });
  8701. // make a copy of the cols that are going to be resized
  8702. var colsToFireEventFor = colsToSpread.slice(0);
  8703. var finishedResizing = false;
  8704. var moveToNotSpread = function (column) {
  8705. _utils__WEBPACK_IMPORTED_MODULE_9__["_"].removeFromArray(colsToSpread, column);
  8706. colsToNotSpread.push(column);
  8707. };
  8708. // resetting cols to their original width makes the sizeColumnsToFit more deterministic,
  8709. // rather than depending on the current size of the columns. most users call sizeColumnsToFit
  8710. // immediately after grid is created, so will make no difference. however if application is calling
  8711. // sizeColumnsToFit repeatedly (eg after column group is opened / closed repeatedly) we don't want
  8712. // the columns to start shrinking / growing over time.
  8713. colsToSpread.forEach(function (column) { return column.resetActualWidth(); });
  8714. while (!finishedResizing) {
  8715. finishedResizing = true;
  8716. var availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread);
  8717. if (availablePixels <= 0) {
  8718. // no width, set everything to minimum
  8719. colsToSpread.forEach(function (column) {
  8720. column.setMinimum(source);
  8721. });
  8722. }
  8723. else {
  8724. var scale = availablePixels / this.getWidthOfColsInList(colsToSpread);
  8725. // we set the pixels for the last col based on what's left, as otherwise
  8726. // we could be a pixel or two short or extra because of rounding errors.
  8727. var pixelsForLastCol = availablePixels;
  8728. // backwards through loop, as we are removing items as we go
  8729. for (var i = colsToSpread.length - 1; i >= 0; i--) {
  8730. var column = colsToSpread[i];
  8731. var newWidth = Math.round(column.getActualWidth() * scale);
  8732. if (newWidth < column.getMinWidth()) {
  8733. column.setMinimum(source);
  8734. moveToNotSpread(column);
  8735. finishedResizing = false;
  8736. }
  8737. else if (column.isGreaterThanMax(newWidth)) {
  8738. column.setActualWidth(column.getMaxWidth(), source);
  8739. moveToNotSpread(column);
  8740. finishedResizing = false;
  8741. }
  8742. else {
  8743. var onLastCol = i === 0;
  8744. if (onLastCol) {
  8745. column.setActualWidth(pixelsForLastCol, source);
  8746. }
  8747. else {
  8748. column.setActualWidth(newWidth, source);
  8749. }
  8750. }
  8751. pixelsForLastCol -= newWidth;
  8752. }
  8753. }
  8754. }
  8755. this.setLeftValues(source);
  8756. this.updateBodyWidths();
  8757. if (silent) {
  8758. return;
  8759. }
  8760. this.fireResizedEventForColumns(colsToFireEventFor, source);
  8761. };
  8762. ColumnController.prototype.fireResizedEventForColumns = function (columns, source) {
  8763. var _this = this;
  8764. columns.forEach(function (column) {
  8765. var event = {
  8766. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED,
  8767. column: column,
  8768. columns: [column],
  8769. finished: true,
  8770. api: _this.gridApi,
  8771. columnApi: _this.columnApi,
  8772. source: source
  8773. };
  8774. _this.eventService.dispatchEvent(event);
  8775. });
  8776. };
  8777. ColumnController.prototype.buildDisplayedTrees = function (visibleColumns) {
  8778. var leftVisibleColumns = [];
  8779. var rightVisibleColumns = [];
  8780. var centerVisibleColumns = [];
  8781. visibleColumns.forEach(function (column) {
  8782. switch (column.getPinned()) {
  8783. case "left":
  8784. leftVisibleColumns.push(column);
  8785. break;
  8786. case "right":
  8787. rightVisibleColumns.push(column);
  8788. break;
  8789. default:
  8790. centerVisibleColumns.push(column);
  8791. break;
  8792. }
  8793. });
  8794. var groupInstanceIdCreator = new _groupInstanceIdCreator__WEBPACK_IMPORTED_MODULE_5__["GroupInstanceIdCreator"]();
  8795. this.displayedLeftColumnTree = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_LEFT, this.displayedLeftColumnTree);
  8796. this.displayedRightColumnTree = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, _constants__WEBPACK_IMPORTED_MODULE_7__["Constants"].PINNED_RIGHT, this.displayedRightColumnTree);
  8797. this.displayedCentreColumnTree = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, null, this.displayedCentreColumnTree);
  8798. };
  8799. ColumnController.prototype.updateOpenClosedVisibilityInColumnGroups = function () {
  8800. var allColumnGroups = this.getAllDisplayedColumnGroups();
  8801. this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {
  8802. if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  8803. var columnGroup = child;
  8804. columnGroup.calculateDisplayedColumns();
  8805. }
  8806. });
  8807. };
  8808. ColumnController.prototype.getGroupAutoColumns = function () {
  8809. return this.groupAutoColumns;
  8810. };
  8811. ColumnController.prototype.createGroupAutoColumnsIfNeeded = function () {
  8812. if (!this.autoGroupsNeedBuilding) {
  8813. return;
  8814. }
  8815. this.autoGroupsNeedBuilding = false;
  8816. var groupFullWidthRow = this.gridOptionsWrapper.isGroupUseEntireRow(this.pivotMode);
  8817. // we need to allow suppressing auto-column separately for group and pivot as the normal situation
  8818. // is CSRM and user provides group column themselves for normal view, but when they go into pivot the
  8819. // columns are generated by the grid so no opportunity for user to provide group column. so need a way
  8820. // to suppress auto-col for grouping only, and not pivot.
  8821. // however if using Viewport RM or SSRM and user is providing the columns, the user may wish full control
  8822. // of the group column in this instance.
  8823. var suppressAutoColumn = this.pivotMode ?
  8824. this.gridOptionsWrapper.isPivotSuppressAutoColumn() : this.gridOptionsWrapper.isGroupSuppressAutoColumn();
  8825. // const groupSuppressAutoColumn = this.gridOptionsWrapper.isGroupSuppressAutoColumn() && !this.pivotMode;
  8826. var groupSuppressRow = this.gridOptionsWrapper.isGroupSuppressRow();
  8827. var groupingActive = this.rowGroupColumns.length > 0 || this.usingTreeData;
  8828. var needAutoColumns = groupingActive && !suppressAutoColumn && !groupFullWidthRow && !groupSuppressRow;
  8829. if (needAutoColumns) {
  8830. var newAutoGroupCols = this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);
  8831. var autoColsDifferent = !this.autoColsEqual(newAutoGroupCols, this.groupAutoColumns);
  8832. // we force recreate when suppressSetColumnStateEvents changes, so new group cols pick up the new
  8833. // definitions. otherwise we could ignore the new cols becasue they appear to be the same.
  8834. if (autoColsDifferent || this.forceRecreateAutoGroups) {
  8835. this.groupAutoColumns = newAutoGroupCols;
  8836. }
  8837. }
  8838. else {
  8839. this.groupAutoColumns = null;
  8840. }
  8841. };
  8842. ColumnController.prototype.autoColsEqual = function (colsA, colsB) {
  8843. return Object(_utils_array__WEBPACK_IMPORTED_MODULE_8__["areEqual"])(colsA, colsB, function (a, b) { return a.getColId() === b.getColId(); });
  8844. };
  8845. ColumnController.prototype.getWidthOfColsInList = function (columnList) {
  8846. return columnList.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);
  8847. };
  8848. ColumnController.prototype.getGridBalancedTree = function () {
  8849. return this.gridBalancedTree;
  8850. };
  8851. ColumnController.prototype.hasFloatingFilters = function () {
  8852. var defaultColDef = this.gridOptionsWrapper.getDefaultColDef();
  8853. return (defaultColDef != null && defaultColDef.floatingFilter === true) ||
  8854. (this.columnDefs != null && this.columnDefs.some(function (c) { return c.floatingFilter === true; }));
  8855. };
  8856. ColumnController.prototype.getFirstDisplayedColumn = function () {
  8857. var isRtl = this.gridOptionsWrapper.isEnableRtl();
  8858. var queryOrder = [
  8859. 'getDisplayedLeftColumns',
  8860. 'getDisplayedCenterColumns',
  8861. 'getDisplayedRightColumns'
  8862. ];
  8863. if (isRtl) {
  8864. queryOrder.reverse();
  8865. }
  8866. for (var i = 0; i < queryOrder.length; i++) {
  8867. var container = this[queryOrder[i]]();
  8868. if (container.length) {
  8869. return isRtl ? _utils__WEBPACK_IMPORTED_MODULE_9__["_"].last(container) : container[0];
  8870. }
  8871. }
  8872. return null;
  8873. };
  8874. __decorate([
  8875. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('gridOptionsWrapper')
  8876. ], ColumnController.prototype, "gridOptionsWrapper", void 0);
  8877. __decorate([
  8878. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('expressionService')
  8879. ], ColumnController.prototype, "expressionService", void 0);
  8880. __decorate([
  8881. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnFactory')
  8882. ], ColumnController.prototype, "columnFactory", void 0);
  8883. __decorate([
  8884. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('displayedGroupCreator')
  8885. ], ColumnController.prototype, "displayedGroupCreator", void 0);
  8886. __decorate([
  8887. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('autoWidthCalculator')
  8888. ], ColumnController.prototype, "autoWidthCalculator", void 0);
  8889. __decorate([
  8890. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnUtils')
  8891. ], ColumnController.prototype, "columnUtils", void 0);
  8892. __decorate([
  8893. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnAnimationService')
  8894. ], ColumnController.prototype, "columnAnimationService", void 0);
  8895. __decorate([
  8896. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('autoGroupColService')
  8897. ], ColumnController.prototype, "autoGroupColService", void 0);
  8898. __decorate([
  8899. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])('aggFuncService')
  8900. ], ColumnController.prototype, "aggFuncService", void 0);
  8901. __decorate([
  8902. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])('valueCache')
  8903. ], ColumnController.prototype, "valueCache", void 0);
  8904. __decorate([
  8905. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])('animationFrameService')
  8906. ], ColumnController.prototype, "animationFrameService", void 0);
  8907. __decorate([
  8908. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('columnApi')
  8909. ], ColumnController.prototype, "columnApi", void 0);
  8910. __decorate([
  8911. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])('gridApi')
  8912. ], ColumnController.prototype, "gridApi", void 0);
  8913. __decorate([
  8914. _context_context__WEBPACK_IMPORTED_MODULE_6__["PostConstruct"]
  8915. ], ColumnController.prototype, "init", null);
  8916. __decorate([
  8917. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Qualifier"])('loggerFactory'))
  8918. ], ColumnController.prototype, "setBeans", null);
  8919. ColumnController = __decorate([
  8920. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Bean"])('columnController')
  8921. ], ColumnController);
  8922. return ColumnController;
  8923. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  8924. /***/ }),
  8925. /* 43 */
  8926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8927. "use strict";
  8928. __webpack_require__.r(__webpack_exports__);
  8929. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44);
  8930. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return _eventKeys__WEBPACK_IMPORTED_MODULE_0__["Events"]; });
  8931. /**
  8932. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  8933. * @version v23.2.1
  8934. * @link http://www.ag-grid.com/
  8935. * @license MIT
  8936. */
  8937. /***/ }),
  8938. /* 44 */
  8939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8940. "use strict";
  8941. __webpack_require__.r(__webpack_exports__);
  8942. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return Events; });
  8943. /**
  8944. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  8945. * @version v23.2.1
  8946. * @link http://www.ag-grid.com/
  8947. * @license MIT
  8948. */
  8949. var Events = /** @class */ (function () {
  8950. function Events() {
  8951. }
  8952. /** Everything has changed with the columns. Either complete new set of columns set, or user called setState()*/
  8953. Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged';
  8954. /** User has set in new columns. */
  8955. Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded';
  8956. /** The pivot mode flag was changed */
  8957. Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged';
  8958. /** A row group column was added, removed or order changed. */
  8959. Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';
  8960. /** expandAll / collapseAll was called from the api. */
  8961. Events.EVENT_EXPAND_COLLAPSE_ALL = 'expandOrCollapseAll';
  8962. /** A pivot column was added, removed or order changed. */
  8963. Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged';
  8964. /** The list of grid columns has changed. */
  8965. Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged';
  8966. /** A value column was added, removed or agg function was changed. */
  8967. Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged';
  8968. /** A column was moved */
  8969. Events.EVENT_COLUMN_MOVED = 'columnMoved';
  8970. /** One or more columns was shown / hidden */
  8971. Events.EVENT_COLUMN_VISIBLE = 'columnVisible';
  8972. /** One or more columns was pinned / unpinned*/
  8973. Events.EVENT_COLUMN_PINNED = 'columnPinned';
  8974. /** A column group was opened / closed */
  8975. Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened';
  8976. /** One or more columns was resized. If just one, the column in the event is set. */
  8977. Events.EVENT_COLUMN_RESIZED = 'columnResized';
  8978. /** The list of displayed columns has changed, can result from columns open / close, column move, pivot, group, etc */
  8979. Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged';
  8980. /** The list of virtual columns has changed, results from viewport changing */
  8981. Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged';
  8982. /** A row group was opened / closed */
  8983. Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened';
  8984. /** The client has set new data into the grid */
  8985. Events.EVENT_ROW_DATA_CHANGED = 'rowDataChanged';
  8986. /** The client has updated data for the grid */
  8987. Events.EVENT_ROW_DATA_UPDATED = 'rowDataUpdated';
  8988. /** The client has set new floating data into the grid */
  8989. Events.EVENT_PINNED_ROW_DATA_CHANGED = 'pinnedRowDataChanged';
  8990. /** Range selection has changed */
  8991. Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged';
  8992. /** Chart was created */
  8993. Events.EVENT_CHART_CREATED = 'chartCreated';
  8994. /** Chart Range selection has changed */
  8995. Events.EVENT_CHART_RANGE_SELECTION_CHANGED = 'chartRangeSelectionChanged';
  8996. /** Chart Options have changed */
  8997. Events.EVENT_CHART_OPTIONS_CHANGED = 'chartOptionsChanged';
  8998. /** Chart was destroyed */
  8999. Events.EVENT_CHART_DESTROYED = 'chartDestroyed';
  9000. /** For when the tool panel is shown / hidden */
  9001. Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED = 'toolPanelVisibleChanged';
  9002. /** Model was updated - grid updates the drawn rows when this happens */
  9003. Events.EVENT_MODEL_UPDATED = 'modelUpdated';
  9004. Events.EVENT_PASTE_START = 'pasteStart';
  9005. Events.EVENT_PASTE_END = 'pasteEnd';
  9006. Events.EVENT_FILL_START = 'fillStart';
  9007. Events.EVENT_FILL_END = 'fillEnd';
  9008. Events.EVENT_CELL_CLICKED = 'cellClicked';
  9009. Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked';
  9010. Events.EVENT_CELL_MOUSE_DOWN = 'cellMouseDown';
  9011. Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu';
  9012. Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged';
  9013. Events.EVENT_ROW_VALUE_CHANGED = 'rowValueChanged';
  9014. Events.EVENT_CELL_FOCUSED = 'cellFocused';
  9015. Events.EVENT_ROW_SELECTED = 'rowSelected';
  9016. Events.EVENT_SELECTION_CHANGED = 'selectionChanged';
  9017. Events.EVENT_CELL_KEY_DOWN = 'cellKeyDown';
  9018. Events.EVENT_CELL_KEY_PRESS = 'cellKeyPress';
  9019. Events.EVENT_CELL_MOUSE_OVER = 'cellMouseOver';
  9020. Events.EVENT_CELL_MOUSE_OUT = 'cellMouseOut';
  9021. /** 2 events for filtering. The grid LISTENS for filterChanged and afterFilterChanged */
  9022. Events.EVENT_FILTER_CHANGED = 'filterChanged';
  9023. /** Filter was change but not applied. Only useful if apply buttons are used in filters. */
  9024. Events.EVENT_FILTER_MODIFIED = 'filterModified';
  9025. Events.EVENT_FILTER_OPENED = 'filterOpened';
  9026. Events.EVENT_SORT_CHANGED = 'sortChanged';
  9027. /** A row was removed from the dom, for any reason. Use to clean up resources (if any) used by the row. */
  9028. Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved';
  9029. Events.EVENT_ROW_CLICKED = 'rowClicked';
  9030. Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked';
  9031. /** Gets called once after the grid has finished initialising. */
  9032. Events.EVENT_GRID_READY = 'gridReady';
  9033. /** Width of height of the main grid div has changed. Grid listens for this and does layout of grid if it's
  9034. * changed, so always filling the space it was given. */
  9035. Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged';
  9036. /** The indexes of the rows rendered has changed, eg user has scrolled to a new vertical position. */
  9037. Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged';
  9038. /** Rows were rendered for the first time (ie on async data load). */
  9039. Events.EVENT_FIRST_DATA_RENDERED = 'firstDataRendered';
  9040. /** A column drag has started, either resizing a column or moving a column. */
  9041. Events.EVENT_DRAG_STARTED = 'dragStarted';
  9042. /** A column drag has stopped */
  9043. Events.EVENT_DRAG_STOPPED = 'dragStopped';
  9044. Events.EVENT_CHECKBOX_CHANGED = 'checkboxChanged';
  9045. Events.EVENT_ROW_EDITING_STARTED = 'rowEditingStarted';
  9046. Events.EVENT_ROW_EDITING_STOPPED = 'rowEditingStopped';
  9047. Events.EVENT_CELL_EDITING_STARTED = 'cellEditingStarted';
  9048. Events.EVENT_CELL_EDITING_STOPPED = 'cellEditingStopped';
  9049. /** Main body of grid has scrolled, either horizontally or vertically */
  9050. Events.EVENT_BODY_SCROLL = 'bodyScroll';
  9051. Events.EVENT_ANIMATION_QUEUE_EMPTY = 'animationQueueEmpty';
  9052. Events.EVENT_HEIGHT_SCALE_CHANGED = 'heightScaleChanged';
  9053. /** The displayed page for pagination has changed. For example the data was filtered or sorted,
  9054. * or the user has moved to a different page. */
  9055. Events.EVENT_PAGINATION_CHANGED = 'paginationChanged';
  9056. /** Only used by React, Angular 2+, Web Components and VueJS ag-Grid components
  9057. * (not used if doing plain JavaScript or Angular 1.x). If the grid receives changes due
  9058. * to bound properties, this event fires after the grid has finished processing the change. */
  9059. Events.EVENT_COMPONENT_STATE_CHANGED = 'componentStateChanged';
  9060. /** All items from here down are used internally by the grid, not intended for external use. */
  9061. // not documented, either experimental, or we just don't want users using an depending on them
  9062. Events.EVENT_BODY_HEIGHT_CHANGED = 'bodyHeightChanged';
  9063. Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED = 'displayedColumnsWidthChanged';
  9064. Events.EVENT_SCROLL_VISIBILITY_CHANGED = 'scrollVisibilityChanged';
  9065. Events.EVENT_COLUMN_HOVER_CHANGED = 'columnHoverChanged';
  9066. Events.EVENT_FLASH_CELLS = 'flashCells';
  9067. Events.EVENT_ROW_DRAG_ENTER = 'rowDragEnter';
  9068. Events.EVENT_ROW_DRAG_MOVE = 'rowDragMove';
  9069. Events.EVENT_ROW_DRAG_LEAVE = 'rowDragLeave';
  9070. Events.EVENT_ROW_DRAG_END = 'rowDragEnd';
  9071. // primarily for charts
  9072. Events.EVENT_POPUP_TO_FRONT = 'popupToFront';
  9073. // these are used for server side group and agg - only used by CS with Viewport Row Model - intention is
  9074. // to design these better around server side functions and then release to general public when fully working with
  9075. // all the row models.
  9076. Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST = 'columnRowGroupChangeRequest';
  9077. Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST = 'columnPivotChangeRequest';
  9078. Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST = 'columnValueChangeRequest';
  9079. Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST = 'columnAggFuncChangeRequest';
  9080. Events.EVENT_KEYBOARD_FOCUS = 'keyboardFocus';
  9081. Events.EVENT_MOUSE_FOCUS = 'mouseFocus';
  9082. return Events;
  9083. }());
  9084. /***/ }),
  9085. /* 45 */
  9086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9087. "use strict";
  9088. __webpack_require__.r(__webpack_exports__);
  9089. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupInstanceIdCreator", function() { return GroupInstanceIdCreator; });
  9090. /**
  9091. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  9092. * @version v23.2.1
  9093. * @link http://www.ag-grid.com/
  9094. * @license MIT
  9095. */
  9096. // class returns unique instance id's for columns.
  9097. // eg, the following calls (in this order) will result in:
  9098. //
  9099. // getInstanceIdForKey('country') => 0
  9100. // getInstanceIdForKey('country') => 1
  9101. // getInstanceIdForKey('country') => 2
  9102. // getInstanceIdForKey('country') => 3
  9103. // getInstanceIdForKey('age') => 0
  9104. // getInstanceIdForKey('age') => 1
  9105. // getInstanceIdForKey('country') => 4
  9106. var GroupInstanceIdCreator = /** @class */ (function () {
  9107. function GroupInstanceIdCreator() {
  9108. // this map contains keys to numbers, so we remember what the last call was
  9109. this.existingIds = {};
  9110. }
  9111. GroupInstanceIdCreator.prototype.getInstanceIdForKey = function (key) {
  9112. var lastResult = this.existingIds[key];
  9113. var result;
  9114. if (typeof lastResult !== 'number') {
  9115. // first time this key
  9116. result = 0;
  9117. }
  9118. else {
  9119. result = lastResult + 1;
  9120. }
  9121. this.existingIds[key] = result;
  9122. return result;
  9123. };
  9124. return GroupInstanceIdCreator;
  9125. }());
  9126. /***/ }),
  9127. /* 46 */
  9128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9129. "use strict";
  9130. __webpack_require__.r(__webpack_exports__);
  9131. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnUtils", function() { return ColumnUtils; });
  9132. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
  9133. /* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33);
  9134. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  9135. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  9136. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41);
  9137. /**
  9138. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  9139. * @version v23.2.1
  9140. * @link http://www.ag-grid.com/
  9141. * @license MIT
  9142. */
  9143. var __extends = (undefined && undefined.__extends) || (function () {
  9144. var extendStatics = function (d, b) {
  9145. extendStatics = Object.setPrototypeOf ||
  9146. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9147. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  9148. return extendStatics(d, b);
  9149. };
  9150. return function (d, b) {
  9151. extendStatics(d, b);
  9152. function __() { this.constructor = d; }
  9153. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9154. };
  9155. })();
  9156. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  9157. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  9158. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  9159. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  9160. return c > 3 && r && Object.defineProperty(target, key, r), r;
  9161. };
  9162. // takes in a list of columns, as specified by the column definitions, and returns column groups
  9163. var ColumnUtils = /** @class */ (function (_super) {
  9164. __extends(ColumnUtils, _super);
  9165. function ColumnUtils() {
  9166. return _super !== null && _super.apply(this, arguments) || this;
  9167. }
  9168. ColumnUtils.prototype.calculateColInitialWidth = function (colDef) {
  9169. var optionsWrapper = this.gridOptionsWrapper;
  9170. var minColWidth = colDef.minWidth != null ? colDef.minWidth : optionsWrapper.getMinColWidth();
  9171. var maxColWidth = colDef.maxWidth != null ? colDef.maxWidth : (optionsWrapper.getMaxColWidth() || _utils__WEBPACK_IMPORTED_MODULE_3__["_"].getMaxSafeInteger());
  9172. var width = colDef.width != null ? colDef.width : optionsWrapper.getColWidth();
  9173. return Math.max(Math.min(width, maxColWidth), minColWidth);
  9174. };
  9175. ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) {
  9176. var result = [];
  9177. var found = false;
  9178. var recursePath = function (balancedColumnTree, dept) {
  9179. for (var i = 0; i < balancedColumnTree.length; i++) {
  9180. if (found) {
  9181. return;
  9182. }
  9183. // quit the search, so 'result' is kept with the found result
  9184. var node = balancedColumnTree[i];
  9185. if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
  9186. var nextNode = node;
  9187. recursePath(nextNode.getChildren(), dept + 1);
  9188. result[dept] = node;
  9189. }
  9190. else if (node === column) {
  9191. found = true;
  9192. }
  9193. }
  9194. };
  9195. recursePath(originalBalancedTree, 0);
  9196. // we should always find the path, but in case there is a bug somewhere, returning null
  9197. // will make it fail rather than provide a 'hard to track down' bug
  9198. return found ? result : null;
  9199. };
  9200. /* public getPathForColumn(column: Column, allDisplayedColumnGroups: ColumnGroupChild[]): ColumnGroup[] {
  9201. let result: ColumnGroup[] = [];
  9202. let found = false;
  9203. recursePath(allDisplayedColumnGroups, 0);
  9204. // we should always find the path, but in case there is a bug somewhere, returning null
  9205. // will make it fail rather than provide a 'hard to track down' bug
  9206. if (found) {
  9207. return result;
  9208. } else {
  9209. return null;
  9210. }
  9211. function recursePath(balancedColumnTree: ColumnGroupChild[], dept: number): void {
  9212. for (let i = 0; i<balancedColumnTree.length; i++) {
  9213. if (found) {
  9214. // quit the search, so 'result' is kept with the found result
  9215. return;
  9216. }
  9217. let node = balancedColumnTree[i];
  9218. if (node instanceof ColumnGroup) {
  9219. let nextNode = <ColumnGroup> node;
  9220. recursePath(nextNode.getChildren(), dept+1);
  9221. result[dept] = node;
  9222. } else {
  9223. if (node === column) {
  9224. found = true;
  9225. }
  9226. }
  9227. }
  9228. }
  9229. }*/
  9230. ColumnUtils.prototype.depthFirstOriginalTreeSearch = function (parent, tree, callback) {
  9231. var _this = this;
  9232. if (!tree) {
  9233. return;
  9234. }
  9235. tree.forEach(function (child) {
  9236. if (child instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_1__["OriginalColumnGroup"]) {
  9237. _this.depthFirstOriginalTreeSearch(child, child.getChildren(), callback);
  9238. }
  9239. callback(child, parent);
  9240. });
  9241. };
  9242. ColumnUtils.prototype.depthFirstAllColumnTreeSearch = function (tree, callback) {
  9243. var _this = this;
  9244. if (!tree) {
  9245. return;
  9246. }
  9247. tree.forEach(function (child) {
  9248. if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  9249. _this.depthFirstAllColumnTreeSearch(child.getChildren(), callback);
  9250. }
  9251. callback(child);
  9252. });
  9253. };
  9254. ColumnUtils.prototype.depthFirstDisplayedColumnTreeSearch = function (tree, callback) {
  9255. var _this = this;
  9256. if (!tree) {
  9257. return;
  9258. }
  9259. tree.forEach(function (child) {
  9260. if (child instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  9261. _this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);
  9262. }
  9263. callback(child);
  9264. });
  9265. };
  9266. __decorate([
  9267. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  9268. ], ColumnUtils.prototype, "gridOptionsWrapper", void 0);
  9269. ColumnUtils = __decorate([
  9270. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('columnUtils')
  9271. ], ColumnUtils);
  9272. return ColumnUtils;
  9273. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_4__["BeanStub"]));
  9274. /***/ }),
  9275. /* 47 */
  9276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9277. "use strict";
  9278. __webpack_require__.r(__webpack_exports__);
  9279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisplayedGroupCreator", function() { return DisplayedGroupCreator; });
  9280. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  9281. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
  9282. /* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33);
  9283. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  9284. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41);
  9285. /**
  9286. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  9287. * @version v23.2.1
  9288. * @link http://www.ag-grid.com/
  9289. * @license MIT
  9290. */
  9291. var __extends = (undefined && undefined.__extends) || (function () {
  9292. var extendStatics = function (d, b) {
  9293. extendStatics = Object.setPrototypeOf ||
  9294. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9295. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  9296. return extendStatics(d, b);
  9297. };
  9298. return function (d, b) {
  9299. extendStatics(d, b);
  9300. function __() { this.constructor = d; }
  9301. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9302. };
  9303. })();
  9304. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  9305. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  9306. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  9307. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  9308. return c > 3 && r && Object.defineProperty(target, key, r), r;
  9309. };
  9310. // takes in a list of columns, as specified by the column definitions, and returns column groups
  9311. var DisplayedGroupCreator = /** @class */ (function (_super) {
  9312. __extends(DisplayedGroupCreator, _super);
  9313. function DisplayedGroupCreator() {
  9314. return _super !== null && _super.apply(this, arguments) || this;
  9315. }
  9316. DisplayedGroupCreator.prototype.createDisplayedGroups = function (
  9317. // all displayed columns sorted - this is the columns the grid should show
  9318. sortedVisibleColumns,
  9319. // the tree of columns, as provided by the users, used to know what groups columns roll up into
  9320. balancedColumnTree,
  9321. // creates unique id's for the group
  9322. groupInstanceIdCreator,
  9323. // whether it's left, right or center col
  9324. pinned,
  9325. // we try to reuse old groups if we can, to allow gui to do animation
  9326. oldDisplayedGroups) {
  9327. var _this = this;
  9328. var result = [];
  9329. var previousRealPath;
  9330. var previousOriginalPath;
  9331. var oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);
  9332. // go through each column, then do a bottom up comparison to the previous column, and start
  9333. // to share groups if they converge at any point.
  9334. sortedVisibleColumns.forEach(function (currentColumn) {
  9335. var currentOriginalPath = _this.getOriginalPathForColumn(balancedColumnTree, currentColumn);
  9336. var currentRealPath = [];
  9337. var firstColumn = !previousOriginalPath;
  9338. for (var i = 0; i < currentOriginalPath.length; i++) {
  9339. if (firstColumn || currentOriginalPath[i] !== previousOriginalPath[i]) {
  9340. // new group needed
  9341. var newGroup = _this.createColumnGroup(currentOriginalPath[i], groupInstanceIdCreator, oldColumnsMapped, pinned);
  9342. currentRealPath[i] = newGroup;
  9343. // if top level, add to result, otherwise add to parent
  9344. if (i == 0) {
  9345. result.push(newGroup);
  9346. }
  9347. else {
  9348. currentRealPath[i - 1].addChild(newGroup);
  9349. }
  9350. }
  9351. else {
  9352. // reuse old group
  9353. currentRealPath[i] = previousRealPath[i];
  9354. }
  9355. }
  9356. var noColumnGroups = currentRealPath.length === 0;
  9357. if (noColumnGroups) {
  9358. // if we are not grouping, then the result of the above is an empty
  9359. // path (no groups), and we just add the column to the root list.
  9360. result.push(currentColumn);
  9361. }
  9362. else {
  9363. var leafGroup = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].last(currentRealPath);
  9364. leafGroup.addChild(currentColumn);
  9365. }
  9366. previousRealPath = currentRealPath;
  9367. previousOriginalPath = currentOriginalPath;
  9368. });
  9369. this.setupParentsIntoColumns(result, null);
  9370. return result;
  9371. };
  9372. DisplayedGroupCreator.prototype.createColumnGroup = function (originalGroup, groupInstanceIdCreator, oldColumnsMapped, pinned) {
  9373. var groupId = originalGroup.getGroupId();
  9374. var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);
  9375. var uniqueId = _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"].createUniqueId(groupId, instanceId);
  9376. var columnGroup = oldColumnsMapped[uniqueId];
  9377. // if the user is setting new colDefs, it is possible that the id's overlap, and we
  9378. // would have a false match from above. so we double check we are talking about the
  9379. // same original column group.
  9380. if (columnGroup && columnGroup.getOriginalColumnGroup() !== originalGroup) {
  9381. columnGroup = null;
  9382. }
  9383. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(columnGroup)) {
  9384. // clean out the old column group here, as we will be adding children into it again
  9385. columnGroup.reset();
  9386. }
  9387. else {
  9388. columnGroup = new _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"](originalGroup, groupId, instanceId, pinned);
  9389. this.context.createBean(columnGroup);
  9390. }
  9391. return columnGroup;
  9392. };
  9393. // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup
  9394. DisplayedGroupCreator.prototype.mapOldGroupsById = function (displayedGroups) {
  9395. var result = {};
  9396. var recursive = function (columnsOrGroups) {
  9397. columnsOrGroups.forEach(function (columnOrGroup) {
  9398. if (columnOrGroup instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"]) {
  9399. var columnGroup = columnOrGroup;
  9400. result[columnOrGroup.getUniqueId()] = columnGroup;
  9401. recursive(columnGroup.getChildren());
  9402. }
  9403. });
  9404. };
  9405. if (displayedGroups) {
  9406. recursive(displayedGroups);
  9407. }
  9408. return result;
  9409. };
  9410. DisplayedGroupCreator.prototype.setupParentsIntoColumns = function (columnsOrGroups, parent) {
  9411. var _this = this;
  9412. columnsOrGroups.forEach(function (columnsOrGroup) {
  9413. columnsOrGroup.setParent(parent);
  9414. if (columnsOrGroup instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"]) {
  9415. var columnGroup = columnsOrGroup;
  9416. _this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup);
  9417. }
  9418. });
  9419. };
  9420. DisplayedGroupCreator.prototype.getOriginalPathForColumn = function (balancedColumnTree, column) {
  9421. var result = [];
  9422. var found = false;
  9423. var recursePath = function (balancedColumnTree, dept) {
  9424. for (var i = 0; i < balancedColumnTree.length; i++) {
  9425. // quit the search, so 'result' is kept with the found result
  9426. if (found) {
  9427. return;
  9428. }
  9429. var node = balancedColumnTree[i];
  9430. if (node instanceof _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_2__["OriginalColumnGroup"]) {
  9431. var nextNode = node;
  9432. recursePath(nextNode.getChildren(), dept + 1);
  9433. result[dept] = node;
  9434. }
  9435. else if (node === column) {
  9436. found = true;
  9437. }
  9438. }
  9439. };
  9440. recursePath(balancedColumnTree, 0);
  9441. // it's possible we didn't find a path. this happens if the column is generated
  9442. // by the grid (auto-group), in that the definition didn't come from the client. in this case,
  9443. // we create a fake original path.
  9444. if (found) {
  9445. return result;
  9446. }
  9447. console.warn('could not get path');
  9448. return null;
  9449. };
  9450. __decorate([
  9451. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnUtils')
  9452. ], DisplayedGroupCreator.prototype, "columnUtils", void 0);
  9453. DisplayedGroupCreator = __decorate([
  9454. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('displayedGroupCreator')
  9455. ], DisplayedGroupCreator);
  9456. return DisplayedGroupCreator;
  9457. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_4__["BeanStub"]));
  9458. /***/ }),
  9459. /* 48 */
  9460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9461. "use strict";
  9462. __webpack_require__.r(__webpack_exports__);
  9463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentUtil", function() { return ComponentUtil; });
  9464. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
  9465. /* harmony import */ var _propertyKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49);
  9466. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50);
  9467. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  9468. /**
  9469. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  9470. * @version v23.2.1
  9471. * @link http://www.ag-grid.com/
  9472. * @license MIT
  9473. */
  9474. var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
  9475. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  9476. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  9477. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  9478. r[k] = a[j];
  9479. return r;
  9480. };
  9481. var ComponentUtil = /** @class */ (function () {
  9482. function ComponentUtil() {
  9483. }
  9484. ComponentUtil.getEventCallbacks = function () {
  9485. if (!ComponentUtil.EVENT_CALLBACKS) {
  9486. ComponentUtil.EVENT_CALLBACKS = ComponentUtil.EVENTS.map(function (event) { return ComponentUtil.getCallbackForEvent(event); });
  9487. }
  9488. return ComponentUtil.EVENT_CALLBACKS;
  9489. };
  9490. ComponentUtil.copyAttributesToGridOptions = function (gridOptions, component, skipEventDeprecationCheck) {
  9491. if (skipEventDeprecationCheck === void 0) { skipEventDeprecationCheck = false; }
  9492. checkForDeprecated(component);
  9493. // create empty grid options if none were passed
  9494. if (typeof gridOptions !== 'object') {
  9495. gridOptions = {};
  9496. }
  9497. // to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'
  9498. var pGridOptions = gridOptions;
  9499. var keyExists = function (key) { return typeof component[key] !== 'undefined'; };
  9500. // add in all the simple properties
  9501. __spreadArrays(ComponentUtil.ARRAY_PROPERTIES, ComponentUtil.STRING_PROPERTIES, ComponentUtil.OBJECT_PROPERTIES, ComponentUtil.FUNCTION_PROPERTIES, ComponentUtil.getEventCallbacks()).filter(keyExists)
  9502. .forEach(function (key) { return pGridOptions[key] = component[key]; });
  9503. ComponentUtil.BOOLEAN_PROPERTIES
  9504. .filter(keyExists)
  9505. .forEach(function (key) { return pGridOptions[key] = ComponentUtil.toBoolean(component[key]); });
  9506. ComponentUtil.NUMBER_PROPERTIES
  9507. .filter(keyExists)
  9508. .forEach(function (key) { return pGridOptions[key] = ComponentUtil.toNumber(component[key]); });
  9509. // purely for event deprecation checks (for frameworks - wouldn't apply for non-fw versions)
  9510. if (!skipEventDeprecationCheck) {
  9511. ComponentUtil.EVENTS
  9512. // React uses onXXX, not sure why this is different to the other frameworks
  9513. .filter(function (event) { return keyExists(event) || keyExists(ComponentUtil.getCallbackForEvent(event)); })
  9514. .forEach(function (event) { return _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].checkEventDeprecation(event); });
  9515. }
  9516. return gridOptions;
  9517. };
  9518. ComponentUtil.getCallbackForEvent = function (eventName) {
  9519. if (!eventName || eventName.length < 2) {
  9520. return eventName;
  9521. }
  9522. else {
  9523. return 'on' + eventName[0].toUpperCase() + eventName.substr(1);
  9524. }
  9525. };
  9526. ComponentUtil.processOnChange = function (changes, gridOptions, api, columnApi) {
  9527. if (!changes) {
  9528. return;
  9529. }
  9530. checkForDeprecated(changes);
  9531. // to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'
  9532. var pGridOptions = gridOptions;
  9533. var keyExists = function (key) { return changes[key]; };
  9534. // check if any change for the simple types, and if so, then just copy in the new value
  9535. __spreadArrays(ComponentUtil.ARRAY_PROPERTIES, ComponentUtil.OBJECT_PROPERTIES, ComponentUtil.STRING_PROPERTIES, ComponentUtil.getEventCallbacks()).filter(keyExists)
  9536. .forEach(function (key) { return pGridOptions[key] = changes[key].currentValue; });
  9537. ComponentUtil.BOOLEAN_PROPERTIES
  9538. .filter(keyExists)
  9539. .forEach(function (key) { return pGridOptions[key] = ComponentUtil.toBoolean(changes[key].currentValue); });
  9540. ComponentUtil.NUMBER_PROPERTIES
  9541. .filter(keyExists)
  9542. .forEach(function (key) { return pGridOptions[key] = ComponentUtil.toNumber(changes[key].currentValue); });
  9543. if (changes.enableCellTextSelection) {
  9544. api.setEnableCellTextSelection(ComponentUtil.toBoolean(changes.enableCellTextSelection.currentValue));
  9545. }
  9546. if (changes.showToolPanel) {
  9547. api.showToolPanel(ComponentUtil.toBoolean(changes.showToolPanel.currentValue));
  9548. }
  9549. if (changes.quickFilterText) {
  9550. api.setQuickFilter(changes.quickFilterText.currentValue);
  9551. }
  9552. if (changes.rowData) {
  9553. api.setRowData(changes.rowData.currentValue);
  9554. }
  9555. if (changes.pinnedTopRowData) {
  9556. api.setPinnedTopRowData(changes.pinnedTopRowData.currentValue);
  9557. }
  9558. if (changes.pinnedBottomRowData) {
  9559. api.setPinnedBottomRowData(changes.pinnedBottomRowData.currentValue);
  9560. }
  9561. if (changes.autoGroupColumnDef) {
  9562. api.setAutoGroupColumnDef(changes.autoGroupColumnDef.currentValue, "gridOptionsChanged");
  9563. }
  9564. if (changes.columnDefs) {
  9565. api.setColumnDefs(changes.columnDefs.currentValue, "gridOptionsChanged");
  9566. }
  9567. if (changes.datasource) {
  9568. api.setDatasource(changes.datasource.currentValue);
  9569. }
  9570. if (changes.headerHeight) {
  9571. api.setHeaderHeight(ComponentUtil.toNumber(changes.headerHeight.currentValue));
  9572. }
  9573. if (changes.paginationPageSize) {
  9574. api.paginationSetPageSize(ComponentUtil.toNumber(changes.paginationPageSize.currentValue));
  9575. }
  9576. if (changes.pivotMode) {
  9577. columnApi.setPivotMode(ComponentUtil.toBoolean(changes.pivotMode.currentValue));
  9578. }
  9579. if (changes.groupRemoveSingleChildren) {
  9580. api.setGroupRemoveSingleChildren(ComponentUtil.toBoolean(changes.groupRemoveSingleChildren.currentValue));
  9581. }
  9582. if (changes.suppressRowDrag) {
  9583. api.setSuppressRowDrag(ComponentUtil.toBoolean(changes.suppressRowDrag.currentValue));
  9584. }
  9585. if (changes.suppressMoveWhenRowDragging) {
  9586. api.setSuppressMoveWhenRowDragging(ComponentUtil.toBoolean(changes.suppressMoveWhenRowDragging.currentValue));
  9587. }
  9588. if (changes.suppressRowClickSelection) {
  9589. api.setSuppressRowClickSelection(ComponentUtil.toBoolean(changes.suppressRowClickSelection.currentValue));
  9590. }
  9591. if (changes.gridAutoHeight) {
  9592. api.setGridAutoHeight(ComponentUtil.toBoolean(changes.gridAutoHeight.currentValue));
  9593. }
  9594. if (changes.suppressClipboardPaste) {
  9595. api.setSuppressClipboardPaste(ComponentUtil.toBoolean(changes.suppressClipboardPaste.currentValue));
  9596. }
  9597. if (changes.sideBar) {
  9598. api.setSideBar(changes.sideBar.currentValue);
  9599. }
  9600. // copy changes into an event for dispatch
  9601. var event = {
  9602. type: _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COMPONENT_STATE_CHANGED,
  9603. api: gridOptions.api,
  9604. columnApi: gridOptions.columnApi
  9605. };
  9606. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].iterateObject(changes, function (key, value) {
  9607. event[key] = value;
  9608. });
  9609. api.dispatchEvent(event);
  9610. };
  9611. ComponentUtil.toBoolean = function (value) {
  9612. if (typeof value === 'boolean') {
  9613. return value;
  9614. }
  9615. else if (typeof value === 'string') {
  9616. // for boolean, compare to empty String to allow attributes appearing with
  9617. // no value to be treated as 'true'
  9618. return value.toUpperCase() === 'TRUE' || value == '';
  9619. }
  9620. else {
  9621. return false;
  9622. }
  9623. };
  9624. ComponentUtil.toNumber = function (value) {
  9625. if (typeof value === 'number') {
  9626. return value;
  9627. }
  9628. else if (typeof value === 'string') {
  9629. return Number(value);
  9630. }
  9631. else {
  9632. return undefined;
  9633. }
  9634. };
  9635. // all the events are populated in here AFTER this class (at the bottom of the file).
  9636. ComponentUtil.EVENTS = [];
  9637. ComponentUtil.STRING_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].STRING_PROPERTIES;
  9638. ComponentUtil.OBJECT_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].OBJECT_PROPERTIES;
  9639. ComponentUtil.ARRAY_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].ARRAY_PROPERTIES;
  9640. ComponentUtil.NUMBER_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].NUMBER_PROPERTIES;
  9641. ComponentUtil.BOOLEAN_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].BOOLEAN_PROPERTIES;
  9642. ComponentUtil.FUNCTION_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].FUNCTION_PROPERTIES;
  9643. ComponentUtil.ALL_PROPERTIES = _propertyKeys__WEBPACK_IMPORTED_MODULE_1__["PropertyKeys"].ALL_PROPERTIES;
  9644. return ComponentUtil;
  9645. }());
  9646. ComponentUtil.EVENTS = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].values(_events__WEBPACK_IMPORTED_MODULE_0__["Events"]);
  9647. function checkForDeprecated(changes) {
  9648. if (changes.rowDeselected || changes.onRowDeselected) {
  9649. console.warn('ag-grid: as of v3.4 rowDeselected no longer exists. Please check the docs.');
  9650. }
  9651. }
  9652. /***/ }),
  9653. /* 49 */
  9654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9655. "use strict";
  9656. __webpack_require__.r(__webpack_exports__);
  9657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyKeys", function() { return PropertyKeys; });
  9658. /**
  9659. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  9660. * @version v23.2.1
  9661. * @link http://www.ag-grid.com/
  9662. * @license MIT
  9663. */
  9664. var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
  9665. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  9666. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  9667. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  9668. r[k] = a[j];
  9669. return r;
  9670. };
  9671. /**
  9672. * These keys are used for validating properties supplied on a gridOptions object, and for code generation.
  9673. * If you change the properties on the gridOptions interface, you *must* update this file as well to be consistent.
  9674. */
  9675. var PropertyKeys = /** @class */ (function () {
  9676. function PropertyKeys() {
  9677. }
  9678. PropertyKeys.STRING_PROPERTIES = [
  9679. 'sortingOrder', 'rowClass', 'rowSelection', 'overlayLoadingTemplate',
  9680. 'overlayNoRowsTemplate', 'quickFilterText', 'rowModelType',
  9681. 'editType', 'domLayout', 'clipboardDeliminator', 'rowGroupPanelShow',
  9682. 'multiSortKey', 'pivotColumnGroupTotals', 'pivotRowTotals', 'pivotPanelShow'
  9683. ];
  9684. PropertyKeys.OBJECT_PROPERTIES = [
  9685. 'components', 'frameworkComponents', 'rowStyle', 'context', 'autoGroupColumnDef', 'groupColumnDef', 'localeText',
  9686. 'icons', 'datasource', 'serverSideDatasource', 'viewportDatasource', 'groupRowRendererParams', 'aggFuncs',
  9687. 'fullWidthCellRendererParams', 'defaultColGroupDef', 'defaultColDef', 'defaultExportParams', 'columnTypes',
  9688. 'rowClassRules', 'detailGridOptions', 'detailCellRendererParams', 'loadingCellRendererParams', 'loadingOverlayComponentParams',
  9689. 'noRowsOverlayComponentParams', 'popupParent', 'colResizeDefault', 'reduxStore', 'statusBar', 'sideBar'
  9690. ];
  9691. PropertyKeys.ARRAY_PROPERTIES = [
  9692. 'slaveGrids', 'alignedGrids', 'rowData', 'columnDefs', 'excelStyles', 'pinnedTopRowData', 'pinnedBottomRowData'
  9693. ];
  9694. PropertyKeys.NUMBER_PROPERTIES = [
  9695. 'rowHeight', 'detailRowHeight', 'rowBuffer', 'colWidth', 'headerHeight', 'groupHeaderHeight', 'floatingFiltersHeight',
  9696. 'pivotHeaderHeight', 'pivotGroupHeaderHeight', 'groupDefaultExpanded', 'minColWidth', 'maxColWidth', 'viewportRowModelPageSize',
  9697. 'viewportRowModelBufferSize', 'autoSizePadding', 'maxBlocksInCache', 'maxConcurrentDatasourceRequests', 'tooltipShowDelay',
  9698. 'cacheOverflowSize', 'paginationPageSize', 'cacheBlockSize', 'infiniteInitialRowCount', 'scrollbarWidth', 'paginationStartPage',
  9699. 'infiniteBlockSize', 'batchUpdateWaitMillis', 'asyncTransactionWaitMillis', 'blockLoadDebounceMillis', 'keepDetailRowsCount',
  9700. 'undoRedoCellEditingLimit', 'cellFlashDelay', 'cellFadeDelay'
  9701. ];
  9702. PropertyKeys.BOOLEAN_PROPERTIES = [
  9703. 'toolPanelSuppressRowGroups', 'toolPanelSuppressValues', 'toolPanelSuppressPivots', 'toolPanelSuppressPivotMode',
  9704. 'toolPanelSuppressSideButtons', 'toolPanelSuppressColumnFilter', 'toolPanelSuppressColumnSelectAll',
  9705. 'toolPanelSuppressColumnExpandAll', 'suppressMakeColumnVisibleAfterUnGroup', 'suppressRowClickSelection',
  9706. 'suppressCellSelection', 'suppressHorizontalScroll', 'alwaysShowVerticalScroll', 'debug', 'enableBrowserTooltips',
  9707. 'enableColResize', 'enableCellExpressions', 'enableSorting', 'enableServerSideSorting', 'enableFilter', 'enableServerSideFilter',
  9708. 'angularCompileRows', 'angularCompileFilters', 'angularCompileHeaders', 'groupSuppressAutoColumn', 'groupSelectsChildren',
  9709. 'groupIncludeFooter', 'groupIncludeTotalFooter', 'groupUseEntireRow', 'groupSuppressRow', 'groupSuppressBlankHeader',
  9710. 'forPrint', 'suppressMenuHide', 'rowDeselection', 'unSortIcon', 'suppressMultiSort', 'singleClickEdit', 'suppressLoadingOverlay',
  9711. 'suppressNoRowsOverlay', 'suppressAutoSize', 'skipHeaderOnAutoSize', 'suppressParentsInRowNodes', 'showToolPanel',
  9712. 'suppressColumnMoveAnimation', 'suppressMovableColumns', 'suppressFieldDotNotation', 'enableRangeSelection', 'enableRangeHandle',
  9713. 'enableFillHandle', 'suppressClearOnFillReduction', 'deltaSort', 'suppressTouch', 'suppressAsyncEvents', 'allowContextMenuWithControlKey',
  9714. 'suppressContextMenu', 'suppressMenuFilterPanel', 'suppressMenuMainPanel', 'suppressMenuColumnPanel', 'rememberGroupStateWhenNewData',
  9715. 'enableCellChangeFlash', 'suppressDragLeaveHidesColumns', 'suppressMiddleClickScrolls', 'suppressPreventDefaultOnMouseWheel',
  9716. 'suppressUseColIdForGroups', 'suppressCopyRowsToClipboard', 'copyHeadersToClipboard', 'pivotMode', 'suppressAggFuncInHeader',
  9717. 'suppressColumnVirtualisation', 'suppressAggAtRootLevel', 'suppressFocusAfterRefresh', 'functionsPassive', 'functionsReadOnly',
  9718. 'animateRows', 'groupSelectsFiltered', 'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'enableRtl', 'suppressClickEdit',
  9719. 'rowDragManaged', 'suppressRowDrag', 'suppressMoveWhenRowDragging', 'enableMultiRowDragging', 'enableGroupEdit', 'embedFullWidthRows',
  9720. 'deprecatedEmbedFullWidthRows', 'suppressTabbing', 'suppressPaginationPanel', 'floatingFilter', 'groupHideOpenParents', 'groupMultiAutoColumn',
  9721. 'pagination', 'stopEditingWhenGridLosesFocus', 'paginationAutoPageSize', 'suppressScrollOnNewData', 'purgeClosedRowNodes', 'cacheQuickFilter',
  9722. 'deltaRowDataMode', 'ensureDomOrder', 'accentedSort', 'pivotTotals', 'suppressChangeDetection', 'valueCache', 'valueCacheNeverExpires',
  9723. 'aggregateOnlyChangedColumns', 'suppressAnimationFrame', 'suppressExcelExport', 'suppressCsvExport', 'treeData', 'masterDetail',
  9724. 'suppressMultiRangeSelection', 'enterMovesDownAfterEdit', 'enterMovesDown', 'suppressPropertyNamesCheck', 'rowMultiSelectWithClick',
  9725. 'contractColumnSelection', 'suppressEnterpriseResetOnNewColumns', 'enableOldSetFilterModel', 'suppressRowHoverHighlight', 'gridAutoHeight',
  9726. 'suppressRowTransform', 'suppressClipboardPaste', 'suppressLastEmptyLineOnPaste', 'serverSideSortingAlwaysResets', 'reactNext',
  9727. 'suppressSetColumnStateEvents', 'enableCharts', 'deltaColumnMode', 'suppressMaintainUnsortedOrder', 'enableCellTextSelection',
  9728. 'suppressBrowserResizeObserver', 'suppressMaxRenderedRowRestriction', 'excludeChildrenWhenTreeDataFiltering', 'tooltipMouseTrack',
  9729. 'keepDetailRows', 'paginateChildRows', 'preventDefaultOnContextMenu', 'undoRedoCellEditing', 'allowDragFromColumnsToolPanel',
  9730. 'immutableData', 'immutableColumns', 'pivotSuppressAutoColumn'
  9731. ];
  9732. /** You do not need to include event callbacks in this list, as they are generated automatically. */
  9733. PropertyKeys.FUNCTION_PROPERTIES = [
  9734. 'localeTextFunc', 'groupRowInnerRenderer', 'groupRowInnerRendererFramework', 'dateComponent', 'dateComponentFramework', 'groupRowRenderer',
  9735. 'groupRowRendererFramework', 'isExternalFilterPresent', 'getRowHeight', 'doesExternalFilterPass', 'getRowClass', 'getRowStyle',
  9736. 'getRowClassRules', 'traverseNode', 'getContextMenuItems', 'getMainMenuItems', 'processRowPostCreate', 'processCellForClipboard',
  9737. 'getNodeChildDetails', 'groupRowAggNodes', 'getRowNodeId', 'isFullWidthCell', 'fullWidthCellRenderer', 'fullWidthCellRendererFramework',
  9738. 'doesDataFlower', 'processSecondaryColDef', 'processSecondaryColGroupDef', 'getBusinessKeyForNode', 'sendToClipboard', 'navigateToNextCell',
  9739. 'tabToNextCell', 'getDetailRowData', 'processCellFromClipboard', 'getDocument', 'postProcessPopup', 'getChildCount', 'getDataPath',
  9740. 'loadingCellRenderer', 'loadingCellRendererFramework', 'loadingOverlayComponent', 'loadingOverlayComponentFramework', 'noRowsOverlayComponent',
  9741. 'noRowsOverlayComponentFramework', 'detailCellRenderer', 'detailCellRendererFramework', 'defaultGroupSortComparator', 'isRowMaster',
  9742. 'isRowSelectable', 'postSort', 'processHeaderForClipboard', 'paginationNumberFormatter', 'processDataFromClipboard', 'getServerSideGroupKey',
  9743. 'isServerSideGroup', 'suppressKeyboardEvent', 'createChartContainer', 'processChartOptions', 'getChartToolbarItems', 'fillOperation'
  9744. ];
  9745. PropertyKeys.ALL_PROPERTIES = __spreadArrays(PropertyKeys.ARRAY_PROPERTIES, PropertyKeys.OBJECT_PROPERTIES, PropertyKeys.STRING_PROPERTIES, PropertyKeys.NUMBER_PROPERTIES, PropertyKeys.FUNCTION_PROPERTIES, PropertyKeys.BOOLEAN_PROPERTIES);
  9746. /**
  9747. * Used when performing property checks. This avoids noise caused when using frameworks, which can add their own
  9748. * framework-specific properties to colDefs, gridOptions etc.
  9749. */
  9750. PropertyKeys.FRAMEWORK_PROPERTIES = [
  9751. '__ob__', '__metadata__', 'mappedColumnProperties', 'hasChildColumns', 'toColDef', 'createColDefFromGridColumn'
  9752. ];
  9753. return PropertyKeys;
  9754. }());
  9755. /***/ }),
  9756. /* 50 */
  9757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9758. "use strict";
  9759. __webpack_require__.r(__webpack_exports__);
  9760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridOptionsWrapper", function() { return GridOptionsWrapper; });
  9761. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
  9762. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
  9763. /* harmony import */ var _components_componentUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48);
  9764. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  9765. /* harmony import */ var _propertyKeys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49);
  9766. /* harmony import */ var _components_colDefUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(51);
  9767. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44);
  9768. /* harmony import */ var _entities_sideBar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52);
  9769. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38);
  9770. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39);
  9771. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7);
  9772. /**
  9773. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  9774. * @version v23.2.1
  9775. * @link http://www.ag-grid.com/
  9776. * @license MIT
  9777. */
  9778. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  9779. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  9780. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  9781. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  9782. return c > 3 && r && Object.defineProperty(target, key, r), r;
  9783. };
  9784. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  9785. return function (target, key) { decorator(target, key, paramIndex); }
  9786. };
  9787. var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
  9788. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  9789. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  9790. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  9791. r[k] = a[j];
  9792. return r;
  9793. };
  9794. var DEFAULT_ROW_HEIGHT = 25;
  9795. var DEFAULT_DETAIL_ROW_HEIGHT = 300;
  9796. var DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE = 5;
  9797. var DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE = 5;
  9798. var DEFAULT_KEEP_DETAIL_ROW_COUNT = 10;
  9799. function isTrue(value) {
  9800. return value === true || value === 'true';
  9801. }
  9802. function zeroOrGreater(value, defaultValue) {
  9803. if (value >= 0) {
  9804. return value;
  9805. }
  9806. // zero gets returned if number is missing or the wrong type
  9807. return defaultValue;
  9808. }
  9809. function oneOrGreater(value, defaultValue) {
  9810. if (value > 0) {
  9811. return value;
  9812. }
  9813. // zero gets returned if number is missing or the wrong type
  9814. return defaultValue;
  9815. }
  9816. var GridOptionsWrapper = /** @class */ (function () {
  9817. function GridOptionsWrapper() {
  9818. this.propertyEventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
  9819. this.domDataKey = '__AG_' + Math.random().toString();
  9820. this.layoutElements = [];
  9821. }
  9822. GridOptionsWrapper_1 = GridOptionsWrapper;
  9823. GridOptionsWrapper.prototype.agWire = function (gridApi, columnApi) {
  9824. this.gridOptions.api = gridApi;
  9825. this.gridOptions.columnApi = columnApi;
  9826. this.checkForDeprecated();
  9827. this.checkForViolations();
  9828. };
  9829. GridOptionsWrapper.prototype.destroy = function () {
  9830. // need to remove these, as we don't own the lifecycle of the gridOptions, we need to
  9831. // remove the references in case the user keeps the grid options, we want the rest
  9832. // of the grid to be picked up by the garbage collector
  9833. this.gridOptions.api = null;
  9834. this.gridOptions.columnApi = null;
  9835. this.removeEventListener(GridOptionsWrapper_1.PROP_DOM_LAYOUT, this.updateLayoutClassesListener);
  9836. };
  9837. GridOptionsWrapper.prototype.init = function () {
  9838. var _this = this;
  9839. if (!(this.gridOptions.suppressPropertyNamesCheck === true)) {
  9840. this.checkGridOptionsProperties();
  9841. this.checkColumnDefProperties();
  9842. }
  9843. var async = this.useAsyncEvents();
  9844. this.eventService.addGlobalListener(this.globalEventHandler.bind(this), async);
  9845. if (this.isGroupSelectsChildren() && this.isSuppressParentsInRowNodes()) {
  9846. console.warn("ag-Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work");
  9847. }
  9848. if (this.isGroupSelectsChildren()) {
  9849. if (!this.isRowSelectionMulti()) {
  9850. console.warn("ag-Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense");
  9851. }
  9852. if (this.isRowModelServerSide()) {
  9853. console.warn('ag-Grid: group selects children is NOT support for Server Side Row Model. ' +
  9854. 'This is because the rows are lazy loaded, so selecting a group is not possible as' +
  9855. 'the grid has no way of knowing what the children are.');
  9856. }
  9857. }
  9858. if (this.isGroupRemoveSingleChildren() && this.isGroupHideOpenParents()) {
  9859. console.warn("ag-Grid: groupRemoveSingleChildren and groupHideOpenParents do not work with each other, you need to pick one. And don't ask us how to us these together on our support forum either you will get the same answer!");
  9860. }
  9861. if (this.isRowModelServerSide()) {
  9862. var msg = function (prop) { return "ag-Grid: '" + prop + "' is not supported on the Server-Side Row Model"; };
  9863. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(this.gridOptions.groupDefaultExpanded)) {
  9864. console.warn(msg('groupDefaultExpanded'));
  9865. }
  9866. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(this.gridOptions.groupDefaultExpanded)) {
  9867. console.warn(msg('groupIncludeFooter'));
  9868. }
  9869. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(this.gridOptions.groupDefaultExpanded)) {
  9870. console.warn(msg('groupIncludeTotalFooter'));
  9871. }
  9872. }
  9873. if (this.isEnableRangeSelection()) {
  9874. _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].RangeSelectionModule, 'enableRangeSelection');
  9875. }
  9876. if (!this.isEnableRangeSelection() && (this.isEnableRangeHandle() || this.isEnableFillHandle())) {
  9877. console.warn("ag-Grid: 'enableRangeHandle' and 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");
  9878. }
  9879. var warnOfDeprecaredIcon = function (name) {
  9880. if (_this.gridOptions.icons && _this.gridOptions.icons[name]) {
  9881. console.warn("gridOptions.icons." + name + " is no longer supported. For information on how to style checkboxes and radio buttons, see https://www.ag-grid.com/javascript-grid-icons/");
  9882. }
  9883. };
  9884. warnOfDeprecaredIcon('radioButtonOff');
  9885. warnOfDeprecaredIcon('radioButtonOn');
  9886. warnOfDeprecaredIcon('checkboxChecked');
  9887. warnOfDeprecaredIcon('checkboxUnchecked');
  9888. warnOfDeprecaredIcon('checkboxIndeterminate');
  9889. this.updateLayoutClassesListener = this.updateLayoutClasses.bind(this);
  9890. this.addEventListener(GridOptionsWrapper_1.PROP_DOM_LAYOUT, this.updateLayoutClassesListener);
  9891. };
  9892. GridOptionsWrapper.prototype.checkColumnDefProperties = function () {
  9893. var _this = this;
  9894. if (this.gridOptions.columnDefs == null) {
  9895. return;
  9896. }
  9897. this.gridOptions.columnDefs.forEach(function (colDef) {
  9898. var userProperties = Object.getOwnPropertyNames(colDef);
  9899. var validProperties = __spreadArrays(_components_colDefUtil__WEBPACK_IMPORTED_MODULE_5__["ColDefUtil"].ALL_PROPERTIES, _components_colDefUtil__WEBPACK_IMPORTED_MODULE_5__["ColDefUtil"].FRAMEWORK_PROPERTIES);
  9900. _this.checkProperties(userProperties, validProperties, validProperties, 'colDef', 'https://www.ag-grid.com/javascript-grid-column-properties/');
  9901. });
  9902. };
  9903. GridOptionsWrapper.prototype.checkGridOptionsProperties = function () {
  9904. var userProperties = Object.getOwnPropertyNames(this.gridOptions);
  9905. var validProperties = __spreadArrays(_propertyKeys__WEBPACK_IMPORTED_MODULE_4__["PropertyKeys"].ALL_PROPERTIES, _propertyKeys__WEBPACK_IMPORTED_MODULE_4__["PropertyKeys"].FRAMEWORK_PROPERTIES, _utils__WEBPACK_IMPORTED_MODULE_10__["_"].values(_eventKeys__WEBPACK_IMPORTED_MODULE_6__["Events"]).map(function (event) { return _components_componentUtil__WEBPACK_IMPORTED_MODULE_2__["ComponentUtil"].getCallbackForEvent(event); }));
  9906. var validPropertiesAndExceptions = __spreadArrays(validProperties, ['api', 'columnApi']);
  9907. this.checkProperties(userProperties, validPropertiesAndExceptions, validProperties, 'gridOptions', 'https://www.ag-grid.com/javascript-grid-properties/');
  9908. };
  9909. GridOptionsWrapper.prototype.checkProperties = function (userProperties, validPropertiesAndExceptions, validProperties, containerName, docsUrl) {
  9910. var invalidProperties = _utils__WEBPACK_IMPORTED_MODULE_10__["_"].fuzzyCheckStrings(userProperties, validPropertiesAndExceptions, validProperties);
  9911. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].iterateObject(invalidProperties, function (key, value) {
  9912. console.warn("ag-grid: invalid " + containerName + " property '" + key + "' did you mean any of these: " + value.slice(0, 8).join(", "));
  9913. });
  9914. if (Object.keys(invalidProperties).length > 0) {
  9915. console.warn("ag-grid: to see all the valid " + containerName + " properties please check: " + docsUrl);
  9916. }
  9917. };
  9918. // returns the dom data, or undefined if not found
  9919. GridOptionsWrapper.prototype.getDomData = function (element, key) {
  9920. var domData = element[this.domDataKey];
  9921. return domData ? domData[key] : undefined;
  9922. };
  9923. GridOptionsWrapper.prototype.setDomData = function (element, key, value) {
  9924. var domData = element[this.domDataKey];
  9925. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].missing(domData)) {
  9926. domData = {};
  9927. element[this.domDataKey] = domData;
  9928. }
  9929. domData[key] = value;
  9930. };
  9931. GridOptionsWrapper.prototype.isRowSelection = function () {
  9932. return this.gridOptions.rowSelection === 'single' || this.gridOptions.rowSelection === 'multiple';
  9933. };
  9934. GridOptionsWrapper.prototype.isRowDeselection = function () {
  9935. return isTrue(this.gridOptions.rowDeselection);
  9936. };
  9937. GridOptionsWrapper.prototype.isRowSelectionMulti = function () {
  9938. return this.gridOptions.rowSelection === 'multiple';
  9939. };
  9940. GridOptionsWrapper.prototype.isRowMultiSelectWithClick = function () {
  9941. return isTrue(this.gridOptions.rowMultiSelectWithClick);
  9942. };
  9943. GridOptionsWrapper.prototype.getContext = function () {
  9944. return this.gridOptions.context;
  9945. };
  9946. GridOptionsWrapper.prototype.isPivotMode = function () {
  9947. return isTrue(this.gridOptions.pivotMode);
  9948. };
  9949. GridOptionsWrapper.prototype.isPivotTotals = function () {
  9950. return isTrue(this.gridOptions.pivotTotals);
  9951. };
  9952. GridOptionsWrapper.prototype.getPivotColumnGroupTotals = function () {
  9953. return this.gridOptions.pivotColumnGroupTotals;
  9954. };
  9955. GridOptionsWrapper.prototype.getPivotRowTotals = function () {
  9956. return this.gridOptions.pivotRowTotals;
  9957. };
  9958. GridOptionsWrapper.prototype.isRowModelInfinite = function () {
  9959. return this.gridOptions.rowModelType === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_INFINITE;
  9960. };
  9961. GridOptionsWrapper.prototype.isRowModelViewport = function () {
  9962. return this.gridOptions.rowModelType === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_VIEWPORT;
  9963. };
  9964. GridOptionsWrapper.prototype.isRowModelServerSide = function () {
  9965. return this.gridOptions.rowModelType === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE;
  9966. };
  9967. GridOptionsWrapper.prototype.isRowModelDefault = function () {
  9968. return (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].missing(this.gridOptions.rowModelType) ||
  9969. this.gridOptions.rowModelType === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE ||
  9970. this.gridOptions.rowModelType === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DEPRECATED_ROW_MODEL_TYPE_NORMAL);
  9971. };
  9972. GridOptionsWrapper.prototype.isFullRowEdit = function () {
  9973. return this.gridOptions.editType === 'fullRow';
  9974. };
  9975. GridOptionsWrapper.prototype.isSuppressFocusAfterRefresh = function () {
  9976. return isTrue(this.gridOptions.suppressFocusAfterRefresh);
  9977. };
  9978. GridOptionsWrapper.prototype.isSuppressBrowserResizeObserver = function () {
  9979. return isTrue(this.gridOptions.suppressBrowserResizeObserver);
  9980. };
  9981. GridOptionsWrapper.prototype.isSuppressMaintainUnsortedOrder = function () {
  9982. return isTrue(this.gridOptions.suppressMaintainUnsortedOrder);
  9983. };
  9984. GridOptionsWrapper.prototype.isSuppressClearOnFillReduction = function () {
  9985. return isTrue(this.gridOptions.suppressClearOnFillReduction);
  9986. };
  9987. GridOptionsWrapper.prototype.isShowToolPanel = function () {
  9988. return isTrue(this.gridOptions.sideBar && Array.isArray(this.getSideBar().toolPanels));
  9989. };
  9990. GridOptionsWrapper.prototype.getSideBar = function () {
  9991. return this.gridOptions.sideBar;
  9992. };
  9993. GridOptionsWrapper.prototype.isSuppressTouch = function () {
  9994. return isTrue(this.gridOptions.suppressTouch);
  9995. };
  9996. GridOptionsWrapper.prototype.isSuppressRowTransform = function () {
  9997. return isTrue(this.gridOptions.suppressRowTransform);
  9998. };
  9999. GridOptionsWrapper.prototype.isSuppressSetColumnStateEvents = function () {
  10000. return isTrue(this.gridOptions.suppressSetColumnStateEvents);
  10001. };
  10002. GridOptionsWrapper.prototype.isAllowDragFromColumnsToolPanel = function () {
  10003. return isTrue(this.gridOptions.allowDragFromColumnsToolPanel);
  10004. };
  10005. GridOptionsWrapper.prototype.useAsyncEvents = function () {
  10006. return !isTrue(this.gridOptions.suppressAsyncEvents);
  10007. };
  10008. GridOptionsWrapper.prototype.isEnableCellChangeFlash = function () {
  10009. return isTrue(this.gridOptions.enableCellChangeFlash);
  10010. };
  10011. GridOptionsWrapper.prototype.getCellFlashDelay = function () {
  10012. return this.gridOptions.cellFlashDelay || 500;
  10013. };
  10014. GridOptionsWrapper.prototype.getCellFadeDelay = function () {
  10015. return this.gridOptions.cellFadeDelay || 1000;
  10016. };
  10017. GridOptionsWrapper.prototype.isGroupSelectsChildren = function () {
  10018. var result = isTrue(this.gridOptions.groupSelectsChildren);
  10019. if (result && this.isTreeData()) {
  10020. console.warn('ag-Grid: groupSelectsChildren does not work with tree data');
  10021. return false;
  10022. }
  10023. return result;
  10024. };
  10025. GridOptionsWrapper.prototype.isSuppressRowHoverHighlight = function () {
  10026. return isTrue(this.gridOptions.suppressRowHoverHighlight);
  10027. };
  10028. GridOptionsWrapper.prototype.isGroupSelectsFiltered = function () {
  10029. return isTrue(this.gridOptions.groupSelectsFiltered);
  10030. };
  10031. GridOptionsWrapper.prototype.isGroupHideOpenParents = function () {
  10032. return isTrue(this.gridOptions.groupHideOpenParents);
  10033. };
  10034. // if we are doing hideOpenParents, then we always have groupMultiAutoColumn, otherwise hideOpenParents would not work
  10035. GridOptionsWrapper.prototype.isGroupMultiAutoColumn = function () {
  10036. return isTrue(this.gridOptions.groupMultiAutoColumn) || isTrue(this.gridOptions.groupHideOpenParents);
  10037. };
  10038. GridOptionsWrapper.prototype.isGroupRemoveSingleChildren = function () {
  10039. return isTrue(this.gridOptions.groupRemoveSingleChildren);
  10040. };
  10041. GridOptionsWrapper.prototype.isGroupRemoveLowestSingleChildren = function () {
  10042. return isTrue(this.gridOptions.groupRemoveLowestSingleChildren);
  10043. };
  10044. GridOptionsWrapper.prototype.isGroupIncludeFooter = function () {
  10045. return isTrue(this.gridOptions.groupIncludeFooter);
  10046. };
  10047. GridOptionsWrapper.prototype.isGroupIncludeTotalFooter = function () {
  10048. return isTrue(this.gridOptions.groupIncludeTotalFooter);
  10049. };
  10050. GridOptionsWrapper.prototype.isGroupSuppressBlankHeader = function () {
  10051. return isTrue(this.gridOptions.groupSuppressBlankHeader);
  10052. };
  10053. GridOptionsWrapper.prototype.isSuppressRowClickSelection = function () {
  10054. return isTrue(this.gridOptions.suppressRowClickSelection);
  10055. };
  10056. GridOptionsWrapper.prototype.isSuppressCellSelection = function () {
  10057. return isTrue(this.gridOptions.suppressCellSelection);
  10058. };
  10059. GridOptionsWrapper.prototype.isSuppressMultiSort = function () {
  10060. return isTrue(this.gridOptions.suppressMultiSort);
  10061. };
  10062. GridOptionsWrapper.prototype.isMultiSortKeyCtrl = function () {
  10063. return this.gridOptions.multiSortKey === 'ctrl';
  10064. };
  10065. GridOptionsWrapper.prototype.isGroupSuppressAutoColumn = function () {
  10066. return isTrue(this.gridOptions.groupSuppressAutoColumn);
  10067. };
  10068. GridOptionsWrapper.prototype.isPivotSuppressAutoColumn = function () {
  10069. return isTrue(this.gridOptions.pivotSuppressAutoColumn);
  10070. };
  10071. GridOptionsWrapper.prototype.isSuppressDragLeaveHidesColumns = function () {
  10072. return isTrue(this.gridOptions.suppressDragLeaveHidesColumns);
  10073. };
  10074. GridOptionsWrapper.prototype.isSuppressScrollOnNewData = function () {
  10075. return isTrue(this.gridOptions.suppressScrollOnNewData);
  10076. };
  10077. GridOptionsWrapper.prototype.isRowDragManaged = function () {
  10078. return isTrue(this.gridOptions.rowDragManaged);
  10079. };
  10080. GridOptionsWrapper.prototype.isSuppressRowDrag = function () {
  10081. return isTrue(this.gridOptions.suppressRowDrag);
  10082. };
  10083. GridOptionsWrapper.prototype.isSuppressMoveWhenRowDragging = function () {
  10084. return isTrue(this.gridOptions.suppressMoveWhenRowDragging);
  10085. };
  10086. GridOptionsWrapper.prototype.isEnableMultiRowDragging = function () {
  10087. return isTrue(this.gridOptions.enableMultiRowDragging);
  10088. };
  10089. // returns either 'print', 'autoHeight' or 'normal' (normal is the default)
  10090. GridOptionsWrapper.prototype.getDomLayout = function () {
  10091. var domLayout = this.gridOptions.domLayout || _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL;
  10092. var validLayouts = [
  10093. _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_PRINT,
  10094. _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_AUTO_HEIGHT,
  10095. _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL
  10096. ];
  10097. if (validLayouts.indexOf(domLayout) === -1) {
  10098. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].doOnce(function () {
  10099. return console.warn("ag-Grid: " + domLayout + " is not valid for DOM Layout, valid values are " + _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL + ", " + _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_AUTO_HEIGHT + " and " + _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_PRINT);
  10100. }, 'warn about dom layout values');
  10101. return _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL;
  10102. }
  10103. return domLayout;
  10104. };
  10105. GridOptionsWrapper.prototype.isSuppressHorizontalScroll = function () {
  10106. return isTrue(this.gridOptions.suppressHorizontalScroll);
  10107. };
  10108. GridOptionsWrapper.prototype.isSuppressMaxRenderedRowRestriction = function () {
  10109. return isTrue(this.gridOptions.suppressMaxRenderedRowRestriction);
  10110. };
  10111. GridOptionsWrapper.prototype.isExcludeChildrenWhenTreeDataFiltering = function () {
  10112. return isTrue(this.gridOptions.excludeChildrenWhenTreeDataFiltering);
  10113. };
  10114. GridOptionsWrapper.prototype.isAlwaysShowVerticalScroll = function () {
  10115. return isTrue(this.gridOptions.alwaysShowVerticalScroll);
  10116. };
  10117. GridOptionsWrapper.prototype.isSuppressLoadingOverlay = function () {
  10118. return isTrue(this.gridOptions.suppressLoadingOverlay);
  10119. };
  10120. GridOptionsWrapper.prototype.isSuppressNoRowsOverlay = function () {
  10121. return isTrue(this.gridOptions.suppressNoRowsOverlay);
  10122. };
  10123. GridOptionsWrapper.prototype.isSuppressFieldDotNotation = function () {
  10124. return isTrue(this.gridOptions.suppressFieldDotNotation);
  10125. };
  10126. GridOptionsWrapper.prototype.getPinnedTopRowData = function () {
  10127. return this.gridOptions.pinnedTopRowData;
  10128. };
  10129. GridOptionsWrapper.prototype.getPinnedBottomRowData = function () {
  10130. return this.gridOptions.pinnedBottomRowData;
  10131. };
  10132. GridOptionsWrapper.prototype.isFunctionsPassive = function () {
  10133. return isTrue(this.gridOptions.functionsPassive);
  10134. };
  10135. GridOptionsWrapper.prototype.isSuppressTabbing = function () {
  10136. return isTrue(this.gridOptions.suppressTabbing);
  10137. };
  10138. GridOptionsWrapper.prototype.isSuppressChangeDetection = function () {
  10139. return isTrue(this.gridOptions.suppressChangeDetection);
  10140. };
  10141. GridOptionsWrapper.prototype.isSuppressAnimationFrame = function () {
  10142. return isTrue(this.gridOptions.suppressAnimationFrame);
  10143. };
  10144. GridOptionsWrapper.prototype.getQuickFilterText = function () {
  10145. return this.gridOptions.quickFilterText;
  10146. };
  10147. GridOptionsWrapper.prototype.isCacheQuickFilter = function () {
  10148. return isTrue(this.gridOptions.cacheQuickFilter);
  10149. };
  10150. GridOptionsWrapper.prototype.isUnSortIcon = function () {
  10151. return isTrue(this.gridOptions.unSortIcon);
  10152. };
  10153. GridOptionsWrapper.prototype.isSuppressMenuHide = function () {
  10154. return isTrue(this.gridOptions.suppressMenuHide);
  10155. };
  10156. GridOptionsWrapper.prototype.isEnterMovesDownAfterEdit = function () {
  10157. return isTrue(this.gridOptions.enterMovesDownAfterEdit);
  10158. };
  10159. GridOptionsWrapper.prototype.isEnterMovesDown = function () {
  10160. return isTrue(this.gridOptions.enterMovesDown);
  10161. };
  10162. GridOptionsWrapper.prototype.isUndoRedoCellEditing = function () {
  10163. return isTrue(this.gridOptions.undoRedoCellEditing);
  10164. };
  10165. GridOptionsWrapper.prototype.getUndoRedoCellEditingLimit = function () {
  10166. return this.gridOptions.undoRedoCellEditingLimit;
  10167. };
  10168. GridOptionsWrapper.prototype.getRowStyle = function () {
  10169. return this.gridOptions.rowStyle;
  10170. };
  10171. GridOptionsWrapper.prototype.getRowClass = function () {
  10172. return this.gridOptions.rowClass;
  10173. };
  10174. GridOptionsWrapper.prototype.getRowStyleFunc = function () {
  10175. return this.gridOptions.getRowStyle;
  10176. };
  10177. GridOptionsWrapper.prototype.getRowClassFunc = function () {
  10178. return this.gridOptions.getRowClass;
  10179. };
  10180. GridOptionsWrapper.prototype.rowClassRules = function () {
  10181. return this.gridOptions.rowClassRules;
  10182. };
  10183. GridOptionsWrapper.prototype.getCreateChartContainerFunc = function () {
  10184. return this.gridOptions.createChartContainer;
  10185. };
  10186. GridOptionsWrapper.prototype.getPopupParent = function () {
  10187. return this.gridOptions.popupParent;
  10188. };
  10189. GridOptionsWrapper.prototype.getBlockLoadDebounceMillis = function () {
  10190. return this.gridOptions.blockLoadDebounceMillis;
  10191. };
  10192. GridOptionsWrapper.prototype.getPostProcessPopupFunc = function () {
  10193. return this.gridOptions.postProcessPopup;
  10194. };
  10195. GridOptionsWrapper.prototype.getDoesDataFlowerFunc = function () {
  10196. return this.gridOptions.doesDataFlower;
  10197. };
  10198. GridOptionsWrapper.prototype.getPaginationNumberFormatterFunc = function () {
  10199. return this.gridOptions.paginationNumberFormatter;
  10200. };
  10201. GridOptionsWrapper.prototype.getChildCountFunc = function () {
  10202. return this.gridOptions.getChildCount;
  10203. };
  10204. GridOptionsWrapper.prototype.getDefaultGroupSortComparator = function () {
  10205. return this.gridOptions.defaultGroupSortComparator;
  10206. };
  10207. GridOptionsWrapper.prototype.getIsFullWidthCellFunc = function () {
  10208. return this.gridOptions.isFullWidthCell;
  10209. };
  10210. GridOptionsWrapper.prototype.getFullWidthCellRendererParams = function () {
  10211. return this.gridOptions.fullWidthCellRendererParams;
  10212. };
  10213. GridOptionsWrapper.prototype.isEmbedFullWidthRows = function () {
  10214. return isTrue(this.gridOptions.embedFullWidthRows) || isTrue(this.gridOptions.deprecatedEmbedFullWidthRows);
  10215. };
  10216. GridOptionsWrapper.prototype.getSuppressKeyboardEventFunc = function () {
  10217. return this.gridOptions.suppressKeyboardEvent;
  10218. };
  10219. GridOptionsWrapper.prototype.getBusinessKeyForNodeFunc = function () {
  10220. return this.gridOptions.getBusinessKeyForNode;
  10221. };
  10222. GridOptionsWrapper.prototype.getApi = function () {
  10223. return this.gridOptions.api;
  10224. };
  10225. GridOptionsWrapper.prototype.getColumnApi = function () {
  10226. return this.gridOptions.columnApi;
  10227. };
  10228. GridOptionsWrapper.prototype.isImmutableData = function () {
  10229. return isTrue(this.gridOptions.immutableData);
  10230. };
  10231. GridOptionsWrapper.prototype.isImmutableColumns = function () {
  10232. return isTrue(this.gridOptions.immutableColumns);
  10233. };
  10234. GridOptionsWrapper.prototype.isEnsureDomOrder = function () {
  10235. return isTrue(this.gridOptions.ensureDomOrder);
  10236. };
  10237. GridOptionsWrapper.prototype.isEnableCharts = function () {
  10238. if (isTrue(this.gridOptions.enableCharts)) {
  10239. return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].GridChartsModule, 'enableCharts');
  10240. }
  10241. return false;
  10242. };
  10243. GridOptionsWrapper.prototype.getColResizeDefault = function () {
  10244. return this.gridOptions.colResizeDefault;
  10245. };
  10246. GridOptionsWrapper.prototype.isSingleClickEdit = function () {
  10247. return isTrue(this.gridOptions.singleClickEdit);
  10248. };
  10249. GridOptionsWrapper.prototype.isSuppressClickEdit = function () {
  10250. return isTrue(this.gridOptions.suppressClickEdit);
  10251. };
  10252. GridOptionsWrapper.prototype.isStopEditingWhenGridLosesFocus = function () {
  10253. return isTrue(this.gridOptions.stopEditingWhenGridLosesFocus);
  10254. };
  10255. GridOptionsWrapper.prototype.getGroupDefaultExpanded = function () {
  10256. return this.gridOptions.groupDefaultExpanded;
  10257. };
  10258. GridOptionsWrapper.prototype.getMaxConcurrentDatasourceRequests = function () {
  10259. return this.gridOptions.maxConcurrentDatasourceRequests;
  10260. };
  10261. GridOptionsWrapper.prototype.getMaxBlocksInCache = function () {
  10262. return this.gridOptions.maxBlocksInCache;
  10263. };
  10264. GridOptionsWrapper.prototype.getCacheOverflowSize = function () {
  10265. return this.gridOptions.cacheOverflowSize;
  10266. };
  10267. GridOptionsWrapper.prototype.getPaginationPageSize = function () {
  10268. return this.gridOptions.paginationPageSize;
  10269. };
  10270. GridOptionsWrapper.prototype.isPaginateChildRows = function () {
  10271. // if using groupSuppressRow, means we are not showing parent rows,
  10272. // so we always paginate on the child rows here as there are no parent rows
  10273. var shouldPaginate = this.isGroupSuppressRow() || this.isGroupRemoveSingleChildren() || this.isGroupRemoveLowestSingleChildren();
  10274. if (shouldPaginate) {
  10275. return true;
  10276. }
  10277. return isTrue(this.gridOptions.paginateChildRows);
  10278. };
  10279. GridOptionsWrapper.prototype.getCacheBlockSize = function () {
  10280. return this.gridOptions.cacheBlockSize;
  10281. };
  10282. GridOptionsWrapper.prototype.getInfiniteInitialRowCount = function () {
  10283. return this.gridOptions.infiniteInitialRowCount;
  10284. };
  10285. GridOptionsWrapper.prototype.isPurgeClosedRowNodes = function () {
  10286. return isTrue(this.gridOptions.purgeClosedRowNodes);
  10287. };
  10288. GridOptionsWrapper.prototype.isSuppressPaginationPanel = function () {
  10289. return isTrue(this.gridOptions.suppressPaginationPanel);
  10290. };
  10291. GridOptionsWrapper.prototype.getRowData = function () {
  10292. return this.gridOptions.rowData;
  10293. };
  10294. // this property is different - we never allow groupUseEntireRow if in pivot mode,
  10295. // as otherwise we don't see the pivot values.
  10296. GridOptionsWrapper.prototype.isGroupUseEntireRow = function (pivotMode) {
  10297. return pivotMode ? false : isTrue(this.gridOptions.groupUseEntireRow);
  10298. };
  10299. GridOptionsWrapper.prototype.isEnableRtl = function () {
  10300. return isTrue(this.gridOptions.enableRtl);
  10301. };
  10302. GridOptionsWrapper.prototype.getAutoGroupColumnDef = function () {
  10303. return this.gridOptions.autoGroupColumnDef;
  10304. };
  10305. GridOptionsWrapper.prototype.isGroupSuppressRow = function () {
  10306. return isTrue(this.gridOptions.groupSuppressRow);
  10307. };
  10308. GridOptionsWrapper.prototype.getRowGroupPanelShow = function () {
  10309. return this.gridOptions.rowGroupPanelShow;
  10310. };
  10311. GridOptionsWrapper.prototype.getPivotPanelShow = function () {
  10312. return this.gridOptions.pivotPanelShow;
  10313. };
  10314. GridOptionsWrapper.prototype.isAngularCompileRows = function () {
  10315. return isTrue(this.gridOptions.angularCompileRows);
  10316. };
  10317. GridOptionsWrapper.prototype.isAngularCompileFilters = function () {
  10318. return isTrue(this.gridOptions.angularCompileFilters);
  10319. };
  10320. GridOptionsWrapper.prototype.isAngularCompileHeaders = function () {
  10321. return isTrue(this.gridOptions.angularCompileHeaders);
  10322. };
  10323. GridOptionsWrapper.prototype.isDebug = function () {
  10324. return isTrue(this.gridOptions.debug);
  10325. };
  10326. GridOptionsWrapper.prototype.getColumnDefs = function () {
  10327. return this.gridOptions.columnDefs;
  10328. };
  10329. GridOptionsWrapper.prototype.getColumnTypes = function () {
  10330. return this.gridOptions.columnTypes;
  10331. };
  10332. GridOptionsWrapper.prototype.getDatasource = function () {
  10333. return this.gridOptions.datasource;
  10334. };
  10335. GridOptionsWrapper.prototype.getViewportDatasource = function () {
  10336. return this.gridOptions.viewportDatasource;
  10337. };
  10338. GridOptionsWrapper.prototype.getServerSideDatasource = function () {
  10339. return this.gridOptions.serverSideDatasource;
  10340. };
  10341. GridOptionsWrapper.prototype.isAccentedSort = function () {
  10342. return isTrue(this.gridOptions.accentedSort);
  10343. };
  10344. GridOptionsWrapper.prototype.isEnableBrowserTooltips = function () {
  10345. return isTrue(this.gridOptions.enableBrowserTooltips);
  10346. };
  10347. GridOptionsWrapper.prototype.isEnableCellExpressions = function () {
  10348. return isTrue(this.gridOptions.enableCellExpressions);
  10349. };
  10350. GridOptionsWrapper.prototype.isEnableGroupEdit = function () {
  10351. return isTrue(this.gridOptions.enableGroupEdit);
  10352. };
  10353. GridOptionsWrapper.prototype.isSuppressMiddleClickScrolls = function () {
  10354. return isTrue(this.gridOptions.suppressMiddleClickScrolls);
  10355. };
  10356. GridOptionsWrapper.prototype.isPreventDefaultOnContextMenu = function () {
  10357. return isTrue(this.gridOptions.preventDefaultOnContextMenu);
  10358. };
  10359. GridOptionsWrapper.prototype.isSuppressPreventDefaultOnMouseWheel = function () {
  10360. return isTrue(this.gridOptions.suppressPreventDefaultOnMouseWheel);
  10361. };
  10362. GridOptionsWrapper.prototype.isSuppressColumnVirtualisation = function () {
  10363. return isTrue(this.gridOptions.suppressColumnVirtualisation);
  10364. };
  10365. GridOptionsWrapper.prototype.isSuppressContextMenu = function () {
  10366. return isTrue(this.gridOptions.suppressContextMenu);
  10367. };
  10368. GridOptionsWrapper.prototype.isAllowContextMenuWithControlKey = function () {
  10369. return isTrue(this.gridOptions.allowContextMenuWithControlKey);
  10370. };
  10371. GridOptionsWrapper.prototype.isSuppressCopyRowsToClipboard = function () {
  10372. return isTrue(this.gridOptions.suppressCopyRowsToClipboard);
  10373. };
  10374. GridOptionsWrapper.prototype.isCopyHeadersToClipboard = function () {
  10375. return isTrue(this.gridOptions.copyHeadersToClipboard);
  10376. };
  10377. GridOptionsWrapper.prototype.isSuppressClipboardPaste = function () {
  10378. return isTrue(this.gridOptions.suppressClipboardPaste);
  10379. };
  10380. GridOptionsWrapper.prototype.isSuppressLastEmptyLineOnPaste = function () {
  10381. return isTrue(this.gridOptions.suppressLastEmptyLineOnPaste);
  10382. };
  10383. GridOptionsWrapper.prototype.isPagination = function () {
  10384. return isTrue(this.gridOptions.pagination);
  10385. };
  10386. GridOptionsWrapper.prototype.isSuppressEnterpriseResetOnNewColumns = function () {
  10387. return isTrue(this.gridOptions.suppressEnterpriseResetOnNewColumns);
  10388. };
  10389. GridOptionsWrapper.prototype.getProcessDataFromClipboardFunc = function () {
  10390. return this.gridOptions.processDataFromClipboard;
  10391. };
  10392. GridOptionsWrapper.prototype.getAsyncTransactionWaitMillis = function () {
  10393. return _utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(this.gridOptions.asyncTransactionWaitMillis) ? this.gridOptions.asyncTransactionWaitMillis : _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].BATCH_WAIT_MILLIS;
  10394. };
  10395. GridOptionsWrapper.prototype.isSuppressMovableColumns = function () {
  10396. return isTrue(this.gridOptions.suppressMovableColumns);
  10397. };
  10398. GridOptionsWrapper.prototype.isAnimateRows = function () {
  10399. // never allow animating if enforcing the row order
  10400. if (this.isEnsureDomOrder()) {
  10401. return false;
  10402. }
  10403. return isTrue(this.gridOptions.animateRows);
  10404. };
  10405. GridOptionsWrapper.prototype.isSuppressColumnMoveAnimation = function () {
  10406. return isTrue(this.gridOptions.suppressColumnMoveAnimation);
  10407. };
  10408. GridOptionsWrapper.prototype.isSuppressAggFuncInHeader = function () {
  10409. return isTrue(this.gridOptions.suppressAggFuncInHeader);
  10410. };
  10411. GridOptionsWrapper.prototype.isSuppressAggAtRootLevel = function () {
  10412. return isTrue(this.gridOptions.suppressAggAtRootLevel);
  10413. };
  10414. GridOptionsWrapper.prototype.isEnableRangeSelection = function () {
  10415. return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].RangeSelectionModule) && isTrue(this.gridOptions.enableRangeSelection);
  10416. };
  10417. GridOptionsWrapper.prototype.isEnableRangeHandle = function () {
  10418. return isTrue(this.gridOptions.enableRangeHandle);
  10419. };
  10420. GridOptionsWrapper.prototype.isEnableFillHandle = function () {
  10421. return isTrue(this.gridOptions.enableFillHandle);
  10422. };
  10423. GridOptionsWrapper.prototype.getFillOperation = function () {
  10424. return this.gridOptions.fillOperation;
  10425. };
  10426. GridOptionsWrapper.prototype.isSuppressMultiRangeSelection = function () {
  10427. return isTrue(this.gridOptions.suppressMultiRangeSelection);
  10428. };
  10429. GridOptionsWrapper.prototype.isPaginationAutoPageSize = function () {
  10430. return isTrue(this.gridOptions.paginationAutoPageSize);
  10431. };
  10432. GridOptionsWrapper.prototype.isRememberGroupStateWhenNewData = function () {
  10433. return isTrue(this.gridOptions.rememberGroupStateWhenNewData);
  10434. };
  10435. GridOptionsWrapper.prototype.getIcons = function () {
  10436. return this.gridOptions.icons;
  10437. };
  10438. GridOptionsWrapper.prototype.getAggFuncs = function () {
  10439. return this.gridOptions.aggFuncs;
  10440. };
  10441. GridOptionsWrapper.prototype.getSortingOrder = function () {
  10442. return this.gridOptions.sortingOrder;
  10443. };
  10444. GridOptionsWrapper.prototype.getAlignedGrids = function () {
  10445. return this.gridOptions.alignedGrids;
  10446. };
  10447. GridOptionsWrapper.prototype.isMasterDetail = function () {
  10448. var masterDetail = isTrue(this.gridOptions.masterDetail);
  10449. if (masterDetail) {
  10450. return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].MasterDetailModule, 'masterDetail');
  10451. }
  10452. else {
  10453. return false;
  10454. }
  10455. };
  10456. GridOptionsWrapper.prototype.isKeepDetailRows = function () {
  10457. return isTrue(this.gridOptions.keepDetailRows);
  10458. };
  10459. GridOptionsWrapper.prototype.getKeepDetailRowsCount = function () {
  10460. if (this.gridOptions.keepDetailRowsCount > 0) {
  10461. return this.gridOptions.keepDetailRowsCount;
  10462. }
  10463. return DEFAULT_KEEP_DETAIL_ROW_COUNT;
  10464. };
  10465. GridOptionsWrapper.prototype.getIsRowMasterFunc = function () {
  10466. return this.gridOptions.isRowMaster;
  10467. };
  10468. GridOptionsWrapper.prototype.getIsRowSelectableFunc = function () {
  10469. return this.gridOptions.isRowSelectable;
  10470. };
  10471. GridOptionsWrapper.prototype.getGroupRowRendererParams = function () {
  10472. return this.gridOptions.groupRowRendererParams;
  10473. };
  10474. GridOptionsWrapper.prototype.getOverlayLoadingTemplate = function () {
  10475. return this.gridOptions.overlayLoadingTemplate;
  10476. };
  10477. GridOptionsWrapper.prototype.getOverlayNoRowsTemplate = function () {
  10478. return this.gridOptions.overlayNoRowsTemplate;
  10479. };
  10480. GridOptionsWrapper.prototype.isSuppressAutoSize = function () {
  10481. return isTrue(this.gridOptions.suppressAutoSize);
  10482. };
  10483. GridOptionsWrapper.prototype.isEnableCellTextSelection = function () {
  10484. return isTrue(this.gridOptions.enableCellTextSelection);
  10485. };
  10486. GridOptionsWrapper.prototype.isSuppressParentsInRowNodes = function () {
  10487. return isTrue(this.gridOptions.suppressParentsInRowNodes);
  10488. };
  10489. GridOptionsWrapper.prototype.isFunctionsReadOnly = function () {
  10490. return isTrue(this.gridOptions.functionsReadOnly);
  10491. };
  10492. GridOptionsWrapper.prototype.isFloatingFilter = function () {
  10493. return this.gridOptions.floatingFilter;
  10494. };
  10495. GridOptionsWrapper.prototype.isEnableCellTextSelect = function () {
  10496. return isTrue(this.gridOptions.enableCellTextSelection);
  10497. };
  10498. GridOptionsWrapper.prototype.isEnableOldSetFilterModel = function () {
  10499. return isTrue(this.gridOptions.enableOldSetFilterModel);
  10500. };
  10501. GridOptionsWrapper.prototype.getDefaultColDef = function () {
  10502. return this.gridOptions.defaultColDef;
  10503. };
  10504. GridOptionsWrapper.prototype.getDefaultColGroupDef = function () {
  10505. return this.gridOptions.defaultColGroupDef;
  10506. };
  10507. GridOptionsWrapper.prototype.getDefaultExportParams = function () {
  10508. return this.gridOptions.defaultExportParams;
  10509. };
  10510. GridOptionsWrapper.prototype.isSuppressCsvExport = function () {
  10511. return isTrue(this.gridOptions.suppressCsvExport);
  10512. };
  10513. GridOptionsWrapper.prototype.isAllowShowChangeAfterFilter = function () {
  10514. return isTrue(this.gridOptions.allowShowChangeAfterFilter);
  10515. };
  10516. GridOptionsWrapper.prototype.isSuppressExcelExport = function () {
  10517. return isTrue(this.gridOptions.suppressExcelExport);
  10518. };
  10519. GridOptionsWrapper.prototype.isSuppressMakeColumnVisibleAfterUnGroup = function () {
  10520. return isTrue(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup);
  10521. };
  10522. GridOptionsWrapper.prototype.getNodeChildDetailsFunc = function () {
  10523. return this.gridOptions.getNodeChildDetails;
  10524. };
  10525. GridOptionsWrapper.prototype.getDataPathFunc = function () {
  10526. return this.gridOptions.getDataPath;
  10527. };
  10528. GridOptionsWrapper.prototype.getIsServerSideGroupFunc = function () {
  10529. return this.gridOptions.isServerSideGroup;
  10530. };
  10531. GridOptionsWrapper.prototype.getServerSideGroupKeyFunc = function () {
  10532. return this.gridOptions.getServerSideGroupKey;
  10533. };
  10534. GridOptionsWrapper.prototype.getGroupRowAggNodesFunc = function () {
  10535. return this.gridOptions.groupRowAggNodes;
  10536. };
  10537. GridOptionsWrapper.prototype.getContextMenuItemsFunc = function () {
  10538. return this.gridOptions.getContextMenuItems;
  10539. };
  10540. GridOptionsWrapper.prototype.getMainMenuItemsFunc = function () {
  10541. return this.gridOptions.getMainMenuItems;
  10542. };
  10543. GridOptionsWrapper.prototype.getChartToolbarItemsFunc = function () {
  10544. return this.gridOptions.getChartToolbarItems;
  10545. };
  10546. GridOptionsWrapper.prototype.getRowNodeIdFunc = function () {
  10547. return this.gridOptions.getRowNodeId;
  10548. };
  10549. GridOptionsWrapper.prototype.getNavigateToNextCellFunc = function () {
  10550. return this.gridOptions.navigateToNextCell;
  10551. };
  10552. GridOptionsWrapper.prototype.getTabToNextCellFunc = function () {
  10553. return this.gridOptions.tabToNextCell;
  10554. };
  10555. GridOptionsWrapper.prototype.isTreeData = function () {
  10556. var usingTreeData = isTrue(this.gridOptions.treeData);
  10557. if (usingTreeData) {
  10558. return _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].RowGroupingModule, 'Tree Data');
  10559. }
  10560. else {
  10561. return false;
  10562. }
  10563. };
  10564. GridOptionsWrapper.prototype.isValueCache = function () {
  10565. return isTrue(this.gridOptions.valueCache);
  10566. };
  10567. GridOptionsWrapper.prototype.isValueCacheNeverExpires = function () {
  10568. return isTrue(this.gridOptions.valueCacheNeverExpires);
  10569. };
  10570. GridOptionsWrapper.prototype.isDeltaSort = function () {
  10571. return isTrue(this.gridOptions.deltaSort);
  10572. };
  10573. GridOptionsWrapper.prototype.isAggregateOnlyChangedColumns = function () {
  10574. return isTrue(this.gridOptions.aggregateOnlyChangedColumns);
  10575. };
  10576. GridOptionsWrapper.prototype.getProcessSecondaryColDefFunc = function () {
  10577. return this.gridOptions.processSecondaryColDef;
  10578. };
  10579. GridOptionsWrapper.prototype.getProcessSecondaryColGroupDefFunc = function () {
  10580. return this.gridOptions.processSecondaryColGroupDef;
  10581. };
  10582. GridOptionsWrapper.prototype.getSendToClipboardFunc = function () {
  10583. return this.gridOptions.sendToClipboard;
  10584. };
  10585. GridOptionsWrapper.prototype.getProcessRowPostCreateFunc = function () {
  10586. return this.gridOptions.processRowPostCreate;
  10587. };
  10588. GridOptionsWrapper.prototype.getProcessCellForClipboardFunc = function () {
  10589. return this.gridOptions.processCellForClipboard;
  10590. };
  10591. GridOptionsWrapper.prototype.getProcessHeaderForClipboardFunc = function () {
  10592. return this.gridOptions.processHeaderForClipboard;
  10593. };
  10594. GridOptionsWrapper.prototype.getProcessCellFromClipboardFunc = function () {
  10595. return this.gridOptions.processCellFromClipboard;
  10596. };
  10597. GridOptionsWrapper.prototype.getViewportRowModelPageSize = function () {
  10598. return oneOrGreater(this.gridOptions.viewportRowModelPageSize, DEFAULT_VIEWPORT_ROW_MODEL_PAGE_SIZE);
  10599. };
  10600. GridOptionsWrapper.prototype.getViewportRowModelBufferSize = function () {
  10601. return zeroOrGreater(this.gridOptions.viewportRowModelBufferSize, DEFAULT_VIEWPORT_ROW_MODEL_BUFFER_SIZE);
  10602. };
  10603. GridOptionsWrapper.prototype.isServerSideSortingAlwaysResets = function () {
  10604. return isTrue(this.gridOptions.serverSideSortingAlwaysResets);
  10605. };
  10606. GridOptionsWrapper.prototype.getPostSortFunc = function () {
  10607. return this.gridOptions.postSort;
  10608. };
  10609. GridOptionsWrapper.prototype.getProcessChartOptionsFunc = function () {
  10610. return this.gridOptions.processChartOptions;
  10611. };
  10612. GridOptionsWrapper.prototype.getClipboardDeliminator = function () {
  10613. return _utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(this.gridOptions.clipboardDeliminator) ? this.gridOptions.clipboardDeliminator : '\t';
  10614. };
  10615. GridOptionsWrapper.prototype.setProperty = function (key, value, force) {
  10616. if (force === void 0) { force = false; }
  10617. var gridOptionsNoType = this.gridOptions;
  10618. var previousValue = gridOptionsNoType[key];
  10619. if (force || previousValue !== value) {
  10620. gridOptionsNoType[key] = value;
  10621. var event_1 = {
  10622. type: key,
  10623. currentValue: value,
  10624. previousValue: previousValue
  10625. };
  10626. this.propertyEventService.dispatchEvent(event_1);
  10627. }
  10628. };
  10629. // this logic is repeated in lots of places. any element that had different CSS
  10630. // dependent on the layout needs to have the layout class added ot it.
  10631. GridOptionsWrapper.prototype.addLayoutElement = function (element) {
  10632. this.layoutElements.push(element);
  10633. this.updateLayoutClasses();
  10634. };
  10635. GridOptionsWrapper.prototype.updateLayoutClasses = function () {
  10636. var domLayout = this.getDomLayout();
  10637. var domLayoutAutoHeight = domLayout === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_AUTO_HEIGHT;
  10638. var domLayoutPrint = domLayout === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_PRINT;
  10639. var domLayoutNormal = domLayout === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].DOM_LAYOUT_NORMAL;
  10640. this.layoutElements.forEach(function (e) {
  10641. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].addOrRemoveCssClass(e, 'ag-layout-auto-height', domLayoutAutoHeight);
  10642. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].addOrRemoveCssClass(e, 'ag-layout-normal', domLayoutNormal);
  10643. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].addOrRemoveCssClass(e, 'ag-layout-print', domLayoutPrint);
  10644. });
  10645. };
  10646. GridOptionsWrapper.prototype.addEventListener = function (key, listener) {
  10647. GridOptionsWrapper_1.checkEventDeprecation(key);
  10648. this.propertyEventService.addEventListener(key, listener);
  10649. };
  10650. GridOptionsWrapper.checkEventDeprecation = function (eventName) {
  10651. if (eventName === 'floatingRowDataChanged') {
  10652. console.warn('ag-Grid: floatingRowDataChanged is now called pinnedRowDataChanged');
  10653. }
  10654. };
  10655. GridOptionsWrapper.prototype.removeEventListener = function (key, listener) {
  10656. this.propertyEventService.removeEventListener(key, listener);
  10657. };
  10658. GridOptionsWrapper.prototype.isSkipHeaderOnAutoSize = function () {
  10659. return !!this.gridOptions.skipHeaderOnAutoSize;
  10660. };
  10661. GridOptionsWrapper.prototype.getAutoSizePadding = function () {
  10662. return this.gridOptions.autoSizePadding && this.gridOptions.autoSizePadding > 0 ? this.gridOptions.autoSizePadding : 20;
  10663. };
  10664. // properties
  10665. GridOptionsWrapper.prototype.getHeaderHeight = function () {
  10666. if (typeof this.gridOptions.headerHeight === 'number') {
  10667. return this.gridOptions.headerHeight;
  10668. }
  10669. return this.getFromTheme(25, 'headerHeight');
  10670. };
  10671. GridOptionsWrapper.prototype.getFloatingFiltersHeight = function () {
  10672. if (typeof this.gridOptions.floatingFiltersHeight === 'number') {
  10673. return this.gridOptions.floatingFiltersHeight;
  10674. }
  10675. return this.getFromTheme(25, 'headerHeight');
  10676. };
  10677. GridOptionsWrapper.prototype.getGroupHeaderHeight = function () {
  10678. if (typeof this.gridOptions.groupHeaderHeight === 'number') {
  10679. return this.gridOptions.groupHeaderHeight;
  10680. }
  10681. return this.getHeaderHeight();
  10682. };
  10683. GridOptionsWrapper.prototype.getPivotHeaderHeight = function () {
  10684. if (typeof this.gridOptions.pivotHeaderHeight === 'number') {
  10685. return this.gridOptions.pivotHeaderHeight;
  10686. }
  10687. return this.getHeaderHeight();
  10688. };
  10689. GridOptionsWrapper.prototype.getPivotGroupHeaderHeight = function () {
  10690. if (typeof this.gridOptions.pivotGroupHeaderHeight === 'number') {
  10691. return this.gridOptions.pivotGroupHeaderHeight;
  10692. }
  10693. return this.getGroupHeaderHeight();
  10694. };
  10695. GridOptionsWrapper.prototype.isExternalFilterPresent = function () {
  10696. if (typeof this.gridOptions.isExternalFilterPresent === 'function') {
  10697. return this.gridOptions.isExternalFilterPresent();
  10698. }
  10699. return false;
  10700. };
  10701. GridOptionsWrapper.prototype.doesExternalFilterPass = function (node) {
  10702. if (typeof this.gridOptions.doesExternalFilterPass === 'function') {
  10703. return this.gridOptions.doesExternalFilterPass(node);
  10704. }
  10705. return false;
  10706. };
  10707. GridOptionsWrapper.prototype.getTooltipShowDelay = function () {
  10708. var tooltipShowDelay = this.gridOptions.tooltipShowDelay;
  10709. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(tooltipShowDelay)) {
  10710. if (tooltipShowDelay < 0) {
  10711. console.warn('ag-grid: tooltipShowDelay should not be lower than 0');
  10712. }
  10713. return Math.max(200, tooltipShowDelay);
  10714. }
  10715. return null;
  10716. };
  10717. GridOptionsWrapper.prototype.isTooltipMouseTrack = function () {
  10718. return isTrue(this.gridOptions.tooltipMouseTrack);
  10719. };
  10720. GridOptionsWrapper.prototype.getDocument = function () {
  10721. // if user is providing document, we use the users one,
  10722. // otherwise we use the document on the global namespace.
  10723. var result = null;
  10724. if (this.gridOptions.getDocument && _utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(this.gridOptions.getDocument)) {
  10725. result = this.gridOptions.getDocument();
  10726. }
  10727. if (result && _utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(result)) {
  10728. return result;
  10729. }
  10730. return document;
  10731. };
  10732. GridOptionsWrapper.prototype.getMinColWidth = function () {
  10733. if (this.gridOptions.minColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) {
  10734. return this.gridOptions.minColWidth;
  10735. }
  10736. var measuredMin = this.getFromTheme(null, 'headerCellMinWidth');
  10737. return Math.max(measuredMin, GridOptionsWrapper_1.MIN_COL_WIDTH);
  10738. };
  10739. GridOptionsWrapper.prototype.getMaxColWidth = function () {
  10740. if (this.gridOptions.maxColWidth && this.gridOptions.maxColWidth > GridOptionsWrapper_1.MIN_COL_WIDTH) {
  10741. return this.gridOptions.maxColWidth;
  10742. }
  10743. return null;
  10744. };
  10745. GridOptionsWrapper.prototype.getColWidth = function () {
  10746. if (typeof this.gridOptions.colWidth !== 'number' || this.gridOptions.colWidth < GridOptionsWrapper_1.MIN_COL_WIDTH) {
  10747. return 200;
  10748. }
  10749. return this.gridOptions.colWidth;
  10750. };
  10751. GridOptionsWrapper.prototype.getRowBuffer = function () {
  10752. var rowBuffer = this.gridOptions.rowBuffer;
  10753. if (typeof rowBuffer === 'number') {
  10754. if (rowBuffer < 0) {
  10755. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].doOnce(function () { return console.warn("ag-Grid: rowBuffer should not be negative"); }, 'warn rowBuffer negative');
  10756. this.gridOptions.rowBuffer = rowBuffer = 0;
  10757. }
  10758. }
  10759. else {
  10760. rowBuffer = _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_BUFFER_SIZE;
  10761. }
  10762. return rowBuffer;
  10763. };
  10764. GridOptionsWrapper.prototype.getRowBufferInPixels = function () {
  10765. var rowsToBuffer = this.getRowBuffer();
  10766. var defaultRowHeight = this.getRowHeightAsNumber();
  10767. return rowsToBuffer * defaultRowHeight;
  10768. };
  10769. // the user might be using some non-standard scrollbar, eg a scrollbar that has zero
  10770. // width and overlays (like the Safari scrollbar, but presented in Chrome). so we
  10771. // allow the user to provide the scroll width before we work it out.
  10772. GridOptionsWrapper.prototype.getScrollbarWidth = function () {
  10773. if (this.scrollWidth == null) {
  10774. var useGridOptions = typeof this.gridOptions.scrollbarWidth === 'number' && this.gridOptions.scrollbarWidth >= 0;
  10775. this.scrollWidth = useGridOptions ? this.gridOptions.scrollbarWidth : _utils__WEBPACK_IMPORTED_MODULE_10__["_"].getScrollbarWidth();
  10776. }
  10777. return this.scrollWidth;
  10778. };
  10779. GridOptionsWrapper.prototype.checkForDeprecated = function () {
  10780. var _this = this;
  10781. // casting to generic object, so typescript compiles even though
  10782. // we are looking for attributes that don't exist
  10783. var options = this.gridOptions;
  10784. if (options.suppressUnSort) {
  10785. console.warn('ag-grid: as of v1.12.4 suppressUnSort is not used. Please use sortingOrder instead.');
  10786. }
  10787. if (options.suppressDescSort) {
  10788. console.warn('ag-grid: as of v1.12.4 suppressDescSort is not used. Please use sortingOrder instead.');
  10789. }
  10790. if (options.groupAggFields) {
  10791. console.warn('ag-grid: as of v3 groupAggFields is not used. Please add appropriate agg fields to your columns.');
  10792. }
  10793. if (options.groupHidePivotColumns) {
  10794. console.warn('ag-grid: as of v3 groupHidePivotColumns is not used as pivot columns are now called rowGroup columns. Please refer to the documentation');
  10795. }
  10796. if (options.groupKeys) {
  10797. console.warn('ag-grid: as of v3 groupKeys is not used. You need to set rowGroupIndex on the columns to group. Please refer to the documentation');
  10798. }
  10799. if (typeof options.groupDefaultExpanded === 'boolean') {
  10800. console.warn('ag-grid: groupDefaultExpanded can no longer be boolean. for groupDefaultExpanded=true, use groupDefaultExpanded=9999 instead, to expand all the groups');
  10801. }
  10802. if (options.onRowDeselected || options.rowDeselected) {
  10803. console.warn('ag-grid: since version 3.4 event rowDeselected no longer exists, please check the docs');
  10804. }
  10805. if (options.rowsAlreadyGrouped) {
  10806. console.warn('ag-grid: since version 3.4 rowsAlreadyGrouped no longer exists, please use getNodeChildDetails() instead');
  10807. }
  10808. if (options.groupAggFunction) {
  10809. console.warn('ag-grid: since version 4.3.x groupAggFunction is now called groupRowAggNodes');
  10810. }
  10811. if (options.checkboxSelection) {
  10812. console.warn('ag-grid: since version 8.0.x checkboxSelection is not supported as a grid option. ' + 'If you want this on all columns, use defaultColDef instead and set it there');
  10813. }
  10814. if (options.paginationInitialRowCount) {
  10815. console.warn('ag-grid: since version 9.0.x paginationInitialRowCount is now called infiniteInitialRowCount');
  10816. }
  10817. if (options.infinitePageSize) {
  10818. console.warn('ag-grid: since version 9.0.x infinitePageSize is now called cacheBlockSize');
  10819. }
  10820. if (options.infiniteBlockSize) {
  10821. console.warn('ag-grid: since version 10.0.x infiniteBlockSize is now called cacheBlockSize');
  10822. }
  10823. if (options.maxPagesInCache) {
  10824. console.warn('ag-grid: since version 10.0.x maxPagesInCache is now called maxBlocksInCache');
  10825. }
  10826. if (options.paginationOverflowSize) {
  10827. console.warn('ag-grid: since version 10.0.x paginationOverflowSize is now called cacheOverflowSize');
  10828. }
  10829. // if (options.forPrint) {
  10830. // console.warn('ag-grid: since version 10.1.x, use property domLayout="forPrint" instead of forPrint=true');
  10831. // }
  10832. if (options.suppressMenuFilterPanel) {
  10833. console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','columnsMenuTab'] instead of suppressMenuFilterPanel=true");
  10834. }
  10835. if (options.suppressMenuMainPanel) {
  10836. console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['filterMenuTab','columnsMenuTab'] instead of suppressMenuMainPanel=true");
  10837. }
  10838. if (options.suppressMenuColumnPanel) {
  10839. console.warn("ag-grid: since version 11.0.x, use property colDef.menuTabs=['generalMenuTab','filterMenuTab'] instead of suppressMenuColumnPanel=true");
  10840. }
  10841. if (options.suppressUseColIdForGroups) {
  10842. console.warn("ag-grid: since version 11.0.x, this is not in use anymore. You should be able to remove it from your definition");
  10843. }
  10844. if (options.groupSuppressRow) {
  10845. console.warn("ag-grid: since version 18.2.x, 'groupSuppressRow' should not be used anymore. Instead remove row groups and perform custom sorting.");
  10846. }
  10847. if (options.groupColumnDef) {
  10848. console.warn("ag-grid: since version 11.0.x, groupColumnDef has been renamed, this property is now called autoGroupColumnDef. Please change your configuration accordingly");
  10849. }
  10850. if (options.slaveGrids) {
  10851. console.warn("ag-grid: since version 12.x, slaveGrids has been renamed, this property is now called alignedGrids. Please change your configuration accordingly");
  10852. }
  10853. if (options.floatingTopRowData) {
  10854. console.warn("ag-grid: since version 12.x, floatingTopRowData is now called pinnedTopRowData");
  10855. }
  10856. if (options.floatingBottomRowData) {
  10857. console.warn("ag-grid: since version 12.x, floatingBottomRowData is now called pinnedBottomRowData");
  10858. }
  10859. if (options.paginationStartPage) {
  10860. console.warn("ag-grid: since version 12.x, paginationStartPage is gone, please call api.paginationGoToPage(" + options.paginationStartPage + ") instead.");
  10861. }
  10862. if (options.getHeaderCellTemplate) {
  10863. console.warn("ag-grid: since version 15.x, getHeaderCellTemplate is gone, please check the header documentation on how to set header templates.");
  10864. }
  10865. if (options.headerCellTemplate) {
  10866. console.warn("ag-grid: since version 15.x, headerCellTemplate is gone, please check the header documentation on how to set header templates.");
  10867. }
  10868. if (options.headerCellRenderer) {
  10869. console.warn("ag-grid: since version 15.x, headerCellRenderer is gone, please check the header documentation on how to set header templates.");
  10870. }
  10871. if (options.angularCompileHeaders) {
  10872. console.warn("ag-grid: since version 15.x, angularCompileHeaders is gone, please see the getting started for Angular 1 docs to see how to do headers in Angular 1.x.");
  10873. }
  10874. if (options.pivotTotals) {
  10875. console.warn("ag-grid: since version 18.x, pivotTotals has been removed, instead if using pivotTotals, set pivotColumnGroupTotals='before'|'after'.");
  10876. options.pivotColumnGroupTotals = 'before';
  10877. }
  10878. if (options.rowModelType === 'inMemory') {
  10879. console.warn("ag-grid: since version 18.x, The In Memory Row Model has been renamed to the Client Side Row Model, set rowModelType='clientSide' instead.");
  10880. options.rowModelType = 'clientSide';
  10881. }
  10882. if (options.rowModelType === 'enterprise') {
  10883. console.warn("ag-grid: since version 18.x, The Enterprise Row Model has been renamed to the Server Side Row Model, set rowModelType='serverSide' instead.");
  10884. options.rowModelType = 'serverSide';
  10885. }
  10886. if (options.layoutInterval) {
  10887. console.warn("ag-grid: since version 18.x, layoutInterval is no longer a property. This is because the grid now uses CSS Flex for layout.");
  10888. }
  10889. if (options.gridAutoHeight) {
  10890. console.warn("ag-grid: since version 19.x, gridAutoHeight is gone, please use domLayout=autoHeight instead");
  10891. options.domLayout = 'autoHeight';
  10892. }
  10893. if (options.showToolPanel === true) {
  10894. console.warn("ag-grid: since version 19.x, showToolPanel is gone, please specify toolPanel components. See https://www.ag-grid.com/javascript-grid-tool-panel/");
  10895. options.showToolPanel = undefined;
  10896. options.sideBar = options.sideBar || true;
  10897. }
  10898. if (options.showToolPanel === false) {
  10899. console.warn("ag-grid: since version 19.x, showToolPanel is gone, please specify toolPanel components. See https://www.ag-grid.com/javascript-grid-tool-panel/");
  10900. options.showToolPanel = undefined;
  10901. options.sideBar = options.sideBar || false;
  10902. }
  10903. var oldToolPanelProperties = {
  10904. toolPanelSuppressRowGroups: 'suppressRowGroups',
  10905. toolPanelSuppressValues: 'suppressValues',
  10906. toolPanelSuppressPivots: 'suppressPivots',
  10907. toolPanelSuppressPivotMode: 'suppressPivotMode',
  10908. toolPanelSuppressColumnFilter: 'suppressColumnFilter',
  10909. toolPanelSuppressColumnSelectAll: 'suppressColumnSelectAll',
  10910. toolPanelSuppressSideButtons: 'suppressSideButtons',
  10911. toolPanelSuppressColumnExpandAll: 'suppressColumnExpandAll',
  10912. contractColumnSelection: 'contractColumnSelection'
  10913. };
  10914. var toolPanelColumnsCompProps = {};
  10915. Object.keys(oldToolPanelProperties).forEach(function (key) {
  10916. var translation = oldToolPanelProperties[key];
  10917. var value = _this.gridOptions[key];
  10918. if (value !== undefined) {
  10919. if (key === 'toolPanelSuppressSideButtons') {
  10920. console.warn('ag-grid: since v19.0 toolPanelSuppressSideButtons has been completely removed. See https://www.ag-grid.com/javascript-grid-tool-panel/');
  10921. return;
  10922. }
  10923. console.warn("ag-grid: since v19.0 gridOptions." + key + " is deprecated, please use gridOptions.sideBar.toolPanel[columnsIndex].componentParams." + translation);
  10924. toolPanelColumnsCompProps[translation] = value;
  10925. }
  10926. });
  10927. if (Object.keys(toolPanelColumnsCompProps).length > 0 && !_utils__WEBPACK_IMPORTED_MODULE_10__["_"].exists(options.sideBar)) {
  10928. console.warn("ag-grid: since version 19.x, sideBar is mandatory if using toolPanel related properties. See https://www.ag-grid.com/javascript-grid-tool-panel/");
  10929. options.sideBar = true;
  10930. }
  10931. if (options.sideBar != null) {
  10932. options.sideBar = _entities_sideBar__WEBPACK_IMPORTED_MODULE_7__["SideBarDefParser"].parse(options.sideBar);
  10933. }
  10934. var sideBarDef = this.gridOptions.sideBar;
  10935. if (Object.keys(toolPanelColumnsCompProps).length > 0 && sideBarDef && sideBarDef.toolPanels) {
  10936. var columnsDef = sideBarDef.toolPanels.filter(function (it) { return it.id === 'columns'; });
  10937. if (columnsDef.length === 1) {
  10938. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].mergeDeep(columnsDef[0], {
  10939. componentParams: toolPanelColumnsCompProps
  10940. });
  10941. }
  10942. }
  10943. if (options.enableStatusBar) {
  10944. console.warn("ag-grid: since version 19.x, enableStatusBar is gone, please specify statusBar components");
  10945. options.statusBar = options.statusBar || {
  10946. components: [{ component: 'agAggregationComponent' }]
  10947. };
  10948. }
  10949. if (options.alwaysShowStatusBar) {
  10950. console.warn("ag-grid: since version 19.x, alwaysShowStatusBar is gone. Please specify a min-height on the ag-status-bar css class, eg .ag-status-bar {min-height: 35px; }");
  10951. }
  10952. if (options.enableServerSideSorting || options.enableSorting) {
  10953. console.warn("ag-Grid: since v20, grid options enableSorting and enableServerSideSorting are gone. Instead set sortable=true on the column definition for the columns sorting are allowed on. To migrate from gridOption.enableSorting=true, set gridOptions.defaultColDef.sortable=true");
  10954. if (!options.defaultColDef) {
  10955. options.defaultColDef = {};
  10956. }
  10957. if (!options.defaultColDef.sortable) {
  10958. options.defaultColDef.sortable = true;
  10959. }
  10960. }
  10961. if (options.enableFilter || options.enableServerSideFilter) {
  10962. console.warn("ag-Grid: since v20, grid options enableFilter and enableServerSideFilter are gone. Instead set filter=true (if not already specifying a specific filter) on the column definition for the columns filtering is allowed on. To migrate from gridOptions.enableFilter=true, set gridOptions.defaultColDef.filter=true. If you are explicitly setting specific filters for each column (ie colDef.filter is already set) the you don't need to do anything.");
  10963. if (!options.defaultColDef) {
  10964. options.defaultColDef = {};
  10965. }
  10966. if (!options.defaultColDef.filter) {
  10967. options.defaultColDef.filter = true;
  10968. }
  10969. }
  10970. if (options.enableColResize) {
  10971. console.warn("ag-Grid: since v20, grid options enableColResize is gone. Instead set resizable=true on the column definition for the columns resizing are allowed on. To migrate from gridOption.enableColResize=true, set gridOptions.defaultColDef.resizable=true");
  10972. if (!options.defaultColDef) {
  10973. options.defaultColDef = {};
  10974. }
  10975. if (!options.defaultColDef.resizable) {
  10976. options.defaultColDef.resizable = true;
  10977. }
  10978. }
  10979. if (options.deprecatedEmbedFullWidthRows) {
  10980. console.warn("ag-Grid: since v21.2, deprecatedEmbedFullWidthRows has been replaced with embedFullWidthRows.");
  10981. }
  10982. if (options.suppressTabbing) {
  10983. console.warn("ag-Grid: since v20.1, suppressTabbing is replaced with the more powerful grid callback suppressKeyboardEvent(params) which can suppress any keyboard event including tabbing.");
  10984. }
  10985. if (options.doesDataFlower) {
  10986. console.warn('ag-Grid: since v21.1, doesDataFlower is deprecated. Master/Detail is the new way for showing child data for a row and was introduced over a year ago. Please migrate your code to use master/detail instead.');
  10987. }
  10988. if (options.enableOldSetFilterModel) {
  10989. console.warn('ag-Grid: since v22.x, enableOldSetFilterModel is deprecated. Please move to the new Set Filter Model as the old one may not be supported in v23 onwards.');
  10990. }
  10991. if (options.floatingFilter) {
  10992. console.warn('ag-Grid: since v23.1, floatingFilter on the gridOptions is deprecated. Please use floatingFilter on the colDef instead.');
  10993. if (!options.defaultColDef) {
  10994. options.defaultColDef = {};
  10995. }
  10996. if (options.defaultColDef.floatingFilter == null) {
  10997. options.defaultColDef.floatingFilter = true;
  10998. }
  10999. }
  11000. var checkRenamedProperty = function (oldProp, newProp, version) {
  11001. if (options[oldProp] != null) {
  11002. console.warn("ag-grid: since version " + version + ", '" + oldProp + "' is deprecated / renamed, please use the new property name '" + newProp + "' instead.");
  11003. if (options[newProp] == null) {
  11004. options[newProp] = options[oldProp];
  11005. }
  11006. }
  11007. };
  11008. checkRenamedProperty('batchUpdateWaitMillis', 'asyncTransactionWaitMillis', '23.1.x');
  11009. checkRenamedProperty('deltaRowDataMode', 'immutableData', '23.1.x');
  11010. checkRenamedProperty('deltaColumnMode', 'immutableColumns', '23.1.x');
  11011. };
  11012. GridOptionsWrapper.prototype.checkForViolations = function () {
  11013. if (this.isTreeData()) {
  11014. this.treeDataViolations();
  11015. }
  11016. };
  11017. GridOptionsWrapper.prototype.treeDataViolations = function () {
  11018. if (this.isRowModelDefault()) {
  11019. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].missing(this.getDataPathFunc())) {
  11020. console.warn('ag-Grid: property usingTreeData=true with rowModel=clientSide, but you did not ' +
  11021. 'provide getDataPath function, please provide getDataPath function if using tree data.');
  11022. }
  11023. }
  11024. if (this.isRowModelServerSide()) {
  11025. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].missing(this.getIsServerSideGroupFunc())) {
  11026. console.warn('ag-Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' +
  11027. 'provide isServerSideGroup function, please provide isServerSideGroup function if using tree data.');
  11028. }
  11029. if (_utils__WEBPACK_IMPORTED_MODULE_10__["_"].missing(this.getServerSideGroupKeyFunc())) {
  11030. console.warn('ag-Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' +
  11031. 'provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data.');
  11032. }
  11033. }
  11034. };
  11035. GridOptionsWrapper.prototype.getLocaleTextFunc = function () {
  11036. if (this.gridOptions.localeTextFunc) {
  11037. return this.gridOptions.localeTextFunc;
  11038. }
  11039. var localeText = this.gridOptions.localeText;
  11040. return function (key, defaultValue) {
  11041. return localeText && localeText[key] ? localeText[key] : defaultValue;
  11042. };
  11043. };
  11044. // responsible for calling the onXXX functions on gridOptions
  11045. GridOptionsWrapper.prototype.globalEventHandler = function (eventName, event) {
  11046. var callbackMethodName = _components_componentUtil__WEBPACK_IMPORTED_MODULE_2__["ComponentUtil"].getCallbackForEvent(eventName);
  11047. if (typeof this.gridOptions[callbackMethodName] === 'function') {
  11048. this.gridOptions[callbackMethodName](event);
  11049. }
  11050. };
  11051. // we don't allow dynamic row height for virtual paging
  11052. GridOptionsWrapper.prototype.getRowHeightAsNumber = function () {
  11053. if (!this.gridOptions.rowHeight || _utils__WEBPACK_IMPORTED_MODULE_10__["_"].missing(this.gridOptions.rowHeight)) {
  11054. return this.getDefaultRowHeight();
  11055. }
  11056. else if (this.gridOptions.rowHeight && this.isNumeric(this.gridOptions.rowHeight)) {
  11057. return this.gridOptions.rowHeight;
  11058. }
  11059. console.warn('ag-Grid row height must be a number if not using standard row model');
  11060. return this.getDefaultRowHeight();
  11061. };
  11062. GridOptionsWrapper.prototype.getRowHeightForNode = function (rowNode, allowEstimate) {
  11063. // check the function first, in case use set both function and
  11064. // number, when using virtual pagination then function can be
  11065. // used for pinned rows and the number for the body rows.
  11066. if (allowEstimate === void 0) { allowEstimate = false; }
  11067. if (typeof this.gridOptions.getRowHeight === 'function') {
  11068. if (allowEstimate) {
  11069. return { height: this.getDefaultRowHeight(), estimated: true };
  11070. }
  11071. var params = {
  11072. node: rowNode,
  11073. data: rowNode.data,
  11074. api: this.gridOptions.api,
  11075. context: this.gridOptions.context
  11076. };
  11077. var height = this.gridOptions.getRowHeight(params);
  11078. if (height != null) {
  11079. return { height: height, estimated: false };
  11080. }
  11081. }
  11082. if (rowNode.detail && this.isMasterDetail()) {
  11083. if (this.isNumeric(this.gridOptions.detailRowHeight)) {
  11084. return { height: this.gridOptions.detailRowHeight, estimated: false };
  11085. }
  11086. return { height: DEFAULT_DETAIL_ROW_HEIGHT, estimated: false };
  11087. }
  11088. var defaultRowHeight = this.getDefaultRowHeight();
  11089. var rowHeight = this.gridOptions.rowHeight && this.isNumeric(this.gridOptions.rowHeight) ? this.gridOptions.rowHeight : defaultRowHeight;
  11090. var minRowHeight = Math.min(defaultRowHeight, rowHeight);
  11091. if (this.columnController.isAutoRowHeightActive()) {
  11092. if (allowEstimate) {
  11093. return { height: rowHeight, estimated: true };
  11094. }
  11095. var autoHeight = this.autoHeightCalculator.getPreferredHeightForRow(rowNode);
  11096. // never return less than the default row height - covers when auto height
  11097. // cells are blank.
  11098. return { height: Math.max(autoHeight, minRowHeight), estimated: false };
  11099. }
  11100. return { height: rowHeight, estimated: false };
  11101. };
  11102. GridOptionsWrapper.prototype.isDynamicRowHeight = function () {
  11103. return typeof this.gridOptions.getRowHeight === 'function';
  11104. };
  11105. GridOptionsWrapper.prototype.getListItemHeight = function () {
  11106. return this.getFromTheme(20, 'listItemHeight');
  11107. };
  11108. GridOptionsWrapper.prototype.chartMenuPanelWidth = function () {
  11109. return this.environment.chartMenuPanelWidth();
  11110. };
  11111. GridOptionsWrapper.prototype.isNumeric = function (value) {
  11112. return !isNaN(value) && typeof value === 'number';
  11113. };
  11114. // Material data table has strict guidelines about whitespace, and these values are different than the ones
  11115. // ag-grid uses by default. We override the default ones for the sake of making it better out of the box
  11116. GridOptionsWrapper.prototype.getFromTheme = function (defaultValue, sassVariableName) {
  11117. var theme = this.environment.getTheme().theme;
  11118. if (theme && theme.indexOf('ag-theme') === 0) {
  11119. return this.environment.getSassVariable(theme, sassVariableName);
  11120. }
  11121. return defaultValue;
  11122. };
  11123. GridOptionsWrapper.prototype.getDefaultRowHeight = function () {
  11124. return this.getFromTheme(DEFAULT_ROW_HEIGHT, 'rowHeight');
  11125. };
  11126. var GridOptionsWrapper_1;
  11127. GridOptionsWrapper.MIN_COL_WIDTH = 10;
  11128. GridOptionsWrapper.PROP_HEADER_HEIGHT = 'headerHeight';
  11129. GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN = 'groupRemoveSingleChildren';
  11130. GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN = 'groupRemoveLowestSingleChildren';
  11131. GridOptionsWrapper.PROP_PIVOT_HEADER_HEIGHT = 'pivotHeaderHeight';
  11132. GridOptionsWrapper.PROP_SUPPRESS_CLIPBOARD_PASTE = 'suppressClipboardPaste';
  11133. GridOptionsWrapper.PROP_GROUP_HEADER_HEIGHT = 'groupHeaderHeight';
  11134. GridOptionsWrapper.PROP_PIVOT_GROUP_HEADER_HEIGHT = 'pivotGroupHeaderHeight';
  11135. GridOptionsWrapper.PROP_FLOATING_FILTERS_HEIGHT = 'floatingFiltersHeight';
  11136. GridOptionsWrapper.PROP_SUPPRESS_ROW_CLICK_SELECTION = 'suppressRowClickSelection';
  11137. GridOptionsWrapper.PROP_SUPPRESS_ROW_DRAG = 'suppressRowDrag';
  11138. GridOptionsWrapper.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG = 'suppressMoveWhenRowDragging';
  11139. GridOptionsWrapper.PROP_POPUP_PARENT = 'popupParent';
  11140. GridOptionsWrapper.PROP_DOM_LAYOUT = 'domLayout';
  11141. __decorate([
  11142. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('gridOptions')
  11143. ], GridOptionsWrapper.prototype, "gridOptions", void 0);
  11144. __decorate([
  11145. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnController')
  11146. ], GridOptionsWrapper.prototype, "columnController", void 0);
  11147. __decorate([
  11148. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('eventService')
  11149. ], GridOptionsWrapper.prototype, "eventService", void 0);
  11150. __decorate([
  11151. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('environment')
  11152. ], GridOptionsWrapper.prototype, "environment", void 0);
  11153. __decorate([
  11154. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('autoHeightCalculator')
  11155. ], GridOptionsWrapper.prototype, "autoHeightCalculator", void 0);
  11156. __decorate([
  11157. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Qualifier"])('gridApi')), __param(1, Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Qualifier"])('columnApi'))
  11158. ], GridOptionsWrapper.prototype, "agWire", null);
  11159. __decorate([
  11160. _context_context__WEBPACK_IMPORTED_MODULE_3__["PreDestroy"]
  11161. ], GridOptionsWrapper.prototype, "destroy", null);
  11162. __decorate([
  11163. _context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
  11164. ], GridOptionsWrapper.prototype, "init", null);
  11165. GridOptionsWrapper = GridOptionsWrapper_1 = __decorate([
  11166. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Bean"])('gridOptionsWrapper')
  11167. ], GridOptionsWrapper);
  11168. return GridOptionsWrapper;
  11169. }());
  11170. /***/ }),
  11171. /* 51 */
  11172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11173. "use strict";
  11174. __webpack_require__.r(__webpack_exports__);
  11175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColDefUtil", function() { return ColDefUtil; });
  11176. /**
  11177. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  11178. * @version v23.2.1
  11179. * @link http://www.ag-grid.com/
  11180. * @license MIT
  11181. */
  11182. var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
  11183. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  11184. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  11185. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  11186. r[k] = a[j];
  11187. return r;
  11188. };
  11189. var ColDefUtil = /** @class */ (function () {
  11190. function ColDefUtil() {
  11191. }
  11192. ColDefUtil.STRING_PROPERTIES = [
  11193. 'headerName',
  11194. 'columnGroupShow',
  11195. 'headerClass',
  11196. 'toolPanelClass',
  11197. 'headerValueGetter',
  11198. 'pivotKeys',
  11199. 'groupId',
  11200. 'colId',
  11201. 'sort',
  11202. 'field',
  11203. 'type',
  11204. 'tooltipComponent',
  11205. 'tooltipField',
  11206. 'headerTooltip',
  11207. 'cellClass',
  11208. 'showRowGroup',
  11209. 'template',
  11210. 'templateUrl',
  11211. 'filter',
  11212. 'aggFunc',
  11213. 'cellRenderer',
  11214. 'cellEditor',
  11215. 'pinned',
  11216. 'chartDataType'
  11217. ];
  11218. ColDefUtil.OBJECT_PROPERTIES = [
  11219. 'headerGroupComponent',
  11220. 'headerGroupComponentFramework',
  11221. 'headerGroupComponentParams',
  11222. 'cellStyle',
  11223. 'cellRendererParams',
  11224. 'cellEditorFramework',
  11225. 'cellEditorParams',
  11226. 'pinnedRowCellRendererFramework',
  11227. 'pinnedRowCellRendererParams',
  11228. 'filterFramework',
  11229. 'filterParams',
  11230. 'pivotValueColumn',
  11231. 'headerComponent',
  11232. 'headerComponentFramework',
  11233. 'headerComponentParams',
  11234. 'floatingFilterComponent',
  11235. 'floatingFilterComponentParams',
  11236. 'floatingFilterComponentFramework',
  11237. 'tooltipComponent',
  11238. 'tooltipComponentParams',
  11239. 'tooltipComponentFramework',
  11240. 'refData'
  11241. ];
  11242. ColDefUtil.ARRAY_PROPERTIES = [
  11243. 'children',
  11244. 'sortingOrder',
  11245. 'allowedAggFuncs',
  11246. 'menuTabs',
  11247. 'pivotTotalColumnIds',
  11248. 'cellClassRules',
  11249. 'icons'
  11250. ];
  11251. ColDefUtil.NUMBER_PROPERTIES = [
  11252. 'sortedAt',
  11253. 'flex',
  11254. 'width',
  11255. 'minWidth',
  11256. 'maxWidth',
  11257. 'rowGroupIndex',
  11258. 'pivotIndex'
  11259. ];
  11260. ColDefUtil.BOOLEAN_PROPERTIES = [
  11261. 'suppressCellFlash',
  11262. 'suppressColumnsToolPanel',
  11263. 'suppressFiltersToolPanel',
  11264. 'openByDefault',
  11265. 'marryChildren',
  11266. 'hide',
  11267. 'rowGroup',
  11268. 'pivot',
  11269. 'checkboxSelection',
  11270. 'headerCheckboxSelection',
  11271. 'headerCheckboxSelectionFilteredOnly',
  11272. 'suppressMenu',
  11273. 'suppressSorting',
  11274. 'suppressMovable',
  11275. 'suppressFilter',
  11276. 'lockPosition',
  11277. 'lockVisible',
  11278. 'lockPinned',
  11279. 'unSortIcon',
  11280. 'suppressSizeToFit',
  11281. 'suppressResize',
  11282. 'suppressAutoSize',
  11283. 'enableRowGroup',
  11284. 'enablePivot',
  11285. 'enableValue',
  11286. 'editable',
  11287. 'suppressPaste',
  11288. 'suppressNavigable',
  11289. 'enableCellChangeFlash',
  11290. 'rowDrag',
  11291. 'dndSource',
  11292. 'autoHeight',
  11293. 'sortable',
  11294. 'resizable',
  11295. 'singleClickEdit',
  11296. 'floatingFilter',
  11297. ];
  11298. ColDefUtil.FUNCTION_PROPERTIES = [
  11299. 'dndSourceOnRowDrag',
  11300. 'valueGetter',
  11301. 'valueSetter',
  11302. 'filterValueGetter',
  11303. 'keyCreator',
  11304. 'cellRenderer',
  11305. 'cellRendererFramework',
  11306. 'pinnedRowCellRenderer',
  11307. 'valueFormatter',
  11308. 'pinnedRowValueFormatter',
  11309. 'valueParser',
  11310. 'comparator',
  11311. 'equals',
  11312. 'pivotComparator',
  11313. 'suppressKeyboardEvent',
  11314. 'colSpan',
  11315. 'rowSpan',
  11316. 'getQuickFilterText',
  11317. 'newValueHandler',
  11318. 'onCellValueChanged',
  11319. 'onCellClicked',
  11320. 'onCellDoubleClicked',
  11321. 'onCellContextMenu',
  11322. 'rowDragText',
  11323. 'tooltip',
  11324. 'tooltipValueGetter',
  11325. 'tooltipComponent',
  11326. 'tooltipComponentFramework',
  11327. 'cellRendererSelector',
  11328. 'cellEditorSelector'
  11329. ];
  11330. ColDefUtil.ALL_PROPERTIES = __spreadArrays(ColDefUtil.ARRAY_PROPERTIES, ColDefUtil.OBJECT_PROPERTIES, ColDefUtil.STRING_PROPERTIES, ColDefUtil.NUMBER_PROPERTIES, ColDefUtil.FUNCTION_PROPERTIES, ColDefUtil.BOOLEAN_PROPERTIES);
  11331. // used when doing property checks - this causes noise when using frameworks which can add their own fw specific
  11332. // properties to colDefs, gridOptions etc
  11333. ColDefUtil.FRAMEWORK_PROPERTIES = ['__ob__', '__metadata__', 'mappedColumnProperties', 'hasChildColumns',
  11334. 'toColDef', 'createColDefFromGridColumn'];
  11335. return ColDefUtil;
  11336. }());
  11337. /***/ }),
  11338. /* 52 */
  11339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11340. "use strict";
  11341. __webpack_require__.r(__webpack_exports__);
  11342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SideBarDefParser", function() { return SideBarDefParser; });
  11343. /**
  11344. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  11345. * @version v23.2.1
  11346. * @link http://www.ag-grid.com/
  11347. * @license MIT
  11348. */
  11349. var SideBarDefParser = /** @class */ (function () {
  11350. function SideBarDefParser() {
  11351. }
  11352. SideBarDefParser.parse = function (toParse) {
  11353. if (!toParse) {
  11354. return null;
  11355. }
  11356. if (toParse === true) {
  11357. return {
  11358. toolPanels: [
  11359. SideBarDefParser.DEFAULT_COLUMN_COMP,
  11360. SideBarDefParser.DEFAULT_FILTER_COMP,
  11361. ],
  11362. defaultToolPanel: 'columns'
  11363. };
  11364. }
  11365. if (typeof toParse === 'string') {
  11366. return SideBarDefParser.parse([toParse]);
  11367. }
  11368. if (Array.isArray(toParse)) {
  11369. var comps_1 = [];
  11370. toParse.forEach(function (key) {
  11371. var lookupResult = SideBarDefParser.DEFAULT_BY_KEY[key];
  11372. if (!lookupResult) {
  11373. console.warn("ag-grid: the key " + key + " is not a valid key for specifying a tool panel, valid keys are: " + Object.keys(SideBarDefParser.DEFAULT_BY_KEY).join(','));
  11374. return;
  11375. }
  11376. comps_1.push(lookupResult);
  11377. });
  11378. if (comps_1.length === 0) {
  11379. return null;
  11380. }
  11381. return {
  11382. toolPanels: comps_1,
  11383. defaultToolPanel: comps_1[0].id
  11384. };
  11385. }
  11386. var result = {
  11387. toolPanels: SideBarDefParser.parseComponents(toParse.toolPanels),
  11388. defaultToolPanel: toParse.defaultToolPanel,
  11389. hiddenByDefault: toParse.hiddenByDefault,
  11390. position: toParse.position
  11391. };
  11392. return result;
  11393. };
  11394. SideBarDefParser.parseComponents = function (from) {
  11395. var result = [];
  11396. from.forEach(function (it) {
  11397. var toAdd = null;
  11398. if (typeof it === 'string') {
  11399. var lookupResult = SideBarDefParser.DEFAULT_BY_KEY[it];
  11400. if (!lookupResult) {
  11401. console.warn("ag-grid: the key " + it + " is not a valid key for specifying a tool panel, valid keys are: " + Object.keys(SideBarDefParser.DEFAULT_BY_KEY).join(','));
  11402. return;
  11403. }
  11404. toAdd = lookupResult;
  11405. }
  11406. else {
  11407. toAdd = it;
  11408. }
  11409. result.push(toAdd);
  11410. });
  11411. return result;
  11412. };
  11413. SideBarDefParser.DEFAULT_COLUMN_COMP = {
  11414. id: 'columns',
  11415. labelDefault: 'Columns',
  11416. labelKey: 'columns',
  11417. iconKey: 'columns',
  11418. toolPanel: 'agColumnsToolPanel',
  11419. };
  11420. SideBarDefParser.DEFAULT_FILTER_COMP = {
  11421. id: 'filters',
  11422. labelDefault: 'Filters',
  11423. labelKey: 'filters',
  11424. iconKey: 'filter',
  11425. toolPanel: 'agFiltersToolPanel',
  11426. };
  11427. SideBarDefParser.DEFAULT_BY_KEY = {
  11428. columns: SideBarDefParser.DEFAULT_COLUMN_COMP,
  11429. filters: SideBarDefParser.DEFAULT_FILTER_COMP
  11430. };
  11431. return SideBarDefParser;
  11432. }());
  11433. /***/ }),
  11434. /* 53 */
  11435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11436. "use strict";
  11437. __webpack_require__.r(__webpack_exports__);
  11438. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RegisteredComponentSource", function() { return RegisteredComponentSource; });
  11439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UserComponentRegistry", function() { return UserComponentRegistry; });
  11440. /* harmony import */ var _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
  11441. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  11442. /* harmony import */ var _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58);
  11443. /* harmony import */ var _headerRendering_header_headerComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(64);
  11444. /* harmony import */ var _headerRendering_headerGroup_headerGroupComp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66);
  11445. /* harmony import */ var _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67);
  11446. /* harmony import */ var _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(76);
  11447. /* harmony import */ var _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(77);
  11448. /* harmony import */ var _rendering_cellRenderers_loadingCellRenderer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(78);
  11449. /* harmony import */ var _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(79);
  11450. /* harmony import */ var _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80);
  11451. /* harmony import */ var _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81);
  11452. /* harmony import */ var _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(82);
  11453. /* harmony import */ var _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(83);
  11454. /* harmony import */ var _rendering_overlays_loadingOverlayComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(84);
  11455. /* harmony import */ var _rendering_overlays_noRowsOverlayComponent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(85);
  11456. /* harmony import */ var _rendering_tooltipComponent__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(86);
  11457. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7);
  11458. /* harmony import */ var _filter_provided_date_defaultDateComponent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(87);
  11459. /* harmony import */ var _filter_provided_date_dateFloatingFilter__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(88);
  11460. /* harmony import */ var _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(90);
  11461. /* harmony import */ var _filter_provided_number_numberFloatingFilter__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(91);
  11462. /* harmony import */ var _filter_provided_text_textFloatingFilter__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(93);
  11463. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(41);
  11464. /**
  11465. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  11466. * @version v23.2.1
  11467. * @link http://www.ag-grid.com/
  11468. * @license MIT
  11469. */
  11470. var __extends = (undefined && undefined.__extends) || (function () {
  11471. var extendStatics = function (d, b) {
  11472. extendStatics = Object.setPrototypeOf ||
  11473. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  11474. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  11475. return extendStatics(d, b);
  11476. };
  11477. return function (d, b) {
  11478. extendStatics(d, b);
  11479. function __() { this.constructor = d; }
  11480. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11481. };
  11482. })();
  11483. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  11484. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  11485. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  11486. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  11487. return c > 3 && r && Object.defineProperty(target, key, r), r;
  11488. };
  11489. var RegisteredComponentSource;
  11490. (function (RegisteredComponentSource) {
  11491. RegisteredComponentSource[RegisteredComponentSource["DEFAULT"] = 0] = "DEFAULT";
  11492. RegisteredComponentSource[RegisteredComponentSource["REGISTERED"] = 1] = "REGISTERED";
  11493. })(RegisteredComponentSource || (RegisteredComponentSource = {}));
  11494. var UserComponentRegistry = /** @class */ (function (_super) {
  11495. __extends(UserComponentRegistry, _super);
  11496. function UserComponentRegistry() {
  11497. var _this = _super !== null && _super.apply(this, arguments) || this;
  11498. _this.agGridDefaults = {
  11499. //date
  11500. agDateInput: _filter_provided_date_defaultDateComponent__WEBPACK_IMPORTED_MODULE_18__["DefaultDateComponent"],
  11501. //header
  11502. agColumnHeader: _headerRendering_header_headerComp__WEBPACK_IMPORTED_MODULE_3__["HeaderComp"],
  11503. agColumnGroupHeader: _headerRendering_headerGroup_headerGroupComp__WEBPACK_IMPORTED_MODULE_4__["HeaderGroupComp"],
  11504. //floating filters
  11505. agTextColumnFloatingFilter: _filter_provided_text_textFloatingFilter__WEBPACK_IMPORTED_MODULE_22__["TextFloatingFilter"],
  11506. agNumberColumnFloatingFilter: _filter_provided_number_numberFloatingFilter__WEBPACK_IMPORTED_MODULE_21__["NumberFloatingFilter"],
  11507. agDateColumnFloatingFilter: _filter_provided_date_dateFloatingFilter__WEBPACK_IMPORTED_MODULE_19__["DateFloatingFilter"],
  11508. // renderers
  11509. agAnimateShowChangeCellRenderer: _rendering_cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_6__["AnimateShowChangeCellRenderer"],
  11510. agAnimateSlideCellRenderer: _rendering_cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_7__["AnimateSlideCellRenderer"],
  11511. agGroupCellRenderer: _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_5__["GroupCellRenderer"],
  11512. agGroupRowRenderer: _rendering_cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_5__["GroupCellRenderer"],
  11513. agLoadingCellRenderer: _rendering_cellRenderers_loadingCellRenderer__WEBPACK_IMPORTED_MODULE_8__["LoadingCellRenderer"],
  11514. //editors
  11515. agCellEditor: _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_0__["TextCellEditor"],
  11516. agTextCellEditor: _rendering_cellEditors_textCellEditor__WEBPACK_IMPORTED_MODULE_0__["TextCellEditor"],
  11517. agSelectCellEditor: _rendering_cellEditors_selectCellEditor__WEBPACK_IMPORTED_MODULE_9__["SelectCellEditor"],
  11518. agPopupTextCellEditor: _rendering_cellEditors_popupTextCellEditor__WEBPACK_IMPORTED_MODULE_10__["PopupTextCellEditor"],
  11519. agPopupSelectCellEditor: _rendering_cellEditors_popupSelectCellEditor__WEBPACK_IMPORTED_MODULE_11__["PopupSelectCellEditor"],
  11520. agLargeTextCellEditor: _rendering_cellEditors_largeTextCellEditor__WEBPACK_IMPORTED_MODULE_12__["LargeTextCellEditor"],
  11521. //filter
  11522. agTextColumnFilter: _filter_provided_text_textFilter__WEBPACK_IMPORTED_MODULE_20__["TextFilter"],
  11523. agNumberColumnFilter: _filter_provided_number_numberFilter__WEBPACK_IMPORTED_MODULE_13__["NumberFilter"],
  11524. agDateColumnFilter: _filter_provided_date_dateFilter__WEBPACK_IMPORTED_MODULE_2__["DateFilter"],
  11525. //overlays
  11526. agLoadingOverlay: _rendering_overlays_loadingOverlayComponent__WEBPACK_IMPORTED_MODULE_14__["LoadingOverlayComponent"],
  11527. agNoRowsOverlay: _rendering_overlays_noRowsOverlayComponent__WEBPACK_IMPORTED_MODULE_15__["NoRowsOverlayComponent"],
  11528. // tooltips
  11529. agTooltipComponent: _rendering_tooltipComponent__WEBPACK_IMPORTED_MODULE_16__["TooltipComponent"]
  11530. };
  11531. _this.agDeprecatedNames = {
  11532. set: {
  11533. newComponentName: 'agSetColumnFilter',
  11534. propertyHolder: 'filter'
  11535. },
  11536. text: {
  11537. newComponentName: 'agTextColumnFilter',
  11538. propertyHolder: 'filter'
  11539. },
  11540. number: {
  11541. newComponentName: 'agNumberColumnFilter',
  11542. propertyHolder: 'filter'
  11543. },
  11544. date: {
  11545. newComponentName: 'agDateColumnFilter',
  11546. propertyHolder: 'filter'
  11547. },
  11548. group: {
  11549. newComponentName: 'agGroupCellRenderer',
  11550. propertyHolder: 'cellRenderer'
  11551. },
  11552. animateShowChange: {
  11553. newComponentName: 'agAnimateShowChangeCellRenderer',
  11554. propertyHolder: 'cellRenderer'
  11555. },
  11556. animateSlide: {
  11557. newComponentName: 'agAnimateSlideCellRenderer',
  11558. propertyHolder: 'cellRenderer'
  11559. },
  11560. select: {
  11561. newComponentName: 'agSelectCellEditor',
  11562. propertyHolder: 'cellEditor'
  11563. },
  11564. largeText: {
  11565. newComponentName: 'agLargeTextCellEditor',
  11566. propertyHolder: 'cellEditor'
  11567. },
  11568. popupSelect: {
  11569. newComponentName: 'agPopupSelectCellEditor',
  11570. propertyHolder: 'cellEditor'
  11571. },
  11572. popupText: {
  11573. newComponentName: 'agPopupTextCellEditor',
  11574. propertyHolder: 'cellEditor'
  11575. },
  11576. richSelect: {
  11577. newComponentName: 'agRichSelectCellEditor',
  11578. propertyHolder: 'cellEditor'
  11579. },
  11580. headerComponent: {
  11581. newComponentName: 'agColumnHeader',
  11582. propertyHolder: 'headerComponent'
  11583. }
  11584. };
  11585. _this.jsComponents = {};
  11586. _this.frameworkComponents = {};
  11587. return _this;
  11588. }
  11589. UserComponentRegistry.prototype.init = function () {
  11590. var _this = this;
  11591. if (this.gridOptions.components != null) {
  11592. Object.keys(this.gridOptions.components).forEach(function (it) {
  11593. _this.registerComponent(it, _this.gridOptions.components[it]);
  11594. });
  11595. }
  11596. if (this.gridOptions.frameworkComponents != null) {
  11597. Object.keys(this.gridOptions.frameworkComponents).forEach(function (it) {
  11598. _this.registerFwComponent(it, _this.gridOptions.frameworkComponents[it]);
  11599. });
  11600. }
  11601. };
  11602. UserComponentRegistry.prototype.registerDefaultComponent = function (rawName, component) {
  11603. var name = this.translateIfDeprecated(rawName);
  11604. if (this.agGridDefaults[name]) {
  11605. console.error("Trying to overwrite a default component. You should call registerComponent");
  11606. return;
  11607. }
  11608. this.agGridDefaults[name] = component;
  11609. };
  11610. UserComponentRegistry.prototype.registerComponent = function (rawName, component) {
  11611. var name = this.translateIfDeprecated(rawName);
  11612. if (this.frameworkComponents[name]) {
  11613. console.error("Trying to register a component that you have already registered for frameworks: " + name);
  11614. return;
  11615. }
  11616. this.jsComponents[name] = component;
  11617. };
  11618. /**
  11619. * B the business interface (ie IHeader)
  11620. * A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
  11621. */
  11622. UserComponentRegistry.prototype.registerFwComponent = function (rawName, component) {
  11623. var name = this.translateIfDeprecated(rawName);
  11624. if (this.jsComponents[name]) {
  11625. console.error("Trying to register a component that you have already registered for plain javascript: " + name);
  11626. return;
  11627. }
  11628. this.frameworkComponents[name] = component;
  11629. };
  11630. /**
  11631. * B the business interface (ie IHeader)
  11632. * A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid
  11633. */
  11634. UserComponentRegistry.prototype.retrieve = function (rawName) {
  11635. var name = this.translateIfDeprecated(rawName);
  11636. if (this.frameworkComponents[name]) {
  11637. return {
  11638. componentFromFramework: true,
  11639. component: this.frameworkComponents[name],
  11640. source: RegisteredComponentSource.REGISTERED
  11641. };
  11642. }
  11643. if (this.jsComponents[name]) {
  11644. return {
  11645. componentFromFramework: false,
  11646. component: this.jsComponents[name],
  11647. source: RegisteredComponentSource.REGISTERED
  11648. };
  11649. }
  11650. if (this.agGridDefaults[name]) {
  11651. return this.agGridDefaults[name] ?
  11652. {
  11653. componentFromFramework: false,
  11654. component: this.agGridDefaults[name],
  11655. source: RegisteredComponentSource.DEFAULT
  11656. } :
  11657. null;
  11658. }
  11659. if (Object.keys(this.agGridDefaults).indexOf(name) < 0) {
  11660. console.warn("ag-Grid: Looking for component [" + name + "] but it wasn't found.");
  11661. }
  11662. return null;
  11663. };
  11664. UserComponentRegistry.prototype.translateIfDeprecated = function (raw) {
  11665. var deprecatedInfo = this.agDeprecatedNames[raw];
  11666. if (deprecatedInfo != null) {
  11667. _utils__WEBPACK_IMPORTED_MODULE_17__["_"].doOnce(function () {
  11668. console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename " + deprecatedInfo.propertyHolder + ":" + raw + " to " + deprecatedInfo.propertyHolder + ":" + deprecatedInfo.newComponentName);
  11669. }, 'DEPRECATE_COMPONENT_' + raw);
  11670. return deprecatedInfo.newComponentName;
  11671. }
  11672. return raw;
  11673. };
  11674. __decorate([
  11675. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptions')
  11676. ], UserComponentRegistry.prototype, "gridOptions", void 0);
  11677. __decorate([
  11678. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  11679. ], UserComponentRegistry.prototype, "init", null);
  11680. UserComponentRegistry = __decorate([
  11681. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('userComponentRegistry')
  11682. ], UserComponentRegistry);
  11683. return UserComponentRegistry;
  11684. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_23__["BeanStub"]));
  11685. /***/ }),
  11686. /* 54 */
  11687. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11688. "use strict";
  11689. __webpack_require__.r(__webpack_exports__);
  11690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextCellEditor", function() { return TextCellEditor; });
  11691. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
  11692. /* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
  11693. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  11694. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  11695. /**
  11696. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  11697. * @version v23.2.1
  11698. * @link http://www.ag-grid.com/
  11699. * @license MIT
  11700. */
  11701. var __extends = (undefined && undefined.__extends) || (function () {
  11702. var extendStatics = function (d, b) {
  11703. extendStatics = Object.setPrototypeOf ||
  11704. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  11705. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  11706. return extendStatics(d, b);
  11707. };
  11708. return function (d, b) {
  11709. extendStatics(d, b);
  11710. function __() { this.constructor = d; }
  11711. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11712. };
  11713. })();
  11714. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  11715. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  11716. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  11717. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  11718. return c > 3 && r && Object.defineProperty(target, key, r), r;
  11719. };
  11720. var TextCellEditor = /** @class */ (function (_super) {
  11721. __extends(TextCellEditor, _super);
  11722. function TextCellEditor() {
  11723. return _super.call(this, TextCellEditor.TEMPLATE) || this;
  11724. }
  11725. TextCellEditor.prototype.init = function (params) {
  11726. this.params = params;
  11727. var eInput = this.eInput;
  11728. var startValue;
  11729. // cellStartedEdit is only false if we are doing fullRow editing
  11730. if (params.cellStartedEdit) {
  11731. this.focusAfterAttached = true;
  11732. var keyPressBackspaceOrDelete = params.keyPress === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_BACKSPACE
  11733. || params.keyPress === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_DELETE;
  11734. if (keyPressBackspaceOrDelete) {
  11735. startValue = '';
  11736. }
  11737. else if (params.charPress) {
  11738. startValue = params.charPress;
  11739. }
  11740. else {
  11741. startValue = this.getStartValue(params);
  11742. if (params.keyPress !== _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_F2) {
  11743. this.highlightAllOnFocus = true;
  11744. }
  11745. }
  11746. }
  11747. else {
  11748. this.focusAfterAttached = false;
  11749. startValue = this.getStartValue(params);
  11750. }
  11751. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(startValue)) {
  11752. eInput.setValue(startValue, true);
  11753. }
  11754. this.addManagedListener(eInput.getGui(), 'keydown', function (event) {
  11755. var pageUp = event.keyCode === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_PAGE_UP;
  11756. var pageDown = event.keyCode === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_PAGE_DOWN;
  11757. if (pageUp || pageDown) {
  11758. event.preventDefault();
  11759. }
  11760. });
  11761. };
  11762. TextCellEditor.prototype.afterGuiAttached = function () {
  11763. if (!this.focusAfterAttached) {
  11764. return;
  11765. }
  11766. var eInput = this.eInput;
  11767. // Added for AG-3238. We can't remove this explicit focus() because Chrome requires an input
  11768. // to be focused before setSelectionRange will work. But it triggers a bug in Safari where
  11769. // explicitly focusing then blurring an empty field will cause the parent container to scroll.
  11770. if (!_utils__WEBPACK_IMPORTED_MODULE_3__["_"].isBrowserSafari()) {
  11771. eInput.getFocusableElement().focus();
  11772. }
  11773. var inputEl = eInput.getInputElement();
  11774. if (this.highlightAllOnFocus) {
  11775. inputEl.select();
  11776. }
  11777. else {
  11778. // when we started editing, we want the caret at the end, not the start.
  11779. // this comes into play in two scenarios: a) when user hits F2 and b)
  11780. // when user hits a printable character, then on IE (and only IE) the caret
  11781. // was placed after the first character, thus 'apply' would end up as 'pplea'
  11782. var value = eInput.getValue();
  11783. var len = (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(value) && value.length) || 0;
  11784. if (len) {
  11785. inputEl.setSelectionRange(len, len);
  11786. }
  11787. }
  11788. };
  11789. // gets called when tabbing trough cells and in full row edit mode
  11790. TextCellEditor.prototype.focusIn = function () {
  11791. var eInput = this.eInput;
  11792. var focusEl = eInput.getFocusableElement();
  11793. var inputEl = eInput.getInputElement();
  11794. focusEl.focus();
  11795. inputEl.select();
  11796. };
  11797. TextCellEditor.prototype.focusOut = function () {
  11798. var inputEl = this.eInput.getInputElement();
  11799. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].isBrowserIE()) {
  11800. inputEl.setSelectionRange(0, 0);
  11801. }
  11802. };
  11803. TextCellEditor.prototype.getValue = function () {
  11804. var eInput = this.eInput;
  11805. return this.params.parseValue(eInput.getValue());
  11806. };
  11807. TextCellEditor.prototype.getStartValue = function (params) {
  11808. var formatValue = params.useFormatter || params.column.getColDef().refData;
  11809. return formatValue ? params.formatValue(params.value) : params.value;
  11810. };
  11811. TextCellEditor.prototype.isPopup = function () {
  11812. return false;
  11813. };
  11814. TextCellEditor.TEMPLATE = '<div class="ag-cell-edit-wrapper"><ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field></div>';
  11815. __decorate([
  11816. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eInput')
  11817. ], TextCellEditor.prototype, "eInput", void 0);
  11818. return TextCellEditor;
  11819. }(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__["PopupComponent"]));
  11820. /***/ }),
  11821. /* 55 */
  11822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11823. "use strict";
  11824. __webpack_require__.r(__webpack_exports__);
  11825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return PopupComponent; });
  11826. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  11827. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  11828. /**
  11829. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  11830. * @version v23.2.1
  11831. * @link http://www.ag-grid.com/
  11832. * @license MIT
  11833. */
  11834. var __extends = (undefined && undefined.__extends) || (function () {
  11835. var extendStatics = function (d, b) {
  11836. extendStatics = Object.setPrototypeOf ||
  11837. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  11838. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  11839. return extendStatics(d, b);
  11840. };
  11841. return function (d, b) {
  11842. extendStatics(d, b);
  11843. function __() { this.constructor = d; }
  11844. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11845. };
  11846. })();
  11847. var PopupComponent = /** @class */ (function (_super) {
  11848. __extends(PopupComponent, _super);
  11849. function PopupComponent() {
  11850. return _super !== null && _super.apply(this, arguments) || this;
  11851. }
  11852. PopupComponent.prototype.isPopup = function () {
  11853. return true;
  11854. };
  11855. PopupComponent.prototype.setParentComponent = function (container) {
  11856. _utils__WEBPACK_IMPORTED_MODULE_1__["_"].addCssClass(container.getGui(), 'ag-has-popup');
  11857. _super.prototype.setParentComponent.call(this, container);
  11858. };
  11859. PopupComponent.prototype.destroy = function () {
  11860. var parentComp = this.parentComponent;
  11861. var hasParent = parentComp && parentComp.isAlive();
  11862. if (hasParent) {
  11863. _utils__WEBPACK_IMPORTED_MODULE_1__["_"].removeCssClass(parentComp.getGui(), 'ag-has-popup');
  11864. }
  11865. _super.prototype.destroy.call(this);
  11866. };
  11867. return PopupComponent;
  11868. }(_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  11869. /***/ }),
  11870. /* 56 */
  11871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11872. "use strict";
  11873. __webpack_require__.r(__webpack_exports__);
  11874. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return Component; });
  11875. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  11876. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  11877. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  11878. /**
  11879. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  11880. * @version v23.2.1
  11881. * @link http://www.ag-grid.com/
  11882. * @license MIT
  11883. */
  11884. var __extends = (undefined && undefined.__extends) || (function () {
  11885. var extendStatics = function (d, b) {
  11886. extendStatics = Object.setPrototypeOf ||
  11887. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  11888. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  11889. return extendStatics(d, b);
  11890. };
  11891. return function (d, b) {
  11892. extendStatics(d, b);
  11893. function __() { this.constructor = d; }
  11894. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  11895. };
  11896. })();
  11897. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  11898. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  11899. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  11900. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  11901. return c > 3 && r && Object.defineProperty(target, key, r), r;
  11902. };
  11903. var compIdSequence = new _utils__WEBPACK_IMPORTED_MODULE_2__["NumberSequence"]();
  11904. var Component = /** @class */ (function (_super) {
  11905. __extends(Component, _super);
  11906. function Component(template) {
  11907. var _this = _super.call(this) || this;
  11908. _this.annotatedGuiListeners = [];
  11909. // if false, then CSS class "ag-hidden" is applied, which sets "display: none"
  11910. _this.displayed = true;
  11911. // if false, then CSS class "ag-invisible" is applied, which sets "visibility: hidden"
  11912. _this.visible = true;
  11913. // unique id for this row component. this is used for getting a reference to the HTML dom.
  11914. // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying
  11915. // around as we create a new rowComp instance for the same row node).
  11916. _this.compId = compIdSequence.next();
  11917. if (template) {
  11918. _this.setTemplate(template);
  11919. }
  11920. return _this;
  11921. }
  11922. Component.prototype.getCompId = function () {
  11923. return this.compId;
  11924. };
  11925. // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag
  11926. Component.prototype.createChildComponentsFromTags = function (parentNode, paramsMap) {
  11927. var _this = this;
  11928. // we MUST take a copy of the list first, as the 'swapComponentForNode' adds comments into the DOM
  11929. // which messes up the traversal order of the children.
  11930. var childNodeList = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].copyNodeList(parentNode.childNodes);
  11931. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].forEach(childNodeList, function (childNode) {
  11932. if (!(childNode instanceof HTMLElement)) {
  11933. return;
  11934. }
  11935. var childComp = _this.createComponentFromElement(childNode, function (childComp) {
  11936. // copy over all attributes, including css classes, so any attributes user put on the tag
  11937. // wll be carried across
  11938. _this.copyAttributesFromNode(childNode, childComp.getGui());
  11939. }, paramsMap);
  11940. if (childComp) {
  11941. if (childComp.addItems && childNode.children.length) {
  11942. _this.createChildComponentsFromTags(childNode);
  11943. // converting from HTMLCollection to Array
  11944. var items = Array.prototype.slice.call(childNode.children);
  11945. childComp.addItems(items);
  11946. }
  11947. // replace the tag (eg ag-checkbox) with the proper HTMLElement (eg 'div') in the dom
  11948. _this.swapComponentForNode(childComp, parentNode, childNode);
  11949. }
  11950. else if (childNode.childNodes) {
  11951. _this.createChildComponentsFromTags(childNode);
  11952. }
  11953. });
  11954. };
  11955. Component.prototype.createComponentFromElement = function (element, afterPreCreateCallback, paramsMap) {
  11956. var key = element.nodeName;
  11957. var componentParams = paramsMap ? paramsMap[element.getAttribute('ref')] : undefined;
  11958. var ComponentClass = this.agStackComponentsRegistry.getComponentClass(key);
  11959. if (ComponentClass) {
  11960. var newComponent = new ComponentClass(componentParams);
  11961. this.createBean(newComponent, null, afterPreCreateCallback);
  11962. return newComponent;
  11963. }
  11964. return null;
  11965. };
  11966. Component.prototype.copyAttributesFromNode = function (source, dest) {
  11967. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].iterateNamedNodeMap(source.attributes, function (name, value) { return dest.setAttribute(name, value); });
  11968. };
  11969. Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) {
  11970. var eComponent = newComponent.getGui();
  11971. parentNode.replaceChild(eComponent, childNode);
  11972. parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);
  11973. this.addDestroyFunc(this.destroyBean.bind(this, newComponent));
  11974. this.swapInComponentForQuerySelectors(newComponent, childNode);
  11975. };
  11976. Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) {
  11977. var thisNoType = this;
  11978. this.iterateOverQuerySelectors(function (querySelector) {
  11979. if (thisNoType[querySelector.attributeName] === childNode) {
  11980. thisNoType[querySelector.attributeName] = newComponent;
  11981. }
  11982. });
  11983. };
  11984. Component.prototype.iterateOverQuerySelectors = function (action) {
  11985. var thisPrototype = Object.getPrototypeOf(this);
  11986. while (thisPrototype != null) {
  11987. var metaData = thisPrototype.__agComponentMetaData;
  11988. var currentProtoName = (thisPrototype.constructor).name;
  11989. if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) {
  11990. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].forEach(metaData[currentProtoName].querySelectors, function (querySelector) { return action(querySelector); });
  11991. }
  11992. thisPrototype = Object.getPrototypeOf(thisPrototype);
  11993. }
  11994. };
  11995. Component.prototype.setTemplate = function (template, paramsMap) {
  11996. var eGui = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].loadTemplate(template);
  11997. this.setTemplateFromElement(eGui, paramsMap);
  11998. };
  11999. Component.prototype.setTemplateFromElement = function (element, paramsMap) {
  12000. this.eGui = element;
  12001. this.eGui.__agComponent = this;
  12002. this.addAnnotatedGuiEventListeners();
  12003. this.wireQuerySelectors();
  12004. // context will not be available when user sets template in constructor
  12005. if (!!this.getContext()) {
  12006. this.createChildComponentsFromTags(this.getGui(), paramsMap);
  12007. }
  12008. };
  12009. Component.prototype.createChildComponentsPreConstruct = function () {
  12010. // ui exists if user sets template in constructor. when this happens, we have to wait for the context
  12011. // to be autoWired first before we can create child components.
  12012. if (!!this.getGui()) {
  12013. this.createChildComponentsFromTags(this.getGui());
  12014. }
  12015. };
  12016. Component.prototype.wireQuerySelectors = function () {
  12017. var _this = this;
  12018. if (!this.eGui) {
  12019. return;
  12020. }
  12021. var thisNoType = this;
  12022. this.iterateOverQuerySelectors(function (querySelector) {
  12023. var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector);
  12024. if (resultOfQuery) {
  12025. thisNoType[querySelector.attributeName] = resultOfQuery.__agComponent || resultOfQuery;
  12026. }
  12027. else {
  12028. // put debug msg in here if query selector fails???
  12029. }
  12030. });
  12031. };
  12032. Component.prototype.addAnnotatedGuiEventListeners = function () {
  12033. var _this = this;
  12034. this.removeAnnotatedGuiEventListeners();
  12035. if (!this.eGui) {
  12036. return;
  12037. }
  12038. var listenerMethods = this.getAgComponentMetaData('guiListenerMethods');
  12039. if (!listenerMethods) {
  12040. return;
  12041. }
  12042. if (!this.annotatedGuiListeners) {
  12043. this.annotatedGuiListeners = [];
  12044. }
  12045. listenerMethods.forEach(function (meta) {
  12046. var element = _this.getRefElement(meta.ref);
  12047. if (!element) {
  12048. return;
  12049. }
  12050. var listener = _this[meta.methodName].bind(_this);
  12051. element.addEventListener(meta.eventName, listener);
  12052. _this.annotatedGuiListeners.push({ eventName: meta.eventName, listener: listener, element: element });
  12053. });
  12054. };
  12055. Component.prototype.addAnnotatedGridEventListeners = function () {
  12056. var _this = this;
  12057. var listenerMetas = this.getAgComponentMetaData('gridListenerMethods');
  12058. if (!listenerMetas) {
  12059. return;
  12060. }
  12061. listenerMetas.forEach(function (meta) {
  12062. var listener = _this[meta.methodName].bind(_this);
  12063. _this.addManagedListener(_this.eventService, meta.eventName, listener);
  12064. });
  12065. };
  12066. Component.prototype.getAgComponentMetaData = function (key) {
  12067. var res = [];
  12068. var thisProto = Object.getPrototypeOf(this);
  12069. while (thisProto != null) {
  12070. var metaData = thisProto.__agComponentMetaData;
  12071. var currentProtoName = (thisProto.constructor).name;
  12072. // IE does not support Function.prototype.name, so we need to extract
  12073. // the name using a RegEx
  12074. // from: https://matt.scharley.me/2012/03/monkey-patch-name-ie.html
  12075. if (currentProtoName === undefined) {
  12076. var funcNameRegex = /function\s([^(]{1,})\(/;
  12077. var results = funcNameRegex.exec(thisProto.constructor.toString());
  12078. if (results && results.length > 1) {
  12079. currentProtoName = results[1].trim();
  12080. }
  12081. }
  12082. if (metaData && metaData[currentProtoName] && metaData[currentProtoName][key]) {
  12083. res = res.concat(metaData[currentProtoName][key]);
  12084. }
  12085. thisProto = Object.getPrototypeOf(thisProto);
  12086. }
  12087. return res;
  12088. };
  12089. Component.prototype.removeAnnotatedGuiEventListeners = function () {
  12090. if (!this.annotatedGuiListeners) {
  12091. return;
  12092. }
  12093. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].forEach(this.annotatedGuiListeners, function (e) {
  12094. e.element.removeEventListener(e.eventName, e.listener);
  12095. });
  12096. this.annotatedGuiListeners = [];
  12097. };
  12098. Component.prototype.getGui = function () {
  12099. return this.eGui;
  12100. };
  12101. Component.prototype.getFocusableElement = function () {
  12102. return this.eGui;
  12103. };
  12104. Component.prototype.setParentComponent = function (component) {
  12105. this.parentComponent = component;
  12106. };
  12107. Component.prototype.getParentComponent = function () {
  12108. return this.parentComponent;
  12109. };
  12110. // this method is for older code, that wants to provide the gui element,
  12111. // it is not intended for this to be in ag-Stack
  12112. Component.prototype.setGui = function (eGui) {
  12113. this.eGui = eGui;
  12114. };
  12115. Component.prototype.queryForHtmlElement = function (cssSelector) {
  12116. return this.eGui.querySelector(cssSelector);
  12117. };
  12118. Component.prototype.queryForHtmlInputElement = function (cssSelector) {
  12119. return this.eGui.querySelector(cssSelector);
  12120. };
  12121. Component.prototype.appendChild = function (newChild, container) {
  12122. if (!container) {
  12123. container = this.eGui;
  12124. }
  12125. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].isNodeOrElement(newChild)) {
  12126. container.appendChild(newChild);
  12127. }
  12128. else {
  12129. var childComponent = newChild;
  12130. container.appendChild(childComponent.getGui());
  12131. this.addDestroyFunc(this.destroyBean.bind(this, childComponent));
  12132. }
  12133. };
  12134. Component.prototype.isDisplayed = function () {
  12135. return this.displayed;
  12136. };
  12137. Component.prototype.setVisible = function (visible) {
  12138. if (visible !== this.visible) {
  12139. this.visible = visible;
  12140. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].setVisible(this.eGui, visible);
  12141. }
  12142. };
  12143. Component.prototype.setDisplayed = function (displayed) {
  12144. if (displayed !== this.displayed) {
  12145. this.displayed = displayed;
  12146. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].setDisplayed(this.eGui, displayed);
  12147. var event_1 = {
  12148. type: Component.EVENT_DISPLAYED_CHANGED,
  12149. visible: this.displayed
  12150. };
  12151. this.dispatchEvent(event_1);
  12152. }
  12153. };
  12154. Component.prototype.destroy = function () {
  12155. this.removeAnnotatedGuiEventListeners();
  12156. _super.prototype.destroy.call(this);
  12157. };
  12158. Component.prototype.addGuiEventListener = function (event, listener) {
  12159. var _this = this;
  12160. this.eGui.addEventListener(event, listener);
  12161. this.addDestroyFunc(function () { return _this.eGui.removeEventListener(event, listener); });
  12162. };
  12163. Component.prototype.addCssClass = function (className) {
  12164. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.eGui, className);
  12165. };
  12166. Component.prototype.removeCssClass = function (className) {
  12167. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].removeCssClass(this.eGui, className);
  12168. };
  12169. Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) {
  12170. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(this.eGui, className, addOrRemove);
  12171. };
  12172. Component.prototype.getAttribute = function (key) {
  12173. var eGui = this.eGui;
  12174. return eGui ? eGui.getAttribute(key) : null;
  12175. };
  12176. Component.prototype.getRefElement = function (refName) {
  12177. return this.queryForHtmlElement("[ref=\"" + refName + "\"]");
  12178. };
  12179. Component.EVENT_DISPLAYED_CHANGED = 'displayedChanged';
  12180. __decorate([
  12181. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('agStackComponentsRegistry')
  12182. ], Component.prototype, "agStackComponentsRegistry", void 0);
  12183. __decorate([
  12184. _context_context__WEBPACK_IMPORTED_MODULE_0__["PreConstruct"]
  12185. ], Component.prototype, "createChildComponentsPreConstruct", null);
  12186. __decorate([
  12187. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  12188. ], Component.prototype, "addAnnotatedGridEventListeners", null);
  12189. return Component;
  12190. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  12191. /***/ }),
  12192. /* 57 */
  12193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12194. "use strict";
  12195. __webpack_require__.r(__webpack_exports__);
  12196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuerySelector", function() { return QuerySelector; });
  12197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RefSelector", function() { return RefSelector; });
  12198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridListener", function() { return GridListener; });
  12199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuiListener", function() { return GuiListener; });
  12200. /**
  12201. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  12202. * @version v23.2.1
  12203. * @link http://www.ag-grid.com/
  12204. * @license MIT
  12205. */
  12206. function QuerySelector(selector) {
  12207. return querySelectorFunc.bind(this, selector);
  12208. }
  12209. function RefSelector(ref) {
  12210. return querySelectorFunc.bind(this, "[ref=" + ref + "]");
  12211. }
  12212. function querySelectorFunc(selector, classPrototype, methodOrAttributeName, index) {
  12213. if (selector === null) {
  12214. console.error("ag-Grid: QuerySelector selector should not be null");
  12215. return;
  12216. }
  12217. if (typeof index === "number") {
  12218. console.error("ag-Grid: QuerySelector should be on an attribute");
  12219. return;
  12220. }
  12221. addToObjectProps(classPrototype, 'querySelectors', {
  12222. attributeName: methodOrAttributeName,
  12223. querySelector: selector
  12224. });
  12225. }
  12226. // think we should take this out, put property bindings on the
  12227. function GridListener(eventName) {
  12228. return gridListenerFunc.bind(this, eventName);
  12229. }
  12230. function gridListenerFunc(eventName, target, methodName) {
  12231. if (eventName == null) {
  12232. console.error("ag-Grid: GridListener eventName is missing");
  12233. return;
  12234. }
  12235. addToObjectProps(target, 'gridListenerMethods', {
  12236. methodName: methodName,
  12237. eventName: eventName
  12238. });
  12239. }
  12240. // think we should take this out, put property bindings on the
  12241. function GuiListener(ref, eventName) {
  12242. return guiListenerFunc.bind(this, ref, eventName);
  12243. }
  12244. function guiListenerFunc(ref, eventName, target, methodName) {
  12245. if (eventName == null) {
  12246. console.error("ag-Grid: GuiListener eventName is missing");
  12247. return;
  12248. }
  12249. addToObjectProps(target, 'guiListenerMethods', {
  12250. methodName: methodName,
  12251. eventName: eventName,
  12252. ref: ref
  12253. });
  12254. }
  12255. // // think we should take this out, put property bindings on the
  12256. // export function Method(eventName?: string): Function {
  12257. // return methodFunc.bind(this, eventName);
  12258. // }
  12259. //
  12260. // function methodFunc(alias: string, target: Object, methodName: string) {
  12261. // if (alias === null) {
  12262. // console.error("ag-Grid: EventListener eventName should not be null");
  12263. // return;
  12264. // }
  12265. //
  12266. // addToObjectProps(target, 'methods', {
  12267. // methodName: methodName,
  12268. // alias: alias
  12269. // });
  12270. // }
  12271. function addToObjectProps(target, key, value) {
  12272. // it's an attribute on the class
  12273. var props = getOrCreateProps(target, target.constructor.name);
  12274. if (!props[key]) {
  12275. props[key] = [];
  12276. }
  12277. props[key].push(value);
  12278. }
  12279. function getOrCreateProps(target, instanceName) {
  12280. if (!target.__agComponentMetaData) {
  12281. target.__agComponentMetaData = {};
  12282. }
  12283. if (!target.__agComponentMetaData[instanceName]) {
  12284. target.__agComponentMetaData[instanceName] = {};
  12285. }
  12286. return target.__agComponentMetaData[instanceName];
  12287. }
  12288. /***/ }),
  12289. /* 58 */
  12290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12291. "use strict";
  12292. __webpack_require__.r(__webpack_exports__);
  12293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateFilter", function() { return DateFilter; });
  12294. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  12295. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  12296. /* harmony import */ var _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59);
  12297. /* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60);
  12298. /* harmony import */ var _scalarFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(63);
  12299. /* harmony import */ var _utils_date__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18);
  12300. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12);
  12301. /**
  12302. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  12303. * @version v23.2.1
  12304. * @link http://www.ag-grid.com/
  12305. * @license MIT
  12306. */
  12307. var __extends = (undefined && undefined.__extends) || (function () {
  12308. var extendStatics = function (d, b) {
  12309. extendStatics = Object.setPrototypeOf ||
  12310. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  12311. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  12312. return extendStatics(d, b);
  12313. };
  12314. return function (d, b) {
  12315. extendStatics(d, b);
  12316. function __() { this.constructor = d; }
  12317. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12318. };
  12319. })();
  12320. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  12321. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  12322. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  12323. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  12324. return c > 3 && r && Object.defineProperty(target, key, r), r;
  12325. };
  12326. var DateFilter = /** @class */ (function (_super) {
  12327. __extends(DateFilter, _super);
  12328. function DateFilter() {
  12329. return _super !== null && _super.apply(this, arguments) || this;
  12330. }
  12331. DateFilter.prototype.mapRangeFromModel = function (filterModel) {
  12332. // unlike the other filters, we do two things here:
  12333. // 1) allow for different attribute names (same as done for other filters) (eg the 'from' and 'to'
  12334. // are in different locations in Date and Number filter models)
  12335. // 2) convert the type (because Date filter uses Dates, however model is 'string')
  12336. //
  12337. // NOTE: The conversion of string to date also removes the timezone - i.e. when user picks
  12338. // a date from the UI, it will have timezone info in it. This is lost when creating
  12339. // the model. When we recreate the date again here, it's without a timezone.
  12340. return {
  12341. from: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(filterModel.dateFrom),
  12342. to: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(filterModel.dateTo)
  12343. };
  12344. };
  12345. DateFilter.prototype.setValueFromFloatingFilter = function (value) {
  12346. if (value != null) {
  12347. var dateFrom = Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(value);
  12348. this.dateCondition1FromComp.setDate(dateFrom);
  12349. }
  12350. else {
  12351. this.dateCondition1FromComp.setDate(null);
  12352. }
  12353. this.dateCondition1ToComp.setDate(null);
  12354. this.dateCondition2FromComp.setDate(null);
  12355. this.dateCondition2ToComp.setDate(null);
  12356. };
  12357. DateFilter.prototype.setConditionIntoUi = function (model, position) {
  12358. var _a = model ?
  12359. [Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(model.dateFrom), Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["parseDateTimeFromString"])(model.dateTo)] :
  12360. [null, null], dateFrom = _a[0], dateTo = _a[1];
  12361. var _b = this.getFromToComponents(position), compFrom = _b[0], compTo = _b[1];
  12362. compFrom.setDate(dateFrom);
  12363. compTo.setDate(dateTo);
  12364. };
  12365. DateFilter.prototype.resetUiToDefaults = function (silent) {
  12366. var _this = this;
  12367. return _super.prototype.resetUiToDefaults.call(this, silent).then(function () {
  12368. _this.dateCondition1FromComp.setDate(null);
  12369. _this.dateCondition1ToComp.setDate(null);
  12370. _this.dateCondition2FromComp.setDate(null);
  12371. _this.dateCondition2ToComp.setDate(null);
  12372. });
  12373. };
  12374. DateFilter.prototype.comparator = function () {
  12375. return this.dateFilterParams.comparator ? this.dateFilterParams.comparator : this.defaultComparator.bind(this);
  12376. };
  12377. DateFilter.prototype.defaultComparator = function (filterDate, cellValue) {
  12378. // The default comparator assumes that the cellValue is a date
  12379. var cellAsDate = cellValue;
  12380. if (cellValue == null || cellAsDate < filterDate) {
  12381. return -1;
  12382. }
  12383. if (cellAsDate > filterDate) {
  12384. return 1;
  12385. }
  12386. return 0;
  12387. };
  12388. DateFilter.prototype.setParams = function (params) {
  12389. _super.prototype.setParams.call(this, params);
  12390. this.dateFilterParams = params;
  12391. this.createDateComponents();
  12392. };
  12393. DateFilter.prototype.createDateComponents = function () {
  12394. var _this = this;
  12395. // params to pass to all four date comps
  12396. var dateComponentParams = {
  12397. onDateChanged: function () { return _this.onUiChanged(); },
  12398. filterParams: this.dateFilterParams
  12399. };
  12400. this.dateCondition1FromComp = new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](this.getContext(), this.userComponentFactory, dateComponentParams, this.eCondition1PanelFrom);
  12401. this.dateCondition1ToComp = new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](this.getContext(), this.userComponentFactory, dateComponentParams, this.eCondition1PanelTo);
  12402. this.dateCondition2FromComp = new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](this.getContext(), this.userComponentFactory, dateComponentParams, this.eCondition2PanelFrom);
  12403. this.dateCondition2ToComp = new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](this.getContext(), this.userComponentFactory, dateComponentParams, this.eCondition2PanelTo);
  12404. this.addDestroyFunc(function () {
  12405. _this.dateCondition1FromComp.destroy();
  12406. _this.dateCondition1ToComp.destroy();
  12407. _this.dateCondition2FromComp.destroy();
  12408. _this.dateCondition2ToComp.destroy();
  12409. });
  12410. };
  12411. DateFilter.prototype.getDefaultFilterOptions = function () {
  12412. return DateFilter.DEFAULT_FILTER_OPTIONS;
  12413. };
  12414. DateFilter.prototype.createValueTemplate = function (position) {
  12415. var pos = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One ? '1' : '2';
  12416. return /* html */ "\n <div class=\"ag-filter-body\" ref=\"eCondition" + pos + "Body\">\n <div class=\"ag-filter-from ag-filter-date-from\" ref=\"eCondition" + pos + "PanelFrom\">\n </div>\n <div class=\"ag-filter-to ag-filter-date-to\" ref=\"eCondition" + pos + "PanelTo\">\n </div>\n </div>";
  12417. };
  12418. DateFilter.prototype.isConditionUiComplete = function (position) {
  12419. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One;
  12420. var option = positionOne ? this.getCondition1Type() : this.getCondition2Type();
  12421. if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["SimpleFilter"].EMPTY) {
  12422. return false;
  12423. }
  12424. if (this.doesFilterHaveHiddenInput(option)) {
  12425. return true;
  12426. }
  12427. var _a = this.getFromToComponents(position), compFrom = _a[0], compTo = _a[1];
  12428. return compFrom.getDate() != null && (option !== _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["SimpleFilter"].IN_RANGE || compTo.getDate() != null);
  12429. };
  12430. DateFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {
  12431. return aSimple.dateFrom === bSimple.dateFrom
  12432. && aSimple.dateTo === bSimple.dateTo
  12433. && aSimple.type === bSimple.type;
  12434. };
  12435. // needed for creating filter model
  12436. DateFilter.prototype.getFilterType = function () {
  12437. return DateFilter.FILTER_TYPE;
  12438. };
  12439. DateFilter.prototype.createCondition = function (position) {
  12440. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One;
  12441. var type = positionOne ? this.getCondition1Type() : this.getCondition2Type();
  12442. var _a = this.getFromToComponents(position), compFrom = _a[0], compTo = _a[1];
  12443. return {
  12444. dateFrom: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["serialiseDate"])(compFrom.getDate()),
  12445. dateTo: Object(_utils_date__WEBPACK_IMPORTED_MODULE_5__["serialiseDate"])(compTo.getDate()),
  12446. type: type,
  12447. filterType: DateFilter.FILTER_TYPE
  12448. };
  12449. };
  12450. DateFilter.prototype.resetPlaceholder = function () {
  12451. var translate = this.gridOptionsWrapper.getLocaleTextFunc();
  12452. var placeholder = translate('dateFormatOoo', 'yyyy-mm-dd');
  12453. this.dateCondition1FromComp.setInputPlaceholder(placeholder);
  12454. this.dateCondition1ToComp.setInputPlaceholder(placeholder);
  12455. this.dateCondition2FromComp.setInputPlaceholder(placeholder);
  12456. this.dateCondition2ToComp.setInputPlaceholder(placeholder);
  12457. };
  12458. DateFilter.prototype.updateUiVisibility = function () {
  12459. _super.prototype.updateUiVisibility.call(this);
  12460. this.resetPlaceholder();
  12461. var condition1Type = this.getCondition1Type();
  12462. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition1PanelFrom, this.showValueFrom(condition1Type));
  12463. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition1PanelTo, this.showValueTo(condition1Type));
  12464. var condition2Type = this.getCondition2Type();
  12465. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition2PanelFrom, this.showValueFrom(condition2Type));
  12466. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.eCondition2PanelTo, this.showValueTo(condition2Type));
  12467. };
  12468. DateFilter.prototype.getFromToComponents = function (position) {
  12469. return position === _simpleFilter__WEBPACK_IMPORTED_MODULE_3__["ConditionPosition"].One ?
  12470. [this.dateCondition1FromComp, this.dateCondition1ToComp] :
  12471. [this.dateCondition2FromComp, this.dateCondition2ToComp];
  12472. };
  12473. DateFilter.FILTER_TYPE = 'date';
  12474. DateFilter.DEFAULT_FILTER_OPTIONS = [
  12475. _scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].EQUALS,
  12476. _scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].GREATER_THAN,
  12477. _scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].LESS_THAN,
  12478. _scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].NOT_EQUAL,
  12479. _scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"].IN_RANGE
  12480. ];
  12481. __decorate([
  12482. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition1PanelFrom')
  12483. ], DateFilter.prototype, "eCondition1PanelFrom", void 0);
  12484. __decorate([
  12485. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition1PanelTo')
  12486. ], DateFilter.prototype, "eCondition1PanelTo", void 0);
  12487. __decorate([
  12488. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition2PanelFrom')
  12489. ], DateFilter.prototype, "eCondition2PanelFrom", void 0);
  12490. __decorate([
  12491. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition2PanelTo')
  12492. ], DateFilter.prototype, "eCondition2PanelTo", void 0);
  12493. __decorate([
  12494. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
  12495. ], DateFilter.prototype, "userComponentFactory", void 0);
  12496. return DateFilter;
  12497. }(_scalarFilter__WEBPACK_IMPORTED_MODULE_4__["ScalarFilter"]));
  12498. /***/ }),
  12499. /* 59 */
  12500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12501. "use strict";
  12502. __webpack_require__.r(__webpack_exports__);
  12503. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateCompWrapper", function() { return DateCompWrapper; });
  12504. /**
  12505. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  12506. * @version v23.2.1
  12507. * @link http://www.ag-grid.com/
  12508. * @license MIT
  12509. */
  12510. /** Provides sync access to async component. Date component can be lazy created - this class encapsulates
  12511. * this by keeping value locally until DateComp has loaded, then passing DateComp the value. */
  12512. var DateCompWrapper = /** @class */ (function () {
  12513. function DateCompWrapper(context, userComponentFactory, dateComponentParams, eParent) {
  12514. var _this = this;
  12515. this.alive = true;
  12516. this.context = context;
  12517. userComponentFactory.newDateComponent(dateComponentParams).then(function (dateComp) {
  12518. // because async, check the filter still exists after component comes back
  12519. if (!_this.alive) {
  12520. context.destroyBean(dateComp);
  12521. return;
  12522. }
  12523. _this.dateComp = dateComp;
  12524. eParent.appendChild(dateComp.getGui());
  12525. if (dateComp.afterGuiAttached) {
  12526. dateComp.afterGuiAttached();
  12527. }
  12528. if (_this.tempValue) {
  12529. dateComp.setDate(_this.tempValue);
  12530. }
  12531. });
  12532. }
  12533. DateCompWrapper.prototype.destroy = function () {
  12534. this.alive = false;
  12535. this.dateComp = this.context.destroyBean(this.dateComp);
  12536. };
  12537. DateCompWrapper.prototype.getDate = function () {
  12538. return this.dateComp ? this.dateComp.getDate() : this.tempValue;
  12539. };
  12540. DateCompWrapper.prototype.setDate = function (value) {
  12541. if (this.dateComp) {
  12542. this.dateComp.setDate(value);
  12543. }
  12544. else {
  12545. this.tempValue = value;
  12546. }
  12547. };
  12548. DateCompWrapper.prototype.setInputPlaceholder = function (placeholder) {
  12549. if (this.dateComp && this.dateComp.setInputPlaceholder) {
  12550. this.dateComp.setInputPlaceholder(placeholder);
  12551. }
  12552. };
  12553. return DateCompWrapper;
  12554. }());
  12555. /***/ }),
  12556. /* 60 */
  12557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12558. "use strict";
  12559. __webpack_require__.r(__webpack_exports__);
  12560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionPosition", function() { return ConditionPosition; });
  12561. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleFilter", function() { return SimpleFilter; });
  12562. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  12563. /* harmony import */ var _optionsFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61);
  12564. /* harmony import */ var _providedFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62);
  12565. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  12566. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
  12567. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);
  12568. /**
  12569. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  12570. * @version v23.2.1
  12571. * @link http://www.ag-grid.com/
  12572. * @license MIT
  12573. */
  12574. var __extends = (undefined && undefined.__extends) || (function () {
  12575. var extendStatics = function (d, b) {
  12576. extendStatics = Object.setPrototypeOf ||
  12577. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  12578. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  12579. return extendStatics(d, b);
  12580. };
  12581. return function (d, b) {
  12582. extendStatics(d, b);
  12583. function __() { this.constructor = d; }
  12584. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12585. };
  12586. })();
  12587. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  12588. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  12589. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  12590. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  12591. return c > 3 && r && Object.defineProperty(target, key, r), r;
  12592. };
  12593. var ConditionPosition;
  12594. (function (ConditionPosition) {
  12595. ConditionPosition[ConditionPosition["One"] = 0] = "One";
  12596. ConditionPosition[ConditionPosition["Two"] = 1] = "Two";
  12597. })(ConditionPosition || (ConditionPosition = {}));
  12598. var DEFAULT_TRANSLATIONS = {
  12599. filterOoo: 'Filter...',
  12600. empty: 'Choose One',
  12601. equals: 'Equals',
  12602. notEqual: 'Not equal',
  12603. lessThan: 'Less than',
  12604. greaterThan: 'Greater than',
  12605. inRange: 'In range',
  12606. inRangeStart: 'From',
  12607. inRangeEnd: 'To',
  12608. lessThanOrEqual: 'Less than or equals',
  12609. greaterThanOrEqual: 'Greater than or equals',
  12610. contains: 'Contains',
  12611. notContains: 'Not contains',
  12612. startsWith: 'Starts with',
  12613. endsWith: 'Ends with',
  12614. andCondition: 'AND',
  12615. orCondition: 'OR',
  12616. };
  12617. /**
  12618. * Every filter with a dropdown where the user can specify a comparing type against the filter values
  12619. */
  12620. var SimpleFilter = /** @class */ (function (_super) {
  12621. __extends(SimpleFilter, _super);
  12622. function SimpleFilter() {
  12623. return _super !== null && _super.apply(this, arguments) || this;
  12624. }
  12625. // returns true if this type requires a 'from' field, eg any filter that requires at least one text value
  12626. SimpleFilter.prototype.showValueFrom = function (type) {
  12627. return !this.doesFilterHaveHiddenInput(type) && type !== SimpleFilter.EMPTY;
  12628. };
  12629. // returns true if this type requires a 'to' field, currently only 'range' returns true
  12630. SimpleFilter.prototype.showValueTo = function (type) {
  12631. return type === SimpleFilter.IN_RANGE;
  12632. };
  12633. // floating filter calls this when user applies filter from floating filter
  12634. SimpleFilter.prototype.onFloatingFilterChanged = function (type, value) {
  12635. this.setTypeFromFloatingFilter(type);
  12636. this.setValueFromFloatingFilter(value);
  12637. this.onUiChanged(true);
  12638. };
  12639. SimpleFilter.prototype.setTypeFromFloatingFilter = function (type) {
  12640. this.eType1.setValue(type);
  12641. this.eType2.setValue(this.optionsFactory.getDefaultOption());
  12642. this.eJoinOperatorAnd.setValue(true);
  12643. };
  12644. SimpleFilter.prototype.getModelFromUi = function () {
  12645. if (!this.isConditionUiComplete(ConditionPosition.One)) {
  12646. return null;
  12647. }
  12648. if (this.isAllowTwoConditions() && this.isConditionUiComplete(ConditionPosition.Two)) {
  12649. return {
  12650. filterType: this.getFilterType(),
  12651. operator: this.getJoinOperator(),
  12652. condition1: this.createCondition(ConditionPosition.One),
  12653. condition2: this.createCondition(ConditionPosition.Two)
  12654. };
  12655. }
  12656. return this.createCondition(ConditionPosition.One);
  12657. };
  12658. SimpleFilter.prototype.getCondition1Type = function () {
  12659. return this.eType1.getValue();
  12660. };
  12661. SimpleFilter.prototype.getCondition2Type = function () {
  12662. return this.eType2.getValue();
  12663. };
  12664. SimpleFilter.prototype.getJoinOperator = function () {
  12665. return this.eJoinOperatorOr.getValue() === true ? 'OR' : 'AND';
  12666. };
  12667. SimpleFilter.prototype.areModelsEqual = function (a, b) {
  12668. // both are missing
  12669. if (!a && !b) {
  12670. return true;
  12671. }
  12672. // one is missing, other present
  12673. if ((!a && b) || (a && !b)) {
  12674. return false;
  12675. }
  12676. // one is combined, the other is not
  12677. var aIsSimple = !a.operator;
  12678. var bIsSimple = !b.operator;
  12679. var oneSimpleOneCombined = (!aIsSimple && bIsSimple) || (aIsSimple && !bIsSimple);
  12680. if (oneSimpleOneCombined) {
  12681. return false;
  12682. }
  12683. var res;
  12684. // otherwise both present, so compare
  12685. if (aIsSimple) {
  12686. var aSimple = a;
  12687. var bSimple = b;
  12688. res = this.areSimpleModelsEqual(aSimple, bSimple);
  12689. }
  12690. else {
  12691. var aCombined = a;
  12692. var bCombined = b;
  12693. res = aCombined.operator === bCombined.operator
  12694. && this.areSimpleModelsEqual(aCombined.condition1, bCombined.condition1)
  12695. && this.areSimpleModelsEqual(aCombined.condition2, bCombined.condition2);
  12696. }
  12697. return res;
  12698. };
  12699. SimpleFilter.prototype.setModelIntoUi = function (model) {
  12700. var isCombined = model.operator;
  12701. if (isCombined) {
  12702. var combinedModel = model;
  12703. var orChecked = combinedModel.operator === 'OR';
  12704. this.eJoinOperatorAnd.setValue(!orChecked);
  12705. this.eJoinOperatorOr.setValue(orChecked);
  12706. this.eType1.setValue(combinedModel.condition1.type);
  12707. this.eType2.setValue(combinedModel.condition2.type);
  12708. this.setConditionIntoUi(combinedModel.condition1, ConditionPosition.One);
  12709. this.setConditionIntoUi(combinedModel.condition2, ConditionPosition.Two);
  12710. }
  12711. else {
  12712. var simpleModel = model;
  12713. this.eJoinOperatorAnd.setValue(true);
  12714. this.eJoinOperatorOr.setValue(false);
  12715. this.eType1.setValue(simpleModel.type);
  12716. this.eType2.setValue(this.optionsFactory.getDefaultOption());
  12717. this.setConditionIntoUi(simpleModel, ConditionPosition.One);
  12718. this.setConditionIntoUi(null, ConditionPosition.Two);
  12719. }
  12720. return _utils__WEBPACK_IMPORTED_MODULE_3__["Promise"].resolve();
  12721. };
  12722. SimpleFilter.prototype.doesFilterPass = function (params) {
  12723. var model = this.getModel();
  12724. var isCombined = model.operator;
  12725. if (isCombined) {
  12726. var combinedModel = model;
  12727. var firstResult = this.individualConditionPasses(params, combinedModel.condition1);
  12728. var secondResult = this.individualConditionPasses(params, combinedModel.condition2);
  12729. if (combinedModel.operator === 'AND') {
  12730. return firstResult && secondResult;
  12731. }
  12732. return firstResult || secondResult;
  12733. }
  12734. var simpleModel = model;
  12735. var result = this.individualConditionPasses(params, simpleModel);
  12736. return result;
  12737. };
  12738. SimpleFilter.prototype.setParams = function (params) {
  12739. _super.prototype.setParams.call(this, params);
  12740. this.optionsFactory = new _optionsFactory__WEBPACK_IMPORTED_MODULE_1__["OptionsFactory"]();
  12741. this.optionsFactory.init(params, this.getDefaultFilterOptions());
  12742. this.allowTwoConditions = !params.suppressAndOrCondition;
  12743. this.putOptionsIntoDropdown();
  12744. this.addChangedListeners();
  12745. };
  12746. SimpleFilter.prototype.putOptionsIntoDropdown = function () {
  12747. var _this = this;
  12748. var filterOptions = this.optionsFactory.getFilterOptions();
  12749. Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])(filterOptions, function (option) {
  12750. var value;
  12751. var text;
  12752. if (typeof option === 'string') {
  12753. value = option;
  12754. text = _this.translate(value);
  12755. }
  12756. else {
  12757. value = option.displayKey;
  12758. var customOption = _this.optionsFactory.getCustomOption(value);
  12759. text = customOption ? customOption.displayName : _this.translate(value);
  12760. }
  12761. var createOption = function () { return ({ value: value, text: text }); };
  12762. _this.eType1.addOption(createOption());
  12763. _this.eType2.addOption(createOption());
  12764. });
  12765. var readOnly = filterOptions.length <= 1;
  12766. this.eType1.setDisabled(readOnly);
  12767. this.eType2.setDisabled(readOnly);
  12768. };
  12769. SimpleFilter.prototype.isAllowTwoConditions = function () {
  12770. return this.allowTwoConditions;
  12771. };
  12772. SimpleFilter.prototype.createBodyTemplate = function () {
  12773. return /* html */ "\n <ag-select class=\"ag-filter-select\" ref=\"eOptions1\"></ag-select>\n " + this.createValueTemplate(ConditionPosition.One) + "\n <div class=\"ag-filter-condition\" ref=\"eJoinOperatorPanel\">\n <ag-radio-button ref=\"eJoinOperatorAnd\" class=\"ag-filter-condition-operator ag-filter-condition-operator-and\"></ag-radio-button>\n <ag-radio-button ref=\"eJoinOperatorOr\" class=\"ag-filter-condition-operator ag-filter-condition-operator-or\"></ag-radio-button>\n </div>\n <ag-select class=\"ag-filter-select\" ref=\"eOptions2\"></ag-select>\n " + this.createValueTemplate(ConditionPosition.Two);
  12774. };
  12775. SimpleFilter.prototype.getCssIdentifier = function () {
  12776. return 'simple-filter';
  12777. };
  12778. SimpleFilter.prototype.updateUiVisibility = function () {
  12779. var firstConditionComplete = this.isConditionUiComplete(ConditionPosition.One);
  12780. var showSecondFilter = this.allowTwoConditions && firstConditionComplete;
  12781. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisplayed"])(this.eCondition2Body, showSecondFilter);
  12782. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisplayed"])(this.eType2.getGui(), showSecondFilter);
  12783. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setDisplayed"])(this.eJoinOperatorPanel, showSecondFilter);
  12784. };
  12785. SimpleFilter.prototype.resetUiToDefaults = function (silent) {
  12786. var uniqueGroupId = 'ag-simple-filter-and-or-' + this.getCompId();
  12787. var defaultOption = this.optionsFactory.getDefaultOption();
  12788. this.eType1.setValue(defaultOption, silent);
  12789. this.eType2.setValue(defaultOption, silent);
  12790. this.eJoinOperatorAnd
  12791. .setValue(true, silent)
  12792. .setName(uniqueGroupId)
  12793. .setLabel(this.translate('andCondition'));
  12794. this.eJoinOperatorOr
  12795. .setValue(false, silent)
  12796. .setName(uniqueGroupId)
  12797. .setLabel(this.translate('orCondition'));
  12798. return _utils__WEBPACK_IMPORTED_MODULE_3__["Promise"].resolve();
  12799. };
  12800. SimpleFilter.prototype.translate = function (toTranslate) {
  12801. var translate = this.gridOptionsWrapper.getLocaleTextFunc();
  12802. return translate(toTranslate, DEFAULT_TRANSLATIONS[toTranslate]);
  12803. };
  12804. SimpleFilter.prototype.addChangedListeners = function () {
  12805. var _this = this;
  12806. var listener = function () { return _this.onUiChanged(); };
  12807. this.eType1.onValueChange(listener);
  12808. this.eType2.onValueChange(listener);
  12809. this.eJoinOperatorOr.onValueChange(listener);
  12810. this.eJoinOperatorAnd.onValueChange(listener);
  12811. };
  12812. SimpleFilter.prototype.doesFilterHaveHiddenInput = function (filterType) {
  12813. var customFilterOption = this.optionsFactory.getCustomOption(filterType);
  12814. return customFilterOption && customFilterOption.hideFilterInput;
  12815. };
  12816. SimpleFilter.EMPTY = 'empty';
  12817. SimpleFilter.EQUALS = 'equals';
  12818. SimpleFilter.NOT_EQUAL = 'notEqual';
  12819. SimpleFilter.LESS_THAN = 'lessThan';
  12820. SimpleFilter.LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
  12821. SimpleFilter.GREATER_THAN = 'greaterThan';
  12822. SimpleFilter.GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual';
  12823. SimpleFilter.IN_RANGE = 'inRange';
  12824. SimpleFilter.CONTAINS = 'contains';
  12825. SimpleFilter.NOT_CONTAINS = 'notContains';
  12826. SimpleFilter.STARTS_WITH = 'startsWith';
  12827. SimpleFilter.ENDS_WITH = 'endsWith';
  12828. __decorate([
  12829. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eOptions1')
  12830. ], SimpleFilter.prototype, "eType1", void 0);
  12831. __decorate([
  12832. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eOptions2')
  12833. ], SimpleFilter.prototype, "eType2", void 0);
  12834. __decorate([
  12835. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eJoinOperatorAnd')
  12836. ], SimpleFilter.prototype, "eJoinOperatorAnd", void 0);
  12837. __decorate([
  12838. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eJoinOperatorOr')
  12839. ], SimpleFilter.prototype, "eJoinOperatorOr", void 0);
  12840. __decorate([
  12841. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eCondition2Body')
  12842. ], SimpleFilter.prototype, "eCondition2Body", void 0);
  12843. __decorate([
  12844. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eJoinOperatorPanel')
  12845. ], SimpleFilter.prototype, "eJoinOperatorPanel", void 0);
  12846. return SimpleFilter;
  12847. }(_providedFilter__WEBPACK_IMPORTED_MODULE_2__["ProvidedFilter"]));
  12848. /***/ }),
  12849. /* 61 */
  12850. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12851. "use strict";
  12852. __webpack_require__.r(__webpack_exports__);
  12853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OptionsFactory", function() { return OptionsFactory; });
  12854. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
  12855. /**
  12856. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  12857. * @version v23.2.1
  12858. * @link http://www.ag-grid.com/
  12859. * @license MIT
  12860. */
  12861. /* Common logic for options, used by both filters and floating filters. */
  12862. var OptionsFactory = /** @class */ (function () {
  12863. function OptionsFactory() {
  12864. this.customFilterOptions = {};
  12865. }
  12866. OptionsFactory.prototype.init = function (params, defaultOptions) {
  12867. this.filterOptions = params.filterOptions || defaultOptions;
  12868. this.mapCustomOptions();
  12869. this.selectDefaultItem(params);
  12870. };
  12871. OptionsFactory.prototype.getFilterOptions = function () {
  12872. return this.filterOptions;
  12873. };
  12874. OptionsFactory.prototype.mapCustomOptions = function () {
  12875. var _this = this;
  12876. if (!this.filterOptions) {
  12877. return;
  12878. }
  12879. this.filterOptions.forEach(function (filterOption) {
  12880. if (typeof filterOption === 'string') {
  12881. return;
  12882. }
  12883. var requiredProperties = ['displayKey', 'displayName', 'test'];
  12884. if (Object(_utils_array__WEBPACK_IMPORTED_MODULE_0__["every"])(requiredProperties, function (key) {
  12885. if (!filterOption[key]) {
  12886. console.warn("ag-Grid: ignoring FilterOptionDef as it doesn't contain a '" + key + "'");
  12887. return false;
  12888. }
  12889. return true;
  12890. })) {
  12891. _this.customFilterOptions[filterOption.displayKey] = filterOption;
  12892. }
  12893. });
  12894. };
  12895. OptionsFactory.prototype.selectDefaultItem = function (params) {
  12896. if (params.defaultOption) {
  12897. this.defaultOption = params.defaultOption;
  12898. }
  12899. else if (this.filterOptions.length >= 1) {
  12900. var firstFilterOption = this.filterOptions[0];
  12901. if (typeof firstFilterOption === 'string') {
  12902. this.defaultOption = firstFilterOption;
  12903. }
  12904. else if (firstFilterOption.displayKey) {
  12905. this.defaultOption = firstFilterOption.displayKey;
  12906. }
  12907. else {
  12908. console.warn("ag-Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'");
  12909. }
  12910. }
  12911. else {
  12912. console.warn('ag-Grid: no filter options for filter');
  12913. }
  12914. };
  12915. OptionsFactory.prototype.getDefaultOption = function () {
  12916. return this.defaultOption;
  12917. };
  12918. OptionsFactory.prototype.getCustomOption = function (name) {
  12919. return this.customFilterOptions[name];
  12920. };
  12921. return OptionsFactory;
  12922. }());
  12923. /***/ }),
  12924. /* 62 */
  12925. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12926. "use strict";
  12927. __webpack_require__.r(__webpack_exports__);
  12928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProvidedFilter", function() { return ProvidedFilter; });
  12929. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  12930. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  12931. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  12932. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
  12933. /* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21);
  12934. /**
  12935. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  12936. * @version v23.2.1
  12937. * @link http://www.ag-grid.com/
  12938. * @license MIT
  12939. */
  12940. var __extends = (undefined && undefined.__extends) || (function () {
  12941. var extendStatics = function (d, b) {
  12942. extendStatics = Object.setPrototypeOf ||
  12943. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  12944. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  12945. return extendStatics(d, b);
  12946. };
  12947. return function (d, b) {
  12948. extendStatics(d, b);
  12949. function __() { this.constructor = d; }
  12950. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  12951. };
  12952. })();
  12953. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  12954. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  12955. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  12956. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  12957. return c > 3 && r && Object.defineProperty(target, key, r), r;
  12958. };
  12959. /**
  12960. * Contains common logic to all provided filters (apply button, clear button, etc).
  12961. * All the filters that come with ag-Grid extend this class. User filters do not
  12962. * extend this class.
  12963. */
  12964. var ProvidedFilter = /** @class */ (function (_super) {
  12965. __extends(ProvidedFilter, _super);
  12966. function ProvidedFilter() {
  12967. var _this = _super !== null && _super.apply(this, arguments) || this;
  12968. _this.applyActive = false;
  12969. _this.hidePopup = null;
  12970. // after the user hits 'apply' the model gets copied to here. this is then the model that we use for
  12971. // all filtering. so if user changes UI but doesn't hit apply, then the UI will be out of sync with this model.
  12972. // this is what we want, as the UI should only become the 'active' filter once it's applied. when apply is
  12973. // inactive, this model will be in sync (following the debounce ms). if the UI is not a valid filter
  12974. // (eg the value is missing so nothing to filter on, or for set filter all checkboxes are checked so filter
  12975. // not active) then this appliedModel will be null/undefined.
  12976. _this.appliedModel = null;
  12977. return _this;
  12978. }
  12979. /** @deprecated */
  12980. ProvidedFilter.prototype.onFilterChanged = function () {
  12981. console.warn("ag-Grid: you should not call onFilterChanged() directly on the filter, please call\n gridApi.onFilterChanged() instead. onFilterChanged is not part of the exposed filter interface (it was\n a method that existed on an old version of the filters that was not intended for public use.");
  12982. this.providedFilterParams.filterChangedCallback();
  12983. };
  12984. ProvidedFilter.prototype.isFilterActive = function () {
  12985. // filter is active if we have a valid applied model
  12986. return !!this.appliedModel;
  12987. };
  12988. ProvidedFilter.prototype.postConstruct = function () {
  12989. var templateString = /* html */ "\n <div>\n <div class=\"ag-filter-body-wrapper ag-" + this.getCssIdentifier() + "-body-wrapper\">\n " + this.createBodyTemplate() + "\n </div>\n </div>";
  12990. this.setTemplate(templateString);
  12991. };
  12992. ProvidedFilter.prototype.init = function (params) {
  12993. var _this = this;
  12994. this.setParams(params);
  12995. this.resetUiToDefaults(true).then(function () {
  12996. _this.updateUiVisibility();
  12997. _this.setupOnBtApplyDebounce();
  12998. });
  12999. };
  13000. ProvidedFilter.prototype.setParams = function (params) {
  13001. ProvidedFilter.checkForDeprecatedParams(params);
  13002. this.providedFilterParams = params;
  13003. if (params.newRowsAction === 'keep') {
  13004. this.newRowsActionKeep = true;
  13005. }
  13006. else if (params.newRowsAction === 'clear') {
  13007. this.newRowsActionKeep = false;
  13008. }
  13009. else {
  13010. // the default for SSRM and IRM is 'keep', for CSRM and VRM the default is 'clear'
  13011. var modelsForKeep = [_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE, _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].ROW_MODEL_TYPE_INFINITE];
  13012. this.newRowsActionKeep = modelsForKeep.indexOf(this.rowModel.getType()) >= 0;
  13013. }
  13014. this.applyActive = ProvidedFilter.isUseApplyButton(params);
  13015. this.createButtonPanel();
  13016. };
  13017. ProvidedFilter.prototype.createButtonPanel = function () {
  13018. var _this = this;
  13019. var buttons = this.providedFilterParams.buttons;
  13020. if (!buttons || buttons.length < 1) {
  13021. return;
  13022. }
  13023. var translate = this.gridOptionsWrapper.getLocaleTextFunc();
  13024. var eButtonsPanel = document.createElement('div');
  13025. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["addCssClass"])(eButtonsPanel, 'ag-filter-apply-panel');
  13026. var addButton = function (type) {
  13027. var text;
  13028. var clickListener;
  13029. switch (type) {
  13030. case 'apply':
  13031. text = translate('applyFilter', 'Apply Filter');
  13032. clickListener = function (e) { return _this.onBtApply(false, false, e); };
  13033. break;
  13034. case 'clear':
  13035. text = translate('clearFilter', 'Clear Filter');
  13036. clickListener = function () { return _this.onBtClear(); };
  13037. break;
  13038. case 'reset':
  13039. text = translate('resetFilter', 'Reset Filter');
  13040. clickListener = function () { return _this.onBtReset(); };
  13041. break;
  13042. case 'cancel':
  13043. text = translate('cancelFilter', 'Cancel Filter');
  13044. clickListener = function (e) { _this.onBtCancel(e); };
  13045. break;
  13046. default:
  13047. console.warn('Unknown button type specified');
  13048. return;
  13049. }
  13050. var button = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["loadTemplate"])(/* html */ "<button\n type=\"button\"\n ref=\"" + type + "FilterButton\"\n class=\"ag-standard-button ag-filter-apply-panel-button\">" + text + "</button>");
  13051. eButtonsPanel.appendChild(button);
  13052. _this.addManagedListener(button, 'click', clickListener);
  13053. };
  13054. new Set(buttons).forEach(function (type) { return addButton(type); });
  13055. this.getGui().appendChild(eButtonsPanel);
  13056. };
  13057. ProvidedFilter.checkForDeprecatedParams = function (params) {
  13058. var buttons = params.buttons || [];
  13059. if (buttons.length > 0) {
  13060. return;
  13061. }
  13062. var applyButton = params.applyButton, resetButton = params.resetButton, clearButton = params.clearButton;
  13063. if (clearButton) {
  13064. console.warn('ag-Grid: as of ag-Grid v23.2, filterParams.clearButton is deprecated. Please use filterParams.buttons instead');
  13065. buttons.push('clear');
  13066. }
  13067. if (resetButton) {
  13068. console.warn('ag-Grid: as of ag-Grid v23.2, filterParams.resetButton is deprecated. Please use filterParams.buttons instead');
  13069. buttons.push('reset');
  13070. }
  13071. if (applyButton) {
  13072. console.warn('ag-Grid: as of ag-Grid v23.2, filterParams.applyButton is deprecated. Please use filterParams.buttons instead');
  13073. buttons.push('apply');
  13074. }
  13075. if (params.apply) {
  13076. console.warn('ag-Grid: as of ag-Grid v21, filterParams.apply is deprecated. Please use filterParams.buttons instead');
  13077. buttons.push('apply');
  13078. }
  13079. params.buttons = buttons;
  13080. };
  13081. // subclasses can override this to provide alternative debounce defaults
  13082. ProvidedFilter.prototype.getDefaultDebounceMs = function () {
  13083. return 0;
  13084. };
  13085. ProvidedFilter.prototype.setupOnBtApplyDebounce = function () {
  13086. var debounceMs = ProvidedFilter.getDebounceMs(this.providedFilterParams, this.getDefaultDebounceMs());
  13087. this.onBtApplyDebounce = Object(_utils_function__WEBPACK_IMPORTED_MODULE_4__["debounce"])(this.onBtApply.bind(this), debounceMs);
  13088. };
  13089. ProvidedFilter.prototype.getModel = function () {
  13090. return this.appliedModel;
  13091. };
  13092. ProvidedFilter.prototype.setModel = function (model) {
  13093. var _this = this;
  13094. var promise = model ? this.setModelIntoUi(model) : this.resetUiToDefaults();
  13095. return promise.then(function () {
  13096. _this.updateUiVisibility();
  13097. // we set the model from the gui, rather than the provided model,
  13098. // so the model is consistent. eg handling of null/undefined will be the same,
  13099. // of if model is case insensitive, then casing is removed.
  13100. _this.applyModel();
  13101. });
  13102. };
  13103. ProvidedFilter.prototype.onBtCancel = function (e) {
  13104. var _this = this;
  13105. this.setModelIntoUi(this.getModel()).then(function () {
  13106. _this.onUiChanged(false, 'prevent');
  13107. if (_this.providedFilterParams.closeOnApply) {
  13108. _this.close(e);
  13109. }
  13110. });
  13111. };
  13112. ProvidedFilter.prototype.onBtClear = function () {
  13113. var _this = this;
  13114. this.resetUiToDefaults().then(function () { return _this.onUiChanged(); });
  13115. };
  13116. ProvidedFilter.prototype.onBtReset = function () {
  13117. this.onBtClear();
  13118. this.onBtApply();
  13119. };
  13120. /**
  13121. * Applies changes made in the UI to the filter, and returns true if the model has changed.
  13122. */
  13123. ProvidedFilter.prototype.applyModel = function () {
  13124. var newModel = this.getModelFromUi();
  13125. if (!this.isModelValid(newModel)) {
  13126. return false;
  13127. }
  13128. var previousModel = this.appliedModel;
  13129. this.appliedModel = newModel;
  13130. // models can be same if user pasted same content into text field, or maybe just changed the case
  13131. // and it's a case insensitive filter
  13132. return !this.areModelsEqual(previousModel, newModel);
  13133. };
  13134. ProvidedFilter.prototype.isModelValid = function (model) {
  13135. return true;
  13136. };
  13137. ProvidedFilter.prototype.onBtApply = function (afterFloatingFilter, afterDataChange, e) {
  13138. if (afterFloatingFilter === void 0) { afterFloatingFilter = false; }
  13139. if (afterDataChange === void 0) { afterDataChange = false; }
  13140. if (this.applyModel()) {
  13141. // the floating filter uses 'afterFloatingFilter' info, so it doesn't refresh after filter changed if change
  13142. // came from floating filter
  13143. this.providedFilterParams.filterChangedCallback({ afterFloatingFilter: afterFloatingFilter, afterDataChange: afterDataChange });
  13144. }
  13145. var closeOnApply = this.providedFilterParams.closeOnApply;
  13146. // only close if an apply button is visible, otherwise we'd be closing every time a change was made!
  13147. if (closeOnApply && !afterFloatingFilter && this.applyActive) {
  13148. this.close(e);
  13149. }
  13150. };
  13151. ProvidedFilter.prototype.onNewRowsLoaded = function () {
  13152. var _this = this;
  13153. if (!this.newRowsActionKeep) {
  13154. this.resetUiToDefaults().then(function () { return _this.appliedModel = null; });
  13155. }
  13156. };
  13157. ProvidedFilter.prototype.close = function (e) {
  13158. if (!this.hidePopup) {
  13159. return;
  13160. }
  13161. var keyboardEvent = e;
  13162. var key = keyboardEvent && keyboardEvent.key;
  13163. var params;
  13164. if (key === 'Enter' || key === 'Space') {
  13165. params = { keyboardEvent: keyboardEvent };
  13166. }
  13167. this.hidePopup(params);
  13168. this.hidePopup = null;
  13169. };
  13170. // called by set filter
  13171. ProvidedFilter.prototype.isNewRowsActionKeep = function () {
  13172. return this.newRowsActionKeep;
  13173. };
  13174. /**
  13175. * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no
  13176. * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can
  13177. * be adjusted by using the apply parameter.
  13178. */
  13179. ProvidedFilter.prototype.onUiChanged = function (fromFloatingFilter, apply) {
  13180. if (fromFloatingFilter === void 0) { fromFloatingFilter = false; }
  13181. this.updateUiVisibility();
  13182. this.providedFilterParams.filterModifiedCallback();
  13183. if (this.applyActive) {
  13184. var isValid = this.isModelValid(this.getModelFromUi());
  13185. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setDisabled"])(this.getRefElement('applyFilterButton'), !isValid);
  13186. }
  13187. if ((fromFloatingFilter && !apply) || apply === 'immediately') {
  13188. this.onBtApply(fromFloatingFilter);
  13189. }
  13190. else if ((!this.applyActive && !apply) || apply === 'debounce') {
  13191. this.onBtApplyDebounce();
  13192. }
  13193. };
  13194. ProvidedFilter.prototype.afterGuiAttached = function (params) {
  13195. this.hidePopup = params.hidePopup;
  13196. };
  13197. // static, as used by floating filter also
  13198. ProvidedFilter.getDebounceMs = function (params, debounceDefault) {
  13199. if (ProvidedFilter.isUseApplyButton(params)) {
  13200. if (params.debounceMs != null) {
  13201. console.warn('ag-Grid: debounceMs is ignored when apply button is present');
  13202. }
  13203. return 0;
  13204. }
  13205. return params.debounceMs != null ? params.debounceMs : debounceDefault;
  13206. };
  13207. // static, as used by floating filter also
  13208. ProvidedFilter.isUseApplyButton = function (params) {
  13209. ProvidedFilter.checkForDeprecatedParams(params);
  13210. return params.buttons && params.buttons.indexOf('apply') >= 0;
  13211. };
  13212. ProvidedFilter.prototype.destroy = function () {
  13213. this.hidePopup = null;
  13214. _super.prototype.destroy.call(this);
  13215. };
  13216. __decorate([
  13217. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  13218. ], ProvidedFilter.prototype, "gridOptionsWrapper", void 0);
  13219. __decorate([
  13220. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
  13221. ], ProvidedFilter.prototype, "rowModel", void 0);
  13222. __decorate([
  13223. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  13224. ], ProvidedFilter.prototype, "postConstruct", null);
  13225. return ProvidedFilter;
  13226. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  13227. /***/ }),
  13228. /* 63 */
  13229. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13230. "use strict";
  13231. __webpack_require__.r(__webpack_exports__);
  13232. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScalarFilter", function() { return ScalarFilter; });
  13233. /* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60);
  13234. /**
  13235. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  13236. * @version v23.2.1
  13237. * @link http://www.ag-grid.com/
  13238. * @license MIT
  13239. */
  13240. var __extends = (undefined && undefined.__extends) || (function () {
  13241. var extendStatics = function (d, b) {
  13242. extendStatics = Object.setPrototypeOf ||
  13243. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  13244. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  13245. return extendStatics(d, b);
  13246. };
  13247. return function (d, b) {
  13248. extendStatics(d, b);
  13249. function __() { this.constructor = d; }
  13250. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13251. };
  13252. })();
  13253. var ScalarFilter = /** @class */ (function (_super) {
  13254. __extends(ScalarFilter, _super);
  13255. function ScalarFilter() {
  13256. return _super !== null && _super.apply(this, arguments) || this;
  13257. }
  13258. ScalarFilter.prototype.setParams = function (params) {
  13259. _super.prototype.setParams.call(this, params);
  13260. this.scalarFilterParams = params;
  13261. this.checkDeprecatedParams();
  13262. };
  13263. ScalarFilter.prototype.checkDeprecatedParams = function () {
  13264. if (this.scalarFilterParams.nullComparator) {
  13265. console.warn('ag-Grid: Since v21.0, the property filterParams.nullComparator is deprecated. ' +
  13266. 'Please use filterParams.includeBlanksInEquals, filterParams.includeBlanksInLessThan and ' +
  13267. 'filterParams.includeBlanksInGreaterThan instead.');
  13268. this.scalarFilterParams.includeBlanksInEquals = this.scalarFilterParams.nullComparator.equals;
  13269. this.scalarFilterParams.includeBlanksInLessThan = this.scalarFilterParams.nullComparator.lessThan;
  13270. this.scalarFilterParams.includeBlanksInGreaterThan = this.scalarFilterParams.nullComparator.greaterThan;
  13271. }
  13272. };
  13273. ScalarFilter.prototype.nullComparator = function (selectedOption, filterValue, gridValue) {
  13274. if (gridValue == null) {
  13275. switch (selectedOption) {
  13276. case ScalarFilter.EMPTY:
  13277. return 0;
  13278. case ScalarFilter.EQUALS:
  13279. return this.scalarFilterParams.includeBlanksInEquals ? 0 : 1;
  13280. case ScalarFilter.NOT_EQUAL:
  13281. return this.scalarFilterParams.includeBlanksInEquals ? 1 : 0;
  13282. case ScalarFilter.GREATER_THAN:
  13283. case ScalarFilter.GREATER_THAN_OR_EQUAL:
  13284. return this.scalarFilterParams.includeBlanksInGreaterThan ? 1 : -1;
  13285. case ScalarFilter.LESS_THAN:
  13286. case ScalarFilter.LESS_THAN_OR_EQUAL:
  13287. return this.scalarFilterParams.includeBlanksInLessThan ? -1 : 1;
  13288. }
  13289. }
  13290. return this.comparator()(filterValue, gridValue);
  13291. };
  13292. ScalarFilter.prototype.individualConditionPasses = function (params, filterModel) {
  13293. var cellValue = this.scalarFilterParams.valueGetter(params.node);
  13294. var range = this.mapRangeFromModel(filterModel);
  13295. var filterValue = range.from;
  13296. var filterValueTo = range.to;
  13297. var filterType = filterModel.type;
  13298. var customFilterOption = this.optionsFactory.getCustomOption(filterType);
  13299. if (customFilterOption) {
  13300. // only execute the custom filter if a value exists or a value isn't required, i.e. input is hidden
  13301. if (filterValue != null || customFilterOption.hideFilterInput) {
  13302. return customFilterOption.test(filterValue, cellValue);
  13303. }
  13304. }
  13305. var compareResult = this.nullComparator(filterType, filterValue, cellValue);
  13306. switch (filterType) {
  13307. case ScalarFilter.EQUALS:
  13308. return compareResult === 0;
  13309. case ScalarFilter.NOT_EQUAL:
  13310. return compareResult !== 0;
  13311. case ScalarFilter.GREATER_THAN:
  13312. return compareResult > 0;
  13313. case ScalarFilter.GREATER_THAN_OR_EQUAL:
  13314. return compareResult >= 0;
  13315. case ScalarFilter.LESS_THAN:
  13316. return compareResult < 0;
  13317. case ScalarFilter.LESS_THAN_OR_EQUAL:
  13318. return compareResult <= 0;
  13319. case ScalarFilter.IN_RANGE: {
  13320. var compareToResult = this.nullComparator(filterType, filterValueTo, cellValue);
  13321. return this.scalarFilterParams.inRangeInclusive ?
  13322. compareResult >= 0 && compareToResult <= 0 :
  13323. compareResult > 0 && compareToResult < 0;
  13324. }
  13325. default:
  13326. throw new Error('Unexpected type of filter: ' + filterType);
  13327. }
  13328. };
  13329. return ScalarFilter;
  13330. }(_simpleFilter__WEBPACK_IMPORTED_MODULE_0__["SimpleFilter"]));
  13331. /***/ }),
  13332. /* 64 */
  13333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13334. "use strict";
  13335. __webpack_require__.r(__webpack_exports__);
  13336. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderComp", function() { return HeaderComp; });
  13337. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  13338. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
  13339. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  13340. /* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65);
  13341. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57);
  13342. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43);
  13343. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
  13344. /**
  13345. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  13346. * @version v23.2.1
  13347. * @link http://www.ag-grid.com/
  13348. * @license MIT
  13349. */
  13350. var __extends = (undefined && undefined.__extends) || (function () {
  13351. var extendStatics = function (d, b) {
  13352. extendStatics = Object.setPrototypeOf ||
  13353. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  13354. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  13355. return extendStatics(d, b);
  13356. };
  13357. return function (d, b) {
  13358. extendStatics(d, b);
  13359. function __() { this.constructor = d; }
  13360. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13361. };
  13362. })();
  13363. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  13364. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  13365. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  13366. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  13367. return c > 3 && r && Object.defineProperty(target, key, r), r;
  13368. };
  13369. var HeaderComp = /** @class */ (function (_super) {
  13370. __extends(HeaderComp, _super);
  13371. function HeaderComp() {
  13372. var _this = _super !== null && _super.apply(this, arguments) || this;
  13373. _this.lastMovingChanged = 0;
  13374. return _this;
  13375. }
  13376. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  13377. // so we need to override destroy() just to make the method public.
  13378. HeaderComp.prototype.destroy = function () {
  13379. _super.prototype.destroy.call(this);
  13380. };
  13381. HeaderComp.prototype.init = function (params) {
  13382. var template = _utils__WEBPACK_IMPORTED_MODULE_6__["_"].firstExistingValue(params.template, HeaderComp.TEMPLATE);
  13383. // take account of any newlines & whitespace before/after the actual template
  13384. template = template && template.trim ? template.trim() : template;
  13385. this.setTemplate(template);
  13386. this.params = params;
  13387. this.setupTap();
  13388. this.setupIcons(params.column);
  13389. this.setupMenu();
  13390. this.setupSort();
  13391. this.setupFilterIcon();
  13392. this.setupText(params.displayName);
  13393. };
  13394. HeaderComp.prototype.setupText = function (displayName) {
  13395. var displayNameSanitised = _utils__WEBPACK_IMPORTED_MODULE_6__["_"].escape(displayName);
  13396. if (this.eText) {
  13397. this.eText.innerHTML = displayNameSanitised;
  13398. }
  13399. };
  13400. HeaderComp.prototype.setupIcons = function (column) {
  13401. this.addInIcon('sortAscending', this.eSortAsc, column);
  13402. this.addInIcon('sortDescending', this.eSortDesc, column);
  13403. this.addInIcon('sortUnSort', this.eSortNone, column);
  13404. this.addInIcon('menu', this.eMenu, column);
  13405. this.addInIcon('filter', this.eFilter, column);
  13406. };
  13407. HeaderComp.prototype.addInIcon = function (iconName, eParent, column) {
  13408. if (eParent == null) {
  13409. return;
  13410. }
  13411. var eIcon = _utils__WEBPACK_IMPORTED_MODULE_6__["_"].createIconNoSpan(iconName, this.gridOptionsWrapper, column);
  13412. eParent.appendChild(eIcon);
  13413. };
  13414. HeaderComp.prototype.setupTap = function () {
  13415. var _this = this;
  13416. var options = this.gridOptionsWrapper;
  13417. if (options.isSuppressTouch()) {
  13418. return;
  13419. }
  13420. var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"](this.getGui(), true);
  13421. var suppressMenuHide = options.isSuppressMenuHide();
  13422. var tapMenuButton = suppressMenuHide && _utils__WEBPACK_IMPORTED_MODULE_6__["_"].exists(this.eMenu);
  13423. var menuTouchListener = tapMenuButton ? new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"](this.eMenu, true) : touchListener;
  13424. if (this.params.enableMenu) {
  13425. var eventType = tapMenuButton ? 'EVENT_TAP' : 'EVENT_LONG_TAP';
  13426. var showMenuFn = function (event) {
  13427. options.getApi().showColumnMenuAfterMouseClick(_this.params.column, event.touchStart);
  13428. };
  13429. this.addManagedListener(menuTouchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"][eventType], showMenuFn);
  13430. }
  13431. if (this.params.enableSorting) {
  13432. var tapListener = function (event) {
  13433. var target = event.touchStart.target;
  13434. // When suppressMenuHide is true, a tap on the menu icon will bubble up
  13435. // to the header container, in that case we should not sort
  13436. if (suppressMenuHide && _this.eMenu.contains(target)) {
  13437. return;
  13438. }
  13439. _this.sortController.progressSort(_this.params.column, false, "uiColumnSorted");
  13440. };
  13441. this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_3__["TouchListener"].EVENT_TAP, tapListener);
  13442. }
  13443. // if tapMenuButton is true `touchListener` and `menuTouchListener` are different
  13444. // so we need to make sure to destroy both listeners here
  13445. this.addDestroyFunc(function () { return touchListener.destroy(); });
  13446. if (tapMenuButton) {
  13447. this.addDestroyFunc(function () { return menuTouchListener.destroy(); });
  13448. }
  13449. };
  13450. HeaderComp.prototype.setupMenu = function () {
  13451. var _this = this;
  13452. // if no menu provided in template, do nothing
  13453. if (!this.eMenu) {
  13454. return;
  13455. }
  13456. // we don't show the menu if on an iPad/iPhone, as the user cannot have a pointer device
  13457. // Note: If suppressMenuHide is set to true the menu will be displayed, and if suppressMenuHide
  13458. // is false (default) user will need to use longpress to display the menu.
  13459. var suppressMenuHide = this.gridOptionsWrapper.isSuppressMenuHide();
  13460. var hideShowMenu = !this.params.enableMenu || (_utils__WEBPACK_IMPORTED_MODULE_6__["_"].isIOSUserAgent() && !suppressMenuHide);
  13461. if (hideShowMenu) {
  13462. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].removeFromParent(this.eMenu);
  13463. return;
  13464. }
  13465. this.addManagedListener(this.eMenu, 'click', function () { return _this.showMenu(_this.eMenu); });
  13466. if (!suppressMenuHide) {
  13467. this.eMenu.style.opacity = '0';
  13468. }
  13469. var style = this.eMenu.style;
  13470. style.transition = 'opacity 0.2s, border 0.2s';
  13471. style['-webkit-transition'] = 'opacity 0.2s, border 0.2s';
  13472. };
  13473. HeaderComp.prototype.setActiveParent = function (activeParent) {
  13474. if (!this.gridOptionsWrapper.isSuppressMenuHide()) {
  13475. this.eMenu.style.opacity = activeParent ? '1' : '0';
  13476. }
  13477. };
  13478. HeaderComp.prototype.showMenu = function (eventSource) {
  13479. if (!eventSource) {
  13480. eventSource = this.eMenu;
  13481. }
  13482. this.menuFactory.showMenuAfterButtonClick(this.params.column, eventSource);
  13483. };
  13484. HeaderComp.prototype.removeSortIcons = function () {
  13485. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].removeFromParent(this.eSortAsc);
  13486. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].removeFromParent(this.eSortDesc);
  13487. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].removeFromParent(this.eSortNone);
  13488. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].removeFromParent(this.eSortOrder);
  13489. };
  13490. HeaderComp.prototype.setupSort = function () {
  13491. var _this = this;
  13492. var enableSorting = this.params.enableSorting;
  13493. if (!enableSorting) {
  13494. this.removeSortIcons();
  13495. return;
  13496. }
  13497. var sortUsingCtrl = this.gridOptionsWrapper.isMultiSortKeyCtrl();
  13498. // keep track of last time the moving changed flag was set
  13499. this.addManagedListener(this.params.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_MOVING_CHANGED, function () {
  13500. _this.lastMovingChanged = new Date().getTime();
  13501. });
  13502. // add the event on the header, so when clicked, we do sorting
  13503. if (this.eLabel) {
  13504. this.addManagedListener(this.eLabel, 'click', function (event) {
  13505. // sometimes when moving a column via dragging, this was also firing a clicked event.
  13506. // here is issue raised by user: https://ag-grid.zendesk.com/agent/tickets/1076
  13507. // this check stops sort if a) column is moving or b) column moved less than 200ms ago (so caters for race condition)
  13508. var moving = _this.params.column.isMoving();
  13509. var nowTime = new Date().getTime();
  13510. // typically there is <2ms if moving flag was set recently, as it would be done in same VM turn
  13511. var movedRecently = (nowTime - _this.lastMovingChanged) < 50;
  13512. var columnMoving = moving || movedRecently;
  13513. if (!columnMoving) {
  13514. var multiSort = sortUsingCtrl ? (event.ctrlKey || event.metaKey) : event.shiftKey;
  13515. _this.params.progressSort(multiSort);
  13516. }
  13517. });
  13518. }
  13519. this.addManagedListener(this.params.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
  13520. this.onSortChanged();
  13521. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_SORT_CHANGED, this.setMultiSortOrder.bind(this));
  13522. this.setMultiSortOrder();
  13523. };
  13524. HeaderComp.prototype.onSortChanged = function () {
  13525. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.getGui(), 'ag-header-cell-sorted-asc', this.params.column.isSortAscending());
  13526. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.getGui(), 'ag-header-cell-sorted-desc', this.params.column.isSortDescending());
  13527. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.getGui(), 'ag-header-cell-sorted-none', this.params.column.isSortNone());
  13528. if (this.eSortAsc) {
  13529. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.eSortAsc, 'ag-hidden', !this.params.column.isSortAscending());
  13530. }
  13531. if (this.eSortDesc) {
  13532. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.eSortDesc, 'ag-hidden', !this.params.column.isSortDescending());
  13533. }
  13534. if (this.eSortNone) {
  13535. var alwaysHideNoSort = !this.params.column.getColDef().unSortIcon && !this.gridOptionsWrapper.isUnSortIcon();
  13536. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.eSortNone, 'ag-hidden', alwaysHideNoSort || !this.params.column.isSortNone());
  13537. }
  13538. };
  13539. // we listen here for global sort events, NOT column sort events, as we want to do this
  13540. // when sorting has been set on all column (if we listened just for our col (where we
  13541. // set the asc / desc icons) then it's possible other cols are yet to get their sorting state.
  13542. HeaderComp.prototype.setMultiSortOrder = function () {
  13543. if (!this.eSortOrder) {
  13544. return;
  13545. }
  13546. var col = this.params.column;
  13547. var allColumnsWithSorting = this.sortController.getColumnsWithSortingOrdered();
  13548. var indexThisCol = allColumnsWithSorting.indexOf(col);
  13549. var moreThanOneColSorting = allColumnsWithSorting.length > 1;
  13550. var showIndex = col.isSorting() && moreThanOneColSorting;
  13551. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].setDisplayed(this.eSortOrder, showIndex);
  13552. if (indexThisCol >= 0) {
  13553. this.eSortOrder.innerHTML = (indexThisCol + 1).toString();
  13554. }
  13555. else {
  13556. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].clearElement(this.eSortOrder);
  13557. }
  13558. };
  13559. HeaderComp.prototype.setupFilterIcon = function () {
  13560. if (!this.eFilter) {
  13561. return;
  13562. }
  13563. this.addManagedListener(this.params.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
  13564. this.onFilterChanged();
  13565. };
  13566. HeaderComp.prototype.onFilterChanged = function () {
  13567. var filterPresent = this.params.column.isFilterActive();
  13568. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].addOrRemoveCssClass(this.eFilter, 'ag-hidden', !filterPresent);
  13569. };
  13570. HeaderComp.TEMPLATE = "<div class=\"ag-cell-label-container\">\n <span ref=\"eMenu\" class=\"ag-header-icon ag-header-cell-menu-button\" aria-hidden=\"true\"></span>\n <div ref=\"eLabel\" class=\"ag-header-cell-label\" role=\"presentation\" unselectable=\"on\">\n <span ref=\"eText\" class=\"ag-header-cell-text\" role=\"columnheader\" unselectable=\"on\"></span>\n <span ref=\"eFilter\" class=\"ag-header-icon ag-header-label-icon ag-filter-icon\" aria-hidden=\"true\"></span>\n <span ref=\"eSortOrder\" class=\"ag-header-icon ag-header-label-icon ag-sort-order\" aria-hidden=\"true\"></span>\n <span ref=\"eSortAsc\" class=\"ag-header-icon ag-header-label-icon ag-sort-ascending-icon\" aria-hidden=\"true\"></span>\n <span ref=\"eSortDesc\" class=\"ag-header-icon ag-header-label-icon ag-sort-descending-icon\" aria-hidden=\"true\"></span>\n <span ref=\"eSortNone\" class=\"ag-header-icon ag-header-label-icon ag-sort-none-icon\" aria-hidden=\"true\"></span>\n </div>\n </div>";
  13571. __decorate([
  13572. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  13573. ], HeaderComp.prototype, "gridOptionsWrapper", void 0);
  13574. __decorate([
  13575. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('sortController')
  13576. ], HeaderComp.prototype, "sortController", void 0);
  13577. __decorate([
  13578. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('menuFactory')
  13579. ], HeaderComp.prototype, "menuFactory", void 0);
  13580. __decorate([
  13581. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eFilter')
  13582. ], HeaderComp.prototype, "eFilter", void 0);
  13583. __decorate([
  13584. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortAsc')
  13585. ], HeaderComp.prototype, "eSortAsc", void 0);
  13586. __decorate([
  13587. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortDesc')
  13588. ], HeaderComp.prototype, "eSortDesc", void 0);
  13589. __decorate([
  13590. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortNone')
  13591. ], HeaderComp.prototype, "eSortNone", void 0);
  13592. __decorate([
  13593. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eSortOrder')
  13594. ], HeaderComp.prototype, "eSortOrder", void 0);
  13595. __decorate([
  13596. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eMenu')
  13597. ], HeaderComp.prototype, "eMenu", void 0);
  13598. __decorate([
  13599. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eLabel')
  13600. ], HeaderComp.prototype, "eLabel", void 0);
  13601. __decorate([
  13602. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eText')
  13603. ], HeaderComp.prototype, "eText", void 0);
  13604. return HeaderComp;
  13605. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  13606. /***/ }),
  13607. /* 65 */
  13608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13609. "use strict";
  13610. __webpack_require__.r(__webpack_exports__);
  13611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TouchListener", function() { return TouchListener; });
  13612. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
  13613. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  13614. /**
  13615. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  13616. * @version v23.2.1
  13617. * @link http://www.ag-grid.com/
  13618. * @license MIT
  13619. */
  13620. var TouchListener = /** @class */ (function () {
  13621. function TouchListener(eElement, preventMouseClick) {
  13622. var _this = this;
  13623. if (preventMouseClick === void 0) { preventMouseClick = false; }
  13624. this.destroyFuncs = [];
  13625. this.touching = false;
  13626. this.eventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
  13627. this.eElement = eElement;
  13628. this.preventMouseClick = preventMouseClick;
  13629. var startListener = this.onTouchStart.bind(this);
  13630. var moveListener = this.onTouchMove.bind(this);
  13631. var endListener = this.onTouchEnd.bind(this);
  13632. this.eElement.addEventListener("touchstart", startListener, { passive: true });
  13633. this.eElement.addEventListener("touchmove", moveListener, { passive: true });
  13634. // we set passive=false, as we want to prevent default on this event
  13635. this.eElement.addEventListener("touchend", endListener, { passive: false });
  13636. this.destroyFuncs.push(function () {
  13637. _this.eElement.removeEventListener("touchstart", startListener, { passive: true });
  13638. _this.eElement.removeEventListener("touchmove", moveListener, { passive: true });
  13639. _this.eElement.removeEventListener("touchend", endListener, { passive: false });
  13640. });
  13641. }
  13642. TouchListener.prototype.getActiveTouch = function (touchList) {
  13643. for (var i = 0; i < touchList.length; i++) {
  13644. var matches = touchList[i].identifier === this.touchStart.identifier;
  13645. if (matches) {
  13646. return touchList[i];
  13647. }
  13648. }
  13649. return null;
  13650. };
  13651. TouchListener.prototype.addEventListener = function (eventType, listener) {
  13652. this.eventService.addEventListener(eventType, listener);
  13653. };
  13654. TouchListener.prototype.removeEventListener = function (eventType, listener) {
  13655. this.eventService.removeEventListener(eventType, listener);
  13656. };
  13657. TouchListener.prototype.onTouchStart = function (touchEvent) {
  13658. var _this = this;
  13659. // only looking at one touch point at any time
  13660. if (this.touching) {
  13661. return;
  13662. }
  13663. this.touchStart = touchEvent.touches[0];
  13664. this.touching = true;
  13665. this.moved = false;
  13666. var touchStartCopy = this.touchStart;
  13667. window.setTimeout(function () {
  13668. var touchesMatch = _this.touchStart === touchStartCopy;
  13669. if (_this.touching && touchesMatch && !_this.moved) {
  13670. _this.moved = true;
  13671. var event_1 = {
  13672. type: TouchListener.EVENT_LONG_TAP,
  13673. touchStart: _this.touchStart,
  13674. touchEvent: touchEvent
  13675. };
  13676. _this.eventService.dispatchEvent(event_1);
  13677. }
  13678. }, 500);
  13679. };
  13680. TouchListener.prototype.onTouchMove = function (touchEvent) {
  13681. if (!this.touching) {
  13682. return;
  13683. }
  13684. var touch = this.getActiveTouch(touchEvent.touches);
  13685. if (!touch) {
  13686. return;
  13687. }
  13688. var eventIsFarAway = !_utils__WEBPACK_IMPORTED_MODULE_1__["_"].areEventsNear(touch, this.touchStart, 4);
  13689. if (eventIsFarAway) {
  13690. this.moved = true;
  13691. }
  13692. };
  13693. TouchListener.prototype.onTouchEnd = function (touchEvent) {
  13694. if (!this.touching) {
  13695. return;
  13696. }
  13697. if (!this.moved) {
  13698. var event_2 = {
  13699. type: TouchListener.EVENT_TAP,
  13700. touchStart: this.touchStart
  13701. };
  13702. this.eventService.dispatchEvent(event_2);
  13703. this.checkForDoubleTap();
  13704. }
  13705. // stops the tap from also been processed as a mouse click
  13706. if (this.preventMouseClick) {
  13707. touchEvent.preventDefault();
  13708. }
  13709. this.touching = false;
  13710. };
  13711. TouchListener.prototype.checkForDoubleTap = function () {
  13712. var now = new Date().getTime();
  13713. if (this.lastTapTime && this.lastTapTime > 0) {
  13714. // if previous tap, see if duration is short enough to be considered double tap
  13715. var interval = now - this.lastTapTime;
  13716. if (interval > TouchListener.DOUBLE_TAP_MILLIS) {
  13717. // dispatch double tap event
  13718. var event_3 = {
  13719. type: TouchListener.EVENT_DOUBLE_TAP,
  13720. touchStart: this.touchStart
  13721. };
  13722. this.eventService.dispatchEvent(event_3);
  13723. // this stops a tripple tap ending up as two double taps
  13724. this.lastTapTime = null;
  13725. }
  13726. else {
  13727. this.lastTapTime = now;
  13728. }
  13729. }
  13730. else {
  13731. this.lastTapTime = now;
  13732. }
  13733. };
  13734. TouchListener.prototype.destroy = function () {
  13735. this.destroyFuncs.forEach(function (func) { return func(); });
  13736. };
  13737. TouchListener.EVENT_TAP = "tap";
  13738. TouchListener.EVENT_DOUBLE_TAP = "doubleTap";
  13739. TouchListener.EVENT_LONG_TAP = "longTap";
  13740. TouchListener.DOUBLE_TAP_MILLIS = 500;
  13741. return TouchListener;
  13742. }());
  13743. /***/ }),
  13744. /* 66 */
  13745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13746. "use strict";
  13747. __webpack_require__.r(__webpack_exports__);
  13748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderGroupComp", function() { return HeaderGroupComp; });
  13749. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  13750. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  13751. /* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65);
  13752. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
  13753. /* harmony import */ var _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(33);
  13754. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  13755. /**
  13756. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  13757. * @version v23.2.1
  13758. * @link http://www.ag-grid.com/
  13759. * @license MIT
  13760. */
  13761. var __extends = (undefined && undefined.__extends) || (function () {
  13762. var extendStatics = function (d, b) {
  13763. extendStatics = Object.setPrototypeOf ||
  13764. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  13765. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  13766. return extendStatics(d, b);
  13767. };
  13768. return function (d, b) {
  13769. extendStatics(d, b);
  13770. function __() { this.constructor = d; }
  13771. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13772. };
  13773. })();
  13774. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  13775. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  13776. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  13777. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  13778. return c > 3 && r && Object.defineProperty(target, key, r), r;
  13779. };
  13780. var HeaderGroupComp = /** @class */ (function (_super) {
  13781. __extends(HeaderGroupComp, _super);
  13782. function HeaderGroupComp() {
  13783. return _super.call(this, HeaderGroupComp.TEMPLATE) || this;
  13784. }
  13785. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  13786. // so we need to override destroy() just to make the method public.
  13787. HeaderGroupComp.prototype.destroy = function () {
  13788. _super.prototype.destroy.call(this);
  13789. };
  13790. HeaderGroupComp.prototype.init = function (params) {
  13791. this.params = params;
  13792. this.setupLabel();
  13793. this.addGroupExpandIcon();
  13794. this.setupExpandIcons();
  13795. };
  13796. HeaderGroupComp.prototype.setupExpandIcons = function () {
  13797. var _this = this;
  13798. this.addInIcon("columnGroupOpened", "agOpened");
  13799. this.addInIcon("columnGroupClosed", "agClosed");
  13800. var expandAction = function (event) {
  13801. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].isStopPropagationForAgGrid(event)) {
  13802. return;
  13803. }
  13804. var newExpandedValue = !_this.params.columnGroup.isExpanded();
  13805. _this.columnController.setColumnGroupOpened(_this.params.columnGroup.getOriginalColumnGroup(), newExpandedValue, "uiColumnExpanded");
  13806. };
  13807. this.addTouchAndClickListeners(this.eCloseIcon, expandAction);
  13808. this.addTouchAndClickListeners(this.eOpenIcon, expandAction);
  13809. var stopPropagationAction = function (event) {
  13810. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].stopPropagationForAgGrid(event);
  13811. };
  13812. // adding stopPropagation to the double click for the icons prevents double click action happening
  13813. // when the icons are clicked. if the icons are double clicked, then the groups should open and
  13814. // then close again straight away. if we also listened to double click, then the group would open,
  13815. // close, then open, which is not what we want. double click should only action if the user double
  13816. // clicks outside of the icons.
  13817. this.addManagedListener(this.eCloseIcon, "dblclick", stopPropagationAction);
  13818. this.addManagedListener(this.eOpenIcon, "dblclick", stopPropagationAction);
  13819. this.addManagedListener(this.getGui(), "dblclick", expandAction);
  13820. this.updateIconVisibility();
  13821. var originalColumnGroup = this.params.columnGroup.getOriginalColumnGroup();
  13822. this.addManagedListener(originalColumnGroup, _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"].EVENT_EXPANDED_CHANGED, this.updateIconVisibility.bind(this));
  13823. this.addManagedListener(originalColumnGroup, _entities_originalColumnGroup__WEBPACK_IMPORTED_MODULE_4__["OriginalColumnGroup"].EVENT_EXPANDABLE_CHANGED, this.updateIconVisibility.bind(this));
  13824. };
  13825. HeaderGroupComp.prototype.addTouchAndClickListeners = function (eElement, action) {
  13826. var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_2__["TouchListener"](eElement);
  13827. this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_2__["TouchListener"].EVENT_TAP, action);
  13828. this.addDestroyFunc(function () { return touchListener.destroy(); });
  13829. this.addManagedListener(eElement, "click", action);
  13830. };
  13831. HeaderGroupComp.prototype.updateIconVisibility = function () {
  13832. var columnGroup = this.params.columnGroup;
  13833. if (columnGroup.isExpandable()) {
  13834. var expanded = this.params.columnGroup.isExpanded();
  13835. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].setDisplayed(this.eOpenIcon, expanded);
  13836. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].setDisplayed(this.eCloseIcon, !expanded);
  13837. }
  13838. else {
  13839. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].setDisplayed(this.eOpenIcon, false);
  13840. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].setDisplayed(this.eCloseIcon, false);
  13841. }
  13842. };
  13843. HeaderGroupComp.prototype.addInIcon = function (iconName, refName) {
  13844. var eIcon = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].createIconNoSpan(iconName, this.gridOptionsWrapper, null);
  13845. this.getRefElement(refName).appendChild(eIcon);
  13846. };
  13847. HeaderGroupComp.prototype.addGroupExpandIcon = function () {
  13848. if (!this.params.columnGroup.isExpandable()) {
  13849. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].setDisplayed(this.eOpenIcon, false);
  13850. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].setDisplayed(this.eCloseIcon, false);
  13851. return;
  13852. }
  13853. };
  13854. HeaderGroupComp.prototype.setupLabel = function () {
  13855. // no renderer, default text render
  13856. var displayName = this.params.displayName;
  13857. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(displayName)) {
  13858. var displayNameSanitised = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].escape(displayName);
  13859. this.getRefElement("agLabel").innerHTML = displayNameSanitised;
  13860. }
  13861. };
  13862. HeaderGroupComp.TEMPLATE = "<div class=\"ag-header-group-cell-label\" ref=\"agContainer\" role=\"presentation\">\n <span ref=\"agLabel\" class=\"ag-header-group-text\" role=\"columnheader\"></span>\n <span ref=\"agOpened\" class=\"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded\"></span>\n <span ref=\"agClosed\" class=\"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed\"></span>\n </div>";
  13863. __decorate([
  13864. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])("columnController")
  13865. ], HeaderGroupComp.prototype, "columnController", void 0);
  13866. __decorate([
  13867. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])("gridOptionsWrapper")
  13868. ], HeaderGroupComp.prototype, "gridOptionsWrapper", void 0);
  13869. __decorate([
  13870. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])("agOpened")
  13871. ], HeaderGroupComp.prototype, "eOpenIcon", void 0);
  13872. __decorate([
  13873. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])("agClosed")
  13874. ], HeaderGroupComp.prototype, "eCloseIcon", void 0);
  13875. return HeaderGroupComp;
  13876. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  13877. /***/ }),
  13878. /* 67 */
  13879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13880. "use strict";
  13881. __webpack_require__.r(__webpack_exports__);
  13882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupCellRenderer", function() { return GroupCellRenderer; });
  13883. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
  13884. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  13885. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
  13886. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68);
  13887. /* harmony import */ var _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69);
  13888. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57);
  13889. /* harmony import */ var _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74);
  13890. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
  13891. /**
  13892. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  13893. * @version v23.2.1
  13894. * @link http://www.ag-grid.com/
  13895. * @license MIT
  13896. */
  13897. var __extends = (undefined && undefined.__extends) || (function () {
  13898. var extendStatics = function (d, b) {
  13899. extendStatics = Object.setPrototypeOf ||
  13900. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  13901. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  13902. return extendStatics(d, b);
  13903. };
  13904. return function (d, b) {
  13905. extendStatics(d, b);
  13906. function __() { this.constructor = d; }
  13907. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13908. };
  13909. })();
  13910. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  13911. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  13912. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  13913. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  13914. return c > 3 && r && Object.defineProperty(target, key, r), r;
  13915. };
  13916. var GroupCellRenderer = /** @class */ (function (_super) {
  13917. __extends(GroupCellRenderer, _super);
  13918. function GroupCellRenderer() {
  13919. return _super.call(this, GroupCellRenderer.TEMPLATE) || this;
  13920. }
  13921. GroupCellRenderer.prototype.init = function (params) {
  13922. this.params = params;
  13923. if (this.gridOptionsWrapper.isGroupIncludeTotalFooter()) {
  13924. this.assignBlankValueToGroupFooterCell(params);
  13925. }
  13926. var embeddedRowMismatch = this.isEmbeddedRowMismatch();
  13927. // This allows for empty strings to appear as groups since
  13928. // it will only return for null or undefined.
  13929. var nullValue = params.value == null;
  13930. var skipCell = false;
  13931. // if the groupCellRenderer is inside of a footer and groupHideOpenParents is true
  13932. // we should only display the groupCellRenderer if the current column is the rowGroupedColumn
  13933. if (this.gridOptionsWrapper.isGroupIncludeFooter() && this.gridOptionsWrapper.isGroupHideOpenParents()) {
  13934. var node = params.node;
  13935. if (node.footer) {
  13936. var showRowGroup = params.colDef && params.colDef.showRowGroup;
  13937. var rowGroupColumnId = node.rowGroupColumn && node.rowGroupColumn.getColId();
  13938. skipCell = showRowGroup !== rowGroupColumnId;
  13939. }
  13940. }
  13941. this.cellIsBlank = embeddedRowMismatch || nullValue || skipCell;
  13942. if (this.cellIsBlank) {
  13943. return;
  13944. }
  13945. this.setupDragOpenParents();
  13946. this.addExpandAndContract();
  13947. this.addCheckboxIfNeeded();
  13948. this.addValueElement();
  13949. this.setupIndent();
  13950. };
  13951. GroupCellRenderer.prototype.assignBlankValueToGroupFooterCell = function (params) {
  13952. // this is not ideal, but it was the only way we could get footer working for the root node
  13953. if (!params.value && params.node.level == -1) {
  13954. params.value = '';
  13955. }
  13956. };
  13957. // if we are doing embedded full width rows, we only show the renderer when
  13958. // in the body, or if pinning in the pinned section, or if pinning and RTL,
  13959. // in the right section. otherwise we would have the cell repeated in each section.
  13960. GroupCellRenderer.prototype.isEmbeddedRowMismatch = function () {
  13961. if (!this.params.fullWidth || !this.gridOptionsWrapper.isEmbedFullWidthRows()) {
  13962. return false;
  13963. }
  13964. var pinnedLeftCell = this.params.pinned === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_LEFT;
  13965. var pinnedRightCell = this.params.pinned === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_RIGHT;
  13966. var bodyCell = !pinnedLeftCell && !pinnedRightCell;
  13967. if (this.gridOptionsWrapper.isEnableRtl()) {
  13968. if (this.columnController.isPinningLeft()) {
  13969. return !pinnedRightCell;
  13970. }
  13971. return !bodyCell;
  13972. }
  13973. if (this.columnController.isPinningLeft()) {
  13974. return !pinnedLeftCell;
  13975. }
  13976. return !bodyCell;
  13977. };
  13978. GroupCellRenderer.prototype.setIndent = function () {
  13979. if (this.gridOptionsWrapper.isGroupHideOpenParents()) {
  13980. return;
  13981. }
  13982. var params = this.params;
  13983. var rowNode = params.node;
  13984. var paddingCount = rowNode.uiLevel;
  13985. var userProvidedPaddingPixelsTheDeprecatedWay = params.padding >= 0;
  13986. if (userProvidedPaddingPixelsTheDeprecatedWay) {
  13987. this.setPaddingDeprecatedWay(paddingCount, params.padding);
  13988. return;
  13989. }
  13990. if (this.indentClass) {
  13991. this.removeCssClass(this.indentClass);
  13992. }
  13993. this.indentClass = 'ag-row-group-indent-' + paddingCount;
  13994. this.addCssClass(this.indentClass);
  13995. };
  13996. GroupCellRenderer.prototype.setPaddingDeprecatedWay = function (paddingCount, padding) {
  13997. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].doOnce(function () { return console.warn('ag-Grid: since v14.2, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the ag-Grid documentation page for Themes, in particular the property $row-group-indent-size.'); }, 'groupCellRenderer->doDeprecatedWay');
  13998. var paddingPx = paddingCount * padding;
  13999. var eGui = this.getGui();
  14000. var paddingSide = this.gridOptionsWrapper.isEnableRtl() ? 'paddingRight' : 'paddingLeft';
  14001. eGui.style[paddingSide] = paddingPx + "px";
  14002. };
  14003. GroupCellRenderer.prototype.setupIndent = function () {
  14004. // only do this if an indent - as this overwrites the padding that
  14005. // the theme set, which will make things look 'not aligned' for the
  14006. // first group level.
  14007. var node = this.params.node;
  14008. var suppressPadding = this.params.suppressPadding;
  14009. if (!suppressPadding) {
  14010. this.addManagedListener(node, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_UI_LEVEL_CHANGED, this.setIndent.bind(this));
  14011. this.setIndent();
  14012. }
  14013. };
  14014. GroupCellRenderer.prototype.addValueElement = function () {
  14015. var params = this.params;
  14016. var rowNode = this.displayedGroup;
  14017. if (rowNode.footer) {
  14018. this.createFooterCell();
  14019. }
  14020. else if (rowNode.hasChildren() ||
  14021. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].get(params.colDef, 'cellRendererParams.innerRenderer', null) ||
  14022. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].get(params.colDef, 'cellRendererParams.innerRendererFramework', null)) {
  14023. this.createGroupCell();
  14024. if (rowNode.hasChildren()) {
  14025. this.addChildCount();
  14026. }
  14027. }
  14028. else {
  14029. this.createLeafCell();
  14030. }
  14031. };
  14032. GroupCellRenderer.prototype.createFooterCell = function () {
  14033. var footerValueGetter = this.params.footerValueGetter;
  14034. var footerValue;
  14035. if (footerValueGetter) {
  14036. // params is same as we were given, except we set the value as the item to display
  14037. var paramsClone = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].cloneObject(this.params);
  14038. paramsClone.value = this.params.value;
  14039. if (typeof footerValueGetter === 'function') {
  14040. footerValue = footerValueGetter(paramsClone);
  14041. }
  14042. else if (typeof footerValueGetter === 'string') {
  14043. footerValue = this.expressionService.evaluate(footerValueGetter, paramsClone);
  14044. }
  14045. else {
  14046. console.warn('ag-Grid: footerValueGetter should be either a function or a string (expression)');
  14047. }
  14048. }
  14049. else {
  14050. footerValue = 'Total ' + this.params.value;
  14051. }
  14052. this.eValue.innerHTML = footerValue;
  14053. };
  14054. GroupCellRenderer.prototype.createGroupCell = function () {
  14055. var _this = this;
  14056. var params = this.params;
  14057. var rowGroupColumn = this.displayedGroup.rowGroupColumn;
  14058. // we try and use the cellRenderer of the column used for the grouping if we can
  14059. var columnToUse = rowGroupColumn ? rowGroupColumn : params.column;
  14060. var groupName = this.params.value;
  14061. var valueFormatted = columnToUse ?
  14062. this.valueFormatterService.formatValue(columnToUse, params.node, params.scope, groupName) : null;
  14063. params.valueFormatted = valueFormatted;
  14064. var rendererPromise;
  14065. rendererPromise = params.fullWidth
  14066. ? this.useFullWidth(params)
  14067. : this.useInnerRenderer(this.params.colDef.cellRendererParams, columnToUse.getColDef(), params);
  14068. // retain a reference to the created renderer - we'll use this later for cleanup (in destroy)
  14069. if (rendererPromise) {
  14070. rendererPromise.then(function (value) {
  14071. _this.innerCellRenderer = value;
  14072. });
  14073. }
  14074. };
  14075. GroupCellRenderer.prototype.useInnerRenderer = function (groupCellRendererParams, groupedColumnDef, // the column this group row is for, eg 'Country'
  14076. params) {
  14077. var _this = this;
  14078. // when grouping, the normal case is we use the cell renderer of the grouped column. eg if grouping by country
  14079. // and then rating, we will use the country cell renderer for each country group row and likewise the rating
  14080. // cell renderer for each rating group row.
  14081. //
  14082. // however if the user has innerCellRenderer defined, this gets preference and we don't use cell renderers
  14083. // of the grouped columns.
  14084. //
  14085. // so we check and use in the following order:
  14086. //
  14087. // 1) thisColDef.cellRendererParams.innerRenderer of the column showing the groups (eg auto group column)
  14088. // 2) groupedColDef.cellRenderer of the grouped column
  14089. // 3) groupedColDef.cellRendererParams.innerRenderer
  14090. var cellRendererPromise = null;
  14091. // we check if cell renderer provided for the group cell renderer, eg colDef.cellRendererParams.innerRenderer
  14092. var groupInnerRendererClass = this.userComponentFactory
  14093. .lookupComponentClassDef(groupCellRendererParams, "innerRenderer");
  14094. if (groupInnerRendererClass && groupInnerRendererClass.component != null
  14095. && groupInnerRendererClass.source != _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__["ComponentSource"].DEFAULT) {
  14096. // use the renderer defined in cellRendererParams.innerRenderer
  14097. cellRendererPromise = this.userComponentFactory.newInnerCellRenderer(groupCellRendererParams, params);
  14098. }
  14099. else {
  14100. // otherwise see if we can use the cellRenderer of the column we are grouping by
  14101. var groupColumnRendererClass = this.userComponentFactory
  14102. .lookupComponentClassDef(groupedColumnDef, "cellRenderer");
  14103. if (groupColumnRendererClass &&
  14104. groupColumnRendererClass.source != _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__["ComponentSource"].DEFAULT) {
  14105. // Only if the original column is using a specific renderer, it it is a using a DEFAULT one ignore it
  14106. cellRendererPromise = this.userComponentFactory.newCellRenderer(groupedColumnDef, params);
  14107. }
  14108. else if (groupColumnRendererClass &&
  14109. groupColumnRendererClass.source == _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_6__["ComponentSource"].DEFAULT &&
  14110. (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].get(groupedColumnDef, 'cellRendererParams.innerRenderer', null))) {
  14111. // EDGE CASE - THIS COMES FROM A COLUMN WHICH HAS BEEN GROUPED DYNAMICALLY, THAT HAS AS RENDERER 'group'
  14112. // AND HAS A INNER CELL RENDERER
  14113. cellRendererPromise = this.userComponentFactory.newInnerCellRenderer(groupedColumnDef.cellRendererParams, params);
  14114. }
  14115. else {
  14116. // This forces the retrieval of the default plain cellRenderer that just renders the values.
  14117. cellRendererPromise = this.userComponentFactory.newCellRenderer({}, params);
  14118. }
  14119. }
  14120. if (cellRendererPromise != null) {
  14121. cellRendererPromise.then(function (rendererToUse) {
  14122. if (rendererToUse == null) {
  14123. _this.eValue.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
  14124. return;
  14125. }
  14126. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].bindCellRendererToHtmlElement(cellRendererPromise, _this.eValue);
  14127. });
  14128. }
  14129. else {
  14130. this.eValue.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
  14131. }
  14132. return cellRendererPromise;
  14133. };
  14134. GroupCellRenderer.prototype.useFullWidth = function (params) {
  14135. var cellRendererPromise = this.userComponentFactory.newFullWidthGroupRowInnerCellRenderer(params);
  14136. if (cellRendererPromise != null) {
  14137. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].bindCellRendererToHtmlElement(cellRendererPromise, this.eValue);
  14138. }
  14139. else {
  14140. this.eValue.innerText = params.valueFormatted != null ? params.valueFormatted : params.value;
  14141. }
  14142. return cellRendererPromise;
  14143. };
  14144. GroupCellRenderer.prototype.addChildCount = function () {
  14145. // only include the child count if it's included, eg if user doing custom aggregation,
  14146. // then this could be left out, or set to -1, ie no child count
  14147. if (this.params.suppressCount) {
  14148. return;
  14149. }
  14150. this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_ALL_CHILDREN_COUNT_CHANGED, this.updateChildCount.bind(this));
  14151. // filtering changes the child count, so need to cater for it
  14152. this.updateChildCount();
  14153. };
  14154. GroupCellRenderer.prototype.updateChildCount = function () {
  14155. var allChildrenCount = this.displayedGroup.allChildrenCount;
  14156. this.eChildCount.innerHTML = allChildrenCount >= 0 ? "(" + allChildrenCount + ")" : "";
  14157. };
  14158. GroupCellRenderer.prototype.createLeafCell = function () {
  14159. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(this.params.value)) {
  14160. this.eValue.innerText = this.params.valueFormatted ? this.params.valueFormatted : this.params.value;
  14161. }
  14162. };
  14163. GroupCellRenderer.prototype.isUserWantsSelected = function () {
  14164. var paramsCheckbox = this.params.checkbox;
  14165. if (typeof paramsCheckbox === 'function') {
  14166. return paramsCheckbox(this.params);
  14167. }
  14168. return paramsCheckbox === true;
  14169. };
  14170. GroupCellRenderer.prototype.addCheckboxIfNeeded = function () {
  14171. var _this = this;
  14172. var rowNode = this.displayedGroup;
  14173. var checkboxNeeded = this.isUserWantsSelected() &&
  14174. // footers cannot be selected
  14175. !rowNode.footer &&
  14176. // pinned rows cannot be selected
  14177. !rowNode.rowPinned &&
  14178. // details cannot be selected
  14179. !rowNode.detail;
  14180. if (checkboxNeeded) {
  14181. var cbSelectionComponent_1 = new _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_4__["CheckboxSelectionComponent"]();
  14182. this.getContext().createBean(cbSelectionComponent_1);
  14183. cbSelectionComponent_1.init({ rowNode: rowNode, column: this.params.column });
  14184. this.eCheckbox.appendChild(cbSelectionComponent_1.getGui());
  14185. this.addDestroyFunc(function () { return _this.getContext().destroyBean(cbSelectionComponent_1); });
  14186. }
  14187. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.eCheckbox, 'ag-invisible', !checkboxNeeded);
  14188. };
  14189. GroupCellRenderer.prototype.addExpandAndContract = function () {
  14190. var params = this.params;
  14191. var eGroupCell = params.eGridCell;
  14192. var eExpandedIcon = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].createIconNoSpan('groupExpanded', this.gridOptionsWrapper, null);
  14193. var eContractedIcon = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].createIconNoSpan('groupContracted', this.gridOptionsWrapper, null);
  14194. this.eExpanded.appendChild(eExpandedIcon);
  14195. this.eContracted.appendChild(eContractedIcon);
  14196. this.addManagedListener(this.eExpanded, 'click', this.onExpandClicked.bind(this));
  14197. this.addManagedListener(this.eContracted, 'click', this.onExpandClicked.bind(this));
  14198. // expand / contract as the user hits enter
  14199. this.addManagedListener(eGroupCell, 'keydown', this.onKeyDown.bind(this));
  14200. this.addManagedListener(params.node, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_EXPANDED_CHANGED, this.showExpandAndContractIcons.bind(this));
  14201. this.showExpandAndContractIcons();
  14202. // because we don't show the expand / contract when there are no children, we need to check every time
  14203. // the number of children change.
  14204. this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_ALL_CHILDREN_COUNT_CHANGED, this.onRowNodeIsExpandableChanged.bind(this));
  14205. this.addManagedListener(this.displayedGroup, _entities_rowNode__WEBPACK_IMPORTED_MODULE_3__["RowNode"].EVENT_MASTER_CHANGED, this.onRowNodeIsExpandableChanged.bind(this));
  14206. // if editing groups, then double click is to start editing
  14207. if (!this.gridOptionsWrapper.isEnableGroupEdit() && this.isExpandable() && !params.suppressDoubleClickExpand) {
  14208. this.addManagedListener(eGroupCell, 'dblclick', this.onCellDblClicked.bind(this));
  14209. }
  14210. };
  14211. GroupCellRenderer.prototype.onRowNodeIsExpandableChanged = function () {
  14212. // maybe if no children now, we should hide the expand / contract icons
  14213. this.showExpandAndContractIcons();
  14214. // if we have no children, this impacts the indent
  14215. this.setIndent();
  14216. };
  14217. GroupCellRenderer.prototype.onKeyDown = function (event) {
  14218. var enterKeyPressed = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isKeyPressed(event, _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_ENTER);
  14219. if (!enterKeyPressed || this.params.suppressEnterExpand) {
  14220. return;
  14221. }
  14222. var cellEditable = this.params.column && this.params.column.isCellEditable(this.params.node);
  14223. if (cellEditable) {
  14224. return;
  14225. }
  14226. event.preventDefault();
  14227. this.onExpandOrContract();
  14228. };
  14229. GroupCellRenderer.prototype.setupDragOpenParents = function () {
  14230. var column = this.params.column;
  14231. var rowNode = this.params.node;
  14232. if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {
  14233. this.draggedFromHideOpenParents = false;
  14234. }
  14235. else if (!rowNode.hasChildren()) {
  14236. // if we are here, and we are not a group, then we must of been dragged down,
  14237. // as otherwise the cell would be blank, and if cell is blank, this method is never called.
  14238. this.draggedFromHideOpenParents = true;
  14239. }
  14240. else {
  14241. var rowGroupColumn = rowNode.rowGroupColumn;
  14242. if (rowGroupColumn) {
  14243. // if the displayGroup column for this col matches the rowGroupColumn we grouped by for this node,
  14244. // then nothing was dragged down
  14245. this.draggedFromHideOpenParents = !column.isRowGroupDisplayed(rowGroupColumn.getId());
  14246. }
  14247. else {
  14248. // the only way we can end up here (no column, but a group) is if we are at the root node,
  14249. // which only happens when 'groupIncludeTotalFooter' is true. here, we are never dragging
  14250. this.draggedFromHideOpenParents = false;
  14251. }
  14252. }
  14253. if (this.draggedFromHideOpenParents) {
  14254. var pointer = rowNode.parent;
  14255. while (true) {
  14256. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(pointer)) {
  14257. break;
  14258. }
  14259. if (pointer.rowGroupColumn && column.isRowGroupDisplayed(pointer.rowGroupColumn.getId())) {
  14260. this.displayedGroup = pointer;
  14261. break;
  14262. }
  14263. pointer = pointer.parent;
  14264. }
  14265. }
  14266. // if we didn't find a displayed group, set it to the row node
  14267. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(this.displayedGroup)) {
  14268. this.displayedGroup = rowNode;
  14269. }
  14270. };
  14271. GroupCellRenderer.prototype.onExpandClicked = function (mouseEvent) {
  14272. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isStopPropagationForAgGrid(mouseEvent)) {
  14273. return;
  14274. }
  14275. // so if we expand a node, it does not also get selected.
  14276. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].stopPropagationForAgGrid(mouseEvent);
  14277. this.onExpandOrContract();
  14278. };
  14279. GroupCellRenderer.prototype.onCellDblClicked = function (mouseEvent) {
  14280. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isStopPropagationForAgGrid(mouseEvent)) {
  14281. return;
  14282. }
  14283. // we want to avoid acting on double click events on the expand / contract icon,
  14284. // as that icons already has expand / collapse functionality on it. otherwise if
  14285. // the icon was double clicked, we would get 'click', 'click', 'dblclick' which
  14286. // is open->close->open, however double click should be open->close only.
  14287. var targetIsExpandIcon = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isElementInEventPath(this.eExpanded, mouseEvent)
  14288. || _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isElementInEventPath(this.eContracted, mouseEvent);
  14289. if (!targetIsExpandIcon) {
  14290. this.onExpandOrContract();
  14291. }
  14292. };
  14293. GroupCellRenderer.prototype.onExpandOrContract = function () {
  14294. // must use the displayedGroup, so if data was dragged down, we expand the parent, not this row
  14295. var rowNode = this.displayedGroup;
  14296. rowNode.setExpanded(!rowNode.expanded);
  14297. };
  14298. GroupCellRenderer.prototype.isExpandable = function () {
  14299. var rowNode = this.params.node;
  14300. var reducedLeafNode = this.columnController.isPivotMode() && rowNode.leafGroup;
  14301. return this.draggedFromHideOpenParents ||
  14302. (rowNode.isExpandable() && !rowNode.footer && !reducedLeafNode);
  14303. };
  14304. GroupCellRenderer.prototype.showExpandAndContractIcons = function () {
  14305. var rowNode = this.params.node;
  14306. if (this.isExpandable()) {
  14307. // if expandable, show one based on expand state.
  14308. // if we were dragged down, means our parent is always expanded
  14309. var expanded = this.draggedFromHideOpenParents ? true : rowNode.expanded;
  14310. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].setDisplayed(this.eContracted, !expanded);
  14311. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].setDisplayed(this.eExpanded, expanded);
  14312. }
  14313. else {
  14314. // it not expandable, show neither
  14315. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].setDisplayed(this.eExpanded, false);
  14316. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].setDisplayed(this.eContracted, false);
  14317. }
  14318. var displayedGroup = this.displayedGroup;
  14319. // compensation padding for leaf nodes, so there is blank space instead of the expand icon
  14320. var pivotModeAndLeafGroup = this.columnController.isPivotMode() && displayedGroup.leafGroup;
  14321. var notExpandable = !displayedGroup.isExpandable();
  14322. var addLeafIndentClass = displayedGroup.footer || notExpandable || pivotModeAndLeafGroup;
  14323. this.addOrRemoveCssClass('ag-row-group', !addLeafIndentClass);
  14324. this.addOrRemoveCssClass('ag-row-group-leaf-indent', addLeafIndentClass);
  14325. };
  14326. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  14327. // so we need to have public here instead of private or protected
  14328. GroupCellRenderer.prototype.destroy = function () {
  14329. this.getContext().destroyBean(this.innerCellRenderer);
  14330. _super.prototype.destroy.call(this);
  14331. };
  14332. GroupCellRenderer.prototype.refresh = function () {
  14333. return false;
  14334. };
  14335. GroupCellRenderer.TEMPLATE = '<span class="ag-cell-wrapper">' +
  14336. '<span class="ag-group-expanded" ref="eExpanded"></span>' +
  14337. '<span class="ag-group-contracted" ref="eContracted"></span>' +
  14338. '<span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>' +
  14339. '<span class="ag-group-value" ref="eValue"></span>' +
  14340. '<span class="ag-group-child-count" ref="eChildCount"></span>' +
  14341. '</span>';
  14342. __decorate([
  14343. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  14344. ], GroupCellRenderer.prototype, "gridOptionsWrapper", void 0);
  14345. __decorate([
  14346. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('expressionService')
  14347. ], GroupCellRenderer.prototype, "expressionService", void 0);
  14348. __decorate([
  14349. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('valueFormatterService')
  14350. ], GroupCellRenderer.prototype, "valueFormatterService", void 0);
  14351. __decorate([
  14352. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  14353. ], GroupCellRenderer.prototype, "columnController", void 0);
  14354. __decorate([
  14355. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
  14356. ], GroupCellRenderer.prototype, "userComponentFactory", void 0);
  14357. __decorate([
  14358. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eExpanded')
  14359. ], GroupCellRenderer.prototype, "eExpanded", void 0);
  14360. __decorate([
  14361. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eContracted')
  14362. ], GroupCellRenderer.prototype, "eContracted", void 0);
  14363. __decorate([
  14364. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eCheckbox')
  14365. ], GroupCellRenderer.prototype, "eCheckbox", void 0);
  14366. __decorate([
  14367. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eValue')
  14368. ], GroupCellRenderer.prototype, "eValue", void 0);
  14369. __decorate([
  14370. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_5__["RefSelector"])('eChildCount')
  14371. ], GroupCellRenderer.prototype, "eChildCount", void 0);
  14372. return GroupCellRenderer;
  14373. }(_widgets_component__WEBPACK_IMPORTED_MODULE_2__["Component"]));
  14374. /***/ }),
  14375. /* 68 */
  14376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14377. "use strict";
  14378. __webpack_require__.r(__webpack_exports__);
  14379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowNode", function() { return RowNode; });
  14380. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
  14381. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  14382. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  14383. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  14384. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  14385. /**
  14386. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  14387. * @version v23.2.1
  14388. * @link http://www.ag-grid.com/
  14389. * @license MIT
  14390. */
  14391. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  14392. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  14393. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  14394. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  14395. return c > 3 && r && Object.defineProperty(target, key, r), r;
  14396. };
  14397. var RowNode = /** @class */ (function () {
  14398. function RowNode() {
  14399. /** Children mapped by the pivot columns */
  14400. this.childrenMapped = {};
  14401. /** True by default - can be overridden via gridOptions.isRowSelectable(rowNode) */
  14402. this.selectable = true;
  14403. /** Used by sorting service - to give deterministic sort to groups. Previously we
  14404. * just id for this, however id is a string and had slower sorting compared to numbers. */
  14405. this.__objectId = RowNode.OBJECT_ID_SEQUENCE++;
  14406. /** True when nodes with the same id are being removed and added as part of the same batch transaction */
  14407. this.alreadyRendered = false;
  14408. this.highlighted = null;
  14409. this.selected = false;
  14410. }
  14411. RowNode.prototype.setData = function (data) {
  14412. var oldData = this.data;
  14413. this.data = data;
  14414. this.valueCache.onDataChanged();
  14415. this.updateDataOnDetailNode();
  14416. this.checkRowSelectable();
  14417. var event = this.createDataChangedEvent(data, oldData, false);
  14418. this.dispatchLocalEvent(event);
  14419. };
  14420. // when we are doing master / detail, the detail node is lazy created, but then kept around.
  14421. // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data
  14422. // in sync, otherwise expand/collapse of the detail would still show the old values.
  14423. RowNode.prototype.updateDataOnDetailNode = function () {
  14424. if (this.detailNode) {
  14425. this.detailNode.data = this.data;
  14426. }
  14427. };
  14428. RowNode.prototype.createDataChangedEvent = function (newData, oldData, update) {
  14429. return {
  14430. type: RowNode.EVENT_DATA_CHANGED,
  14431. node: this,
  14432. oldData: oldData,
  14433. newData: newData,
  14434. update: update
  14435. };
  14436. };
  14437. RowNode.prototype.createLocalRowEvent = function (type) {
  14438. return {
  14439. type: type,
  14440. node: this
  14441. };
  14442. };
  14443. // similar to setRowData, however it is expected that the data is the same data item. this
  14444. // is intended to be used with Redux type stores, where the whole data can be changed. we are
  14445. // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the
  14446. // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving
  14447. // dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions).
  14448. RowNode.prototype.updateData = function (data) {
  14449. var oldData = this.data;
  14450. this.data = data;
  14451. this.updateDataOnDetailNode();
  14452. this.checkRowSelectable();
  14453. this.updateDataOnDetailNode();
  14454. var event = this.createDataChangedEvent(data, oldData, true);
  14455. this.dispatchLocalEvent(event);
  14456. };
  14457. RowNode.prototype.getRowIndexString = function () {
  14458. if (this.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP) {
  14459. return 't-' + this.rowIndex;
  14460. }
  14461. else if (this.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM) {
  14462. return 'b-' + this.rowIndex;
  14463. }
  14464. return this.rowIndex.toString();
  14465. };
  14466. RowNode.prototype.createDaemonNode = function () {
  14467. var oldNode = new RowNode();
  14468. this.context.createBean(oldNode);
  14469. // just copy the id and data, this is enough for the node to be used
  14470. // in the selection controller (the selection controller is the only
  14471. // place where daemon nodes can live).
  14472. oldNode.id = this.id;
  14473. oldNode.data = this.data;
  14474. oldNode.daemon = true;
  14475. oldNode.selected = this.selected;
  14476. oldNode.level = this.level;
  14477. return oldNode;
  14478. };
  14479. RowNode.prototype.setDataAndId = function (data, id) {
  14480. var oldNode = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(this.id) ? this.createDaemonNode() : null;
  14481. var oldData = this.data;
  14482. this.data = data;
  14483. this.updateDataOnDetailNode();
  14484. this.setId(id);
  14485. this.selectionController.syncInRowNode(this, oldNode);
  14486. this.checkRowSelectable();
  14487. var event = this.createDataChangedEvent(data, oldData, false);
  14488. this.dispatchLocalEvent(event);
  14489. };
  14490. RowNode.prototype.checkRowSelectable = function () {
  14491. var isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
  14492. var shouldInvokeIsRowSelectable = isRowSelectableFunc && _utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(this);
  14493. this.setRowSelectable(shouldInvokeIsRowSelectable ? isRowSelectableFunc(this) : true);
  14494. };
  14495. RowNode.prototype.setRowSelectable = function (newVal) {
  14496. if (this.selectable !== newVal) {
  14497. this.selectable = newVal;
  14498. if (this.eventService) {
  14499. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_SELECTABLE_CHANGED));
  14500. }
  14501. }
  14502. };
  14503. RowNode.prototype.setId = function (id) {
  14504. // see if user is providing the id's
  14505. var getRowNodeId = this.gridOptionsWrapper.getRowNodeIdFunc();
  14506. if (getRowNodeId) {
  14507. // if user is providing the id's, then we set the id only after the data has been set.
  14508. // this is important for virtual pagination and viewport, where empty rows exist.
  14509. if (this.data) {
  14510. this.id = getRowNodeId(this.data);
  14511. // make sure id provided doesn't start with 'row-group-' as this is reserved. also check that
  14512. // it has 'startsWith' in case the user provided a number.
  14513. if (this.id && this.id.startsWith && this.id.startsWith(RowNode.ID_PREFIX_ROW_GROUP)) {
  14514. console.error("ag-Grid: Row ID's cannot start with " + RowNode.ID_PREFIX_ROW_GROUP + ", this is a reserved prefix for ag-Grid's row grouping feature.");
  14515. }
  14516. }
  14517. else {
  14518. // this can happen if user has set blank into the rowNode after the row previously
  14519. // having data. this happens in virtual page row model, when data is delete and
  14520. // the page is refreshed.
  14521. this.id = undefined;
  14522. }
  14523. }
  14524. else {
  14525. this.id = id;
  14526. }
  14527. };
  14528. RowNode.prototype.isPixelInRange = function (pixel) {
  14529. return pixel >= this.rowTop && pixel < (this.rowTop + this.rowHeight);
  14530. };
  14531. RowNode.prototype.clearRowTop = function () {
  14532. this.oldRowTop = this.rowTop;
  14533. this.setRowTop(null);
  14534. };
  14535. RowNode.prototype.setFirstChild = function (firstChild) {
  14536. if (this.firstChild === firstChild) {
  14537. return;
  14538. }
  14539. this.firstChild = firstChild;
  14540. if (this.eventService) {
  14541. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED));
  14542. }
  14543. };
  14544. RowNode.prototype.setLastChild = function (lastChild) {
  14545. if (this.lastChild === lastChild) {
  14546. return;
  14547. }
  14548. this.lastChild = lastChild;
  14549. if (this.eventService) {
  14550. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED));
  14551. }
  14552. };
  14553. RowNode.prototype.setChildIndex = function (childIndex) {
  14554. if (this.childIndex === childIndex) {
  14555. return;
  14556. }
  14557. this.childIndex = childIndex;
  14558. if (this.eventService) {
  14559. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED));
  14560. }
  14561. };
  14562. RowNode.prototype.setRowTop = function (rowTop) {
  14563. if (this.rowTop === rowTop) {
  14564. return;
  14565. }
  14566. this.rowTop = rowTop;
  14567. if (this.eventService) {
  14568. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED));
  14569. }
  14570. };
  14571. RowNode.prototype.setDragging = function (dragging) {
  14572. if (this.dragging === dragging) {
  14573. return;
  14574. }
  14575. this.dragging = dragging;
  14576. if (this.eventService) {
  14577. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DRAGGING_CHANGED));
  14578. }
  14579. };
  14580. RowNode.prototype.setHighlighted = function (highlighted) {
  14581. if (highlighted === this.highlighted) {
  14582. return;
  14583. }
  14584. this.highlighted = highlighted;
  14585. if (this.eventService) {
  14586. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HIGHLIGHT_CHANGED));
  14587. }
  14588. };
  14589. RowNode.prototype.setAllChildrenCount = function (allChildrenCount) {
  14590. if (this.allChildrenCount === allChildrenCount) {
  14591. return;
  14592. }
  14593. this.allChildrenCount = allChildrenCount;
  14594. if (this.eventService) {
  14595. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED));
  14596. }
  14597. };
  14598. RowNode.prototype.setMaster = function (master) {
  14599. if (this.master === master) {
  14600. return;
  14601. }
  14602. // if changing AWAY from master, then unexpand, otherwise
  14603. // next time it's shown it is expanded again
  14604. if (this.master && !master) {
  14605. this.expanded = false;
  14606. }
  14607. this.master = master;
  14608. if (this.eventService) {
  14609. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_MASTER_CHANGED));
  14610. }
  14611. };
  14612. RowNode.prototype.setRowHeight = function (rowHeight, estimated) {
  14613. if (estimated === void 0) { estimated = false; }
  14614. this.rowHeight = rowHeight;
  14615. this.rowHeightEstimated = estimated;
  14616. if (this.eventService) {
  14617. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED));
  14618. }
  14619. };
  14620. RowNode.prototype.setRowIndex = function (rowIndex) {
  14621. this.rowIndex = rowIndex;
  14622. if (this.eventService) {
  14623. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED));
  14624. }
  14625. };
  14626. RowNode.prototype.setUiLevel = function (uiLevel) {
  14627. if (this.uiLevel === uiLevel) {
  14628. return;
  14629. }
  14630. this.uiLevel = uiLevel;
  14631. if (this.eventService) {
  14632. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED));
  14633. }
  14634. };
  14635. RowNode.prototype.setExpanded = function (expanded) {
  14636. if (this.expanded === expanded) {
  14637. return;
  14638. }
  14639. this.expanded = expanded;
  14640. if (this.eventService) {
  14641. this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED));
  14642. }
  14643. var event = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].assign({}, this.createGlobalRowEvent(_events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_GROUP_OPENED), {
  14644. expanded: expanded
  14645. });
  14646. this.mainEventService.dispatchEvent(event);
  14647. if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
  14648. this.gridApi.redrawRows({ rowNodes: [this] });
  14649. }
  14650. };
  14651. RowNode.prototype.createGlobalRowEvent = function (type) {
  14652. return {
  14653. type: type,
  14654. node: this,
  14655. data: this.data,
  14656. rowIndex: this.rowIndex,
  14657. rowPinned: this.rowPinned,
  14658. context: this.gridOptionsWrapper.getContext(),
  14659. api: this.gridOptionsWrapper.getApi(),
  14660. columnApi: this.gridOptionsWrapper.getColumnApi()
  14661. };
  14662. };
  14663. RowNode.prototype.dispatchLocalEvent = function (event) {
  14664. if (this.eventService) {
  14665. this.eventService.dispatchEvent(event);
  14666. }
  14667. };
  14668. // we also allow editing the value via the editors. when it is done via
  14669. // the editors, no 'cell changed' event gets fired, as it's assumed that
  14670. // the cell knows about the change given it's in charge of the editing.
  14671. // this method is for the client to call, so the cell listens for the change
  14672. // event, and also flashes the cell when the change occurs.
  14673. RowNode.prototype.setDataValue = function (colKey, newValue) {
  14674. var column = this.columnController.getPrimaryColumn(colKey);
  14675. var oldValue = this.valueService.getValue(column, this);
  14676. this.valueService.setValue(this, column, newValue);
  14677. this.dispatchCellChangedEvent(column, newValue, oldValue);
  14678. };
  14679. RowNode.prototype.setGroupValue = function (colKey, newValue) {
  14680. var column = this.columnController.getGridColumn(colKey);
  14681. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].missing(this.groupData)) {
  14682. this.groupData = {};
  14683. }
  14684. var columnId = column.getColId();
  14685. var oldValue = this.groupData[columnId];
  14686. if (oldValue === newValue) {
  14687. return;
  14688. }
  14689. this.groupData[columnId] = newValue;
  14690. this.dispatchCellChangedEvent(column, newValue, oldValue);
  14691. };
  14692. // sets the data for an aggregation
  14693. RowNode.prototype.setAggData = function (newAggData) {
  14694. var _this = this;
  14695. // find out all keys that could potentially change
  14696. var colIds = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].getAllKeysInObjects([this.aggData, newAggData]);
  14697. var oldAggData = this.aggData;
  14698. this.aggData = newAggData;
  14699. // if no event service, nobody has registered for events, so no need fire event
  14700. if (this.eventService) {
  14701. colIds.forEach(function (colId) {
  14702. var column = _this.columnController.getGridColumn(colId);
  14703. var value = _this.aggData ? _this.aggData[colId] : undefined;
  14704. var oldValue = oldAggData ? oldAggData[colId] : undefined;
  14705. _this.dispatchCellChangedEvent(column, value, oldValue);
  14706. });
  14707. }
  14708. };
  14709. RowNode.prototype.hasChildren = function () {
  14710. // we need to return true when this.group=true, as this is used by server side row model
  14711. // (as children are lazy loaded and stored in a cache anyway). otherwise we return true
  14712. // if children exist.
  14713. return this.group || (this.childrenAfterGroup && this.childrenAfterGroup.length > 0);
  14714. };
  14715. RowNode.prototype.isEmptyRowGroupNode = function () {
  14716. return this.group && _utils__WEBPACK_IMPORTED_MODULE_4__["_"].missingOrEmpty(this.childrenAfterGroup);
  14717. };
  14718. RowNode.prototype.dispatchCellChangedEvent = function (column, newValue, oldValue) {
  14719. var cellChangedEvent = {
  14720. type: RowNode.EVENT_CELL_CHANGED,
  14721. node: this,
  14722. column: column,
  14723. newValue: newValue,
  14724. oldValue: oldValue
  14725. };
  14726. this.dispatchLocalEvent(cellChangedEvent);
  14727. };
  14728. RowNode.prototype.resetQuickFilterAggregateText = function () {
  14729. this.quickFilterAggregateText = null;
  14730. };
  14731. RowNode.prototype.isExpandable = function () {
  14732. return this.hasChildren() || this.master;
  14733. };
  14734. RowNode.prototype.isSelected = function () {
  14735. // for footers, we just return what our sibling selected state is, as cannot select a footer
  14736. if (this.footer) {
  14737. return this.sibling.isSelected();
  14738. }
  14739. return this.selected;
  14740. };
  14741. RowNode.prototype.depthFirstSearch = function (callback) {
  14742. if (this.childrenAfterGroup) {
  14743. this.childrenAfterGroup.forEach(function (child) { return child.depthFirstSearch(callback); });
  14744. }
  14745. callback(this);
  14746. };
  14747. // + rowController.updateGroupsInSelection()
  14748. // + selectionController.calculatedSelectedForAllGroupNodes()
  14749. RowNode.prototype.calculateSelectedFromChildren = function () {
  14750. var atLeastOneSelected = false;
  14751. var atLeastOneDeSelected = false;
  14752. var atLeastOneMixed = false;
  14753. var newSelectedValue;
  14754. if (this.childrenAfterGroup) {
  14755. for (var i = 0; i < this.childrenAfterGroup.length; i++) {
  14756. var child = this.childrenAfterGroup[i];
  14757. // skip non-selectable nodes to prevent inconsistent selection values
  14758. if (!child.selectable) {
  14759. continue;
  14760. }
  14761. var childState = child.isSelected();
  14762. switch (childState) {
  14763. case true:
  14764. atLeastOneSelected = true;
  14765. break;
  14766. case false:
  14767. atLeastOneDeSelected = true;
  14768. break;
  14769. default:
  14770. atLeastOneMixed = true;
  14771. break;
  14772. }
  14773. }
  14774. }
  14775. if (atLeastOneMixed) {
  14776. newSelectedValue = undefined;
  14777. }
  14778. else if (atLeastOneSelected && !atLeastOneDeSelected) {
  14779. newSelectedValue = true;
  14780. }
  14781. else if (!atLeastOneSelected && atLeastOneDeSelected) {
  14782. newSelectedValue = false;
  14783. }
  14784. else {
  14785. newSelectedValue = undefined;
  14786. }
  14787. this.selectThisNode(newSelectedValue);
  14788. };
  14789. RowNode.prototype.setSelectedInitialValue = function (selected) {
  14790. this.selected = selected;
  14791. };
  14792. RowNode.prototype.setSelected = function (newValue, clearSelection, suppressFinishActions) {
  14793. if (clearSelection === void 0) { clearSelection = false; }
  14794. if (suppressFinishActions === void 0) { suppressFinishActions = false; }
  14795. this.setSelectedParams({
  14796. newValue: newValue,
  14797. clearSelection: clearSelection,
  14798. suppressFinishActions: suppressFinishActions,
  14799. rangeSelect: false
  14800. });
  14801. };
  14802. RowNode.prototype.isRowPinned = function () {
  14803. return this.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP || this.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM;
  14804. };
  14805. // to make calling code more readable, this is the same method as setSelected except it takes names parameters
  14806. RowNode.prototype.setSelectedParams = function (params) {
  14807. var groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
  14808. var newValue = params.newValue === true;
  14809. var clearSelection = params.clearSelection === true;
  14810. var suppressFinishActions = params.suppressFinishActions === true;
  14811. var rangeSelect = params.rangeSelect === true;
  14812. // groupSelectsFiltered only makes sense when group selects children
  14813. var groupSelectsFiltered = groupSelectsChildren && (params.groupSelectsFiltered === true);
  14814. if (this.id === undefined) {
  14815. console.warn('ag-Grid: cannot select node until id for node is known');
  14816. return 0;
  14817. }
  14818. if (this.rowPinned) {
  14819. console.warn('ag-Grid: cannot select pinned rows');
  14820. return 0;
  14821. }
  14822. // if we are a footer, we don't do selection, just pass the info
  14823. // to the sibling (the parent of the group)
  14824. if (this.footer) {
  14825. var count = this.sibling.setSelectedParams(params);
  14826. return count;
  14827. }
  14828. if (rangeSelect) {
  14829. var newRowClicked = this.selectionController.getLastSelectedNode() !== this;
  14830. var allowMultiSelect = this.gridOptionsWrapper.isRowSelectionMulti();
  14831. if (newRowClicked && allowMultiSelect) {
  14832. return this.doRowRangeSelection();
  14833. }
  14834. }
  14835. var updatedCount = 0;
  14836. // when groupSelectsFiltered, then this node may end up intermediate despite
  14837. // trying to set it to true / false. this group will be calculated further on
  14838. // down when we call calculatedSelectedForAllGroupNodes(). we need to skip it
  14839. // here, otherwise the updatedCount would include it.
  14840. var skipThisNode = groupSelectsFiltered && this.group;
  14841. if (!skipThisNode) {
  14842. var thisNodeWasSelected = this.selectThisNode(newValue);
  14843. if (thisNodeWasSelected) {
  14844. updatedCount++;
  14845. }
  14846. }
  14847. if (groupSelectsChildren && this.group) {
  14848. updatedCount += this.selectChildNodes(newValue, groupSelectsFiltered);
  14849. }
  14850. // clear other nodes if not doing multi select
  14851. if (!suppressFinishActions) {
  14852. var clearOtherNodes = newValue && (clearSelection || !this.gridOptionsWrapper.isRowSelectionMulti());
  14853. if (clearOtherNodes) {
  14854. updatedCount += this.selectionController.clearOtherNodes(this);
  14855. }
  14856. // only if we selected something, then update groups and fire events
  14857. if (updatedCount > 0) {
  14858. this.selectionController.updateGroupsFromChildrenSelections();
  14859. // this is the very end of the 'action node', so we are finished all the updates,
  14860. // include any parent / child changes that this method caused
  14861. var event_1 = {
  14862. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SELECTION_CHANGED,
  14863. api: this.gridApi,
  14864. columnApi: this.columnApi
  14865. };
  14866. this.mainEventService.dispatchEvent(event_1);
  14867. }
  14868. // so if user next does shift-select, we know where to start the selection from
  14869. if (newValue) {
  14870. this.selectionController.setLastSelectedNode(this);
  14871. }
  14872. }
  14873. return updatedCount;
  14874. };
  14875. // selects all rows between this node and the last selected node (or the top if this is the first selection).
  14876. // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by
  14877. // holding down 'shift'.
  14878. RowNode.prototype.doRowRangeSelection = function () {
  14879. var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
  14880. var lastSelectedNode = this.selectionController.getLastSelectedNode();
  14881. var nodesToSelect = this.rowModel.getNodesInRangeForSelection(this, lastSelectedNode);
  14882. var updatedCount = 0;
  14883. nodesToSelect.forEach(function (rowNode) {
  14884. if (rowNode.group && groupsSelectChildren) {
  14885. return;
  14886. }
  14887. var nodeWasSelected = rowNode.selectThisNode(true);
  14888. if (nodeWasSelected) {
  14889. updatedCount++;
  14890. }
  14891. });
  14892. this.selectionController.updateGroupsFromChildrenSelections();
  14893. var event = {
  14894. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SELECTION_CHANGED,
  14895. api: this.gridApi,
  14896. columnApi: this.columnApi
  14897. };
  14898. this.mainEventService.dispatchEvent(event);
  14899. return updatedCount;
  14900. };
  14901. RowNode.prototype.isParentOfNode = function (potentialParent) {
  14902. var parentNode = this.parent;
  14903. while (parentNode) {
  14904. if (parentNode === potentialParent) {
  14905. return true;
  14906. }
  14907. parentNode = parentNode.parent;
  14908. }
  14909. return false;
  14910. };
  14911. RowNode.prototype.selectThisNode = function (newValue) {
  14912. // we only check selectable when newValue=true (ie selecting) to allow unselecting values,
  14913. // as selectable is dynamic, need a way to unselect rows when selectable becomes false.
  14914. var selectionNotAllowed = !this.selectable && newValue;
  14915. var selectionNotChanged = this.selected === newValue;
  14916. if (selectionNotAllowed || selectionNotChanged) {
  14917. return false;
  14918. }
  14919. this.selected = newValue;
  14920. if (this.eventService) {
  14921. this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));
  14922. }
  14923. var event = this.createGlobalRowEvent(_events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_SELECTED);
  14924. this.mainEventService.dispatchEvent(event);
  14925. return true;
  14926. };
  14927. RowNode.prototype.selectChildNodes = function (newValue, groupSelectsFiltered) {
  14928. var children = groupSelectsFiltered ? this.childrenAfterFilter : this.childrenAfterGroup;
  14929. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].missing(children)) {
  14930. return;
  14931. }
  14932. var updatedCount = 0;
  14933. for (var i = 0; i < children.length; i++) {
  14934. updatedCount += children[i].setSelectedParams({
  14935. newValue: newValue,
  14936. clearSelection: false,
  14937. suppressFinishActions: true,
  14938. groupSelectsFiltered: groupSelectsFiltered
  14939. });
  14940. }
  14941. return updatedCount;
  14942. };
  14943. RowNode.prototype.addEventListener = function (eventType, listener) {
  14944. if (!this.eventService) {
  14945. this.eventService = new _eventService__WEBPACK_IMPORTED_MODULE_0__["EventService"]();
  14946. }
  14947. this.eventService.addEventListener(eventType, listener);
  14948. };
  14949. RowNode.prototype.removeEventListener = function (eventType, listener) {
  14950. this.eventService.removeEventListener(eventType, listener);
  14951. };
  14952. RowNode.prototype.onMouseEnter = function () {
  14953. this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER));
  14954. };
  14955. RowNode.prototype.onMouseLeave = function () {
  14956. this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE));
  14957. };
  14958. RowNode.prototype.getFirstChildOfFirstChild = function (rowGroupColumn) {
  14959. var currentRowNode = this;
  14960. var isCandidate = true;
  14961. var foundFirstChildPath = false;
  14962. var nodeToSwapIn;
  14963. // if we are hiding groups, then if we are the first child, of the first child,
  14964. // all the way up to the column we are interested in, then we show the group cell.
  14965. while (isCandidate && !foundFirstChildPath) {
  14966. var parentRowNode = currentRowNode.parent;
  14967. var firstChild = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(parentRowNode) && currentRowNode.firstChild;
  14968. if (firstChild) {
  14969. if (parentRowNode.rowGroupColumn === rowGroupColumn) {
  14970. foundFirstChildPath = true;
  14971. nodeToSwapIn = parentRowNode;
  14972. }
  14973. }
  14974. else {
  14975. isCandidate = false;
  14976. }
  14977. currentRowNode = parentRowNode;
  14978. }
  14979. return foundFirstChildPath ? nodeToSwapIn : null;
  14980. };
  14981. RowNode.prototype.isFullWidthCell = function () {
  14982. var isFullWidthCellFunc = this.gridOptionsWrapper.getIsFullWidthCellFunc();
  14983. return isFullWidthCellFunc ? isFullWidthCellFunc(this) : false;
  14984. };
  14985. RowNode.ID_PREFIX_ROW_GROUP = 'row-group-';
  14986. RowNode.ID_PREFIX_TOP_PINNED = 't-';
  14987. RowNode.ID_PREFIX_BOTTOM_PINNED = 'b-';
  14988. RowNode.OBJECT_ID_SEQUENCE = 0;
  14989. RowNode.EVENT_ROW_SELECTED = 'rowSelected';
  14990. RowNode.EVENT_DATA_CHANGED = 'dataChanged';
  14991. RowNode.EVENT_CELL_CHANGED = 'cellChanged';
  14992. RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED = 'allChildrenCountChanged';
  14993. RowNode.EVENT_MASTER_CHANGED = 'masterChanged';
  14994. RowNode.EVENT_MOUSE_ENTER = 'mouseEnter';
  14995. RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave';
  14996. RowNode.EVENT_HEIGHT_CHANGED = 'heightChanged';
  14997. RowNode.EVENT_TOP_CHANGED = 'topChanged';
  14998. RowNode.EVENT_FIRST_CHILD_CHANGED = 'firstChildChanged';
  14999. RowNode.EVENT_LAST_CHILD_CHANGED = 'lastChildChanged';
  15000. RowNode.EVENT_CHILD_INDEX_CHANGED = 'childIndexChanged';
  15001. RowNode.EVENT_ROW_INDEX_CHANGED = 'rowIndexChanged';
  15002. RowNode.EVENT_EXPANDED_CHANGED = 'expandedChanged';
  15003. RowNode.EVENT_SELECTABLE_CHANGED = 'selectableChanged';
  15004. RowNode.EVENT_UI_LEVEL_CHANGED = 'uiLevelChanged';
  15005. RowNode.EVENT_HIGHLIGHT_CHANGED = 'rowHighlightChanged';
  15006. RowNode.EVENT_DRAGGING_CHANGED = 'draggingChanged';
  15007. __decorate([
  15008. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('eventService')
  15009. ], RowNode.prototype, "mainEventService", void 0);
  15010. __decorate([
  15011. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  15012. ], RowNode.prototype, "gridOptionsWrapper", void 0);
  15013. __decorate([
  15014. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
  15015. ], RowNode.prototype, "selectionController", void 0);
  15016. __decorate([
  15017. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnController')
  15018. ], RowNode.prototype, "columnController", void 0);
  15019. __decorate([
  15020. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueService')
  15021. ], RowNode.prototype, "valueService", void 0);
  15022. __decorate([
  15023. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
  15024. ], RowNode.prototype, "rowModel", void 0);
  15025. __decorate([
  15026. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('context')
  15027. ], RowNode.prototype, "context", void 0);
  15028. __decorate([
  15029. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueCache')
  15030. ], RowNode.prototype, "valueCache", void 0);
  15031. __decorate([
  15032. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
  15033. ], RowNode.prototype, "columnApi", void 0);
  15034. __decorate([
  15035. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
  15036. ], RowNode.prototype, "gridApi", void 0);
  15037. return RowNode;
  15038. }());
  15039. /***/ }),
  15040. /* 69 */
  15041. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15042. "use strict";
  15043. __webpack_require__.r(__webpack_exports__);
  15044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxSelectionComponent", function() { return CheckboxSelectionComponent; });
  15045. /* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70);
  15046. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  15047. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
  15048. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  15049. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57);
  15050. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(68);
  15051. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
  15052. /**
  15053. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  15054. * @version v23.2.1
  15055. * @link http://www.ag-grid.com/
  15056. * @license MIT
  15057. */
  15058. var __extends = (undefined && undefined.__extends) || (function () {
  15059. var extendStatics = function (d, b) {
  15060. extendStatics = Object.setPrototypeOf ||
  15061. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15062. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15063. return extendStatics(d, b);
  15064. };
  15065. return function (d, b) {
  15066. extendStatics(d, b);
  15067. function __() { this.constructor = d; }
  15068. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15069. };
  15070. })();
  15071. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  15072. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  15073. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  15074. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  15075. return c > 3 && r && Object.defineProperty(target, key, r), r;
  15076. };
  15077. var CheckboxSelectionComponent = /** @class */ (function (_super) {
  15078. __extends(CheckboxSelectionComponent, _super);
  15079. function CheckboxSelectionComponent() {
  15080. return _super.call(this, /* html*/ "\n <div class=\"ag-selection-checkbox\">\n <ag-checkbox role=\"presentation\" ref=\"eCheckbox\"></ag-checkbox>\n </div>") || this;
  15081. }
  15082. CheckboxSelectionComponent.prototype.onDataChanged = function () {
  15083. // when rows are loaded for the second time, this can impact the selection, as a row
  15084. // could be loaded as already selected (if user scrolls down, and then up again).
  15085. this.onSelectionChanged();
  15086. };
  15087. CheckboxSelectionComponent.prototype.onSelectableChanged = function () {
  15088. this.showOrHideSelect();
  15089. };
  15090. CheckboxSelectionComponent.prototype.onSelectionChanged = function () {
  15091. var state = this.rowNode.isSelected();
  15092. this.eCheckbox.setValue(state, true);
  15093. };
  15094. CheckboxSelectionComponent.prototype.onCheckedClicked = function () {
  15095. var groupSelectsFiltered = this.gridOptionsWrapper.isGroupSelectsFiltered();
  15096. var updatedCount = this.rowNode.setSelectedParams({ newValue: false, groupSelectsFiltered: groupSelectsFiltered });
  15097. return updatedCount;
  15098. };
  15099. CheckboxSelectionComponent.prototype.onUncheckedClicked = function (event) {
  15100. var groupSelectsFiltered = this.gridOptionsWrapper.isGroupSelectsFiltered();
  15101. var updatedCount = this.rowNode.setSelectedParams({ newValue: true, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered });
  15102. return updatedCount;
  15103. };
  15104. CheckboxSelectionComponent.prototype.init = function (params) {
  15105. var _this = this;
  15106. this.rowNode = params.rowNode;
  15107. this.column = params.column;
  15108. this.onSelectionChanged();
  15109. // we don't want the row clicked event to fire when selecting the checkbox, otherwise the row
  15110. // would possibly get selected twice
  15111. this.addGuiEventListener('click', function (event) { return _utils__WEBPACK_IMPORTED_MODULE_6__["_"].stopPropagationForAgGrid(event); });
  15112. // likewise we don't want double click on this icon to open a group
  15113. this.addGuiEventListener('dblclick', function (event) { return _utils__WEBPACK_IMPORTED_MODULE_6__["_"].stopPropagationForAgGrid(event); });
  15114. this.addManagedListener(this.eCheckbox, _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_0__["AgCheckbox"].EVENT_CHANGED, function (params) {
  15115. if (params.selected) {
  15116. _this.onUncheckedClicked(params.event || {});
  15117. }
  15118. else {
  15119. _this.onCheckedClicked();
  15120. }
  15121. });
  15122. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_5__["RowNode"].EVENT_ROW_SELECTED, this.onSelectionChanged.bind(this));
  15123. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_5__["RowNode"].EVENT_DATA_CHANGED, this.onDataChanged.bind(this));
  15124. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_5__["RowNode"].EVENT_SELECTABLE_CHANGED, this.onSelectableChanged.bind(this));
  15125. this.isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
  15126. var checkboxVisibleIsDynamic = this.isRowSelectableFunc || this.checkboxCallbackExists();
  15127. if (checkboxVisibleIsDynamic) {
  15128. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelect.bind(this));
  15129. this.showOrHideSelect();
  15130. }
  15131. this.eCheckbox.setInputAriaLabel('Toggle Row Selection');
  15132. };
  15133. CheckboxSelectionComponent.prototype.showOrHideSelect = function () {
  15134. // if the isRowSelectable() is not provided the row node is selectable by default
  15135. var selectable = this.rowNode.selectable;
  15136. // checkboxSelection callback is deemed a legacy solution however we will still consider it's result.
  15137. // If selectable, then also check the colDef callback. if not selectable, this it short circuits - no need
  15138. // to call the colDef callback.
  15139. if (selectable && this.checkboxCallbackExists()) {
  15140. selectable = this.column.isCellCheckboxSelection(this.rowNode);
  15141. }
  15142. // show checkbox if both conditions are true
  15143. this.setDisplayed(selectable);
  15144. };
  15145. CheckboxSelectionComponent.prototype.checkboxCallbackExists = function () {
  15146. // column will be missing if groupUseEntireRow=true
  15147. var colDef = this.column ? this.column.getColDef() : null;
  15148. return colDef && typeof colDef.checkboxSelection === 'function';
  15149. };
  15150. __decorate([
  15151. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  15152. ], CheckboxSelectionComponent.prototype, "gridOptionsWrapper", void 0);
  15153. __decorate([
  15154. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eCheckbox')
  15155. ], CheckboxSelectionComponent.prototype, "eCheckbox", void 0);
  15156. return CheckboxSelectionComponent;
  15157. }(_widgets_component__WEBPACK_IMPORTED_MODULE_2__["Component"]));
  15158. /***/ }),
  15159. /* 70 */
  15160. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15161. "use strict";
  15162. __webpack_require__.r(__webpack_exports__);
  15163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgCheckbox", function() { return AgCheckbox; });
  15164. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  15165. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  15166. /* harmony import */ var _agAbstractInputField__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71);
  15167. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  15168. /**
  15169. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  15170. * @version v23.2.1
  15171. * @link http://www.ag-grid.com/
  15172. * @license MIT
  15173. */
  15174. var __extends = (undefined && undefined.__extends) || (function () {
  15175. var extendStatics = function (d, b) {
  15176. extendStatics = Object.setPrototypeOf ||
  15177. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15178. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15179. return extendStatics(d, b);
  15180. };
  15181. return function (d, b) {
  15182. extendStatics(d, b);
  15183. function __() { this.constructor = d; }
  15184. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15185. };
  15186. })();
  15187. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  15188. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  15189. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  15190. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  15191. return c > 3 && r && Object.defineProperty(target, key, r), r;
  15192. };
  15193. var AgCheckbox = /** @class */ (function (_super) {
  15194. __extends(AgCheckbox, _super);
  15195. function AgCheckbox() {
  15196. var _this = _super.call(this) || this;
  15197. _this.className = 'ag-checkbox';
  15198. _this.displayTag = 'input';
  15199. _this.inputType = 'checkbox';
  15200. _this.labelAlignment = 'right';
  15201. _this.selected = false;
  15202. _this.readOnly = false;
  15203. _this.passive = false;
  15204. _this.setTemplate(_this.TEMPLATE.replace(/%displayField%/g, _this.displayTag));
  15205. return _this;
  15206. }
  15207. AgCheckbox.prototype.addInputListeners = function () {
  15208. this.addManagedListener(this.eInput, 'click', this.onCheckboxClick.bind(this));
  15209. };
  15210. AgCheckbox.prototype.getNextValue = function () {
  15211. return this.selected === undefined ? true : !this.selected;
  15212. };
  15213. AgCheckbox.prototype.setPassive = function (passive) {
  15214. this.passive = passive;
  15215. };
  15216. AgCheckbox.prototype.isReadOnly = function () {
  15217. return this.readOnly;
  15218. };
  15219. AgCheckbox.prototype.setReadOnly = function (readOnly) {
  15220. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.eWrapper, 'ag-disabled', readOnly);
  15221. this.eInput.disabled = readOnly;
  15222. this.readOnly = readOnly;
  15223. };
  15224. AgCheckbox.prototype.setDisabled = function (disabled) {
  15225. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.eWrapper, 'ag-disabled', disabled);
  15226. return _super.prototype.setDisabled.call(this, disabled);
  15227. };
  15228. AgCheckbox.prototype.toggle = function () {
  15229. var nextValue = this.getNextValue();
  15230. if (this.passive) {
  15231. this.dispatchChange(nextValue);
  15232. }
  15233. else {
  15234. this.setValue(nextValue);
  15235. }
  15236. };
  15237. AgCheckbox.prototype.getValue = function () {
  15238. return this.isSelected();
  15239. };
  15240. AgCheckbox.prototype.setValue = function (value, silent) {
  15241. this.refreshSelectedClass(value);
  15242. this.setSelected(value, silent);
  15243. return this;
  15244. };
  15245. AgCheckbox.prototype.setName = function (name) {
  15246. var input = this.getInputElement();
  15247. input.name = name;
  15248. return this;
  15249. };
  15250. AgCheckbox.prototype.isSelected = function () {
  15251. return this.selected;
  15252. };
  15253. AgCheckbox.prototype.setSelected = function (selected, silent) {
  15254. if (this.isSelected() === selected) {
  15255. return;
  15256. }
  15257. this.selected = typeof selected === 'boolean' ? selected : undefined;
  15258. this.eInput.checked = this.selected;
  15259. this.eInput.indeterminate = this.selected === undefined;
  15260. if (!silent) {
  15261. this.dispatchChange(this.selected);
  15262. }
  15263. };
  15264. AgCheckbox.prototype.dispatchChange = function (selected, event) {
  15265. this.dispatchEvent({ type: AgCheckbox.EVENT_CHANGED, selected: selected, event: event });
  15266. var input = this.getInputElement();
  15267. var checkboxChangedEvent = {
  15268. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CHECKBOX_CHANGED,
  15269. id: input.id,
  15270. name: input.name,
  15271. selected: selected
  15272. };
  15273. this.eventService.dispatchEvent(checkboxChangedEvent);
  15274. };
  15275. AgCheckbox.prototype.onCheckboxClick = function (e) {
  15276. this.selected = e.target.checked;
  15277. this.refreshSelectedClass(this.selected);
  15278. this.dispatchChange(this.selected, e);
  15279. };
  15280. AgCheckbox.prototype.refreshSelectedClass = function (value) {
  15281. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.eWrapper, 'ag-checked', value === true);
  15282. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.eWrapper, 'ag-indeterminate', value == null);
  15283. };
  15284. __decorate([
  15285. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  15286. ], AgCheckbox.prototype, "gridOptionsWrapper", void 0);
  15287. return AgCheckbox;
  15288. }(_agAbstractInputField__WEBPACK_IMPORTED_MODULE_2__["AgAbstractInputField"]));
  15289. /***/ }),
  15290. /* 71 */
  15291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15292. "use strict";
  15293. __webpack_require__.r(__webpack_exports__);
  15294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAbstractInputField", function() { return AgAbstractInputField; });
  15295. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  15296. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72);
  15297. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
  15298. /**
  15299. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  15300. * @version v23.2.1
  15301. * @link http://www.ag-grid.com/
  15302. * @license MIT
  15303. */
  15304. var __extends = (undefined && undefined.__extends) || (function () {
  15305. var extendStatics = function (d, b) {
  15306. extendStatics = Object.setPrototypeOf ||
  15307. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15308. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15309. return extendStatics(d, b);
  15310. };
  15311. return function (d, b) {
  15312. extendStatics(d, b);
  15313. function __() { this.constructor = d; }
  15314. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15315. };
  15316. })();
  15317. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  15318. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  15319. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  15320. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  15321. return c > 3 && r && Object.defineProperty(target, key, r), r;
  15322. };
  15323. var AgAbstractInputField = /** @class */ (function (_super) {
  15324. __extends(AgAbstractInputField, _super);
  15325. function AgAbstractInputField() {
  15326. var _this = _super !== null && _super.apply(this, arguments) || this;
  15327. _this.config = {};
  15328. _this.TEMPLATE = "\n <div role=\"presentation\">\n <label ref=\"eLabel\" class=\"ag-input-field-label\"></label>\n <div ref=\"eWrapper\" class=\"ag-wrapper ag-input-wrapper\" role=\"presentation\">\n <%displayField% ref=\"eInput\" class=\"ag-input-field-input\"></%displayField%>\n </div>\n </div>";
  15329. return _this;
  15330. }
  15331. AgAbstractInputField.prototype.postConstruct = function () {
  15332. _super.prototype.postConstruct.call(this);
  15333. this.setInputType();
  15334. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eLabel, this.className + "-label");
  15335. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eWrapper, this.className + "-input-wrapper");
  15336. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.eInput, this.className + "-input");
  15337. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["addCssClass"])(this.getGui(), 'ag-input-field');
  15338. var inputId = this.eInput.id ? this.eInput.id : "ag-input-id-" + this.getCompId();
  15339. this.eLabel.htmlFor = inputId;
  15340. this.eInput.id = inputId;
  15341. var _a = this.config, width = _a.width, value = _a.value;
  15342. if (width != null) {
  15343. this.setWidth(width);
  15344. }
  15345. if (value != null) {
  15346. this.setValue(value);
  15347. }
  15348. this.addInputListeners();
  15349. };
  15350. AgAbstractInputField.prototype.addInputListeners = function () {
  15351. var _this = this;
  15352. this.addManagedListener(this.eInput, 'input', function (e) {
  15353. var value = e.target.value;
  15354. _this.setValue(value);
  15355. });
  15356. };
  15357. AgAbstractInputField.prototype.setInputType = function () {
  15358. if (this.inputType) {
  15359. this.eInput.setAttribute('type', this.inputType);
  15360. }
  15361. };
  15362. AgAbstractInputField.prototype.getInputElement = function () {
  15363. return this.eInput;
  15364. };
  15365. AgAbstractInputField.prototype.setInputWidth = function (width) {
  15366. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setElementWidth"])(this.eWrapper, width);
  15367. return this;
  15368. };
  15369. AgAbstractInputField.prototype.setInputName = function (name) {
  15370. this.getInputElement().setAttribute('name', name);
  15371. return this;
  15372. };
  15373. AgAbstractInputField.prototype.getFocusableElement = function () {
  15374. return this.eInput;
  15375. };
  15376. AgAbstractInputField.prototype.setMaxLength = function (length) {
  15377. var eInput = this.eInput;
  15378. eInput.maxLength = length;
  15379. return this;
  15380. };
  15381. AgAbstractInputField.prototype.setInputPlaceholder = function (placeholder) {
  15382. var eInput = this.eInput;
  15383. var attributeName = 'placeholder';
  15384. if (placeholder) {
  15385. eInput.setAttribute(attributeName, placeholder);
  15386. }
  15387. else {
  15388. eInput.removeAttribute(attributeName);
  15389. }
  15390. return this;
  15391. };
  15392. AgAbstractInputField.prototype.setDisabled = function (disabled) {
  15393. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__["setDisabled"])(this.eInput, disabled);
  15394. return _super.prototype.setDisabled.call(this, disabled);
  15395. };
  15396. AgAbstractInputField.prototype.setInputAriaLabel = function (label) {
  15397. this.eInput.setAttribute('aria-label', label);
  15398. return this;
  15399. };
  15400. __decorate([
  15401. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eLabel')
  15402. ], AgAbstractInputField.prototype, "eLabel", void 0);
  15403. __decorate([
  15404. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eWrapper')
  15405. ], AgAbstractInputField.prototype, "eWrapper", void 0);
  15406. __decorate([
  15407. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eInput')
  15408. ], AgAbstractInputField.prototype, "eInput", void 0);
  15409. return AgAbstractInputField;
  15410. }(_agAbstractField__WEBPACK_IMPORTED_MODULE_1__["AgAbstractField"]));
  15411. /***/ }),
  15412. /* 72 */
  15413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15414. "use strict";
  15415. __webpack_require__.r(__webpack_exports__);
  15416. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAbstractField", function() { return AgAbstractField; });
  15417. /* harmony import */ var _agAbstractLabel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73);
  15418. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
  15419. /**
  15420. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  15421. * @version v23.2.1
  15422. * @link http://www.ag-grid.com/
  15423. * @license MIT
  15424. */
  15425. var __extends = (undefined && undefined.__extends) || (function () {
  15426. var extendStatics = function (d, b) {
  15427. extendStatics = Object.setPrototypeOf ||
  15428. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15429. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15430. return extendStatics(d, b);
  15431. };
  15432. return function (d, b) {
  15433. extendStatics(d, b);
  15434. function __() { this.constructor = d; }
  15435. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15436. };
  15437. })();
  15438. var AgAbstractField = /** @class */ (function (_super) {
  15439. __extends(AgAbstractField, _super);
  15440. function AgAbstractField() {
  15441. var _this = _super !== null && _super.apply(this, arguments) || this;
  15442. _this.disabled = false;
  15443. return _this;
  15444. }
  15445. AgAbstractField.prototype.postConstruct = function () {
  15446. _super.prototype.postConstruct.call(this);
  15447. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addCssClass"])(this.getGui(), this.className);
  15448. };
  15449. AgAbstractField.prototype.onValueChange = function (callbackFn) {
  15450. var _this = this;
  15451. this.addManagedListener(this, AgAbstractField.EVENT_CHANGED, function () { return callbackFn(_this.getValue()); });
  15452. return this;
  15453. };
  15454. AgAbstractField.prototype.getWidth = function () {
  15455. return this.getGui().clientWidth;
  15456. };
  15457. AgAbstractField.prototype.setWidth = function (width) {
  15458. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["setFixedWidth"])(this.getGui(), width);
  15459. return this;
  15460. };
  15461. AgAbstractField.prototype.getValue = function () {
  15462. return this.value;
  15463. };
  15464. AgAbstractField.prototype.setValue = function (value, silent) {
  15465. if (this.value === value) {
  15466. return this;
  15467. }
  15468. this.value = value;
  15469. if (!silent) {
  15470. this.dispatchEvent({ type: AgAbstractField.EVENT_CHANGED });
  15471. }
  15472. return this;
  15473. };
  15474. AgAbstractField.prototype.setDisabled = function (disabled) {
  15475. disabled = !!disabled;
  15476. var element = this.getGui();
  15477. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["setDisabled"])(element, disabled);
  15478. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_1__["addOrRemoveCssClass"])(element, 'ag-disabled', disabled);
  15479. this.disabled = disabled;
  15480. return this;
  15481. };
  15482. AgAbstractField.prototype.isDisabled = function () {
  15483. return !!this.disabled;
  15484. };
  15485. AgAbstractField.EVENT_CHANGED = 'valueChange';
  15486. return AgAbstractField;
  15487. }(_agAbstractLabel__WEBPACK_IMPORTED_MODULE_0__["AgAbstractLabel"]));
  15488. /***/ }),
  15489. /* 73 */
  15490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15491. "use strict";
  15492. __webpack_require__.r(__webpack_exports__);
  15493. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAbstractLabel", function() { return AgAbstractLabel; });
  15494. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  15495. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  15496. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  15497. /**
  15498. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  15499. * @version v23.2.1
  15500. * @link http://www.ag-grid.com/
  15501. * @license MIT
  15502. */
  15503. var __extends = (undefined && undefined.__extends) || (function () {
  15504. var extendStatics = function (d, b) {
  15505. extendStatics = Object.setPrototypeOf ||
  15506. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15507. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15508. return extendStatics(d, b);
  15509. };
  15510. return function (d, b) {
  15511. extendStatics(d, b);
  15512. function __() { this.constructor = d; }
  15513. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15514. };
  15515. })();
  15516. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  15517. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  15518. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  15519. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  15520. return c > 3 && r && Object.defineProperty(target, key, r), r;
  15521. };
  15522. var AgAbstractLabel = /** @class */ (function (_super) {
  15523. __extends(AgAbstractLabel, _super);
  15524. function AgAbstractLabel() {
  15525. var _this = _super !== null && _super.apply(this, arguments) || this;
  15526. _this.labelSeparator = '';
  15527. _this.labelAlignment = 'left';
  15528. _this.config = {};
  15529. _this.label = '';
  15530. return _this;
  15531. }
  15532. AgAbstractLabel.prototype.postConstruct = function () {
  15533. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.getGui(), 'ag-labeled');
  15534. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.eLabel, 'ag-label');
  15535. var _a = this.config, labelSeparator = _a.labelSeparator, label = _a.label, labelWidth = _a.labelWidth, labelAlignment = _a.labelAlignment;
  15536. if (labelSeparator != null) {
  15537. this.setLabelSeparator(labelSeparator);
  15538. }
  15539. if (label != null) {
  15540. this.setLabel(label);
  15541. }
  15542. if (labelWidth != null) {
  15543. this.setLabelWidth(labelWidth);
  15544. }
  15545. this.setLabelAlignment(labelAlignment || this.labelAlignment);
  15546. this.refreshLabel();
  15547. };
  15548. AgAbstractLabel.prototype.refreshLabel = function () {
  15549. this.eLabel.innerText = this.label + this.labelSeparator;
  15550. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(this.eLabel, 'ag-hidden', this.label === '');
  15551. };
  15552. AgAbstractLabel.prototype.setLabelSeparator = function (labelSeparator) {
  15553. if (this.labelSeparator === labelSeparator) {
  15554. return this;
  15555. }
  15556. this.labelSeparator = labelSeparator;
  15557. if (this.label != null) {
  15558. this.refreshLabel();
  15559. }
  15560. return this;
  15561. };
  15562. AgAbstractLabel.prototype.setLabel = function (label) {
  15563. if (this.label === label) {
  15564. return this;
  15565. }
  15566. this.label = label;
  15567. this.refreshLabel();
  15568. return this;
  15569. };
  15570. AgAbstractLabel.prototype.setLabelAlignment = function (alignment) {
  15571. var eGui = this.getGui();
  15572. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(eGui, 'ag-label-align-left', alignment === 'left');
  15573. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(eGui, 'ag-label-align-right', alignment === 'right');
  15574. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(eGui, 'ag-label-align-top', alignment === 'top');
  15575. return this;
  15576. };
  15577. AgAbstractLabel.prototype.setLabelWidth = function (width) {
  15578. if (this.label == null) {
  15579. return this;
  15580. }
  15581. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].setElementWidth(this.eLabel, width);
  15582. return this;
  15583. };
  15584. __decorate([
  15585. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  15586. ], AgAbstractLabel.prototype, "postConstruct", null);
  15587. return AgAbstractLabel;
  15588. }(_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  15589. /***/ }),
  15590. /* 74 */
  15591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15592. "use strict";
  15593. __webpack_require__.r(__webpack_exports__);
  15594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentSource", function() { return ComponentSource; });
  15595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UserComponentFactory", function() { return UserComponentFactory; });
  15596. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  15597. /* harmony import */ var _userComponentRegistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53);
  15598. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  15599. /* harmony import */ var _componentTypes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75);
  15600. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41);
  15601. /* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(16);
  15602. /**
  15603. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  15604. * @version v23.2.1
  15605. * @link http://www.ag-grid.com/
  15606. * @license MIT
  15607. */
  15608. var __extends = (undefined && undefined.__extends) || (function () {
  15609. var extendStatics = function (d, b) {
  15610. extendStatics = Object.setPrototypeOf ||
  15611. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15612. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  15613. return extendStatics(d, b);
  15614. };
  15615. return function (d, b) {
  15616. extendStatics(d, b);
  15617. function __() { this.constructor = d; }
  15618. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15619. };
  15620. })();
  15621. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  15622. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  15623. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  15624. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  15625. return c > 3 && r && Object.defineProperty(target, key, r), r;
  15626. };
  15627. var ComponentSource;
  15628. (function (ComponentSource) {
  15629. ComponentSource[ComponentSource["DEFAULT"] = 0] = "DEFAULT";
  15630. ComponentSource[ComponentSource["REGISTERED_BY_NAME"] = 1] = "REGISTERED_BY_NAME";
  15631. ComponentSource[ComponentSource["HARDCODED"] = 2] = "HARDCODED";
  15632. })(ComponentSource || (ComponentSource = {}));
  15633. var UserComponentFactory = /** @class */ (function (_super) {
  15634. __extends(UserComponentFactory, _super);
  15635. function UserComponentFactory() {
  15636. return _super !== null && _super.apply(this, arguments) || this;
  15637. }
  15638. UserComponentFactory.prototype.newDateComponent = function (params) {
  15639. return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["DateComponent"], 'agDateInput');
  15640. };
  15641. UserComponentFactory.prototype.newHeaderComponent = function (params) {
  15642. return this.createAndInitUserComponent(params.column.getColDef(), params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["HeaderComponent"], 'agColumnHeader');
  15643. };
  15644. UserComponentFactory.prototype.newHeaderGroupComponent = function (params) {
  15645. return this.createAndInitUserComponent(params.columnGroup.getColGroupDef(), params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["HeaderGroupComponent"], 'agColumnGroupHeader');
  15646. };
  15647. UserComponentFactory.prototype.newFullWidthGroupRowInnerCellRenderer = function (params) {
  15648. return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["GroupRowInnerRendererComponent"], null, true);
  15649. };
  15650. // this one is unusual, as it can be LoadingCellRenderer, DetailCellRenderer, FullWidthCellRenderer or GroupRowRenderer.
  15651. // so we have to pass the type in.
  15652. UserComponentFactory.prototype.newFullWidthCellRenderer = function (params, cellRendererType, cellRendererName) {
  15653. return this.createAndInitUserComponent(null, params, {
  15654. propertyName: cellRendererType,
  15655. isCellRenderer: function () { return true; }
  15656. }, cellRendererName);
  15657. };
  15658. UserComponentFactory.prototype.newCellRenderer = function (target, params, isPinned) {
  15659. if (isPinned === void 0) { isPinned = false; }
  15660. return this.createAndInitUserComponent(target, params, isPinned ? _componentTypes__WEBPACK_IMPORTED_MODULE_3__["PinnedRowCellRendererComponent"] : _componentTypes__WEBPACK_IMPORTED_MODULE_3__["CellRendererComponent"], null, true);
  15661. };
  15662. UserComponentFactory.prototype.newCellEditor = function (colDef, params) {
  15663. return this.createAndInitUserComponent(colDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["CellEditorComponent"], 'agCellEditor');
  15664. };
  15665. UserComponentFactory.prototype.newInnerCellRenderer = function (target, params) {
  15666. return this.createAndInitUserComponent(target, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["InnerRendererComponent"], null);
  15667. };
  15668. UserComponentFactory.prototype.newLoadingOverlayComponent = function (params) {
  15669. return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["LoadingOverlayComponent"], 'agLoadingOverlay');
  15670. };
  15671. UserComponentFactory.prototype.newNoRowsOverlayComponent = function (params) {
  15672. return this.createAndInitUserComponent(this.gridOptions, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["NoRowsOverlayComponent"], 'agNoRowsOverlay');
  15673. };
  15674. UserComponentFactory.prototype.newTooltipComponent = function (params) {
  15675. return this.createAndInitUserComponent(params.colDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["TooltipComponent"], 'agTooltipComponent');
  15676. };
  15677. UserComponentFactory.prototype.newFilterComponent = function (colDef, params, defaultFilter, modifyParamsCallback) {
  15678. return this.createAndInitUserComponent(colDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["FilterComponent"], defaultFilter, false, modifyParamsCallback);
  15679. };
  15680. UserComponentFactory.prototype.newSetFilterCellRenderer = function (target, params) {
  15681. return this.createAndInitUserComponent(target, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["CellRendererComponent"], null, true);
  15682. };
  15683. UserComponentFactory.prototype.newFloatingFilterComponent = function (colDef, params, defaultFloatingFilter) {
  15684. return this.createAndInitUserComponent(colDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["FloatingFilterComponent"], defaultFloatingFilter, true);
  15685. };
  15686. UserComponentFactory.prototype.newToolPanelComponent = function (toolPanelDef, params) {
  15687. return this.createAndInitUserComponent(toolPanelDef, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["ToolPanelComponent"]);
  15688. };
  15689. UserComponentFactory.prototype.newStatusPanelComponent = function (def, params) {
  15690. return this.createAndInitUserComponent(def, params, _componentTypes__WEBPACK_IMPORTED_MODULE_3__["StatusPanelComponent"]);
  15691. };
  15692. /**
  15693. * This method creates a component given everything needed to guess what sort of component needs to be instantiated
  15694. * It takes
  15695. * @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions
  15696. * (global) or columnDef mostly.
  15697. * @param paramsFromGrid: Params to be passed to the component and passed by ag-Grid. This will get merged with any params
  15698. * specified by the user in the configuration
  15699. * @param propertyName: The name of the property used in ag-grid as a convention to refer to the component, it can be:
  15700. * 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component
  15701. * @param defaultComponentName: The actual name of the component to instantiate, this is usually the same as propertyName, but in
  15702. * some cases is not, like floatingFilter, if it is the same is not necessary to specify
  15703. * @param optional: Handy method to tell if this should return a component ALWAYS. if that is the case, but there is no
  15704. * component found, it throws an error, by default all components are MANDATORY
  15705. * @param modifyParamsCallback: A chance to customise the params passed to the init method. It receives what the current
  15706. * params are and the component that init is about to get called for
  15707. */
  15708. UserComponentFactory.prototype.createAndInitUserComponent = function (definitionObject, paramsFromGrid, componentType, defaultComponentName,
  15709. // optional items are: FloatingFilter, CellComp (for cellRenderer)
  15710. optional,
  15711. // used by FilterManager only
  15712. modifyParamsCallback) {
  15713. if (optional === void 0) { optional = false; }
  15714. if (!definitionObject) {
  15715. definitionObject = this.gridOptions;
  15716. }
  15717. // Create the component instance
  15718. var componentAndParams = this.createComponentInstance(definitionObject, componentType, paramsFromGrid, defaultComponentName, optional);
  15719. if (!componentAndParams) {
  15720. return null;
  15721. }
  15722. var componentInstance = componentAndParams.componentInstance;
  15723. // Wire the component and call the init method with the correct params
  15724. var params = this.createFinalParams(definitionObject, componentType.propertyName, paramsFromGrid, componentAndParams.paramsFromSelector);
  15725. this.addReactHacks(params);
  15726. // give caller chance to set any params that depend on the componentInstance (need here as the
  15727. // componentInstance was not available when createUserComponent was called)
  15728. var paramsAfterCallback = modifyParamsCallback ? modifyParamsCallback(params, componentInstance) : params;
  15729. var deferredInit = this.initComponent(componentInstance, paramsAfterCallback);
  15730. if (deferredInit == null) {
  15731. return _utils__WEBPACK_IMPORTED_MODULE_2__["Promise"].resolve(componentInstance);
  15732. }
  15733. else {
  15734. return deferredInit.then(function () { return componentInstance; });
  15735. }
  15736. };
  15737. UserComponentFactory.prototype.addReactHacks = function (params) {
  15738. // a temporary fix for AG-1574
  15739. // AG-1715 raised to do a wider ranging refactor to improve this
  15740. var agGridReact = this.context.getBean('agGridReact');
  15741. if (agGridReact) {
  15742. params.agGridReact = Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["cloneObject"])(agGridReact);
  15743. }
  15744. // AG-1716 - directly related to AG-1574 and AG-1715
  15745. var frameworkComponentWrapper = this.context.getBean('frameworkComponentWrapper');
  15746. if (frameworkComponentWrapper) {
  15747. params.frameworkComponentWrapper = frameworkComponentWrapper;
  15748. }
  15749. };
  15750. /**
  15751. * This method creates a component given everything needed to guess what sort of component needs to be instantiated
  15752. * It takes
  15753. * @param clazz: The class to instantiate,
  15754. * @param agGridParams: Params to be passed to the component and passed by ag-Grid. This will get merged with any params
  15755. * specified by the user in the configuration
  15756. * @param modifyParamsCallback: A chance to customise the params passed to the init method. It receives what the current
  15757. * params are and the component that init is about to get called for
  15758. */
  15759. UserComponentFactory.prototype.createUserComponentFromConcreteClass = function (clazz, agGridParams) {
  15760. var internalComponent = new clazz();
  15761. this.initComponent(internalComponent, agGridParams);
  15762. return internalComponent;
  15763. };
  15764. /**
  15765. * This method returns the underlying representation of the component to be created. ie for Javascript the
  15766. * underlying function where we should be calling new into. In case of the frameworks, the framework class
  15767. * object that represents the component to be created.
  15768. *
  15769. * This method is handy for different reasons, for example if you want to check if a component has a particular
  15770. * method implemented without having to create the component, just by inspecting the source component
  15771. *
  15772. * It takes
  15773. * @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions
  15774. * (global) or columnDef mostly.
  15775. * @param propertyName: The name of the property used in ag-grid as a convention to refer to the component, it can be:
  15776. * 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component
  15777. * @param params: Params to be passed to the dynamic component function in case it needs to be
  15778. * invoked
  15779. * @param defaultComponentName: The name of the component to load if there is no component specified
  15780. */
  15781. UserComponentFactory.prototype.lookupComponentClassDef = function (definitionObject, propertyName, params, defaultComponentName) {
  15782. if (params === void 0) { params = null; }
  15783. /**
  15784. * There are five things that can happen when resolving a component.
  15785. * a) HardcodedFwComponent: That holder[propertyName]Framework has associated a Framework native component
  15786. * b) HardcodedJsComponent: That holder[propertyName] has associate a JS component
  15787. * c) hardcodedJsFunction: That holder[propertyName] has associate a JS function
  15788. * d) hardcodedNameComponent: That holder[propertyName] has associate a string that represents a component to load
  15789. * e) That none of the three previous are specified, then we need to use the DefaultRegisteredComponent
  15790. */
  15791. var hardcodedNameComponent = null;
  15792. var HardcodedJsComponent = null;
  15793. var hardcodedJsFunction = null;
  15794. var HardcodedFwComponent = null;
  15795. var componentSelectorFunc;
  15796. if (definitionObject != null) {
  15797. var componentPropertyValue = definitionObject[propertyName];
  15798. // for filters only, we allow 'true' for the component, which means default filter to be used
  15799. var usingDefaultComponent = componentPropertyValue === true;
  15800. if (componentPropertyValue != null && !usingDefaultComponent) {
  15801. if (typeof componentPropertyValue === 'string') {
  15802. hardcodedNameComponent = componentPropertyValue;
  15803. }
  15804. else if (typeof componentPropertyValue === 'boolean') {
  15805. // never happens, as we test for usingDefaultComponent above,
  15806. // however it's needed for the next block to compile
  15807. }
  15808. else if (this.agComponentUtils.doesImplementIComponent(componentPropertyValue)) {
  15809. HardcodedJsComponent = componentPropertyValue;
  15810. }
  15811. else {
  15812. hardcodedJsFunction = componentPropertyValue;
  15813. }
  15814. }
  15815. HardcodedFwComponent = definitionObject[propertyName + "Framework"];
  15816. componentSelectorFunc = definitionObject[propertyName + "Selector"];
  15817. }
  15818. /**
  15819. * Since we allow many types of flavors for specifying the components, let's make sure this is not an illegal
  15820. * combination
  15821. */
  15822. if ((HardcodedJsComponent && HardcodedFwComponent) ||
  15823. (hardcodedNameComponent && HardcodedFwComponent) ||
  15824. (hardcodedJsFunction && HardcodedFwComponent)) {
  15825. throw Error("ag-grid: you are trying to specify: " + propertyName + " twice as a component.");
  15826. }
  15827. if (HardcodedFwComponent && !this.frameworkComponentWrapper) {
  15828. throw Error("ag-grid: you are specifying a framework component but you are not using a framework version of ag-grid for : " + propertyName);
  15829. }
  15830. if (componentSelectorFunc && (hardcodedNameComponent || HardcodedJsComponent || hardcodedJsFunction || HardcodedFwComponent)) {
  15831. throw Error("ag-grid: you can't specify both, the selector and the component of ag-grid for : " + propertyName);
  15832. }
  15833. /**
  15834. * At this stage we are guaranteed to either have,
  15835. * DEPRECATED
  15836. * - A unique HardcodedFwComponent
  15837. * - A unique HardcodedJsComponent
  15838. * - A unique hardcodedJsFunction
  15839. * BY NAME- FAVOURED APPROACH
  15840. * - A unique hardcodedNameComponent
  15841. * - None of the previous, hence we revert to: RegisteredComponent
  15842. */
  15843. if (HardcodedFwComponent) {
  15844. // console.warn(`ag-grid: Since version 12.1.0 specifying a component directly is deprecated, you should register the component by name`);
  15845. // console.warn(`${HardcodedFwComponent}`);
  15846. return {
  15847. componentFromFramework: true,
  15848. component: HardcodedFwComponent,
  15849. source: ComponentSource.HARDCODED,
  15850. paramsFromSelector: null
  15851. };
  15852. }
  15853. if (HardcodedJsComponent) {
  15854. // console.warn(`ag-grid: Since version 12.1.0 specifying a component directly is deprecated, you should register the component by name`);
  15855. // console.warn(`${HardcodedJsComponent}`);
  15856. return {
  15857. componentFromFramework: false,
  15858. component: HardcodedJsComponent,
  15859. source: ComponentSource.HARDCODED,
  15860. paramsFromSelector: null
  15861. };
  15862. }
  15863. if (hardcodedJsFunction) {
  15864. // console.warn(`ag-grid: Since version 12.1.0 specifying a function directly is deprecated, you should register the component by name`);
  15865. // console.warn(`${hardcodedJsFunction}`);
  15866. return this.agComponentUtils.adaptFunction(propertyName, hardcodedJsFunction, false, ComponentSource.HARDCODED);
  15867. }
  15868. var selectorResult = componentSelectorFunc ? componentSelectorFunc(params) : null;
  15869. var componentNameToUse;
  15870. if (selectorResult && selectorResult.component) {
  15871. componentNameToUse = selectorResult.component;
  15872. }
  15873. else if (hardcodedNameComponent) {
  15874. componentNameToUse = hardcodedNameComponent;
  15875. }
  15876. else {
  15877. componentNameToUse = defaultComponentName;
  15878. }
  15879. if (!componentNameToUse) {
  15880. return null;
  15881. }
  15882. var registeredCompClassDef = this.lookupFromRegisteredComponents(propertyName, componentNameToUse);
  15883. if (!registeredCompClassDef) {
  15884. return null;
  15885. }
  15886. return {
  15887. componentFromFramework: registeredCompClassDef.componentFromFramework,
  15888. component: registeredCompClassDef.component,
  15889. source: registeredCompClassDef.source,
  15890. paramsFromSelector: selectorResult ? selectorResult.params : null
  15891. };
  15892. };
  15893. UserComponentFactory.prototype.lookupFromRegisteredComponents = function (propertyName, componentNameOpt) {
  15894. var componentName = componentNameOpt != null ? componentNameOpt : propertyName;
  15895. var registeredComponent = this.userComponentRegistry.retrieve(componentName);
  15896. if (registeredComponent == null) {
  15897. return null;
  15898. }
  15899. //If it is a FW it has to be registered as a component
  15900. if (registeredComponent.componentFromFramework) {
  15901. return {
  15902. component: registeredComponent.component,
  15903. componentFromFramework: true,
  15904. source: ComponentSource.REGISTERED_BY_NAME,
  15905. paramsFromSelector: null
  15906. };
  15907. }
  15908. //If it is JS it may be a function or a component
  15909. if (this.agComponentUtils.doesImplementIComponent(registeredComponent.component)) {
  15910. return {
  15911. component: registeredComponent.component,
  15912. componentFromFramework: false,
  15913. source: (registeredComponent.source == _userComponentRegistry__WEBPACK_IMPORTED_MODULE_1__["RegisteredComponentSource"].REGISTERED) ? ComponentSource.REGISTERED_BY_NAME : ComponentSource.DEFAULT,
  15914. paramsFromSelector: null
  15915. };
  15916. }
  15917. // This is a function
  15918. return this.agComponentUtils.adaptFunction(propertyName, registeredComponent.component, registeredComponent.componentFromFramework, (registeredComponent.source == _userComponentRegistry__WEBPACK_IMPORTED_MODULE_1__["RegisteredComponentSource"].REGISTERED) ? ComponentSource.REGISTERED_BY_NAME : ComponentSource.DEFAULT);
  15919. };
  15920. /**
  15921. * Useful to check what would be the resultant params for a given object
  15922. * @param definitionObject: This is the context for which this component needs to be created, it can be gridOptions
  15923. * (global) or columnDef mostly.
  15924. * @param propertyName: The name of the property used in ag-grid as a convention to refer to the component, it can be:
  15925. * 'floatingFilter', 'cellRenderer', is used to find if the user is specifying a custom component
  15926. * @param paramsFromGrid: Params to be passed to the component and passed by ag-Grid. This will get merged with any params
  15927. * specified by the user in the configuration
  15928. * @returns {TParams} It merges the user agGridParams with the actual params specified by the user.
  15929. */
  15930. UserComponentFactory.prototype.createFinalParams = function (definitionObject, propertyName, paramsFromGrid, paramsFromSelector) {
  15931. if (paramsFromSelector === void 0) { paramsFromSelector = null; }
  15932. var params = {};
  15933. Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, paramsFromGrid);
  15934. var userParams = definitionObject ? definitionObject[propertyName + "Params"] : null;
  15935. if (userParams != null) {
  15936. if (typeof userParams === 'function') {
  15937. Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, userParams(paramsFromGrid));
  15938. }
  15939. else if (typeof userParams === 'object') {
  15940. Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, userParams);
  15941. }
  15942. }
  15943. Object(_utils_object__WEBPACK_IMPORTED_MODULE_5__["mergeDeep"])(params, paramsFromSelector);
  15944. return params;
  15945. };
  15946. UserComponentFactory.prototype.createComponentInstance = function (holder, componentType, paramsForSelector, defaultComponentName, optional) {
  15947. var propertyName = componentType.propertyName;
  15948. var componentToUse = this.lookupComponentClassDef(holder, propertyName, paramsForSelector, defaultComponentName);
  15949. var missing = !componentToUse || !componentToUse.component;
  15950. if (missing) {
  15951. // to help the user, we print out the name they are looking for, rather than the default name.
  15952. // i don't know why the default name was originally printed out (that doesn't help the user)
  15953. var overrideName = holder ? holder[propertyName] : defaultComponentName;
  15954. var nameToReport = overrideName ? overrideName : defaultComponentName;
  15955. if (!optional) {
  15956. console.error("Could not find component " + nameToReport + ", did you forget to configure this component?");
  15957. }
  15958. return null;
  15959. }
  15960. var componentInstance;
  15961. if (componentToUse.componentFromFramework) {
  15962. // Using framework component
  15963. var FrameworkComponentRaw = componentToUse.component;
  15964. var thisComponentConfig = this.componentMetadataProvider.retrieve(propertyName);
  15965. componentInstance = this.frameworkComponentWrapper.wrap(FrameworkComponentRaw, thisComponentConfig.mandatoryMethodList, thisComponentConfig.optionalMethodList, componentType, defaultComponentName);
  15966. }
  15967. else {
  15968. // Using plain JavaScript component
  15969. componentInstance = new componentToUse.component();
  15970. }
  15971. return { componentInstance: componentInstance, paramsFromSelector: componentToUse.paramsFromSelector };
  15972. };
  15973. UserComponentFactory.prototype.initComponent = function (component, params) {
  15974. this.context.createBean(component);
  15975. if (component.init == null) {
  15976. return;
  15977. }
  15978. return component.init(params);
  15979. };
  15980. __decorate([
  15981. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("gridOptions")
  15982. ], UserComponentFactory.prototype, "gridOptions", void 0);
  15983. __decorate([
  15984. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("agComponentUtils")
  15985. ], UserComponentFactory.prototype, "agComponentUtils", void 0);
  15986. __decorate([
  15987. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("componentMetadataProvider")
  15988. ], UserComponentFactory.prototype, "componentMetadataProvider", void 0);
  15989. __decorate([
  15990. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("userComponentRegistry")
  15991. ], UserComponentFactory.prototype, "userComponentRegistry", void 0);
  15992. __decorate([
  15993. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])("frameworkComponentWrapper")
  15994. ], UserComponentFactory.prototype, "frameworkComponentWrapper", void 0);
  15995. UserComponentFactory = __decorate([
  15996. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('userComponentFactory')
  15997. ], UserComponentFactory);
  15998. return UserComponentFactory;
  15999. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_4__["BeanStub"]));
  16000. /***/ }),
  16001. /* 75 */
  16002. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16003. "use strict";
  16004. __webpack_require__.r(__webpack_exports__);
  16005. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateComponent", function() { return DateComponent; });
  16006. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderComponent", function() { return HeaderComponent; });
  16007. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderGroupComponent", function() { return HeaderGroupComponent; });
  16008. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupRowInnerRendererComponent", function() { return GroupRowInnerRendererComponent; });
  16009. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellRendererComponent", function() { return CellRendererComponent; });
  16010. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PinnedRowCellRendererComponent", function() { return PinnedRowCellRendererComponent; });
  16011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellEditorComponent", function() { return CellEditorComponent; });
  16012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerRendererComponent", function() { return InnerRendererComponent; });
  16013. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingOverlayComponent", function() { return LoadingOverlayComponent; });
  16014. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoRowsOverlayComponent", function() { return NoRowsOverlayComponent; });
  16015. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipComponent", function() { return TooltipComponent; });
  16016. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterComponent", function() { return FilterComponent; });
  16017. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterComponent", function() { return FloatingFilterComponent; });
  16018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToolPanelComponent", function() { return ToolPanelComponent; });
  16019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StatusPanelComponent", function() { return StatusPanelComponent; });
  16020. /**
  16021. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16022. * @version v23.2.1
  16023. * @link http://www.ag-grid.com/
  16024. * @license MIT
  16025. */
  16026. var DateComponent = {
  16027. propertyName: 'dateComponent',
  16028. isCellRenderer: function () { return false; }
  16029. };
  16030. var HeaderComponent = {
  16031. propertyName: 'headerComponent',
  16032. isCellRenderer: function () { return false; },
  16033. };
  16034. var HeaderGroupComponent = {
  16035. propertyName: 'headerGroupComponent',
  16036. isCellRenderer: function () { return false; },
  16037. };
  16038. var GroupRowInnerRendererComponent = {
  16039. propertyName: 'groupRowInnerRenderer',
  16040. isCellRenderer: function () { return true; },
  16041. };
  16042. var CellRendererComponent = {
  16043. propertyName: 'cellRenderer',
  16044. isCellRenderer: function () { return true; },
  16045. };
  16046. var PinnedRowCellRendererComponent = {
  16047. propertyName: 'pinnedRowCellRenderer',
  16048. isCellRenderer: function () { return true; },
  16049. };
  16050. var CellEditorComponent = {
  16051. propertyName: 'cellEditor',
  16052. isCellRenderer: function () { return false; },
  16053. };
  16054. var InnerRendererComponent = {
  16055. propertyName: 'innerRenderer',
  16056. isCellRenderer: function () { return true; },
  16057. };
  16058. var LoadingOverlayComponent = {
  16059. propertyName: 'loadingOverlayComponent',
  16060. isCellRenderer: function () { return false; },
  16061. };
  16062. var NoRowsOverlayComponent = {
  16063. propertyName: 'noRowsOverlayComponent',
  16064. isCellRenderer: function () { return false; },
  16065. };
  16066. var TooltipComponent = {
  16067. propertyName: 'tooltipComponent',
  16068. isCellRenderer: function () { return false; },
  16069. };
  16070. var FilterComponent = {
  16071. propertyName: 'filter',
  16072. isCellRenderer: function () { return false; },
  16073. };
  16074. var FloatingFilterComponent = {
  16075. propertyName: 'floatingFilterComponent',
  16076. isCellRenderer: function () { return false; },
  16077. };
  16078. var ToolPanelComponent = {
  16079. propertyName: 'toolPanel',
  16080. isCellRenderer: function () { return false; },
  16081. };
  16082. var StatusPanelComponent = {
  16083. propertyName: 'statusPanel',
  16084. isCellRenderer: function () { return false; },
  16085. };
  16086. /***/ }),
  16087. /* 76 */
  16088. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16089. "use strict";
  16090. __webpack_require__.r(__webpack_exports__);
  16091. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateShowChangeCellRenderer", function() { return AnimateShowChangeCellRenderer; });
  16092. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  16093. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  16094. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  16095. /**
  16096. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16097. * @version v23.2.1
  16098. * @link http://www.ag-grid.com/
  16099. * @license MIT
  16100. */
  16101. var __extends = (undefined && undefined.__extends) || (function () {
  16102. var extendStatics = function (d, b) {
  16103. extendStatics = Object.setPrototypeOf ||
  16104. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16105. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16106. return extendStatics(d, b);
  16107. };
  16108. return function (d, b) {
  16109. extendStatics(d, b);
  16110. function __() { this.constructor = d; }
  16111. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16112. };
  16113. })();
  16114. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16115. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16116. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16117. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16118. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16119. };
  16120. var ARROW_UP = '\u2191';
  16121. var ARROW_DOWN = '\u2193';
  16122. var AnimateShowChangeCellRenderer = /** @class */ (function (_super) {
  16123. __extends(AnimateShowChangeCellRenderer, _super);
  16124. function AnimateShowChangeCellRenderer() {
  16125. var _this = _super.call(this, AnimateShowChangeCellRenderer.TEMPLATE) || this;
  16126. _this.refreshCount = 0;
  16127. return _this;
  16128. }
  16129. AnimateShowChangeCellRenderer.prototype.init = function (params) {
  16130. // this.params = params;
  16131. this.eValue = this.queryForHtmlElement('.ag-value-change-value');
  16132. this.eDelta = this.queryForHtmlElement('.ag-value-change-delta');
  16133. this.refresh(params);
  16134. };
  16135. AnimateShowChangeCellRenderer.prototype.showDelta = function (params, delta) {
  16136. var absDelta = Math.abs(delta);
  16137. var valueFormatted = params.formatValue(absDelta);
  16138. var valueToUse = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(valueFormatted) ? valueFormatted : absDelta;
  16139. var deltaUp = (delta >= 0);
  16140. if (deltaUp) {
  16141. this.eDelta.innerHTML = ARROW_UP + valueToUse;
  16142. }
  16143. else {
  16144. // because negative, use ABS to remove sign
  16145. this.eDelta.innerHTML = ARROW_DOWN + valueToUse;
  16146. }
  16147. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(this.eDelta, 'ag-value-change-delta-up', deltaUp);
  16148. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(this.eDelta, 'ag-value-change-delta-down', !deltaUp);
  16149. };
  16150. AnimateShowChangeCellRenderer.prototype.setTimerToRemoveDelta = function () {
  16151. var _this = this;
  16152. // the refreshCount makes sure that if the value updates again while
  16153. // the below timer is waiting, then the below timer will realise it
  16154. // is not the most recent and will not try to remove the delta value.
  16155. this.refreshCount++;
  16156. var refreshCountCopy = this.refreshCount;
  16157. window.setTimeout(function () {
  16158. if (refreshCountCopy === _this.refreshCount) {
  16159. _this.hideDeltaValue();
  16160. }
  16161. }, 2000);
  16162. };
  16163. AnimateShowChangeCellRenderer.prototype.hideDeltaValue = function () {
  16164. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].removeCssClass(this.eValue, 'ag-value-change-value-highlight');
  16165. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].clearElement(this.eDelta);
  16166. };
  16167. AnimateShowChangeCellRenderer.prototype.refresh = function (params) {
  16168. var value = params.value;
  16169. if (value === this.lastValue) {
  16170. return;
  16171. }
  16172. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(params.valueFormatted)) {
  16173. this.eValue.innerHTML = params.valueFormatted;
  16174. }
  16175. else if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(params.value)) {
  16176. this.eValue.innerHTML = value;
  16177. }
  16178. else {
  16179. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].clearElement(this.eValue);
  16180. }
  16181. // we don't show the delta if we are in the middle of a filter. see comment on FilterManager
  16182. // with regards processingFilterChange
  16183. if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) {
  16184. return;
  16185. }
  16186. if (typeof value === 'number' && typeof this.lastValue === 'number') {
  16187. var delta = value - this.lastValue;
  16188. this.showDelta(params, delta);
  16189. }
  16190. // highlight the current value, but only if it's not new, otherwise it
  16191. // would get highlighted first time the value is shown
  16192. if (this.lastValue) {
  16193. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.eValue, 'ag-value-change-value-highlight');
  16194. }
  16195. this.setTimerToRemoveDelta();
  16196. this.lastValue = value;
  16197. return true;
  16198. };
  16199. AnimateShowChangeCellRenderer.TEMPLATE = '<span>' +
  16200. '<span class="ag-value-change-delta"></span>' +
  16201. '<span class="ag-value-change-value"></span>' +
  16202. '</span>';
  16203. __decorate([
  16204. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  16205. ], AnimateShowChangeCellRenderer.prototype, "filterManager", void 0);
  16206. return AnimateShowChangeCellRenderer;
  16207. }(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  16208. /***/ }),
  16209. /* 77 */
  16210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16211. "use strict";
  16212. __webpack_require__.r(__webpack_exports__);
  16213. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateSlideCellRenderer", function() { return AnimateSlideCellRenderer; });
  16214. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  16215. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  16216. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  16217. /**
  16218. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16219. * @version v23.2.1
  16220. * @link http://www.ag-grid.com/
  16221. * @license MIT
  16222. */
  16223. var __extends = (undefined && undefined.__extends) || (function () {
  16224. var extendStatics = function (d, b) {
  16225. extendStatics = Object.setPrototypeOf ||
  16226. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16227. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16228. return extendStatics(d, b);
  16229. };
  16230. return function (d, b) {
  16231. extendStatics(d, b);
  16232. function __() { this.constructor = d; }
  16233. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16234. };
  16235. })();
  16236. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16237. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16238. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16239. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16240. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16241. };
  16242. var AnimateSlideCellRenderer = /** @class */ (function (_super) {
  16243. __extends(AnimateSlideCellRenderer, _super);
  16244. function AnimateSlideCellRenderer() {
  16245. var _this = _super.call(this, AnimateSlideCellRenderer.TEMPLATE) || this;
  16246. _this.refreshCount = 0;
  16247. _this.eCurrent = _this.queryForHtmlElement('.ag-value-slide-current');
  16248. return _this;
  16249. }
  16250. AnimateSlideCellRenderer.prototype.init = function (params) {
  16251. this.params = params;
  16252. this.refresh(params);
  16253. };
  16254. AnimateSlideCellRenderer.prototype.addSlideAnimation = function () {
  16255. var _this = this;
  16256. this.refreshCount++;
  16257. // below we keep checking this, and stop working on the animation
  16258. // if it no longer matches - this means another animation has started
  16259. // and this one is stale.
  16260. var refreshCountCopy = this.refreshCount;
  16261. // if old animation, remove it
  16262. if (this.ePrevious) {
  16263. this.getGui().removeChild(this.ePrevious);
  16264. }
  16265. this.ePrevious = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].loadTemplate('<span class="ag-value-slide-previous ag-value-slide-out"></span>');
  16266. this.ePrevious.innerHTML = this.eCurrent.innerHTML;
  16267. this.getGui().insertBefore(this.ePrevious, this.eCurrent);
  16268. // having timeout of 0 allows use to skip to the next css turn,
  16269. // so we know the previous css classes have been applied. so the
  16270. // complex set of setTimeout below creates the animation
  16271. window.setTimeout(function () {
  16272. if (refreshCountCopy !== _this.refreshCount) {
  16273. return;
  16274. }
  16275. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(_this.ePrevious, 'ag-value-slide-out-end');
  16276. }, 50);
  16277. window.setTimeout(function () {
  16278. if (refreshCountCopy !== _this.refreshCount) {
  16279. return;
  16280. }
  16281. _this.getGui().removeChild(_this.ePrevious);
  16282. _this.ePrevious = null;
  16283. }, 3000);
  16284. };
  16285. AnimateSlideCellRenderer.prototype.refresh = function (params) {
  16286. var value = params.value;
  16287. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].missing(value)) {
  16288. value = '';
  16289. }
  16290. if (value === this.lastValue) {
  16291. return;
  16292. }
  16293. // we don't show the delta if we are in the middle of a filter. see comment on FilterManager
  16294. // with regards processingFilterChange
  16295. if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) {
  16296. return;
  16297. }
  16298. this.addSlideAnimation();
  16299. this.lastValue = value;
  16300. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(params.valueFormatted)) {
  16301. this.eCurrent.innerHTML = params.valueFormatted;
  16302. }
  16303. else if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(params.value)) {
  16304. this.eCurrent.innerHTML = value;
  16305. }
  16306. else {
  16307. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].clearElement(this.eCurrent);
  16308. }
  16309. return true;
  16310. };
  16311. AnimateSlideCellRenderer.TEMPLATE = '<span>' +
  16312. '<span class="ag-value-slide-current"></span>' +
  16313. '</span>';
  16314. __decorate([
  16315. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  16316. ], AnimateSlideCellRenderer.prototype, "filterManager", void 0);
  16317. return AnimateSlideCellRenderer;
  16318. }(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  16319. /***/ }),
  16320. /* 78 */
  16321. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16322. "use strict";
  16323. __webpack_require__.r(__webpack_exports__);
  16324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingCellRenderer", function() { return LoadingCellRenderer; });
  16325. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  16326. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  16327. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  16328. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  16329. /**
  16330. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16331. * @version v23.2.1
  16332. * @link http://www.ag-grid.com/
  16333. * @license MIT
  16334. */
  16335. var __extends = (undefined && undefined.__extends) || (function () {
  16336. var extendStatics = function (d, b) {
  16337. extendStatics = Object.setPrototypeOf ||
  16338. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16339. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16340. return extendStatics(d, b);
  16341. };
  16342. return function (d, b) {
  16343. extendStatics(d, b);
  16344. function __() { this.constructor = d; }
  16345. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16346. };
  16347. })();
  16348. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16349. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16350. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16351. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16352. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16353. };
  16354. var LoadingCellRenderer = /** @class */ (function (_super) {
  16355. __extends(LoadingCellRenderer, _super);
  16356. function LoadingCellRenderer() {
  16357. return _super.call(this, LoadingCellRenderer.TEMPLATE) || this;
  16358. }
  16359. LoadingCellRenderer.prototype.init = function (params) {
  16360. var eLoadingIcon = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].createIconNoSpan('groupLoading', this.gridOptionsWrapper, null);
  16361. this.eLoadingIcon.appendChild(eLoadingIcon);
  16362. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  16363. this.eLoadingText.innerText = localeTextFunc('loadingOoo', 'Loading');
  16364. };
  16365. LoadingCellRenderer.prototype.refresh = function (params) {
  16366. return false;
  16367. };
  16368. LoadingCellRenderer.TEMPLATE = "<div class=\"ag-loading\">\n <span class=\"ag-loading-icon\" ref=\"eLoadingIcon\"></span>\n <span class=\"ag-loading-text\" ref=\"eLoadingText\"></span>\n </div>";
  16369. __decorate([
  16370. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  16371. ], LoadingCellRenderer.prototype, "gridOptionsWrapper", void 0);
  16372. __decorate([
  16373. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eLoadingIcon')
  16374. ], LoadingCellRenderer.prototype, "eLoadingIcon", void 0);
  16375. __decorate([
  16376. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eLoadingText')
  16377. ], LoadingCellRenderer.prototype, "eLoadingText", void 0);
  16378. return LoadingCellRenderer;
  16379. }(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  16380. /***/ }),
  16381. /* 79 */
  16382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16383. "use strict";
  16384. __webpack_require__.r(__webpack_exports__);
  16385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectCellEditor", function() { return SelectCellEditor; });
  16386. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  16387. /* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
  16388. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  16389. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  16390. /**
  16391. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16392. * @version v23.2.1
  16393. * @link http://www.ag-grid.com/
  16394. * @license MIT
  16395. */
  16396. var __extends = (undefined && undefined.__extends) || (function () {
  16397. var extendStatics = function (d, b) {
  16398. extendStatics = Object.setPrototypeOf ||
  16399. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16400. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16401. return extendStatics(d, b);
  16402. };
  16403. return function (d, b) {
  16404. extendStatics(d, b);
  16405. function __() { this.constructor = d; }
  16406. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16407. };
  16408. })();
  16409. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16410. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16411. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16412. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16413. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16414. };
  16415. var SelectCellEditor = /** @class */ (function (_super) {
  16416. __extends(SelectCellEditor, _super);
  16417. function SelectCellEditor() {
  16418. return _super.call(this, '<div class="ag-cell-edit-wrapper"><ag-select class="ag-cell-editor" ref="eSelect"></ag-select></div>') || this;
  16419. }
  16420. SelectCellEditor.prototype.init = function (params) {
  16421. var _this = this;
  16422. this.focusAfterAttached = params.cellStartedEdit;
  16423. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].missing(params.values)) {
  16424. console.warn('ag-Grid: no values found for select cellEditor');
  16425. return;
  16426. }
  16427. params.values.forEach(function (value) {
  16428. var option = { value: value };
  16429. var valueFormatted = _this.valueFormatterService.formatValue(params.column, null, null, value);
  16430. var valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;
  16431. option.text = valueFormattedExits ? valueFormatted : value;
  16432. _this.eSelect.addOption(option);
  16433. });
  16434. this.eSelect.setValue(params.value, true);
  16435. // we don't want to add this if full row editing, otherwise selecting will stop the
  16436. // full row editing.
  16437. if (!this.gridOptionsWrapper.isFullRowEdit()) {
  16438. this.eSelect.onValueChange(function () { return params.stopEditing(); });
  16439. }
  16440. };
  16441. SelectCellEditor.prototype.afterGuiAttached = function () {
  16442. if (this.focusAfterAttached) {
  16443. this.eSelect.getFocusableElement().focus();
  16444. }
  16445. };
  16446. SelectCellEditor.prototype.focusIn = function () {
  16447. this.eSelect.getFocusableElement().focus();
  16448. };
  16449. SelectCellEditor.prototype.getValue = function () {
  16450. return this.eSelect.getValue();
  16451. };
  16452. SelectCellEditor.prototype.isPopup = function () {
  16453. return false;
  16454. };
  16455. __decorate([
  16456. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  16457. ], SelectCellEditor.prototype, "gridOptionsWrapper", void 0);
  16458. __decorate([
  16459. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueFormatterService')
  16460. ], SelectCellEditor.prototype, "valueFormatterService", void 0);
  16461. __decorate([
  16462. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eSelect')
  16463. ], SelectCellEditor.prototype, "eSelect", void 0);
  16464. return SelectCellEditor;
  16465. }(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__["PopupComponent"]));
  16466. /***/ }),
  16467. /* 80 */
  16468. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16469. "use strict";
  16470. __webpack_require__.r(__webpack_exports__);
  16471. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupTextCellEditor", function() { return PopupTextCellEditor; });
  16472. /* harmony import */ var _textCellEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
  16473. /**
  16474. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16475. * @version v23.2.1
  16476. * @link http://www.ag-grid.com/
  16477. * @license MIT
  16478. */
  16479. var __extends = (undefined && undefined.__extends) || (function () {
  16480. var extendStatics = function (d, b) {
  16481. extendStatics = Object.setPrototypeOf ||
  16482. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16483. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16484. return extendStatics(d, b);
  16485. };
  16486. return function (d, b) {
  16487. extendStatics(d, b);
  16488. function __() { this.constructor = d; }
  16489. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16490. };
  16491. })();
  16492. var PopupTextCellEditor = /** @class */ (function (_super) {
  16493. __extends(PopupTextCellEditor, _super);
  16494. function PopupTextCellEditor() {
  16495. return _super !== null && _super.apply(this, arguments) || this;
  16496. }
  16497. PopupTextCellEditor.prototype.isPopup = function () {
  16498. return true;
  16499. };
  16500. return PopupTextCellEditor;
  16501. }(_textCellEditor__WEBPACK_IMPORTED_MODULE_0__["TextCellEditor"]));
  16502. /***/ }),
  16503. /* 81 */
  16504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16505. "use strict";
  16506. __webpack_require__.r(__webpack_exports__);
  16507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupSelectCellEditor", function() { return PopupSelectCellEditor; });
  16508. /* harmony import */ var _selectCellEditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79);
  16509. /**
  16510. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16511. * @version v23.2.1
  16512. * @link http://www.ag-grid.com/
  16513. * @license MIT
  16514. */
  16515. var __extends = (undefined && undefined.__extends) || (function () {
  16516. var extendStatics = function (d, b) {
  16517. extendStatics = Object.setPrototypeOf ||
  16518. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16519. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16520. return extendStatics(d, b);
  16521. };
  16522. return function (d, b) {
  16523. extendStatics(d, b);
  16524. function __() { this.constructor = d; }
  16525. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16526. };
  16527. })();
  16528. var PopupSelectCellEditor = /** @class */ (function (_super) {
  16529. __extends(PopupSelectCellEditor, _super);
  16530. function PopupSelectCellEditor() {
  16531. return _super !== null && _super.apply(this, arguments) || this;
  16532. }
  16533. PopupSelectCellEditor.prototype.isPopup = function () {
  16534. return true;
  16535. };
  16536. return PopupSelectCellEditor;
  16537. }(_selectCellEditor__WEBPACK_IMPORTED_MODULE_0__["SelectCellEditor"]));
  16538. /***/ }),
  16539. /* 82 */
  16540. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16541. "use strict";
  16542. __webpack_require__.r(__webpack_exports__);
  16543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LargeTextCellEditor", function() { return LargeTextCellEditor; });
  16544. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
  16545. /* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
  16546. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  16547. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  16548. /**
  16549. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16550. * @version v23.2.1
  16551. * @link http://www.ag-grid.com/
  16552. * @license MIT
  16553. */
  16554. var __extends = (undefined && undefined.__extends) || (function () {
  16555. var extendStatics = function (d, b) {
  16556. extendStatics = Object.setPrototypeOf ||
  16557. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16558. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16559. return extendStatics(d, b);
  16560. };
  16561. return function (d, b) {
  16562. extendStatics(d, b);
  16563. function __() { this.constructor = d; }
  16564. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16565. };
  16566. })();
  16567. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16568. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16569. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16570. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16571. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16572. };
  16573. var LargeTextCellEditor = /** @class */ (function (_super) {
  16574. __extends(LargeTextCellEditor, _super);
  16575. function LargeTextCellEditor() {
  16576. return _super.call(this, LargeTextCellEditor.TEMPLATE) || this;
  16577. }
  16578. LargeTextCellEditor.prototype.init = function (params) {
  16579. this.params = params;
  16580. this.focusAfterAttached = params.cellStartedEdit;
  16581. this.eTextArea
  16582. .setMaxLength(params.maxLength || 200)
  16583. .setCols(params.cols || 60)
  16584. .setRows(params.rows || 10);
  16585. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(params.value)) {
  16586. this.eTextArea.setValue(params.value.toString(), true);
  16587. }
  16588. this.addGuiEventListener('keydown', this.onKeyDown.bind(this));
  16589. };
  16590. LargeTextCellEditor.prototype.onKeyDown = function (event) {
  16591. var key = event.which || event.keyCode;
  16592. if (key == _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_LEFT ||
  16593. key == _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_UP ||
  16594. key == _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_RIGHT ||
  16595. key == _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_DOWN ||
  16596. (event.shiftKey && key == _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_ENTER)) { // shift+enter allows for newlines
  16597. event.stopPropagation();
  16598. }
  16599. };
  16600. LargeTextCellEditor.prototype.afterGuiAttached = function () {
  16601. if (this.focusAfterAttached) {
  16602. this.eTextArea.getFocusableElement().focus();
  16603. }
  16604. };
  16605. LargeTextCellEditor.prototype.getValue = function () {
  16606. return this.params.parseValue(this.eTextArea.getValue());
  16607. };
  16608. LargeTextCellEditor.TEMPLATE = "<div class=\"ag-large-text\" tabindex=\"0\">\n <ag-input-text-area ref=\"eTextArea\" class=\"ag-large-text-input\"></ag-input-text-area>\n </div>";
  16609. __decorate([
  16610. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])("eTextArea")
  16611. ], LargeTextCellEditor.prototype, "eTextArea", void 0);
  16612. return LargeTextCellEditor;
  16613. }(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_1__["PopupComponent"]));
  16614. /***/ }),
  16615. /* 83 */
  16616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16617. "use strict";
  16618. __webpack_require__.r(__webpack_exports__);
  16619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFilter", function() { return NumberFilter; });
  16620. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  16621. /* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60);
  16622. /* harmony import */ var _scalarFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63);
  16623. /* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
  16624. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12);
  16625. /**
  16626. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16627. * @version v23.2.1
  16628. * @link http://www.ag-grid.com/
  16629. * @license MIT
  16630. */
  16631. var __extends = (undefined && undefined.__extends) || (function () {
  16632. var extendStatics = function (d, b) {
  16633. extendStatics = Object.setPrototypeOf ||
  16634. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16635. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16636. return extendStatics(d, b);
  16637. };
  16638. return function (d, b) {
  16639. extendStatics(d, b);
  16640. function __() { this.constructor = d; }
  16641. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16642. };
  16643. })();
  16644. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16645. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16646. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16647. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16648. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16649. };
  16650. var NumberFilter = /** @class */ (function (_super) {
  16651. __extends(NumberFilter, _super);
  16652. function NumberFilter() {
  16653. return _super !== null && _super.apply(this, arguments) || this;
  16654. }
  16655. NumberFilter.prototype.mapRangeFromModel = function (filterModel) {
  16656. return {
  16657. from: filterModel.filter,
  16658. to: filterModel.filterTo
  16659. };
  16660. };
  16661. NumberFilter.prototype.getDefaultDebounceMs = function () {
  16662. return 500;
  16663. };
  16664. NumberFilter.prototype.resetUiToDefaults = function (silent) {
  16665. var _this = this;
  16666. return _super.prototype.resetUiToDefaults.call(this, silent).then(function () {
  16667. var fields = [_this.eValueFrom1, _this.eValueFrom2, _this.eValueTo1, _this.eValueTo2];
  16668. fields.forEach(function (field) { return field.setValue(null, silent); });
  16669. _this.resetPlaceholder();
  16670. });
  16671. };
  16672. NumberFilter.prototype.setConditionIntoUi = function (model, position) {
  16673. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  16674. var eValueFrom = positionOne ? this.eValueFrom1 : this.eValueFrom2;
  16675. var eValueTo = positionOne ? this.eValueTo1 : this.eValueTo2;
  16676. eValueFrom.setValue(model ? ('' + model.filter) : null);
  16677. eValueTo.setValue(model ? ('' + model.filterTo) : null);
  16678. };
  16679. NumberFilter.prototype.setValueFromFloatingFilter = function (value) {
  16680. this.eValueFrom1.setValue(value);
  16681. this.eValueFrom2.setValue(null);
  16682. this.eValueTo1.setValue(null);
  16683. this.eValueTo2.setValue(null);
  16684. };
  16685. NumberFilter.prototype.comparator = function () {
  16686. return function (left, right) {
  16687. if (left === right) {
  16688. return 0;
  16689. }
  16690. if (left < right) {
  16691. return 1;
  16692. }
  16693. return -1;
  16694. };
  16695. };
  16696. NumberFilter.prototype.setParams = function (params) {
  16697. _super.prototype.setParams.call(this, params);
  16698. this.addValueChangedListeners();
  16699. };
  16700. NumberFilter.prototype.addValueChangedListeners = function () {
  16701. var _this = this;
  16702. var listener = function () { return _this.onUiChanged(); };
  16703. this.eValueFrom1.onValueChange(listener);
  16704. this.eValueFrom2.onValueChange(listener);
  16705. this.eValueTo1.onValueChange(listener);
  16706. this.eValueTo2.onValueChange(listener);
  16707. };
  16708. NumberFilter.prototype.resetPlaceholder = function () {
  16709. var isRange1 = this.getCondition1Type() === _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].IN_RANGE;
  16710. var isRange2 = this.getCondition2Type() === _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].IN_RANGE;
  16711. this.eValueFrom1.setInputPlaceholder(this.translate(isRange1 ? 'inRangeStart' : 'filterOoo'));
  16712. this.eValueTo1.setInputPlaceholder(this.translate(isRange1 ? 'inRangeEnd' : 'filterOoo'));
  16713. this.eValueFrom2.setInputPlaceholder(this.translate(isRange2 ? 'inRangeStart' : 'filterOoo'));
  16714. this.eValueTo2.setInputPlaceholder(this.translate(isRange2 ? 'inRangeEnd' : 'filterOoo'));
  16715. };
  16716. NumberFilter.prototype.afterGuiAttached = function (params) {
  16717. _super.prototype.afterGuiAttached.call(this, params);
  16718. this.resetPlaceholder();
  16719. this.eValueFrom1.getInputElement().focus();
  16720. };
  16721. NumberFilter.prototype.getDefaultFilterOptions = function () {
  16722. return NumberFilter.DEFAULT_FILTER_OPTIONS;
  16723. };
  16724. NumberFilter.prototype.createValueTemplate = function (position) {
  16725. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  16726. var pos = positionOne ? '1' : '2';
  16727. return "<div class=\"ag-filter-body\" ref=\"eCondition" + pos + "Body\" role=\"presentation\">\n <ag-input-number-field class=\"ag-filter-from ag-filter-filter\" ref=\"eValueFrom" + pos + "\"></ag-input-number-field>\n <ag-input-number-field class=\"ag-filter-to ag-filter-filter\" ref=\"eValueTo" + pos + "\"></ag-input-number-field>\n </div>";
  16728. };
  16729. NumberFilter.prototype.isConditionUiComplete = function (position) {
  16730. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  16731. var option = positionOne ? this.getCondition1Type() : this.getCondition2Type();
  16732. var eValue = positionOne ? this.eValueFrom1 : this.eValueFrom2;
  16733. var eValueTo = positionOne ? this.eValueTo1 : this.eValueTo2;
  16734. var value = this.stringToFloat(eValue.getValue());
  16735. var valueTo = this.stringToFloat(eValueTo.getValue());
  16736. if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EMPTY) {
  16737. return false;
  16738. }
  16739. if (this.doesFilterHaveHiddenInput(option)) {
  16740. return true;
  16741. }
  16742. if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].IN_RANGE) {
  16743. return value != null && valueTo != null;
  16744. }
  16745. return value != null;
  16746. };
  16747. NumberFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {
  16748. return aSimple.filter === bSimple.filter
  16749. && aSimple.filterTo === bSimple.filterTo
  16750. && aSimple.type === bSimple.type;
  16751. };
  16752. // needed for creating filter model
  16753. NumberFilter.prototype.getFilterType = function () {
  16754. return NumberFilter.FILTER_TYPE;
  16755. };
  16756. NumberFilter.prototype.stringToFloat = function (value) {
  16757. if (typeof value === 'number') {
  16758. return value;
  16759. }
  16760. var filterText = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_3__["makeNull"])(value);
  16761. if (filterText && filterText.trim() === '') {
  16762. filterText = null;
  16763. }
  16764. var newFilter;
  16765. if (filterText !== null && filterText !== undefined) {
  16766. newFilter = parseFloat(filterText);
  16767. }
  16768. else {
  16769. newFilter = null;
  16770. }
  16771. return newFilter;
  16772. };
  16773. NumberFilter.prototype.createCondition = function (position) {
  16774. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  16775. var type = positionOne ? this.getCondition1Type() : this.getCondition2Type();
  16776. var eValue = positionOne ? this.eValueFrom1 : this.eValueFrom2;
  16777. var value = this.stringToFloat(eValue.getValue());
  16778. var eValueTo = positionOne ? this.eValueTo1 : this.eValueTo2;
  16779. var valueTo = this.stringToFloat(eValueTo.getValue());
  16780. var model = {
  16781. filterType: NumberFilter.FILTER_TYPE,
  16782. type: type
  16783. };
  16784. if (!this.doesFilterHaveHiddenInput(type)) {
  16785. model.filter = value;
  16786. model.filterTo = valueTo; // FIX - should only populate this when filter choice has 'to' option
  16787. }
  16788. return model;
  16789. };
  16790. NumberFilter.prototype.updateUiVisibility = function () {
  16791. _super.prototype.updateUiVisibility.call(this);
  16792. this.resetPlaceholder();
  16793. var showFrom1 = this.showValueFrom(this.getCondition1Type());
  16794. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueFrom1.getGui(), showFrom1);
  16795. var showTo1 = this.showValueTo(this.getCondition1Type());
  16796. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueTo1.getGui(), showTo1);
  16797. var showFrom2 = this.showValueFrom(this.getCondition2Type());
  16798. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueFrom2.getGui(), showFrom2);
  16799. var showTo2 = this.showValueTo(this.getCondition2Type());
  16800. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_4__["setDisplayed"])(this.eValueTo2.getGui(), showTo2);
  16801. };
  16802. NumberFilter.FILTER_TYPE = 'number';
  16803. NumberFilter.DEFAULT_FILTER_OPTIONS = [
  16804. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].EQUALS,
  16805. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].NOT_EQUAL,
  16806. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].LESS_THAN,
  16807. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].LESS_THAN_OR_EQUAL,
  16808. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].GREATER_THAN,
  16809. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].GREATER_THAN_OR_EQUAL,
  16810. _scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"].IN_RANGE
  16811. ];
  16812. __decorate([
  16813. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueFrom1')
  16814. ], NumberFilter.prototype, "eValueFrom1", void 0);
  16815. __decorate([
  16816. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueFrom2')
  16817. ], NumberFilter.prototype, "eValueFrom2", void 0);
  16818. __decorate([
  16819. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueTo1')
  16820. ], NumberFilter.prototype, "eValueTo1", void 0);
  16821. __decorate([
  16822. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValueTo2')
  16823. ], NumberFilter.prototype, "eValueTo2", void 0);
  16824. return NumberFilter;
  16825. }(_scalarFilter__WEBPACK_IMPORTED_MODULE_2__["ScalarFilter"]));
  16826. /***/ }),
  16827. /* 84 */
  16828. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16829. "use strict";
  16830. __webpack_require__.r(__webpack_exports__);
  16831. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoadingOverlayComponent", function() { return LoadingOverlayComponent; });
  16832. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  16833. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  16834. /**
  16835. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16836. * @version v23.2.1
  16837. * @link http://www.ag-grid.com/
  16838. * @license MIT
  16839. */
  16840. var __extends = (undefined && undefined.__extends) || (function () {
  16841. var extendStatics = function (d, b) {
  16842. extendStatics = Object.setPrototypeOf ||
  16843. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16844. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16845. return extendStatics(d, b);
  16846. };
  16847. return function (d, b) {
  16848. extendStatics(d, b);
  16849. function __() { this.constructor = d; }
  16850. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16851. };
  16852. })();
  16853. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16854. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16855. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16856. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16857. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16858. };
  16859. var LoadingOverlayComponent = /** @class */ (function (_super) {
  16860. __extends(LoadingOverlayComponent, _super);
  16861. function LoadingOverlayComponent() {
  16862. return _super.call(this) || this;
  16863. }
  16864. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  16865. // so we need to override destroy() just to make the method public.
  16866. LoadingOverlayComponent.prototype.destroy = function () {
  16867. _super.prototype.destroy.call(this);
  16868. };
  16869. LoadingOverlayComponent.prototype.init = function (params) {
  16870. var template = this.gridOptionsWrapper.getOverlayLoadingTemplate() ?
  16871. this.gridOptionsWrapper.getOverlayLoadingTemplate() : LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE;
  16872. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  16873. var localisedTemplate = template.replace('[LOADING...]', localeTextFunc('loadingOoo', 'Loading...'));
  16874. this.setTemplate(localisedTemplate);
  16875. };
  16876. LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE = '<span class="ag-overlay-loading-center">[LOADING...]</span>';
  16877. __decorate([
  16878. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  16879. ], LoadingOverlayComponent.prototype, "gridOptionsWrapper", void 0);
  16880. return LoadingOverlayComponent;
  16881. }(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  16882. /***/ }),
  16883. /* 85 */
  16884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16885. "use strict";
  16886. __webpack_require__.r(__webpack_exports__);
  16887. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NoRowsOverlayComponent", function() { return NoRowsOverlayComponent; });
  16888. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  16889. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  16890. /**
  16891. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16892. * @version v23.2.1
  16893. * @link http://www.ag-grid.com/
  16894. * @license MIT
  16895. */
  16896. var __extends = (undefined && undefined.__extends) || (function () {
  16897. var extendStatics = function (d, b) {
  16898. extendStatics = Object.setPrototypeOf ||
  16899. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16900. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16901. return extendStatics(d, b);
  16902. };
  16903. return function (d, b) {
  16904. extendStatics(d, b);
  16905. function __() { this.constructor = d; }
  16906. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16907. };
  16908. })();
  16909. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  16910. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16911. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16912. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16913. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16914. };
  16915. var NoRowsOverlayComponent = /** @class */ (function (_super) {
  16916. __extends(NoRowsOverlayComponent, _super);
  16917. function NoRowsOverlayComponent() {
  16918. return _super.call(this) || this;
  16919. }
  16920. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  16921. // so we need to override destroy() just to make the method public.
  16922. NoRowsOverlayComponent.prototype.destroy = function () {
  16923. _super.prototype.destroy.call(this);
  16924. };
  16925. NoRowsOverlayComponent.prototype.init = function (params) {
  16926. var template = this.gridOptionsWrapper.getOverlayNoRowsTemplate() ?
  16927. this.gridOptionsWrapper.getOverlayNoRowsTemplate() : NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE;
  16928. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  16929. var localisedTemplate = template.replace('[NO_ROWS_TO_SHOW]', localeTextFunc('noRowsToShow', 'No Rows To Show'));
  16930. this.setTemplate(localisedTemplate);
  16931. };
  16932. NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE = '<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';
  16933. __decorate([
  16934. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  16935. ], NoRowsOverlayComponent.prototype, "gridOptionsWrapper", void 0);
  16936. return NoRowsOverlayComponent;
  16937. }(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  16938. /***/ }),
  16939. /* 86 */
  16940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16941. "use strict";
  16942. __webpack_require__.r(__webpack_exports__);
  16943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipComponent", function() { return TooltipComponent; });
  16944. /* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
  16945. /**
  16946. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16947. * @version v23.2.1
  16948. * @link http://www.ag-grid.com/
  16949. * @license MIT
  16950. */
  16951. var __extends = (undefined && undefined.__extends) || (function () {
  16952. var extendStatics = function (d, b) {
  16953. extendStatics = Object.setPrototypeOf ||
  16954. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16955. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16956. return extendStatics(d, b);
  16957. };
  16958. return function (d, b) {
  16959. extendStatics(d, b);
  16960. function __() { this.constructor = d; }
  16961. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16962. };
  16963. })();
  16964. var TooltipComponent = /** @class */ (function (_super) {
  16965. __extends(TooltipComponent, _super);
  16966. function TooltipComponent() {
  16967. return _super.call(this, /* html */ "<div class=\"ag-tooltip\"></div>") || this;
  16968. }
  16969. // will need to type params
  16970. TooltipComponent.prototype.init = function (params) {
  16971. var value = params.value;
  16972. this.getGui().innerHTML = value;
  16973. };
  16974. return TooltipComponent;
  16975. }(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__["PopupComponent"]));
  16976. /***/ }),
  16977. /* 87 */
  16978. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16979. "use strict";
  16980. __webpack_require__.r(__webpack_exports__);
  16981. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultDateComponent", function() { return DefaultDateComponent; });
  16982. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  16983. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  16984. /* harmony import */ var _utils_date__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
  16985. /* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13);
  16986. /**
  16987. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  16988. * @version v23.2.1
  16989. * @link http://www.ag-grid.com/
  16990. * @license MIT
  16991. */
  16992. var __extends = (undefined && undefined.__extends) || (function () {
  16993. var extendStatics = function (d, b) {
  16994. extendStatics = Object.setPrototypeOf ||
  16995. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16996. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16997. return extendStatics(d, b);
  16998. };
  16999. return function (d, b) {
  17000. extendStatics(d, b);
  17001. function __() { this.constructor = d; }
  17002. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17003. };
  17004. })();
  17005. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  17006. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17007. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17008. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  17009. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17010. };
  17011. var DefaultDateComponent = /** @class */ (function (_super) {
  17012. __extends(DefaultDateComponent, _super);
  17013. function DefaultDateComponent() {
  17014. return _super.call(this, /* html */ "\n <div class=\"ag-filter-filter\">\n <ag-input-text-field class=\"ag-date-filter\" ref=\"eDateInput\"></ag-input-text-field>\n </div>") || this;
  17015. }
  17016. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  17017. // so we need to override destroy() just to make the method public.
  17018. DefaultDateComponent.prototype.destroy = function () {
  17019. _super.prototype.destroy.call(this);
  17020. };
  17021. DefaultDateComponent.prototype.init = function (params) {
  17022. var _this = this;
  17023. if (this.shouldUseBrowserDatePicker(params)) {
  17024. if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserIE"])()) {
  17025. console.warn('ag-grid: browserDatePicker is specified to true, but it is not supported in IE 11, reverting to plain text date picker');
  17026. }
  17027. else {
  17028. this.eDateInput.getInputElement().type = 'date';
  17029. }
  17030. }
  17031. this.listener = params.onDateChanged;
  17032. this.addManagedListener(this.eDateInput.getInputElement(), 'input', function (e) {
  17033. if (e.target !== document.activeElement) {
  17034. return;
  17035. }
  17036. _this.listener();
  17037. });
  17038. };
  17039. DefaultDateComponent.prototype.getDate = function () {
  17040. return Object(_utils_date__WEBPACK_IMPORTED_MODULE_2__["parseDateTimeFromString"])(this.eDateInput.getValue());
  17041. };
  17042. DefaultDateComponent.prototype.setDate = function (date) {
  17043. this.eDateInput.setValue(Object(_utils_date__WEBPACK_IMPORTED_MODULE_2__["serialiseDate"])(date, false));
  17044. };
  17045. DefaultDateComponent.prototype.setInputPlaceholder = function (placeholder) {
  17046. this.eDateInput.setInputPlaceholder(placeholder);
  17047. };
  17048. DefaultDateComponent.prototype.shouldUseBrowserDatePicker = function (params) {
  17049. if (params.filterParams && params.filterParams.browserDatePicker != null) {
  17050. return params.filterParams.browserDatePicker;
  17051. }
  17052. else {
  17053. return Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserChrome"])() || Object(_utils_browser__WEBPACK_IMPORTED_MODULE_3__["isBrowserFirefox"])();
  17054. }
  17055. };
  17056. __decorate([
  17057. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eDateInput')
  17058. ], DefaultDateComponent.prototype, "eDateInput", void 0);
  17059. return DefaultDateComponent;
  17060. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  17061. /***/ }),
  17062. /* 88 */
  17063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17064. "use strict";
  17065. __webpack_require__.r(__webpack_exports__);
  17066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DateFloatingFilter", function() { return DateFloatingFilter; });
  17067. /* harmony import */ var _dateFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58);
  17068. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  17069. /* harmony import */ var _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59);
  17070. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
  17071. /* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(60);
  17072. /* harmony import */ var _floating_provided_simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89);
  17073. /* harmony import */ var _providedFilter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62);
  17074. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12);
  17075. /* harmony import */ var _utils_date__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18);
  17076. /* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(21);
  17077. /**
  17078. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17079. * @version v23.2.1
  17080. * @link http://www.ag-grid.com/
  17081. * @license MIT
  17082. */
  17083. var __extends = (undefined && undefined.__extends) || (function () {
  17084. var extendStatics = function (d, b) {
  17085. extendStatics = Object.setPrototypeOf ||
  17086. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17087. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17088. return extendStatics(d, b);
  17089. };
  17090. return function (d, b) {
  17091. extendStatics(d, b);
  17092. function __() { this.constructor = d; }
  17093. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17094. };
  17095. })();
  17096. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  17097. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17098. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17099. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  17100. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17101. };
  17102. var DateFloatingFilter = /** @class */ (function (_super) {
  17103. __extends(DateFloatingFilter, _super);
  17104. function DateFloatingFilter() {
  17105. return _super.call(this, /* html */ "\n <div class=\"ag-floating-filter-input\" role=\"presentation\">\n <ag-input-text-field ref=\"eReadOnlyText\"></ag-input-text-field>\n <div ref=\"eDateWrapper\" style=\"display: flex; overflow: hidden;\"></div>\n </div>") || this;
  17106. }
  17107. DateFloatingFilter.prototype.getDefaultFilterOptions = function () {
  17108. return _dateFilter__WEBPACK_IMPORTED_MODULE_0__["DateFilter"].DEFAULT_FILTER_OPTIONS;
  17109. };
  17110. DateFloatingFilter.prototype.conditionToString = function (condition) {
  17111. if (condition.type === _simpleFilter__WEBPACK_IMPORTED_MODULE_4__["SimpleFilter"].IN_RANGE) {
  17112. return condition.dateFrom + "-" + condition.dateTo;
  17113. }
  17114. // cater for when the type doesn't need a value
  17115. if (condition.dateFrom != null) {
  17116. return "" + condition.dateFrom;
  17117. }
  17118. return "" + condition.type;
  17119. };
  17120. DateFloatingFilter.prototype.init = function (params) {
  17121. _super.prototype.init.call(this, params);
  17122. this.params = params;
  17123. this.createDateComponent();
  17124. this.eReadOnlyText
  17125. .setDisabled(true)
  17126. .setInputAriaLabel('Date Filter Input');
  17127. };
  17128. DateFloatingFilter.prototype.setEditable = function (editable) {
  17129. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eDateWrapper, editable);
  17130. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_7__["setDisplayed"])(this.eReadOnlyText.getGui(), !editable);
  17131. };
  17132. DateFloatingFilter.prototype.onParentModelChanged = function (model, event) {
  17133. // We don't want to update the floating filter if the floating filter caused the change,
  17134. // because the UI is already in sync. if we didn't do this, the UI would behave strangely
  17135. // as it would be updating as the user is typing
  17136. if (this.isEventFromFloatingFilter(event)) {
  17137. return;
  17138. }
  17139. _super.prototype.setLastTypeFromModel.call(this, model);
  17140. var allowEditing = this.canWeEditAfterModelFromParentFilter(model);
  17141. this.setEditable(allowEditing);
  17142. if (allowEditing) {
  17143. if (model) {
  17144. var dateModel = model;
  17145. this.dateComp.setDate(Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["parseDateTimeFromString"])(dateModel.dateFrom));
  17146. }
  17147. else {
  17148. this.dateComp.setDate(null);
  17149. }
  17150. this.eReadOnlyText.setValue('');
  17151. }
  17152. else {
  17153. this.eReadOnlyText.setValue(this.getTextFromModel(model));
  17154. this.dateComp.setDate(null);
  17155. }
  17156. };
  17157. DateFloatingFilter.prototype.onDateChanged = function () {
  17158. var _this = this;
  17159. var filterValueDate = this.dateComp.getDate();
  17160. var filterValueText = Object(_utils_date__WEBPACK_IMPORTED_MODULE_8__["serialiseDate"])(filterValueDate);
  17161. this.params.parentFilterInstance(function (filterInstance) {
  17162. if (filterInstance) {
  17163. var simpleFilter = filterInstance;
  17164. simpleFilter.onFloatingFilterChanged(_this.getLastType(), filterValueText);
  17165. }
  17166. });
  17167. };
  17168. DateFloatingFilter.prototype.createDateComponent = function () {
  17169. var _this = this;
  17170. var debounceMs = _providedFilter__WEBPACK_IMPORTED_MODULE_6__["ProvidedFilter"].getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs());
  17171. var dateComponentParams = {
  17172. onDateChanged: Object(_utils_function__WEBPACK_IMPORTED_MODULE_9__["debounce"])(this.onDateChanged.bind(this), debounceMs),
  17173. filterParams: this.params.column.getColDef().filterParams
  17174. };
  17175. this.dateComp = new _dateCompWrapper__WEBPACK_IMPORTED_MODULE_2__["DateCompWrapper"](this.getContext(), this.userComponentFactory, dateComponentParams, this.eDateWrapper);
  17176. this.addDestroyFunc(function () { return _this.dateComp.destroy(); });
  17177. };
  17178. __decorate([
  17179. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
  17180. ], DateFloatingFilter.prototype, "userComponentFactory", void 0);
  17181. __decorate([
  17182. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eReadOnlyText')
  17183. ], DateFloatingFilter.prototype, "eReadOnlyText", void 0);
  17184. __decorate([
  17185. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eDateWrapper')
  17186. ], DateFloatingFilter.prototype, "eDateWrapper", void 0);
  17187. return DateFloatingFilter;
  17188. }(_floating_provided_simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_5__["SimpleFloatingFilter"]));
  17189. /***/ }),
  17190. /* 89 */
  17191. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17192. "use strict";
  17193. __webpack_require__.r(__webpack_exports__);
  17194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleFloatingFilter", function() { return SimpleFloatingFilter; });
  17195. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  17196. /* harmony import */ var _provided_simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60);
  17197. /* harmony import */ var _provided_optionsFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61);
  17198. /**
  17199. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17200. * @version v23.2.1
  17201. * @link http://www.ag-grid.com/
  17202. * @license MIT
  17203. */
  17204. var __extends = (undefined && undefined.__extends) || (function () {
  17205. var extendStatics = function (d, b) {
  17206. extendStatics = Object.setPrototypeOf ||
  17207. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17208. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17209. return extendStatics(d, b);
  17210. };
  17211. return function (d, b) {
  17212. extendStatics(d, b);
  17213. function __() { this.constructor = d; }
  17214. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17215. };
  17216. })();
  17217. var SimpleFloatingFilter = /** @class */ (function (_super) {
  17218. __extends(SimpleFloatingFilter, _super);
  17219. function SimpleFloatingFilter() {
  17220. return _super !== null && _super.apply(this, arguments) || this;
  17221. }
  17222. SimpleFloatingFilter.prototype.getDefaultDebounceMs = function () {
  17223. return 0;
  17224. };
  17225. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  17226. // so we need to override destroy() just to make the method public.
  17227. SimpleFloatingFilter.prototype.destroy = function () {
  17228. _super.prototype.destroy.call(this);
  17229. };
  17230. // used by:
  17231. // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only.
  17232. // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only)
  17233. SimpleFloatingFilter.prototype.getTextFromModel = function (model) {
  17234. if (!model) {
  17235. return null;
  17236. }
  17237. var isCombined = model.operator;
  17238. if (isCombined) {
  17239. var combinedModel = model;
  17240. var con1Str = this.conditionToString(combinedModel.condition1);
  17241. var con2Str = this.conditionToString(combinedModel.condition2);
  17242. return con1Str + " " + combinedModel.operator + " " + con2Str;
  17243. }
  17244. else {
  17245. var condition = model;
  17246. return this.conditionToString(condition);
  17247. }
  17248. };
  17249. SimpleFloatingFilter.prototype.isEventFromFloatingFilter = function (event) {
  17250. return event && event.afterFloatingFilter;
  17251. };
  17252. SimpleFloatingFilter.prototype.getLastType = function () {
  17253. return this.lastType;
  17254. };
  17255. SimpleFloatingFilter.prototype.setLastTypeFromModel = function (model) {
  17256. // if no model provided by the parent filter use default
  17257. if (!model) {
  17258. this.lastType = this.optionsFactory.getDefaultOption();
  17259. return;
  17260. }
  17261. var isCombined = model.operator;
  17262. var condition;
  17263. if (isCombined) {
  17264. var combinedModel = model;
  17265. condition = combinedModel.condition1;
  17266. }
  17267. else {
  17268. condition = model;
  17269. }
  17270. this.lastType = condition.type;
  17271. };
  17272. SimpleFloatingFilter.prototype.canWeEditAfterModelFromParentFilter = function (model) {
  17273. if (!model) {
  17274. // if no model, then we can edit as long as the lastType is something we can edit, as this
  17275. // is the type we will provide to the parent filter if the user decides to use the floating filter.
  17276. return this.isTypeEditable(this.lastType);
  17277. }
  17278. // never allow editing if the filter is combined (ie has two parts)
  17279. var isCombined = model.operator;
  17280. if (isCombined) {
  17281. return false;
  17282. }
  17283. var simpleModel = model;
  17284. return this.isTypeEditable(simpleModel.type);
  17285. };
  17286. SimpleFloatingFilter.prototype.init = function (params) {
  17287. this.optionsFactory = new _provided_optionsFactory__WEBPACK_IMPORTED_MODULE_2__["OptionsFactory"]();
  17288. this.optionsFactory.init(params.filterParams, this.getDefaultFilterOptions());
  17289. this.lastType = this.optionsFactory.getDefaultOption();
  17290. // we are editable if:
  17291. // 1) there is a type (user has configured filter wrong if not type)
  17292. // AND
  17293. // 2) the default type is not 'in range'
  17294. var editable = this.isTypeEditable(this.lastType);
  17295. this.setEditable(editable);
  17296. };
  17297. SimpleFloatingFilter.prototype.doesFilterHaveHiddenInput = function (filterType) {
  17298. var customFilterOption = this.optionsFactory.getCustomOption(filterType);
  17299. return customFilterOption && customFilterOption.hideFilterInput;
  17300. };
  17301. SimpleFloatingFilter.prototype.isTypeEditable = function (type) {
  17302. return !this.doesFilterHaveHiddenInput(type) &&
  17303. type
  17304. && type !== _provided_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].IN_RANGE
  17305. && type !== _provided_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EMPTY;
  17306. };
  17307. return SimpleFloatingFilter;
  17308. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  17309. /***/ }),
  17310. /* 90 */
  17311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17312. "use strict";
  17313. __webpack_require__.r(__webpack_exports__);
  17314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextFilter", function() { return TextFilter; });
  17315. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  17316. /* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60);
  17317. /* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
  17318. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
  17319. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
  17320. /**
  17321. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17322. * @version v23.2.1
  17323. * @link http://www.ag-grid.com/
  17324. * @license MIT
  17325. */
  17326. var __extends = (undefined && undefined.__extends) || (function () {
  17327. var extendStatics = function (d, b) {
  17328. extendStatics = Object.setPrototypeOf ||
  17329. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17330. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17331. return extendStatics(d, b);
  17332. };
  17333. return function (d, b) {
  17334. extendStatics(d, b);
  17335. function __() { this.constructor = d; }
  17336. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17337. };
  17338. })();
  17339. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  17340. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17341. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17342. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  17343. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17344. };
  17345. var TextFilter = /** @class */ (function (_super) {
  17346. __extends(TextFilter, _super);
  17347. function TextFilter() {
  17348. return _super !== null && _super.apply(this, arguments) || this;
  17349. }
  17350. TextFilter.prototype.getDefaultDebounceMs = function () {
  17351. return 500;
  17352. };
  17353. TextFilter.prototype.getValue = function (inputField) {
  17354. var val = inputField.getValue();
  17355. val = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_2__["makeNull"])(val);
  17356. if (val && val.trim() === '') {
  17357. val = null;
  17358. }
  17359. return val;
  17360. };
  17361. TextFilter.prototype.addValueChangedListeners = function () {
  17362. var _this = this;
  17363. var listener = function () { return _this.onUiChanged(); };
  17364. this.eValue1.onValueChange(listener);
  17365. this.eValue2.onValueChange(listener);
  17366. };
  17367. TextFilter.prototype.setParams = function (params) {
  17368. _super.prototype.setParams.call(this, params);
  17369. this.textFilterParams = params;
  17370. this.comparator = this.textFilterParams.textCustomComparator || TextFilter.DEFAULT_COMPARATOR;
  17371. this.formatter = this.textFilterParams.textFormatter ||
  17372. (this.textFilterParams.caseSensitive == true
  17373. ? TextFilter.DEFAULT_FORMATTER
  17374. : TextFilter.DEFAULT_LOWERCASE_FORMATTER);
  17375. this.addValueChangedListeners();
  17376. };
  17377. TextFilter.prototype.setConditionIntoUi = function (model, position) {
  17378. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  17379. var eValue = positionOne ? this.eValue1 : this.eValue2;
  17380. eValue.setValue(model ? model.filter : null);
  17381. };
  17382. TextFilter.prototype.createCondition = function (position) {
  17383. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  17384. var type = positionOne ? this.getCondition1Type() : this.getCondition2Type();
  17385. var eValue = positionOne ? this.eValue1 : this.eValue2;
  17386. var value = this.getValue(eValue);
  17387. var model = {
  17388. filterType: TextFilter.FILTER_TYPE,
  17389. type: type
  17390. };
  17391. if (!this.doesFilterHaveHiddenInput(type)) {
  17392. model.filter = value;
  17393. }
  17394. return model;
  17395. };
  17396. TextFilter.prototype.getFilterType = function () {
  17397. return TextFilter.FILTER_TYPE;
  17398. };
  17399. TextFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) {
  17400. return aSimple.filter === bSimple.filter && aSimple.type === bSimple.type;
  17401. };
  17402. TextFilter.prototype.resetUiToDefaults = function (silent) {
  17403. var _this = this;
  17404. return _super.prototype.resetUiToDefaults.call(this, silent).then(function () {
  17405. _this.forEachInput(function (field) { return field.setValue(null, silent); });
  17406. _this.resetPlaceholder();
  17407. });
  17408. };
  17409. TextFilter.prototype.resetPlaceholder = function () {
  17410. var placeholder = this.translate('filterOoo');
  17411. this.forEachInput(function (field) { return field.setInputPlaceholder(placeholder); });
  17412. };
  17413. TextFilter.prototype.forEachInput = function (action) {
  17414. Object(_utils_array__WEBPACK_IMPORTED_MODULE_4__["forEach"])([this.eValue1, this.eValue2], action);
  17415. };
  17416. TextFilter.prototype.setValueFromFloatingFilter = function (value) {
  17417. this.eValue1.setValue(value);
  17418. this.eValue2.setValue(null);
  17419. };
  17420. TextFilter.prototype.getDefaultFilterOptions = function () {
  17421. return TextFilter.DEFAULT_FILTER_OPTIONS;
  17422. };
  17423. TextFilter.prototype.createValueTemplate = function (position) {
  17424. var pos = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One ? '1' : '2';
  17425. return /* html */ "\n <div class=\"ag-filter-body\" ref=\"eCondition" + pos + "Body\" role=\"presentation\">\n <ag-input-text-field class=\"ag-filter-filter\" ref=\"eValue" + pos + "\"></ag-input-text-field>\n </div>";
  17426. };
  17427. TextFilter.prototype.updateUiVisibility = function () {
  17428. _super.prototype.updateUiVisibility.call(this);
  17429. var showValue1 = this.showValueFrom(this.getCondition1Type());
  17430. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setDisplayed"])(this.eValue1.getGui(), showValue1);
  17431. var showValue2 = this.showValueFrom(this.getCondition2Type());
  17432. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["setDisplayed"])(this.eValue2.getGui(), showValue2);
  17433. };
  17434. TextFilter.prototype.afterGuiAttached = function (params) {
  17435. _super.prototype.afterGuiAttached.call(this, params);
  17436. this.resetPlaceholder();
  17437. this.eValue1.getInputElement().focus();
  17438. };
  17439. TextFilter.prototype.isConditionUiComplete = function (position) {
  17440. var positionOne = position === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["ConditionPosition"].One;
  17441. var option = positionOne ? this.getCondition1Type() : this.getCondition2Type();
  17442. if (option === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EMPTY) {
  17443. return false;
  17444. }
  17445. if (this.doesFilterHaveHiddenInput(option)) {
  17446. return true;
  17447. }
  17448. return this.getValue(positionOne ? this.eValue1 : this.eValue2) != null;
  17449. };
  17450. TextFilter.prototype.individualConditionPasses = function (params, filterModel) {
  17451. var filterText = filterModel.filter;
  17452. var filterOption = filterModel.type;
  17453. var cellValue = this.textFilterParams.valueGetter(params.node);
  17454. var cellValueFormatted = this.formatter(cellValue);
  17455. var customFilterOption = this.optionsFactory.getCustomOption(filterOption);
  17456. if (customFilterOption) {
  17457. // only execute the custom filter if a value exists or a value isn't required, i.e. input is hidden
  17458. if (filterText != null || customFilterOption.hideFilterInput) {
  17459. return customFilterOption.test(filterText, cellValueFormatted);
  17460. }
  17461. }
  17462. if (cellValue == null) {
  17463. return filterOption === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_EQUAL || filterOption === _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_CONTAINS;
  17464. }
  17465. var filterTextFormatted = this.formatter(filterText);
  17466. return this.comparator(filterOption, cellValueFormatted, filterTextFormatted);
  17467. };
  17468. TextFilter.FILTER_TYPE = 'text';
  17469. TextFilter.DEFAULT_FILTER_OPTIONS = [
  17470. _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].CONTAINS,
  17471. _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_CONTAINS,
  17472. _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].EQUALS,
  17473. _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].NOT_EQUAL,
  17474. _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].STARTS_WITH,
  17475. _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].ENDS_WITH
  17476. ];
  17477. TextFilter.DEFAULT_FORMATTER = function (from) { return from; };
  17478. TextFilter.DEFAULT_LOWERCASE_FORMATTER = function (from) {
  17479. return from == null ? null : from.toString().toLowerCase();
  17480. };
  17481. TextFilter.DEFAULT_COMPARATOR = function (filter, value, filterText) {
  17482. switch (filter) {
  17483. case TextFilter.CONTAINS:
  17484. return value.indexOf(filterText) >= 0;
  17485. case TextFilter.NOT_CONTAINS:
  17486. return value.indexOf(filterText) === -1;
  17487. case TextFilter.EQUALS:
  17488. return value === filterText;
  17489. case TextFilter.NOT_EQUAL:
  17490. return value != filterText;
  17491. case TextFilter.STARTS_WITH:
  17492. return value.indexOf(filterText) === 0;
  17493. case TextFilter.ENDS_WITH:
  17494. var index = value.lastIndexOf(filterText);
  17495. return index >= 0 && index === (value.length - filterText.length);
  17496. default:
  17497. // should never happen
  17498. console.warn('invalid filter type ' + filter);
  17499. return false;
  17500. }
  17501. };
  17502. __decorate([
  17503. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValue1')
  17504. ], TextFilter.prototype, "eValue1", void 0);
  17505. __decorate([
  17506. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eValue2')
  17507. ], TextFilter.prototype, "eValue2", void 0);
  17508. return TextFilter;
  17509. }(_simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"]));
  17510. /***/ }),
  17511. /* 91 */
  17512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17513. "use strict";
  17514. __webpack_require__.r(__webpack_exports__);
  17515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberFloatingFilter", function() { return NumberFloatingFilter; });
  17516. /* harmony import */ var _numberFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(83);
  17517. /* harmony import */ var _simpleFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60);
  17518. /* harmony import */ var _floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(92);
  17519. /**
  17520. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17521. * @version v23.2.1
  17522. * @link http://www.ag-grid.com/
  17523. * @license MIT
  17524. */
  17525. var __extends = (undefined && undefined.__extends) || (function () {
  17526. var extendStatics = function (d, b) {
  17527. extendStatics = Object.setPrototypeOf ||
  17528. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17529. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17530. return extendStatics(d, b);
  17531. };
  17532. return function (d, b) {
  17533. extendStatics(d, b);
  17534. function __() { this.constructor = d; }
  17535. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17536. };
  17537. })();
  17538. var NumberFloatingFilter = /** @class */ (function (_super) {
  17539. __extends(NumberFloatingFilter, _super);
  17540. function NumberFloatingFilter() {
  17541. return _super !== null && _super.apply(this, arguments) || this;
  17542. }
  17543. NumberFloatingFilter.prototype.getDefaultFilterOptions = function () {
  17544. return _numberFilter__WEBPACK_IMPORTED_MODULE_0__["NumberFilter"].DEFAULT_FILTER_OPTIONS;
  17545. };
  17546. NumberFloatingFilter.prototype.conditionToString = function (condition) {
  17547. var isRange = condition.type == _simpleFilter__WEBPACK_IMPORTED_MODULE_1__["SimpleFilter"].IN_RANGE;
  17548. if (isRange) {
  17549. return condition.filter + "-" + condition.filterTo;
  17550. }
  17551. // cater for when the type doesn't need a value
  17552. if (condition.filter != null) {
  17553. return "" + condition.filter;
  17554. }
  17555. return "" + condition.type;
  17556. };
  17557. return NumberFloatingFilter;
  17558. }(_floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_2__["TextInputFloatingFilter"]));
  17559. /***/ }),
  17560. /* 92 */
  17561. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17562. "use strict";
  17563. __webpack_require__.r(__webpack_exports__);
  17564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextInputFloatingFilter", function() { return TextInputFloatingFilter; });
  17565. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  17566. /* harmony import */ var _utils_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
  17567. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  17568. /* harmony import */ var _provided_providedFilter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62);
  17569. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37);
  17570. /* harmony import */ var _simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89);
  17571. /* harmony import */ var _utils_keyboard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(24);
  17572. /**
  17573. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17574. * @version v23.2.1
  17575. * @link http://www.ag-grid.com/
  17576. * @license MIT
  17577. */
  17578. var __extends = (undefined && undefined.__extends) || (function () {
  17579. var extendStatics = function (d, b) {
  17580. extendStatics = Object.setPrototypeOf ||
  17581. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17582. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17583. return extendStatics(d, b);
  17584. };
  17585. return function (d, b) {
  17586. extendStatics(d, b);
  17587. function __() { this.constructor = d; }
  17588. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17589. };
  17590. })();
  17591. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  17592. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17593. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17594. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  17595. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17596. };
  17597. var TextInputFloatingFilter = /** @class */ (function (_super) {
  17598. __extends(TextInputFloatingFilter, _super);
  17599. function TextInputFloatingFilter() {
  17600. return _super !== null && _super.apply(this, arguments) || this;
  17601. }
  17602. TextInputFloatingFilter.prototype.postConstruct = function () {
  17603. this.setTemplate(/* html */ "\n <div class=\"ag-floating-filter-input\" role=\"presentation\">\n <ag-input-text-field ref=\"eFloatingFilterInput\"></ag-input-text-field>\n </div>");
  17604. };
  17605. TextInputFloatingFilter.prototype.getDefaultDebounceMs = function () {
  17606. return 500;
  17607. };
  17608. TextInputFloatingFilter.prototype.onParentModelChanged = function (model, event) {
  17609. // we don't want to update the floating filter if the floating filter caused the change.
  17610. // as if it caused the change, the ui is already in sync. if we didn't do this, the UI
  17611. // would behave strange as it would be updating as the user is typing
  17612. if (this.isEventFromFloatingFilter(event)) {
  17613. return;
  17614. }
  17615. this.setLastTypeFromModel(model);
  17616. var modelString = this.getTextFromModel(model);
  17617. this.eFloatingFilterInput.setValue(modelString);
  17618. var editable = this.canWeEditAfterModelFromParentFilter(model);
  17619. this.setEditable(editable);
  17620. };
  17621. TextInputFloatingFilter.prototype.init = function (params) {
  17622. _super.prototype.init.call(this, params);
  17623. this.params = params;
  17624. this.applyActive = _provided_providedFilter__WEBPACK_IMPORTED_MODULE_3__["ProvidedFilter"].isUseApplyButton(this.params.filterParams);
  17625. var debounceMs = _provided_providedFilter__WEBPACK_IMPORTED_MODULE_3__["ProvidedFilter"].getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs());
  17626. var toDebounce = Object(_utils_function__WEBPACK_IMPORTED_MODULE_1__["debounce"])(this.syncUpWithParentFilter.bind(this), debounceMs);
  17627. var filterGui = this.eFloatingFilterInput.getGui();
  17628. this.addManagedListener(filterGui, 'input', toDebounce);
  17629. this.addManagedListener(filterGui, 'keypress', toDebounce);
  17630. this.addManagedListener(filterGui, 'keydown', toDebounce);
  17631. var columnDef = params.column.getDefinition();
  17632. if (columnDef.filterParams &&
  17633. columnDef.filterParams.filterOptions &&
  17634. columnDef.filterParams.filterOptions.length === 1 &&
  17635. columnDef.filterParams.filterOptions[0] === 'inRange') {
  17636. this.eFloatingFilterInput.setDisabled(true);
  17637. }
  17638. var displayName = this.columnController.getDisplayNameForColumn(params.column, 'header', true);
  17639. this.eFloatingFilterInput.setInputAriaLabel(displayName + " Filter Input");
  17640. };
  17641. TextInputFloatingFilter.prototype.syncUpWithParentFilter = function (e) {
  17642. var _this = this;
  17643. var value = this.eFloatingFilterInput.getValue();
  17644. var enterKeyPressed = Object(_utils_keyboard__WEBPACK_IMPORTED_MODULE_6__["isKeyPressed"])(e, _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_ENTER);
  17645. if (this.applyActive && !enterKeyPressed) {
  17646. return;
  17647. }
  17648. this.params.parentFilterInstance(function (filterInstance) {
  17649. if (filterInstance) {
  17650. var simpleFilter = filterInstance;
  17651. simpleFilter.onFloatingFilterChanged(_this.getLastType(), value);
  17652. }
  17653. });
  17654. };
  17655. TextInputFloatingFilter.prototype.setEditable = function (editable) {
  17656. this.eFloatingFilterInput.setDisabled(!editable);
  17657. };
  17658. __decorate([
  17659. Object(_context_context__WEBPACK_IMPORTED_MODULE_4__["Autowired"])('columnController')
  17660. ], TextInputFloatingFilter.prototype, "columnController", void 0);
  17661. __decorate([
  17662. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eFloatingFilterInput')
  17663. ], TextInputFloatingFilter.prototype, "eFloatingFilterInput", void 0);
  17664. __decorate([
  17665. _context_context__WEBPACK_IMPORTED_MODULE_4__["PostConstruct"]
  17666. ], TextInputFloatingFilter.prototype, "postConstruct", null);
  17667. return TextInputFloatingFilter;
  17668. }(_simpleFloatingFilter__WEBPACK_IMPORTED_MODULE_5__["SimpleFloatingFilter"]));
  17669. /***/ }),
  17670. /* 93 */
  17671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17672. "use strict";
  17673. __webpack_require__.r(__webpack_exports__);
  17674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextFloatingFilter", function() { return TextFloatingFilter; });
  17675. /* harmony import */ var _textFilter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90);
  17676. /* harmony import */ var _floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(92);
  17677. /**
  17678. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17679. * @version v23.2.1
  17680. * @link http://www.ag-grid.com/
  17681. * @license MIT
  17682. */
  17683. var __extends = (undefined && undefined.__extends) || (function () {
  17684. var extendStatics = function (d, b) {
  17685. extendStatics = Object.setPrototypeOf ||
  17686. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17687. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17688. return extendStatics(d, b);
  17689. };
  17690. return function (d, b) {
  17691. extendStatics(d, b);
  17692. function __() { this.constructor = d; }
  17693. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17694. };
  17695. })();
  17696. var TextFloatingFilter = /** @class */ (function (_super) {
  17697. __extends(TextFloatingFilter, _super);
  17698. function TextFloatingFilter() {
  17699. return _super !== null && _super.apply(this, arguments) || this;
  17700. }
  17701. TextFloatingFilter.prototype.conditionToString = function (condition) {
  17702. // it's not possible to have 'in range' for string, so no need to check for it.
  17703. // also cater for when the type doesn't need a value
  17704. if (condition.filter != null) {
  17705. return "" + condition.filter;
  17706. }
  17707. else {
  17708. return "" + condition.type;
  17709. }
  17710. };
  17711. TextFloatingFilter.prototype.getDefaultFilterOptions = function () {
  17712. return _textFilter__WEBPACK_IMPORTED_MODULE_0__["TextFilter"].DEFAULT_FILTER_OPTIONS;
  17713. };
  17714. return TextFloatingFilter;
  17715. }(_floating_provided_textInputFloatingFilter__WEBPACK_IMPORTED_MODULE_1__["TextInputFloatingFilter"]));
  17716. /***/ }),
  17717. /* 94 */
  17718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17719. "use strict";
  17720. __webpack_require__.r(__webpack_exports__);
  17721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithAngular1", function() { return initialiseAgGridWithAngular1; });
  17722. /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
  17723. /**
  17724. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17725. * @version v23.2.1
  17726. * @link http://www.ag-grid.com/
  17727. * @license MIT
  17728. */
  17729. function initialiseAgGridWithAngular1(angular) {
  17730. var angularModule = angular.module("agGrid", []);
  17731. angularModule.directive("agGrid", function () {
  17732. return {
  17733. restrict: "A",
  17734. controller: ['$element', '$scope', '$compile', '$attrs', AngularDirectiveController],
  17735. scope: true
  17736. };
  17737. });
  17738. }
  17739. function AngularDirectiveController($element, $scope, $compile, $attrs) {
  17740. var gridOptions;
  17741. var quickFilterOnScope;
  17742. var keyOfGridInScope = $attrs.agGrid;
  17743. quickFilterOnScope = keyOfGridInScope + '.quickFilterText';
  17744. gridOptions = $scope.$eval(keyOfGridInScope);
  17745. if (!gridOptions) {
  17746. console.warn("WARNING - grid options for ag-Grid not found. Please ensure the attribute ag-grid points to a valid object on the scope");
  17747. return;
  17748. }
  17749. var eGridDiv = $element[0];
  17750. var gridParams = {
  17751. $scope: $scope,
  17752. $compile: $compile,
  17753. quickFilterOnScope: quickFilterOnScope
  17754. };
  17755. var grid = new _grid__WEBPACK_IMPORTED_MODULE_0__["Grid"](eGridDiv, gridOptions, gridParams);
  17756. $scope.$on("$destroy", function () {
  17757. grid.destroy();
  17758. grid = null;
  17759. });
  17760. }
  17761. /***/ }),
  17762. /* 95 */
  17763. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17764. "use strict";
  17765. __webpack_require__.r(__webpack_exports__);
  17766. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Grid", function() { return Grid; });
  17767. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
  17768. /* harmony import */ var _selectionController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(96);
  17769. /* harmony import */ var _columnController_columnApi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98);
  17770. /* harmony import */ var _columnController_columnController__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
  17771. /* harmony import */ var _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99);
  17772. /* harmony import */ var _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(108);
  17773. /* harmony import */ var _filter_filterManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(125);
  17774. /* harmony import */ var _valueService_valueService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(126);
  17775. /* harmony import */ var _eventService__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(36);
  17776. /* harmony import */ var _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(127);
  17777. /* harmony import */ var _gridApi__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(130);
  17778. /* harmony import */ var _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5);
  17779. /* harmony import */ var _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(47);
  17780. /* harmony import */ var _valueService_expressionService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(131);
  17781. /* harmony import */ var _templateService__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(132);
  17782. /* harmony import */ var _widgets_popupService__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(133);
  17783. /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(134);
  17784. /* harmony import */ var _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(46);
  17785. /* harmony import */ var _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(135);
  17786. /* harmony import */ var _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(136);
  17787. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(37);
  17788. /* harmony import */ var _gridCore__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(137);
  17789. /* harmony import */ var _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(138);
  17790. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(104);
  17791. /* harmony import */ var _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(139);
  17792. /* harmony import */ var _sortController__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(140);
  17793. /* harmony import */ var _focusController__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(141);
  17794. /* harmony import */ var _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(142);
  17795. /* harmony import */ var _cellNavigationService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(143);
  17796. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(43);
  17797. /* harmony import */ var _rendering_cellRendererFactory__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(144);
  17798. /* harmony import */ var _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(145);
  17799. /* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(70);
  17800. /* harmony import */ var _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(146);
  17801. /* harmony import */ var _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(147);
  17802. /* harmony import */ var _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(148);
  17803. /* harmony import */ var _styling_stylingService__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(149);
  17804. /* harmony import */ var _rendering_columnHoverService__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(150);
  17805. /* harmony import */ var _rendering_columnAnimationService__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(151);
  17806. /* harmony import */ var _columnController_autoGroupColService__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(152);
  17807. /* harmony import */ var _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(153);
  17808. /* harmony import */ var _pagination_paginationAutoPageSizeService__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(154);
  17809. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(25);
  17810. /* harmony import */ var _valueService_valueCache__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(155);
  17811. /* harmony import */ var _valueService_changeDetectionService__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(156);
  17812. /* harmony import */ var _alignedGridsService__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(157);
  17813. /* harmony import */ var _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(74);
  17814. /* harmony import */ var _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(53);
  17815. /* harmony import */ var _components_framework_agComponentUtils__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(158);
  17816. /* harmony import */ var _components_framework_componentMetadataProvider__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(159);
  17817. /* harmony import */ var _rendering_beans__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(160);
  17818. /* harmony import */ var _environment__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(161);
  17819. /* harmony import */ var _misc_animationFrameService__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(162);
  17820. /* harmony import */ var _gridPanel_navigationService__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(163);
  17821. /* harmony import */ var _rendering_maxDivHeightScaler__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(164);
  17822. /* harmony import */ var _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(165);
  17823. /* harmony import */ var _rendering_autoHeightCalculator__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(166);
  17824. /* harmony import */ var _pagination_paginationComp__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(167);
  17825. /* harmony import */ var _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(168);
  17826. /* harmony import */ var _rendering_overlays_overlayWrapperComponent__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(169);
  17827. /* harmony import */ var _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(170);
  17828. /* harmony import */ var _widgets_agDialog__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(171);
  17829. /* harmony import */ var _widgets_agPanel__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(172);
  17830. /* harmony import */ var _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(173);
  17831. /* harmony import */ var _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(174);
  17832. /* harmony import */ var _widgets_agSlider__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(175);
  17833. /* harmony import */ var _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(176);
  17834. /* harmony import */ var _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(179);
  17835. /* harmony import */ var _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(180);
  17836. /* harmony import */ var _widgets_agSelect__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(181);
  17837. /* harmony import */ var _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(183);
  17838. /* harmony import */ var _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(184);
  17839. /* harmony import */ var _rendering_detailRowCompCache__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(185);
  17840. /* harmony import */ var _entities_rowPosition__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(186);
  17841. /* harmony import */ var _entities_cellPosition__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(187);
  17842. /* harmony import */ var _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(188);
  17843. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(39);
  17844. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(38);
  17845. /* harmony import */ var _undoRedo_undoRedoService__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(189);
  17846. /* harmony import */ var _components_agStackComponentsRegistry__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(191);
  17847. /* harmony import */ var _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(192);
  17848. /* harmony import */ var _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(124);
  17849. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(7);
  17850. /**
  17851. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  17852. * @version v23.2.1
  17853. * @link http://www.ag-grid.com/
  17854. * @license MIT
  17855. */
  17856. var Grid = /** @class */ (function () {
  17857. function Grid(eGridDiv, gridOptions, params) {
  17858. if (!eGridDiv) {
  17859. console.error('ag-Grid: no div element provided to the grid');
  17860. return;
  17861. }
  17862. if (!gridOptions) {
  17863. console.error('ag-Grid: no gridOptions provided to the grid');
  17864. return;
  17865. }
  17866. var debug = !!gridOptions.debug;
  17867. this.gridOptions = gridOptions;
  17868. var registeredModules = this.getRegisteredModules(params);
  17869. var beanClasses = this.createBeansList(registeredModules);
  17870. var providedBeanInstances = this.createProvidedBeans(eGridDiv, params);
  17871. if (!beanClasses) {
  17872. return;
  17873. } // happens when no row model found
  17874. var contextParams = {
  17875. providedBeanInstances: providedBeanInstances,
  17876. beanClasses: beanClasses,
  17877. debug: debug
  17878. };
  17879. this.logger = new _logger__WEBPACK_IMPORTED_MODULE_16__["Logger"]('ag-Grid', function () { return gridOptions.debug; });
  17880. var contextLogger = new _logger__WEBPACK_IMPORTED_MODULE_16__["Logger"]('Context', function () { return contextParams.debug; });
  17881. this.context = new _context_context__WEBPACK_IMPORTED_MODULE_20__["Context"](contextParams, contextLogger);
  17882. this.registerModuleUserComponents(registeredModules);
  17883. this.registerStackComponents(registeredModules);
  17884. var gridCoreClass = (params && params.rootComponent) || _gridCore__WEBPACK_IMPORTED_MODULE_21__["GridCore"];
  17885. var gridCore = new gridCoreClass();
  17886. this.context.createBean(gridCore);
  17887. this.setColumnsAndData();
  17888. this.dispatchGridReadyEvent(gridOptions);
  17889. var isEnterprise = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_76__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_77__["ModuleNames"].EnterpriseCoreModule);
  17890. this.logger.log("initialised successfully, enterprise = " + isEnterprise);
  17891. }
  17892. Grid.prototype.registerStackComponents = function (registeredModules) {
  17893. var agStackComponents = this.createAgStackComponentsList(registeredModules);
  17894. var agStackComponentsRegistry = this.context.getBean('agStackComponentsRegistry');
  17895. agStackComponentsRegistry.setupComponents(agStackComponents);
  17896. };
  17897. Grid.prototype.getRegisteredModules = function (params) {
  17898. var passedViaConstructor = params ? params.modules : null;
  17899. var registered = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_76__["ModuleRegistry"].getRegisteredModules();
  17900. var allModules = [];
  17901. var mapNames = {};
  17902. // adds to list and removes duplicates
  17903. function addModule(moduleBased, module) {
  17904. function addIndividualModule(module) {
  17905. if (!mapNames[module.moduleName]) {
  17906. mapNames[module.moduleName] = true;
  17907. allModules.push(module);
  17908. _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_76__["ModuleRegistry"].register(module, moduleBased);
  17909. }
  17910. }
  17911. addIndividualModule(module);
  17912. if (module.dependantModules) {
  17913. module.dependantModules.forEach(addModule.bind(null, moduleBased));
  17914. }
  17915. }
  17916. if (passedViaConstructor) {
  17917. passedViaConstructor.forEach(addModule.bind(null, true));
  17918. }
  17919. if (registered) {
  17920. registered.forEach(addModule.bind(null, !_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_76__["ModuleRegistry"].isPackageBased()));
  17921. }
  17922. return allModules;
  17923. };
  17924. Grid.prototype.registerModuleUserComponents = function (registeredModules) {
  17925. var userComponentRegistry = this.context.getBean('userComponentRegistry');
  17926. var moduleUserComps = this.extractModuleEntity(registeredModules, function (module) { return module.userComponents ? module.userComponents : []; });
  17927. moduleUserComps.forEach(function (compMeta) {
  17928. userComponentRegistry.registerDefaultComponent(compMeta.componentName, compMeta.componentClass);
  17929. });
  17930. };
  17931. Grid.prototype.createProvidedBeans = function (eGridDiv, params) {
  17932. var frameworkOverrides = params ? params.frameworkOverrides : null;
  17933. if (_utils__WEBPACK_IMPORTED_MODULE_82__["_"].missing(frameworkOverrides)) {
  17934. frameworkOverrides = new _vanillaFrameworkOverrides__WEBPACK_IMPORTED_MODULE_34__["VanillaFrameworkOverrides"]();
  17935. }
  17936. var seed = {
  17937. gridOptions: this.gridOptions,
  17938. eGridDiv: eGridDiv,
  17939. $scope: params ? params.$scope : null,
  17940. $compile: params ? params.$compile : null,
  17941. quickFilterOnScope: params ? params.quickFilterOnScope : null,
  17942. globalEventListener: params ? params.globalEventListener : null,
  17943. frameworkOverrides: frameworkOverrides
  17944. };
  17945. if (params && params.providedBeanInstances) {
  17946. _utils__WEBPACK_IMPORTED_MODULE_82__["_"].assign(seed, params.providedBeanInstances);
  17947. }
  17948. return seed;
  17949. };
  17950. Grid.prototype.createAgStackComponentsList = function (registeredModules) {
  17951. var components = [
  17952. { componentName: 'AgCheckbox', componentClass: _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_32__["AgCheckbox"] },
  17953. { componentName: 'AgRadioButton', componentClass: _widgets_agRadioButton__WEBPACK_IMPORTED_MODULE_33__["AgRadioButton"] },
  17954. { componentName: 'AgToggleButton', componentClass: _widgets_agToggleButton__WEBPACK_IMPORTED_MODULE_71__["AgToggleButton"] },
  17955. { componentName: 'AgInputTextField', componentClass: _widgets_agInputTextField__WEBPACK_IMPORTED_MODULE_63__["AgInputTextField"] },
  17956. { componentName: 'AgInputTextArea', componentClass: _widgets_agInputTextArea__WEBPACK_IMPORTED_MODULE_64__["AgInputTextArea"] },
  17957. { componentName: 'AgInputNumberField', componentClass: _widgets_agInputNumberField__WEBPACK_IMPORTED_MODULE_67__["AgInputNumberField"] },
  17958. { componentName: 'AgInputRange', componentClass: _widgets_agInputRange__WEBPACK_IMPORTED_MODULE_68__["AgInputRange"] },
  17959. { componentName: 'AgSelect', componentClass: _widgets_agSelect__WEBPACK_IMPORTED_MODULE_69__["AgSelect"] },
  17960. { componentName: 'AgSlider', componentClass: _widgets_agSlider__WEBPACK_IMPORTED_MODULE_65__["AgSlider"] },
  17961. { componentName: 'AgAngleSelect', componentClass: _widgets_agAngleSelect__WEBPACK_IMPORTED_MODULE_70__["AgAngleSelect"] },
  17962. { componentName: 'AgColorPicker', componentClass: _widgets_agColorPicker__WEBPACK_IMPORTED_MODULE_66__["AgColorPicker"] },
  17963. { componentName: 'AgGridComp', componentClass: _gridPanel_gridPanel__WEBPACK_IMPORTED_MODULE_9__["GridPanel"] },
  17964. { componentName: 'AgHeaderRoot', componentClass: _headerRendering_headerRootComp__WEBPACK_IMPORTED_MODULE_5__["HeaderRootComp"] },
  17965. { componentName: 'AgPagination', componentClass: _pagination_paginationComp__WEBPACK_IMPORTED_MODULE_57__["PaginationComp"] },
  17966. { componentName: 'AgOverlayWrapper', componentClass: _rendering_overlays_overlayWrapperComponent__WEBPACK_IMPORTED_MODULE_59__["OverlayWrapperComponent"] },
  17967. { componentName: 'AgGroupComponent', componentClass: _widgets_agGroupComponent__WEBPACK_IMPORTED_MODULE_60__["AgGroupComponent"] },
  17968. { componentName: 'AgPanel', componentClass: _widgets_agPanel__WEBPACK_IMPORTED_MODULE_62__["AgPanel"] },
  17969. { componentName: 'AgDialog', componentClass: _widgets_agDialog__WEBPACK_IMPORTED_MODULE_61__["AgDialog"] }
  17970. ];
  17971. var moduleAgStackComps = this.extractModuleEntity(registeredModules, function (module) { return module.agStackComponents ? module.agStackComponents : []; });
  17972. components = components.concat(moduleAgStackComps);
  17973. return components;
  17974. };
  17975. Grid.prototype.createBeansList = function (registeredModules) {
  17976. var rowModelClass = this.getRowModelClass(registeredModules);
  17977. if (!rowModelClass) {
  17978. return undefined;
  17979. }
  17980. // beans should only contain SERVICES, it should NEVER contain COMPONENTS
  17981. var beans = [
  17982. rowModelClass, _rendering_beans__WEBPACK_IMPORTED_MODULE_50__["Beans"], _entities_rowPosition__WEBPACK_IMPORTED_MODULE_73__["RowPositionUtils"], _entities_cellPosition__WEBPACK_IMPORTED_MODULE_74__["CellPositionUtils"], _headerRendering_header_headerPosition__WEBPACK_IMPORTED_MODULE_80__["HeaderPositionUtils"],
  17983. _pagination_paginationAutoPageSizeService__WEBPACK_IMPORTED_MODULE_41__["PaginationAutoPageSizeService"], _gridApi__WEBPACK_IMPORTED_MODULE_10__["GridApi"], _components_framework_userComponentRegistry__WEBPACK_IMPORTED_MODULE_47__["UserComponentRegistry"], _components_framework_agComponentUtils__WEBPACK_IMPORTED_MODULE_48__["AgComponentUtils"],
  17984. _components_framework_componentMetadataProvider__WEBPACK_IMPORTED_MODULE_49__["ComponentMetadataProvider"], _misc_resizeObserverService__WEBPACK_IMPORTED_MODULE_58__["ResizeObserverService"], _components_framework_userComponentFactory__WEBPACK_IMPORTED_MODULE_46__["UserComponentFactory"],
  17985. _rendering_maxDivHeightScaler__WEBPACK_IMPORTED_MODULE_54__["MaxDivHeightScaler"], _rendering_autoHeightCalculator__WEBPACK_IMPORTED_MODULE_56__["AutoHeightCalculator"], _rendering_cellRendererFactory__WEBPACK_IMPORTED_MODULE_30__["CellRendererFactory"], _headerRendering_horizontalResizeService__WEBPACK_IMPORTED_MODULE_19__["HorizontalResizeService"],
  17986. _pinnedRowModel_pinnedRowModel__WEBPACK_IMPORTED_MODULE_75__["PinnedRowModel"], _dragAndDrop_dragService__WEBPACK_IMPORTED_MODULE_24__["DragService"], _columnController_displayedGroupCreator__WEBPACK_IMPORTED_MODULE_12__["DisplayedGroupCreator"], _eventService__WEBPACK_IMPORTED_MODULE_8__["EventService"], _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"],
  17987. _widgets_popupService__WEBPACK_IMPORTED_MODULE_15__["PopupService"], _selectionController__WEBPACK_IMPORTED_MODULE_1__["SelectionController"], _filter_filterManager__WEBPACK_IMPORTED_MODULE_6__["FilterManager"], _columnController_columnController__WEBPACK_IMPORTED_MODULE_3__["ColumnController"], _headerRendering_header_headerNavigationService__WEBPACK_IMPORTED_MODULE_81__["HeaderNavigationService"],
  17988. _pagination_paginationProxy__WEBPACK_IMPORTED_MODULE_40__["PaginationProxy"], _rendering_rowRenderer__WEBPACK_IMPORTED_MODULE_4__["RowRenderer"], _valueService_expressionService__WEBPACK_IMPORTED_MODULE_13__["ExpressionService"], _columnController_columnFactory__WEBPACK_IMPORTED_MODULE_11__["ColumnFactory"], _templateService__WEBPACK_IMPORTED_MODULE_14__["TemplateService"],
  17989. _alignedGridsService__WEBPACK_IMPORTED_MODULE_45__["AlignedGridsService"], _gridPanel_navigationService__WEBPACK_IMPORTED_MODULE_53__["NavigationService"], _valueService_valueCache__WEBPACK_IMPORTED_MODULE_43__["ValueCache"], _valueService_valueService__WEBPACK_IMPORTED_MODULE_7__["ValueService"], _logger__WEBPACK_IMPORTED_MODULE_16__["LoggerFactory"],
  17990. _columnController_columnUtils__WEBPACK_IMPORTED_MODULE_17__["ColumnUtils"], _rendering_autoWidthCalculator__WEBPACK_IMPORTED_MODULE_18__["AutoWidthCalculator"], _headerRendering_standardMenu__WEBPACK_IMPORTED_MODULE_22__["StandardMenuFactory"], _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_23__["DragAndDropService"], _columnController_columnApi__WEBPACK_IMPORTED_MODULE_2__["ColumnApi"],
  17991. _focusController__WEBPACK_IMPORTED_MODULE_26__["FocusController"], _gridPanel_mouseEventService__WEBPACK_IMPORTED_MODULE_27__["MouseEventService"], _environment__WEBPACK_IMPORTED_MODULE_51__["Environment"], _cellNavigationService__WEBPACK_IMPORTED_MODULE_28__["CellNavigationService"], _rendering_valueFormatterService__WEBPACK_IMPORTED_MODULE_31__["ValueFormatterService"],
  17992. _styling_stylingService__WEBPACK_IMPORTED_MODULE_36__["StylingService"], _gridPanel_scrollVisibleService__WEBPACK_IMPORTED_MODULE_35__["ScrollVisibleService"], _sortController__WEBPACK_IMPORTED_MODULE_25__["SortController"], _rendering_columnHoverService__WEBPACK_IMPORTED_MODULE_37__["ColumnHoverService"], _rendering_columnAnimationService__WEBPACK_IMPORTED_MODULE_38__["ColumnAnimationService"],
  17993. _rowNodes_selectableService__WEBPACK_IMPORTED_MODULE_55__["SelectableService"], _columnController_autoGroupColService__WEBPACK_IMPORTED_MODULE_39__["AutoGroupColService"], _valueService_changeDetectionService__WEBPACK_IMPORTED_MODULE_44__["ChangeDetectionService"], _misc_animationFrameService__WEBPACK_IMPORTED_MODULE_52__["AnimationFrameService"],
  17994. _rendering_detailRowCompCache__WEBPACK_IMPORTED_MODULE_72__["DetailRowCompCache"], _undoRedo_undoRedoService__WEBPACK_IMPORTED_MODULE_78__["UndoRedoService"], _components_agStackComponentsRegistry__WEBPACK_IMPORTED_MODULE_79__["AgStackComponentsRegistry"]
  17995. ];
  17996. var moduleBeans = this.extractModuleEntity(registeredModules, function (module) { return module.beans ? module.beans : []; });
  17997. beans.push.apply(beans, moduleBeans);
  17998. // check for duplicates, as different modules could include the same beans that
  17999. // they depend on, eg ClientSideRowModel in enterprise, and ClientSideRowModel in community
  18000. var beansNoDuplicates = [];
  18001. beans.forEach(function (bean) {
  18002. if (beansNoDuplicates.indexOf(bean) < 0) {
  18003. beansNoDuplicates.push(bean);
  18004. }
  18005. });
  18006. return beansNoDuplicates;
  18007. };
  18008. Grid.prototype.extractModuleEntity = function (moduleEntities, extractor) {
  18009. return [].concat.apply([], moduleEntities.map(extractor));
  18010. };
  18011. Grid.prototype.setColumnsAndData = function () {
  18012. var gridOptionsWrapper = this.context.getBean('gridOptionsWrapper');
  18013. var columnController = this.context.getBean('columnController');
  18014. var columnDefs = gridOptionsWrapper.getColumnDefs();
  18015. if (_utils__WEBPACK_IMPORTED_MODULE_82__["_"].exists(columnDefs)) {
  18016. columnController.setColumnDefs(columnDefs, "gridInitializing");
  18017. }
  18018. var rowModel = this.context.getBean('rowModel');
  18019. rowModel.start();
  18020. };
  18021. Grid.prototype.dispatchGridReadyEvent = function (gridOptions) {
  18022. var eventService = this.context.getBean('eventService');
  18023. var readyEvent = {
  18024. type: _events__WEBPACK_IMPORTED_MODULE_29__["Events"].EVENT_GRID_READY,
  18025. api: gridOptions.api,
  18026. columnApi: gridOptions.columnApi
  18027. };
  18028. eventService.dispatchEvent(readyEvent);
  18029. };
  18030. Grid.prototype.getRowModelClass = function (registeredModules) {
  18031. var rowModelType = this.gridOptions.rowModelType;
  18032. //TODO: temporary measure before 'enterprise' is completely removed (similar handling in gridOptionsWrapper is also required)
  18033. if (rowModelType === 'enterprise') {
  18034. console.warn("ag-Grid: enterprise rowModel deprecated. Should now be called server side row model instead.");
  18035. rowModelType = _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE;
  18036. }
  18037. if (rowModelType === 'normal') {
  18038. console.warn("ag-Grid: normal rowModel deprecated. Should now be called client side row model instead.");
  18039. rowModelType = _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
  18040. }
  18041. // default to client side
  18042. if (!rowModelType) {
  18043. rowModelType = _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
  18044. }
  18045. var rowModelClasses = {};
  18046. registeredModules.forEach(function (module) {
  18047. _utils__WEBPACK_IMPORTED_MODULE_82__["_"].iterateObject(module.rowModels, function (key, value) {
  18048. rowModelClasses[key] = value;
  18049. });
  18050. });
  18051. var rowModelClass = rowModelClasses[rowModelType];
  18052. if (_utils__WEBPACK_IMPORTED_MODULE_82__["_"].exists(rowModelClass)) {
  18053. return rowModelClass;
  18054. }
  18055. else {
  18056. if (rowModelType === _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_INFINITE) {
  18057. console.error("ag-Grid: Row Model \"Infinite\" not found. Please ensure the " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_77__["ModuleNames"].InfiniteRowModelModule + " is registered.';");
  18058. }
  18059. console.error('ag-Grid: could not find matching row model for rowModelType ' + rowModelType);
  18060. if (rowModelType === _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_VIEWPORT) {
  18061. console.error("ag-Grid: Row Model \"Viewport\" not found. Please ensure the ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_77__["ModuleNames"].ViewportRowModelModule + " is registered.';");
  18062. }
  18063. if (rowModelType === _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE) {
  18064. console.error("ag-Grid: Row Model \"Server Side\" not found. Please ensure the ag-Grid Enterprise Module " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_77__["ModuleNames"].ServerSideRowModelModule + " is registered.';");
  18065. }
  18066. if (rowModelType === _constants__WEBPACK_IMPORTED_MODULE_42__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
  18067. console.error("ag-Grid: Row Model \"Client Side\" not found. Please ensure the " + _modules_moduleNames__WEBPACK_IMPORTED_MODULE_77__["ModuleNames"].ClientSideRowModelModule + " is registered.';");
  18068. }
  18069. return undefined;
  18070. }
  18071. };
  18072. Grid.prototype.destroy = function () {
  18073. this.gridOptions.api.destroy();
  18074. };
  18075. return Grid;
  18076. }());
  18077. /***/ }),
  18078. /* 96 */
  18079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18080. "use strict";
  18081. __webpack_require__.r(__webpack_exports__);
  18082. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionController", function() { return SelectionController; });
  18083. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  18084. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  18085. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  18086. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  18087. /* harmony import */ var _utils_changedPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97);
  18088. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  18089. /**
  18090. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  18091. * @version v23.2.1
  18092. * @link http://www.ag-grid.com/
  18093. * @license MIT
  18094. */
  18095. var __extends = (undefined && undefined.__extends) || (function () {
  18096. var extendStatics = function (d, b) {
  18097. extendStatics = Object.setPrototypeOf ||
  18098. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  18099. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  18100. return extendStatics(d, b);
  18101. };
  18102. return function (d, b) {
  18103. extendStatics(d, b);
  18104. function __() { this.constructor = d; }
  18105. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  18106. };
  18107. })();
  18108. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  18109. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  18110. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  18111. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  18112. return c > 3 && r && Object.defineProperty(target, key, r), r;
  18113. };
  18114. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  18115. return function (target, key) { decorator(target, key, paramIndex); }
  18116. };
  18117. var SelectionController = /** @class */ (function (_super) {
  18118. __extends(SelectionController, _super);
  18119. function SelectionController() {
  18120. return _super !== null && _super.apply(this, arguments) || this;
  18121. }
  18122. SelectionController.prototype.setBeans = function (loggerFactory) {
  18123. this.logger = loggerFactory.create('SelectionController');
  18124. this.reset();
  18125. if (this.gridOptionsWrapper.isRowModelDefault()) {
  18126. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_CHANGED, this.reset.bind(this));
  18127. }
  18128. };
  18129. SelectionController.prototype.init = function () {
  18130. this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
  18131. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
  18132. };
  18133. SelectionController.prototype.setLastSelectedNode = function (rowNode) {
  18134. this.lastSelectedNode = rowNode;
  18135. };
  18136. SelectionController.prototype.getLastSelectedNode = function () {
  18137. return this.lastSelectedNode;
  18138. };
  18139. SelectionController.prototype.getSelectedNodes = function () {
  18140. var selectedNodes = [];
  18141. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.selectedNodes, function (key, rowNode) {
  18142. if (rowNode) {
  18143. selectedNodes.push(rowNode);
  18144. }
  18145. });
  18146. return selectedNodes;
  18147. };
  18148. SelectionController.prototype.getSelectedRows = function () {
  18149. var selectedRows = [];
  18150. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.selectedNodes, function (key, rowNode) {
  18151. if (rowNode && rowNode.data) {
  18152. selectedRows.push(rowNode.data);
  18153. }
  18154. });
  18155. return selectedRows;
  18156. };
  18157. SelectionController.prototype.removeGroupsFromSelection = function () {
  18158. var _this = this;
  18159. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.selectedNodes, function (key, rowNode) {
  18160. if (rowNode && rowNode.group) {
  18161. _this.selectedNodes[rowNode.id] = undefined;
  18162. }
  18163. });
  18164. };
  18165. // should only be called if groupSelectsChildren=true
  18166. SelectionController.prototype.updateGroupsFromChildrenSelections = function (changedPath) {
  18167. // we only do this when group selection state depends on selected children
  18168. if (!this.gridOptionsWrapper.isGroupSelectsChildren()) {
  18169. return;
  18170. }
  18171. // also only do it if CSRM (code should never allow this anyway)
  18172. if (this.rowModel.getType() !== _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
  18173. return;
  18174. }
  18175. var clientSideRowModel = this.rowModel;
  18176. var rootNode = clientSideRowModel.getRootNode();
  18177. if (!changedPath) {
  18178. changedPath = new _utils_changedPath__WEBPACK_IMPORTED_MODULE_4__["ChangedPath"](true, rootNode);
  18179. changedPath.setInactive();
  18180. }
  18181. changedPath.forEachChangedNodeDepthFirst(function (rowNode) {
  18182. if (rowNode !== rootNode) {
  18183. rowNode.calculateSelectedFromChildren();
  18184. }
  18185. });
  18186. // clientSideRowModel.getTopLevelNodes()!.forEach((rowNode: RowNode) => {
  18187. // rowNode.depthFirstSearch((node) => {
  18188. // if (node.group) {
  18189. // }
  18190. // });
  18191. // });
  18192. };
  18193. SelectionController.prototype.getNodeForIdIfSelected = function (id) {
  18194. return this.selectedNodes[id];
  18195. };
  18196. SelectionController.prototype.clearOtherNodes = function (rowNodeToKeepSelected) {
  18197. var _this = this;
  18198. var groupsToRefresh = {};
  18199. var updatedCount = 0;
  18200. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.selectedNodes, function (key, otherRowNode) {
  18201. if (otherRowNode && otherRowNode.id !== rowNodeToKeepSelected.id) {
  18202. var rowNode = _this.selectedNodes[otherRowNode.id];
  18203. updatedCount += rowNode.setSelectedParams({
  18204. newValue: false,
  18205. clearSelection: false,
  18206. suppressFinishActions: true
  18207. });
  18208. if (_this.groupSelectsChildren && otherRowNode.parent) {
  18209. groupsToRefresh[otherRowNode.parent.id] = otherRowNode.parent;
  18210. }
  18211. }
  18212. });
  18213. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(groupsToRefresh, function (key, group) {
  18214. group.calculateSelectedFromChildren();
  18215. });
  18216. return updatedCount;
  18217. };
  18218. SelectionController.prototype.onRowSelected = function (event) {
  18219. var rowNode = event.node;
  18220. // we do not store the group rows when the groups select children
  18221. if (this.groupSelectsChildren && rowNode.group) {
  18222. return;
  18223. }
  18224. if (rowNode.isSelected()) {
  18225. this.selectedNodes[rowNode.id] = rowNode;
  18226. }
  18227. else {
  18228. this.selectedNodes[rowNode.id] = undefined;
  18229. }
  18230. };
  18231. SelectionController.prototype.syncInRowNode = function (rowNode, oldNode) {
  18232. this.syncInOldRowNode(rowNode, oldNode);
  18233. this.syncInNewRowNode(rowNode);
  18234. };
  18235. // if the id has changed for the node, then this means the rowNode
  18236. // is getting used for a different data item, which breaks
  18237. // our selectedNodes, as the node now is mapped by the old id
  18238. // which is inconsistent. so to keep the old node as selected,
  18239. // we swap in the clone (with the old id and old data). this means
  18240. // the oldNode is effectively a daemon we keep a reference to,
  18241. // so if client calls api.getSelectedNodes(), it gets the daemon
  18242. // in the result. when the client un-selects, the reference to the
  18243. // daemon is removed. the daemon, because it's an oldNode, is not
  18244. // used by the grid for rendering, it's a copy of what the node used
  18245. // to be like before the id was changed.
  18246. SelectionController.prototype.syncInOldRowNode = function (rowNode, oldNode) {
  18247. var oldNodeHasDifferentId = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(oldNode) && (rowNode.id !== oldNode.id);
  18248. if (oldNodeHasDifferentId) {
  18249. var oldNodeSelected = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(this.selectedNodes[oldNode.id]);
  18250. if (oldNodeSelected) {
  18251. this.selectedNodes[oldNode.id] = oldNode;
  18252. }
  18253. }
  18254. };
  18255. SelectionController.prototype.syncInNewRowNode = function (rowNode) {
  18256. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(this.selectedNodes[rowNode.id])) {
  18257. rowNode.setSelectedInitialValue(true);
  18258. this.selectedNodes[rowNode.id] = rowNode;
  18259. }
  18260. else {
  18261. rowNode.setSelectedInitialValue(false);
  18262. }
  18263. };
  18264. SelectionController.prototype.reset = function () {
  18265. this.logger.log('reset');
  18266. this.selectedNodes = {};
  18267. this.lastSelectedNode = null;
  18268. };
  18269. // returns a list of all nodes at 'best cost' - a feature to be used
  18270. // with groups / trees. if a group has all it's children selected,
  18271. // then the group appears in the result, but not the children.
  18272. // Designed for use with 'children' as the group selection type,
  18273. // where groups don't actually appear in the selection normally.
  18274. SelectionController.prototype.getBestCostNodeSelection = function () {
  18275. if (this.rowModel.getType() !== _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
  18276. console.warn('getBestCostNodeSelection is only available when using normal row model');
  18277. return;
  18278. }
  18279. var clientSideRowModel = this.rowModel;
  18280. var topLevelNodes = clientSideRowModel.getTopLevelNodes();
  18281. if (topLevelNodes === null) {
  18282. console.warn('selectAll not available doing rowModel=virtual');
  18283. return;
  18284. }
  18285. var result = [];
  18286. // recursive function, to find the selected nodes
  18287. function traverse(nodes) {
  18288. for (var i = 0, l = nodes.length; i < l; i++) {
  18289. var node = nodes[i];
  18290. if (node.isSelected()) {
  18291. result.push(node);
  18292. }
  18293. else {
  18294. // if not selected, then if it's a group, and the group
  18295. // has children, continue to search for selections
  18296. if (node.group && node.children) {
  18297. traverse(node.children);
  18298. }
  18299. }
  18300. }
  18301. }
  18302. traverse(topLevelNodes);
  18303. return result;
  18304. };
  18305. SelectionController.prototype.setRowModel = function (rowModel) {
  18306. this.rowModel = rowModel;
  18307. };
  18308. SelectionController.prototype.isEmpty = function () {
  18309. var count = 0;
  18310. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.selectedNodes, function (nodeId, rowNode) {
  18311. if (rowNode) {
  18312. count++;
  18313. }
  18314. });
  18315. return count === 0;
  18316. };
  18317. SelectionController.prototype.deselectAllRowNodes = function (justFiltered) {
  18318. if (justFiltered === void 0) { justFiltered = false; }
  18319. var callback = function (rowNode) { return rowNode.selectThisNode(false); };
  18320. var rowModelClientSide = this.rowModel.getType() === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
  18321. if (justFiltered) {
  18322. if (!rowModelClientSide) {
  18323. console.error('ag-Grid: selecting just filtered only works with In Memory Row Model');
  18324. return;
  18325. }
  18326. var clientSideRowModel = this.rowModel;
  18327. clientSideRowModel.forEachNodeAfterFilter(callback);
  18328. }
  18329. else {
  18330. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.selectedNodes, function (id, rowNode) {
  18331. // remember the reference can be to null, as we never 'delete' from the map
  18332. if (rowNode) {
  18333. callback(rowNode);
  18334. }
  18335. });
  18336. // this clears down the map (whereas above only sets the items in map to 'undefined')
  18337. this.reset();
  18338. }
  18339. // the above does not clean up the parent rows if they are selected
  18340. if (rowModelClientSide && this.groupSelectsChildren) {
  18341. this.updateGroupsFromChildrenSelections();
  18342. }
  18343. var event = {
  18344. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SELECTION_CHANGED,
  18345. api: this.gridApi,
  18346. columnApi: this.columnApi
  18347. };
  18348. this.eventService.dispatchEvent(event);
  18349. };
  18350. SelectionController.prototype.selectAllRowNodes = function (justFiltered) {
  18351. if (justFiltered === void 0) { justFiltered = false; }
  18352. if (this.rowModel.getType() !== _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
  18353. throw new Error("selectAll only available with normal row model, ie not " + this.rowModel.getType());
  18354. }
  18355. var clientSideRowModel = this.rowModel;
  18356. var callback = function (rowNode) { return rowNode.selectThisNode(true); };
  18357. if (justFiltered) {
  18358. clientSideRowModel.forEachNodeAfterFilter(callback);
  18359. }
  18360. else {
  18361. clientSideRowModel.forEachNode(callback);
  18362. }
  18363. // the above does not clean up the parent rows if they are selected
  18364. if (this.rowModel.getType() === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE && this.groupSelectsChildren) {
  18365. this.updateGroupsFromChildrenSelections();
  18366. }
  18367. var event = {
  18368. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SELECTION_CHANGED,
  18369. api: this.gridApi,
  18370. columnApi: this.columnApi
  18371. };
  18372. this.eventService.dispatchEvent(event);
  18373. };
  18374. /**
  18375. * @method
  18376. * @deprecated
  18377. */
  18378. SelectionController.prototype.selectNode = function (rowNode, tryMulti) {
  18379. if (rowNode) {
  18380. rowNode.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
  18381. }
  18382. };
  18383. /**
  18384. * @method
  18385. * @deprecated
  18386. */
  18387. SelectionController.prototype.deselectIndex = function (rowIndex) {
  18388. var node = this.rowModel.getRow(rowIndex);
  18389. this.deselectNode(node);
  18390. };
  18391. /**
  18392. * @method
  18393. * @deprecated
  18394. */
  18395. SelectionController.prototype.deselectNode = function (rowNode) {
  18396. if (rowNode) {
  18397. rowNode.setSelectedParams({ newValue: false, clearSelection: false });
  18398. }
  18399. };
  18400. /**
  18401. * @method
  18402. * @deprecated
  18403. */
  18404. SelectionController.prototype.selectIndex = function (index, tryMulti) {
  18405. var node = this.rowModel.getRow(index);
  18406. this.selectNode(node, tryMulti);
  18407. };
  18408. __decorate([
  18409. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  18410. ], SelectionController.prototype, "rowModel", void 0);
  18411. __decorate([
  18412. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  18413. ], SelectionController.prototype, "gridOptionsWrapper", void 0);
  18414. __decorate([
  18415. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  18416. ], SelectionController.prototype, "columnApi", void 0);
  18417. __decorate([
  18418. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  18419. ], SelectionController.prototype, "gridApi", void 0);
  18420. __decorate([
  18421. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory'))
  18422. ], SelectionController.prototype, "setBeans", null);
  18423. __decorate([
  18424. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  18425. ], SelectionController.prototype, "init", null);
  18426. SelectionController = __decorate([
  18427. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('selectionController')
  18428. ], SelectionController);
  18429. return SelectionController;
  18430. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  18431. /***/ }),
  18432. /* 97 */
  18433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18434. "use strict";
  18435. __webpack_require__.r(__webpack_exports__);
  18436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangedPath", function() { return ChangedPath; });
  18437. /**
  18438. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  18439. * @version v23.2.1
  18440. * @link http://www.ag-grid.com/
  18441. * @license MIT
  18442. */
  18443. // when doing transactions, or change detection, and grouping is present
  18444. // in the data, there is no need for the ClientSideRowModel to update each
  18445. // group after an update, ony parts that were impacted by the change.
  18446. // this class keeps track of all groups that were impacted by a transaction.
  18447. // the the different CSRM operations (filter, sort etc) use the forEach method
  18448. // to visit each group that was changed.
  18449. var ChangedPath = /** @class */ (function () {
  18450. function ChangedPath(keepingColumns, rootNode) {
  18451. // whether changed path is active of not. it is active when a) doing
  18452. // a transaction update or b) doing change detection. if we are doing
  18453. // a CSRM refresh for other reasons (after sort or filter, or user calling
  18454. // setRowData() without delta mode) then we are not active. we are also
  18455. // marked as not active if secondary columns change in pivot (as this impacts
  18456. // aggregations)
  18457. this.active = true;
  18458. // for each node in the change path, we also store which columns need
  18459. // to be re-aggregated.
  18460. this.nodeIdsToColumns = {};
  18461. // for quick lookup, all items in the change path are mapped by nodeId
  18462. this.mapToItems = {};
  18463. this.keepingColumns = keepingColumns;
  18464. this.pathRoot = {
  18465. rowNode: rootNode,
  18466. children: null
  18467. };
  18468. this.mapToItems[rootNode.id] = this.pathRoot;
  18469. }
  18470. // can be set inactive by:
  18471. // a) ClientSideRowModel, if no transactions or
  18472. // b) PivotService, if secondary columns changed
  18473. ChangedPath.prototype.setInactive = function () {
  18474. this.active = false;
  18475. };
  18476. ChangedPath.prototype.isActive = function () {
  18477. return this.active;
  18478. };
  18479. ChangedPath.prototype.depthFirstSearchChangedPath = function (pathItem, callback) {
  18480. if (pathItem.children) {
  18481. for (var i = 0; i < pathItem.children.length; i++) {
  18482. this.depthFirstSearchChangedPath(pathItem.children[i], callback);
  18483. }
  18484. }
  18485. callback(pathItem.rowNode);
  18486. };
  18487. ChangedPath.prototype.depthFirstSearchEverything = function (rowNode, callback, traverseEverything) {
  18488. if (rowNode.childrenAfterGroup) {
  18489. for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {
  18490. var childNode = rowNode.childrenAfterGroup[i];
  18491. if (childNode.childrenAfterGroup) {
  18492. this.depthFirstSearchEverything(rowNode.childrenAfterGroup[i], callback, traverseEverything);
  18493. }
  18494. else if (traverseEverything) {
  18495. callback(childNode);
  18496. }
  18497. }
  18498. }
  18499. callback(rowNode);
  18500. };
  18501. // traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback
  18502. // will be called for child nodes in addition to parent nodes.
  18503. ChangedPath.prototype.forEachChangedNodeDepthFirst = function (callback, traverseLeafNodes) {
  18504. if (traverseLeafNodes === void 0) { traverseLeafNodes = false; }
  18505. if (this.active) {
  18506. // if we are active, then use the change path to callback
  18507. // only for updated groups
  18508. this.depthFirstSearchChangedPath(this.pathRoot, callback);
  18509. }
  18510. else {
  18511. // we are not active, so callback for everything, walk the entire path
  18512. this.depthFirstSearchEverything(this.pathRoot.rowNode, callback, traverseLeafNodes);
  18513. }
  18514. };
  18515. ChangedPath.prototype.executeFromRootNode = function (callback) {
  18516. callback(this.pathRoot.rowNode);
  18517. };
  18518. ChangedPath.prototype.createPathItems = function (rowNode) {
  18519. var pointer = rowNode;
  18520. var newEntryCount = 0;
  18521. while (!this.mapToItems[pointer.id]) {
  18522. var newEntry = {
  18523. rowNode: pointer,
  18524. children: null
  18525. };
  18526. this.mapToItems[pointer.id] = newEntry;
  18527. newEntryCount++;
  18528. pointer = pointer.parent;
  18529. }
  18530. return newEntryCount;
  18531. };
  18532. ChangedPath.prototype.populateColumnsMap = function (rowNode, columns) {
  18533. var _this = this;
  18534. if (!this.keepingColumns || !columns) {
  18535. return;
  18536. }
  18537. var pointer = rowNode;
  18538. while (pointer) {
  18539. // if columns, add the columns in all the way to parent, merging
  18540. // in any other columns that might be there already
  18541. if (!this.nodeIdsToColumns[pointer.id]) {
  18542. this.nodeIdsToColumns[pointer.id] = {};
  18543. }
  18544. columns.forEach(function (col) { return _this.nodeIdsToColumns[pointer.id][col.getId()] = true; });
  18545. pointer = pointer.parent;
  18546. }
  18547. };
  18548. ChangedPath.prototype.linkPathItems = function (rowNode, newEntryCount) {
  18549. var pointer = rowNode;
  18550. for (var i = 0; i < newEntryCount; i++) {
  18551. var thisItem = this.mapToItems[pointer.id];
  18552. var parentItem = this.mapToItems[pointer.parent.id];
  18553. if (!parentItem.children) {
  18554. parentItem.children = [];
  18555. }
  18556. parentItem.children.push(thisItem);
  18557. pointer = pointer.parent;
  18558. }
  18559. };
  18560. // called by
  18561. // 1) change detection (provides cols) and
  18562. // 2) groupStage if doing transaction update (doesn't provide cols)
  18563. ChangedPath.prototype.addParentNode = function (rowNode, columns) {
  18564. if (!rowNode || rowNode.isRowPinned()) {
  18565. return;
  18566. }
  18567. // we cannot do both steps below in the same loop as
  18568. // the second loop has a dependency on the first loop.
  18569. // ie the hierarchy cannot be stitched up yet because
  18570. // we don't have it built yet
  18571. // create the new PathItem objects.
  18572. var newEntryCount = this.createPathItems(rowNode);
  18573. // link in the node items
  18574. this.linkPathItems(rowNode, newEntryCount);
  18575. // update columns
  18576. this.populateColumnsMap(rowNode, columns);
  18577. };
  18578. ChangedPath.prototype.canSkip = function (rowNode) {
  18579. return this.active && !this.mapToItems[rowNode.id];
  18580. };
  18581. ChangedPath.prototype.getValueColumnsForNode = function (rowNode, valueColumns) {
  18582. if (!this.keepingColumns) {
  18583. return valueColumns;
  18584. }
  18585. var colsForThisNode = this.nodeIdsToColumns[rowNode.id];
  18586. var result = valueColumns.filter(function (col) { return colsForThisNode[col.getId()]; });
  18587. return result;
  18588. };
  18589. ChangedPath.prototype.getNotValueColumnsForNode = function (rowNode, valueColumns) {
  18590. if (!this.keepingColumns) {
  18591. return null;
  18592. }
  18593. var colsForThisNode = this.nodeIdsToColumns[rowNode.id];
  18594. var result = valueColumns.filter(function (col) { return !colsForThisNode[col.getId()]; });
  18595. return result;
  18596. };
  18597. return ChangedPath;
  18598. }());
  18599. /***/ }),
  18600. /* 98 */
  18601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18602. "use strict";
  18603. __webpack_require__.r(__webpack_exports__);
  18604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnApi", function() { return ColumnApi; });
  18605. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  18606. /**
  18607. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  18608. * @version v23.2.1
  18609. * @link http://www.ag-grid.com/
  18610. * @license MIT
  18611. */
  18612. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  18613. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  18614. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  18615. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  18616. return c > 3 && r && Object.defineProperty(target, key, r), r;
  18617. };
  18618. var ColumnApi = /** @class */ (function () {
  18619. function ColumnApi() {
  18620. }
  18621. ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) {
  18622. // AG-3403 validate that gridWidth is provided because this method has the same name as
  18623. // a method on the grid API that takes no arguments, and it's easy to confuse the two
  18624. if (typeof gridWidth === "undefined") {
  18625. console.error('ag-Grid: missing parameter to columnApi.sizeColumnsToFit(gridWidth)');
  18626. }
  18627. this.columnController.sizeColumnsToFit(gridWidth, 'api');
  18628. };
  18629. ColumnApi.prototype.setColumnGroupOpened = function (group, newValue) { this.columnController.setColumnGroupOpened(group, newValue, 'api'); };
  18630. ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this.columnController.getColumnGroup(name, instanceId); };
  18631. ColumnApi.prototype.getOriginalColumnGroup = function (name) { return this.columnController.getOriginalColumnGroup(name); };
  18632. ColumnApi.prototype.getDisplayNameForColumn = function (column, location) { return this.columnController.getDisplayNameForColumn(column, location) || ''; };
  18633. ColumnApi.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.columnController.getDisplayNameForColumnGroup(columnGroup, location) || ''; };
  18634. ColumnApi.prototype.getColumn = function (key) { return this.columnController.getPrimaryColumn(key); };
  18635. ColumnApi.prototype.setColumnState = function (columnState) { return this.columnController.setColumnState(columnState, false, 'api'); };
  18636. ColumnApi.prototype.getColumnState = function () { return this.columnController.getColumnState(); };
  18637. ColumnApi.prototype.resetColumnState = function () { this.columnController.resetColumnState(false, 'api'); };
  18638. ColumnApi.prototype.getColumnGroupState = function () { return this.columnController.getColumnGroupState(); };
  18639. ColumnApi.prototype.setColumnGroupState = function (stateItems) { this.columnController.setColumnGroupState(stateItems, 'api'); };
  18640. ColumnApi.prototype.resetColumnGroupState = function () { this.columnController.resetColumnGroupState('api'); };
  18641. ColumnApi.prototype.isPinning = function () { return this.columnController.isPinningLeft() || this.columnController.isPinningRight(); };
  18642. ColumnApi.prototype.isPinningLeft = function () { return this.columnController.isPinningLeft(); };
  18643. ColumnApi.prototype.isPinningRight = function () { return this.columnController.isPinningRight(); };
  18644. ColumnApi.prototype.getDisplayedColAfter = function (col) { return this.columnController.getDisplayedColAfter(col); };
  18645. ColumnApi.prototype.getDisplayedColBefore = function (col) { return this.columnController.getDisplayedColBefore(col); };
  18646. ColumnApi.prototype.setColumnVisible = function (key, visible) { this.columnController.setColumnVisible(key, visible, 'api'); };
  18647. ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this.columnController.setColumnsVisible(keys, visible, 'api'); };
  18648. ColumnApi.prototype.setColumnPinned = function (key, pinned) { this.columnController.setColumnPinned(key, pinned, 'api'); };
  18649. ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this.columnController.setColumnsPinned(keys, pinned, 'api'); };
  18650. ColumnApi.prototype.getAllColumns = function () { return this.columnController.getAllPrimaryColumns(); };
  18651. ColumnApi.prototype.getAllGridColumns = function () { return this.columnController.getAllGridColumns(); };
  18652. ColumnApi.prototype.getDisplayedLeftColumns = function () { return this.columnController.getDisplayedLeftColumns(); };
  18653. ColumnApi.prototype.getDisplayedCenterColumns = function () { return this.columnController.getDisplayedCenterColumns(); };
  18654. ColumnApi.prototype.getDisplayedRightColumns = function () { return this.columnController.getDisplayedRightColumns(); };
  18655. ColumnApi.prototype.getAllDisplayedColumns = function () { return this.columnController.getAllDisplayedColumns(); };
  18656. ColumnApi.prototype.getAllDisplayedVirtualColumns = function () { return this.columnController.getAllDisplayedVirtualColumns(); };
  18657. ColumnApi.prototype.moveColumn = function (key, toIndex) {
  18658. if (typeof key === 'number') {
  18659. // moveColumn used to take indexes, so this is advising user who hasn't moved to new method name
  18660. console.warn('ag-Grid: you are using moveColumn(fromIndex, toIndex) - moveColumn takes a column key and a destination index, not two indexes, to move with indexes use moveColumnByIndex(from,to) instead');
  18661. this.columnController.moveColumnByIndex(key, toIndex, 'api');
  18662. }
  18663. else {
  18664. this.columnController.moveColumn(key, toIndex, 'api');
  18665. }
  18666. };
  18667. ColumnApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.columnController.moveColumnByIndex(fromIndex, toIndex, 'api'); };
  18668. ColumnApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.columnController.moveColumns(columnsToMoveKeys, toIndex, 'api'); };
  18669. ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.columnController.moveRowGroupColumn(fromIndex, toIndex); };
  18670. ColumnApi.prototype.setColumnAggFunc = function (column, aggFunc) { this.columnController.setColumnAggFunc(column, aggFunc); };
  18671. ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished) {
  18672. if (finished === void 0) { finished = true; }
  18673. this.columnController.setColumnWidths([{ key: key, newWidth: newWidth }], false, finished);
  18674. };
  18675. ColumnApi.prototype.setColumnWidths = function (columnWidths, finished) {
  18676. if (finished === void 0) { finished = true; }
  18677. this.columnController.setColumnWidths(columnWidths, false, finished);
  18678. };
  18679. ColumnApi.prototype.setPivotMode = function (pivotMode) { this.columnController.setPivotMode(pivotMode); };
  18680. ColumnApi.prototype.isPivotMode = function () { return this.columnController.isPivotMode(); };
  18681. ColumnApi.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { return this.columnController.getSecondaryPivotColumn(pivotKeys, valueColKey); };
  18682. ColumnApi.prototype.setValueColumns = function (colKeys) { this.columnController.setValueColumns(colKeys, 'api'); };
  18683. ColumnApi.prototype.getValueColumns = function () { return this.columnController.getValueColumns(); };
  18684. ColumnApi.prototype.removeValueColumn = function (colKey) { this.columnController.removeValueColumn(colKey, 'api'); };
  18685. ColumnApi.prototype.removeValueColumns = function (colKeys) { this.columnController.removeValueColumns(colKeys, 'api'); };
  18686. ColumnApi.prototype.addValueColumn = function (colKey) { this.columnController.addValueColumn(colKey, 'api'); };
  18687. ColumnApi.prototype.addValueColumns = function (colKeys) { this.columnController.addValueColumns(colKeys, 'api'); };
  18688. ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this.columnController.setRowGroupColumns(colKeys, 'api'); };
  18689. ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this.columnController.removeRowGroupColumn(colKey, 'api'); };
  18690. ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this.columnController.removeRowGroupColumns(colKeys, 'api'); };
  18691. ColumnApi.prototype.addRowGroupColumn = function (colKey) { this.columnController.addRowGroupColumn(colKey, 'api'); };
  18692. ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this.columnController.addRowGroupColumns(colKeys, 'api'); };
  18693. ColumnApi.prototype.getRowGroupColumns = function () { return this.columnController.getRowGroupColumns(); };
  18694. ColumnApi.prototype.setPivotColumns = function (colKeys) { this.columnController.setPivotColumns(colKeys, 'api'); };
  18695. ColumnApi.prototype.removePivotColumn = function (colKey) { this.columnController.removePivotColumn(colKey, 'api'); };
  18696. ColumnApi.prototype.removePivotColumns = function (colKeys) { this.columnController.removePivotColumns(colKeys, 'api'); };
  18697. ColumnApi.prototype.addPivotColumn = function (colKey) { this.columnController.addPivotColumn(colKey, 'api'); };
  18698. ColumnApi.prototype.addPivotColumns = function (colKeys) { this.columnController.addPivotColumns(colKeys, 'api'); };
  18699. ColumnApi.prototype.getPivotColumns = function () { return this.columnController.getPivotColumns(); };
  18700. ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this.columnController.getLeftDisplayedColumnGroups(); };
  18701. ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this.columnController.getCenterDisplayedColumnGroups(); };
  18702. ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this.columnController.getRightDisplayedColumnGroups(); };
  18703. ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this.columnController.getAllDisplayedColumnGroups(); };
  18704. ColumnApi.prototype.autoSizeColumn = function (key, skipHeader) { return this.columnController.autoSizeColumn(key, skipHeader, 'api'); };
  18705. ColumnApi.prototype.autoSizeColumns = function (keys, skipHeader) { return this.columnController.autoSizeColumns(keys, skipHeader, 'api'); };
  18706. ColumnApi.prototype.autoSizeAllColumns = function (skipHeader) { this.columnController.autoSizeAllColumns(skipHeader, 'api'); };
  18707. ColumnApi.prototype.setSecondaryColumns = function (colDefs) { this.columnController.setSecondaryColumns(colDefs, 'api'); };
  18708. ColumnApi.prototype.getSecondaryColumns = function () { return this.columnController.getSecondaryColumns(); };
  18709. ColumnApi.prototype.getPrimaryColumns = function () { return this.columnController.getAllPrimaryColumns(); };
  18710. // below goes through deprecated items, prints message to user, then calls the new version of the same method
  18711. ColumnApi.prototype.columnGroupOpened = function (group, newValue) {
  18712. console.error('ag-Grid: columnGroupOpened no longer exists, use setColumnGroupOpened');
  18713. this.setColumnGroupOpened(group, newValue);
  18714. };
  18715. ColumnApi.prototype.hideColumns = function (colIds, hide) {
  18716. console.error('ag-Grid: hideColumns is deprecated, use setColumnsVisible');
  18717. this.columnController.setColumnsVisible(colIds, !hide, 'api');
  18718. };
  18719. ColumnApi.prototype.hideColumn = function (colId, hide) {
  18720. console.error('ag-Grid: hideColumn is deprecated, use setColumnVisible');
  18721. this.columnController.setColumnVisible(colId, !hide, 'api');
  18722. };
  18723. ColumnApi.prototype.setState = function (columnState) {
  18724. console.error('ag-Grid: setState is deprecated, use setColumnState');
  18725. return this.setColumnState(columnState);
  18726. };
  18727. ColumnApi.prototype.getState = function () {
  18728. console.error('ag-Grid: getState is deprecated, use getColumnState');
  18729. return this.getColumnState();
  18730. };
  18731. ColumnApi.prototype.resetState = function () {
  18732. console.error('ag-Grid: resetState is deprecated, use resetColumnState');
  18733. this.resetColumnState();
  18734. };
  18735. ColumnApi.prototype.getAggregationColumns = function () {
  18736. console.error('ag-Grid: getAggregationColumns is deprecated, use getValueColumns');
  18737. return this.columnController.getValueColumns();
  18738. };
  18739. ColumnApi.prototype.removeAggregationColumn = function (colKey) {
  18740. console.error('ag-Grid: removeAggregationColumn is deprecated, use removeValueColumn');
  18741. this.columnController.removeValueColumn(colKey, 'api');
  18742. };
  18743. ColumnApi.prototype.removeAggregationColumns = function (colKeys) {
  18744. console.error('ag-Grid: removeAggregationColumns is deprecated, use removeValueColumns');
  18745. this.columnController.removeValueColumns(colKeys, 'api');
  18746. };
  18747. ColumnApi.prototype.addAggregationColumn = function (colKey) {
  18748. console.error('ag-Grid: addAggregationColumn is deprecated, use addValueColumn');
  18749. this.columnController.addValueColumn(colKey, 'api');
  18750. };
  18751. ColumnApi.prototype.addAggregationColumns = function (colKeys) {
  18752. console.error('ag-Grid: addAggregationColumns is deprecated, use addValueColumns');
  18753. this.columnController.addValueColumns(colKeys, 'api');
  18754. };
  18755. ColumnApi.prototype.setColumnAggFunction = function (column, aggFunc) {
  18756. console.error('ag-Grid: setColumnAggFunction is deprecated, use setColumnAggFunc');
  18757. this.columnController.setColumnAggFunc(column, aggFunc, 'api');
  18758. };
  18759. ColumnApi.prototype.getDisplayNameForCol = function (column) {
  18760. console.error('ag-Grid: getDisplayNameForCol is deprecated, use getDisplayNameForColumn');
  18761. return this.getDisplayNameForColumn(column, null);
  18762. };
  18763. __decorate([
  18764. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  18765. ], ColumnApi.prototype, "columnController", void 0);
  18766. ColumnApi = __decorate([
  18767. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('columnApi')
  18768. ], ColumnApi);
  18769. return ColumnApi;
  18770. }());
  18771. /***/ }),
  18772. /* 99 */
  18773. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18774. "use strict";
  18775. __webpack_require__.r(__webpack_exports__);
  18776. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowRenderer", function() { return RowRenderer; });
  18777. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
  18778. /* harmony import */ var _rowComp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(100);
  18779. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35);
  18780. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  18781. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
  18782. /* harmony import */ var _cellComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(101);
  18783. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37);
  18784. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(41);
  18785. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7);
  18786. /**
  18787. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  18788. * @version v23.2.1
  18789. * @link http://www.ag-grid.com/
  18790. * @license MIT
  18791. */
  18792. var __extends = (undefined && undefined.__extends) || (function () {
  18793. var extendStatics = function (d, b) {
  18794. extendStatics = Object.setPrototypeOf ||
  18795. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  18796. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  18797. return extendStatics(d, b);
  18798. };
  18799. return function (d, b) {
  18800. extendStatics(d, b);
  18801. function __() { this.constructor = d; }
  18802. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  18803. };
  18804. })();
  18805. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  18806. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  18807. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  18808. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  18809. return c > 3 && r && Object.defineProperty(target, key, r), r;
  18810. };
  18811. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  18812. return function (target, key) { decorator(target, key, paramIndex); }
  18813. };
  18814. var RowRenderer = /** @class */ (function (_super) {
  18815. __extends(RowRenderer, _super);
  18816. function RowRenderer() {
  18817. var _this = _super !== null && _super.apply(this, arguments) || this;
  18818. _this.destroyFuncsForColumnListeners = [];
  18819. // map of row ids to row objects. keeps track of which elements
  18820. // are rendered for which rows in the dom.
  18821. _this.rowCompsByIndex = {};
  18822. _this.floatingTopRowComps = [];
  18823. _this.floatingBottomRowComps = [];
  18824. // we only allow one refresh at a time, otherwise the internal memory structure here
  18825. // will get messed up. this can happen if the user has a cellRenderer, and inside the
  18826. // renderer they call an API method that results in another pass of the refresh,
  18827. // then it will be trying to draw rows in the middle of a refresh.
  18828. _this.refreshInProgress = false;
  18829. return _this;
  18830. }
  18831. RowRenderer.prototype.registerGridCore = function (gridCore) {
  18832. this.gridCore = gridCore;
  18833. };
  18834. RowRenderer.prototype.getGridCore = function () {
  18835. return this.gridCore;
  18836. };
  18837. RowRenderer.prototype.agWire = function (loggerFactory) {
  18838. this.logger = loggerFactory.create("RowRenderer");
  18839. };
  18840. RowRenderer.prototype.registerGridComp = function (gridPanel) {
  18841. this.gridPanel = gridPanel;
  18842. this.rowContainers = this.gridPanel.getRowContainers();
  18843. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_PAGINATION_CHANGED, this.onPageLoaded.bind(this));
  18844. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this));
  18845. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
  18846. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_BODY_SCROLL, this.redrawAfterScroll.bind(this));
  18847. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_BODY_HEIGHT_CHANGED, this.redrawAfterScroll.bind(this));
  18848. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.onDomLayoutChanged.bind(this));
  18849. this.registerCellEventListeners();
  18850. this.printLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].DOM_LAYOUT_PRINT;
  18851. this.embedFullWidthRows = this.printLayout || this.gridOptionsWrapper.isEmbedFullWidthRows();
  18852. this.redrawAfterModelUpdate();
  18853. };
  18854. // in a clean design, each cell would register for each of these events. however when scrolling, all the cells
  18855. // registering and de-registering for events is a performance bottleneck. so we register here once and inform
  18856. // all active cells.
  18857. RowRenderer.prototype.registerCellEventListeners = function () {
  18858. var _this = this;
  18859. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_CELL_FOCUSED, function (event) {
  18860. _this.forEachCellComp(function (cellComp) { return cellComp.onCellFocused(event); });
  18861. });
  18862. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_FLASH_CELLS, function (event) {
  18863. _this.forEachCellComp(function (cellComp) { return cellComp.onFlashCells(event); });
  18864. });
  18865. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_HOVER_CHANGED, function () {
  18866. _this.forEachCellComp(function (cellComp) { return cellComp.onColumnHover(); });
  18867. });
  18868. // only for printLayout - because we are rendering all the cells in the same row, regardless of pinned state,
  18869. // then changing the width of the containers will impact left position. eg the center cols all have their
  18870. // left position adjusted by the width of the left pinned column, so if the pinned left column width changes,
  18871. // all the center cols need to be shifted to accommodate this. when in normal layout, the pinned cols are
  18872. // in different containers so doesn't impact.
  18873. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, function () {
  18874. if (_this.printLayout) {
  18875. _this.forEachCellComp(function (cellComp) { return cellComp.onLeftChanged(); });
  18876. }
  18877. });
  18878. var rangeSelectionEnabled = this.gridOptionsWrapper.isEnableRangeSelection();
  18879. if (rangeSelectionEnabled) {
  18880. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_RANGE_SELECTION_CHANGED, function () {
  18881. _this.forEachCellComp(function (cellComp) { return cellComp.onRangeSelectionChanged(); });
  18882. });
  18883. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_MOVED, function () {
  18884. _this.forEachCellComp(function (cellComp) { return cellComp.updateRangeBordersIfRangeCount(); });
  18885. });
  18886. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_PINNED, function () {
  18887. _this.forEachCellComp(function (cellComp) { return cellComp.updateRangeBordersIfRangeCount(); });
  18888. });
  18889. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_VISIBLE, function () {
  18890. _this.forEachCellComp(function (cellComp) { return cellComp.updateRangeBordersIfRangeCount(); });
  18891. });
  18892. }
  18893. // add listeners to the grid columns
  18894. this.refreshListenersToColumnsForCellComps();
  18895. // if the grid columns change, then refresh the listeners again
  18896. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_GRID_COLUMNS_CHANGED, this.refreshListenersToColumnsForCellComps.bind(this));
  18897. this.addDestroyFunc(this.removeGridColumnListeners.bind(this));
  18898. };
  18899. // executes all functions in destroyFuncsForColumnListeners and then clears the list
  18900. RowRenderer.prototype.removeGridColumnListeners = function () {
  18901. this.destroyFuncsForColumnListeners.forEach(function (func) { return func(); });
  18902. this.destroyFuncsForColumnListeners.length = 0;
  18903. };
  18904. // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for.
  18905. // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to
  18906. // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here
  18907. // once instead.
  18908. RowRenderer.prototype.refreshListenersToColumnsForCellComps = function () {
  18909. var _this = this;
  18910. this.removeGridColumnListeners();
  18911. var cols = this.columnController.getAllGridColumns();
  18912. if (!cols) {
  18913. return;
  18914. }
  18915. cols.forEach(function (col) {
  18916. var forEachCellWithThisCol = function (callback) {
  18917. _this.forEachCellComp(function (cellComp) {
  18918. if (cellComp.getColumn() === col) {
  18919. callback(cellComp);
  18920. }
  18921. });
  18922. };
  18923. var leftChangedListener = function () {
  18924. forEachCellWithThisCol(function (cellComp) { return cellComp.onLeftChanged(); });
  18925. };
  18926. var widthChangedListener = function () {
  18927. forEachCellWithThisCol(function (cellComp) { return cellComp.onWidthChanged(); });
  18928. };
  18929. var firstRightPinnedChangedListener = function () {
  18930. forEachCellWithThisCol(function (cellComp) { return cellComp.onFirstRightPinnedChanged(); });
  18931. };
  18932. var lastLeftPinnedChangedListener = function () {
  18933. forEachCellWithThisCol(function (cellComp) { return cellComp.onLastLeftPinnedChanged(); });
  18934. };
  18935. col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LEFT_CHANGED, leftChangedListener);
  18936. col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
  18937. col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_FIRST_RIGHT_PINNED_CHANGED, firstRightPinnedChangedListener);
  18938. col.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LAST_LEFT_PINNED_CHANGED, lastLeftPinnedChangedListener);
  18939. _this.destroyFuncsForColumnListeners.push(function () {
  18940. col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LEFT_CHANGED, leftChangedListener);
  18941. col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
  18942. col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_FIRST_RIGHT_PINNED_CHANGED, firstRightPinnedChangedListener);
  18943. col.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_2__["Column"].EVENT_LAST_LEFT_PINNED_CHANGED, lastLeftPinnedChangedListener);
  18944. });
  18945. });
  18946. };
  18947. RowRenderer.prototype.onDomLayoutChanged = function () {
  18948. var printLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].DOM_LAYOUT_PRINT;
  18949. var embedFullWidthRows = printLayout || this.gridOptionsWrapper.isEmbedFullWidthRows();
  18950. // if moving towards or away from print layout, means we need to destroy all rows, as rows are not laid
  18951. // out using absolute positioning when doing print layout
  18952. var destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout;
  18953. this.printLayout = printLayout;
  18954. this.embedFullWidthRows = embedFullWidthRows;
  18955. if (destroyRows) {
  18956. this.redrawAfterModelUpdate();
  18957. }
  18958. };
  18959. // for row models that have datasources, when we update the datasource, we need to force the rowRenderer
  18960. // to redraw all rows. otherwise the old rows from the old datasource will stay displayed.
  18961. RowRenderer.prototype.datasourceChanged = function () {
  18962. this.firstRenderedRow = 0;
  18963. this.lastRenderedRow = -1;
  18964. var rowIndexesToRemove = Object.keys(this.rowCompsByIndex);
  18965. this.removeRowComps(rowIndexesToRemove);
  18966. };
  18967. RowRenderer.prototype.onPageLoaded = function (refreshEvent) {
  18968. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(refreshEvent)) {
  18969. refreshEvent = {
  18970. type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_MODEL_UPDATED,
  18971. api: this.gridApi,
  18972. columnApi: this.columnApi,
  18973. animate: false,
  18974. keepRenderedRows: false,
  18975. newData: false,
  18976. newPage: false
  18977. };
  18978. }
  18979. this.onModelUpdated(refreshEvent);
  18980. };
  18981. RowRenderer.prototype.getAllCellsForColumn = function (column) {
  18982. var eCells = [];
  18983. function callback(key, rowComp) {
  18984. var eCell = rowComp.getCellForCol(column);
  18985. if (eCell) {
  18986. eCells.push(eCell);
  18987. }
  18988. }
  18989. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, callback);
  18990. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.floatingBottomRowComps, callback);
  18991. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.floatingTopRowComps, callback);
  18992. return eCells;
  18993. };
  18994. RowRenderer.prototype.refreshFloatingRowComps = function () {
  18995. this.refreshFloatingRows(this.floatingTopRowComps, this.pinnedRowModel.getPinnedTopRowData(), this.rowContainers.floatingTopPinnedLeft, this.rowContainers.floatingTopPinnedRight, this.rowContainers.floatingTop, this.rowContainers.floatingTopFullWidth);
  18996. this.refreshFloatingRows(this.floatingBottomRowComps, this.pinnedRowModel.getPinnedBottomRowData(), this.rowContainers.floatingBottomPinnedLeft, this.rowContainers.floatingBottomPinnedRight, this.rowContainers.floatingBottom, this.rowContainers.floatingBottomFullWidth);
  18997. };
  18998. RowRenderer.prototype.refreshFloatingRows = function (rowComps, rowNodes, pinnedLeftContainerComp, pinnedRightContainerComp, bodyContainerComp, fullWidthContainerComp) {
  18999. var _this = this;
  19000. rowComps.forEach(function (row) {
  19001. row.destroy();
  19002. });
  19003. rowComps.length = 0;
  19004. if (rowNodes) {
  19005. rowNodes.forEach(function (node) {
  19006. var rowComp = new _rowComp__WEBPACK_IMPORTED_MODULE_1__["RowComp"](_this.$scope, bodyContainerComp, pinnedLeftContainerComp, pinnedRightContainerComp, fullWidthContainerComp, node, _this.beans, false, false, _this.printLayout, _this.embedFullWidthRows);
  19007. rowComp.init();
  19008. rowComps.push(rowComp);
  19009. });
  19010. }
  19011. this.flushContainers(rowComps);
  19012. };
  19013. RowRenderer.prototype.onPinnedRowDataChanged = function () {
  19014. // recycling rows in order to ensure cell editing is not cancelled
  19015. var params = {
  19016. recycleRows: true
  19017. };
  19018. this.redrawAfterModelUpdate(params);
  19019. };
  19020. RowRenderer.prototype.onModelUpdated = function (refreshEvent) {
  19021. var params = {
  19022. recycleRows: refreshEvent.keepRenderedRows,
  19023. animate: refreshEvent.animate,
  19024. newData: refreshEvent.newData,
  19025. newPage: refreshEvent.newPage,
  19026. // because this is a model updated event (not pinned rows), we
  19027. // can skip updating the pinned rows. this is needed so that if user
  19028. // is doing transaction updates, the pinned rows are not getting constantly
  19029. // trashed - or editing cells in pinned rows are not refreshed and put into read mode
  19030. onlyBody: true
  19031. };
  19032. this.redrawAfterModelUpdate(params);
  19033. };
  19034. // if the row nodes are not rendered, no index is returned
  19035. RowRenderer.prototype.getRenderedIndexesForRowNodes = function (rowNodes) {
  19036. var result = [];
  19037. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(rowNodes)) {
  19038. return result;
  19039. }
  19040. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, function (index, renderedRow) {
  19041. var rowNode = renderedRow.getRowNode();
  19042. if (rowNodes.indexOf(rowNode) >= 0) {
  19043. result.push(index);
  19044. }
  19045. });
  19046. return result;
  19047. };
  19048. RowRenderer.prototype.redrawRows = function (rowNodes) {
  19049. if (!rowNodes || rowNodes.length == 0) {
  19050. return;
  19051. }
  19052. // we only need to be worried about rendered rows, as this method is
  19053. // called to what's rendered. if the row isn't rendered, we don't care
  19054. var indexesToRemove = this.getRenderedIndexesForRowNodes(rowNodes);
  19055. // remove the rows
  19056. this.removeRowComps(indexesToRemove);
  19057. // add draw them again
  19058. this.redrawAfterModelUpdate({
  19059. recycleRows: true
  19060. });
  19061. };
  19062. RowRenderer.prototype.getCellToRestoreFocusToAfterRefresh = function (params) {
  19063. var focusedCell = params.suppressKeepFocus ? null : this.focusController.getFocusCellToUseAfterRefresh();
  19064. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(focusedCell)) {
  19065. return null;
  19066. }
  19067. // if the dom is not actually focused on a cell, then we don't try to refocus. the problem this
  19068. // solves is with editing - if the user is editing, eg focus is on a text field, and not on the
  19069. // cell itself, then the cell can be registered as having focus, however it's the text field that
  19070. // has the focus and not the cell div. therefore, when the refresh is finished, the grid will focus
  19071. // the cell, and not the textfield. that means if the user is in a text field, and the grid refreshes,
  19072. // the focus is lost from the text field. we do not want this.
  19073. var activeElement = document.activeElement;
  19074. var domData = this.gridOptionsWrapper.getDomData(activeElement, _cellComp__WEBPACK_IMPORTED_MODULE_5__["CellComp"].DOM_DATA_KEY_CELL_COMP);
  19075. var elementIsNotACellDev = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(domData);
  19076. return elementIsNotACellDev ? null : focusedCell;
  19077. };
  19078. // gets called after changes to the model.
  19079. RowRenderer.prototype.redrawAfterModelUpdate = function (params) {
  19080. if (params === void 0) { params = {}; }
  19081. this.getLockOnRefresh();
  19082. var focusedCell = this.getCellToRestoreFocusToAfterRefresh(params);
  19083. this.sizeContainerToPageHeight();
  19084. this.scrollToTopIfNewData(params);
  19085. // never recycle rows when print layout, we draw each row again from scratch. this is because print layout
  19086. // uses normal dom layout to put cells into dom - it doesn't allow reordering rows.
  19087. var recycleRows = !this.printLayout && params.recycleRows;
  19088. var animate = params.animate && this.gridOptionsWrapper.isAnimateRows();
  19089. var rowsToRecycle = this.binRowComps(recycleRows);
  19090. this.redraw(rowsToRecycle, animate);
  19091. if (!params.onlyBody) {
  19092. this.refreshFloatingRowComps();
  19093. }
  19094. this.restoreFocusedCell(focusedCell);
  19095. this.releaseLockOnRefresh();
  19096. };
  19097. RowRenderer.prototype.scrollToTopIfNewData = function (params) {
  19098. var scrollToTop = params.newData || params.newPage;
  19099. var suppressScrollToTop = this.gridOptionsWrapper.isSuppressScrollOnNewData();
  19100. if (scrollToTop && !suppressScrollToTop) {
  19101. this.gridPanel.scrollToTop();
  19102. }
  19103. };
  19104. RowRenderer.prototype.sizeContainerToPageHeight = function () {
  19105. var containers = [
  19106. this.rowContainers.body,
  19107. this.rowContainers.fullWidth,
  19108. this.rowContainers.pinnedLeft,
  19109. this.rowContainers.pinnedRight
  19110. ];
  19111. if (this.printLayout) {
  19112. containers.forEach(function (container) { return container.setHeight(null); });
  19113. return;
  19114. }
  19115. var containerHeight = this.paginationProxy.getCurrentPageHeight();
  19116. // we need at least 1 pixel for the horizontal scroll to work. so if there are now rows,
  19117. // we still want the scroll to be present, otherwise there would be no way to scroll the header
  19118. // which might be needed us user wants to access columns
  19119. // on the RHS - and if that was where the filter was that cause no rows to be presented, there
  19120. // is no way to remove the filter.
  19121. if (containerHeight === 0) {
  19122. containerHeight = 1;
  19123. }
  19124. this.maxDivHeightScaler.setModelHeight(containerHeight);
  19125. var realHeight = this.maxDivHeightScaler.getUiContainerHeight();
  19126. containers.forEach(function (container) { return container.setHeight(realHeight); });
  19127. };
  19128. RowRenderer.prototype.getLockOnRefresh = function () {
  19129. if (this.refreshInProgress) {
  19130. throw new Error("ag-Grid: cannot get grid to draw rows when it is in the middle of drawing rows. " +
  19131. "Your code probably called a grid API method while the grid was in the render stage. To overcome " +
  19132. "this, put the API call into a timeout, eg instead of api.refreshView(), " +
  19133. "call setTimeout(function(){api.refreshView(),0}). To see what part of your code " +
  19134. "that caused the refresh check this stacktrace.");
  19135. }
  19136. this.refreshInProgress = true;
  19137. };
  19138. RowRenderer.prototype.releaseLockOnRefresh = function () {
  19139. this.refreshInProgress = false;
  19140. };
  19141. // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without
  19142. // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits
  19143. // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the
  19144. // edited cell).
  19145. RowRenderer.prototype.restoreFocusedCell = function (cellPosition) {
  19146. if (cellPosition) {
  19147. this.focusController.setFocusedCell(cellPosition.rowIndex, cellPosition.column, cellPosition.rowPinned, true);
  19148. }
  19149. };
  19150. RowRenderer.prototype.stopEditing = function (cancel) {
  19151. if (cancel === void 0) { cancel = false; }
  19152. this.forEachRowComp(function (key, rowComp) {
  19153. rowComp.stopEditing(cancel);
  19154. });
  19155. };
  19156. RowRenderer.prototype.forEachCellComp = function (callback) {
  19157. this.forEachRowComp(function (key, rowComp) { return rowComp.forEachCellComp(callback); });
  19158. };
  19159. RowRenderer.prototype.forEachRowComp = function (callback) {
  19160. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, callback);
  19161. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.floatingTopRowComps, callback);
  19162. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.floatingBottomRowComps, callback);
  19163. };
  19164. RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
  19165. var rowComp = this.rowCompsByIndex[rowIndex];
  19166. if (rowComp) {
  19167. rowComp.addEventListener(eventName, callback);
  19168. }
  19169. };
  19170. RowRenderer.prototype.flashCells = function (params) {
  19171. if (params === void 0) { params = {}; }
  19172. var flashDelay = params.flashDelay, fadeDelay = params.fadeDelay;
  19173. this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) { return cellComp.flashCell({ flashDelay: flashDelay, fadeDelay: fadeDelay }); });
  19174. };
  19175. RowRenderer.prototype.refreshCells = function (params) {
  19176. if (params === void 0) { params = {}; }
  19177. var refreshCellParams = {
  19178. forceRefresh: params.force,
  19179. newData: false,
  19180. suppressFlash: params.suppressFlash
  19181. };
  19182. this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) { return cellComp.refreshCell(refreshCellParams); });
  19183. };
  19184. RowRenderer.prototype.getCellRendererInstances = function (params) {
  19185. var res = [];
  19186. this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) {
  19187. var cellRenderer = cellComp.getCellRenderer();
  19188. if (cellRenderer) {
  19189. res.push(cellRenderer);
  19190. }
  19191. });
  19192. return res;
  19193. };
  19194. RowRenderer.prototype.getCellEditorInstances = function (params) {
  19195. var res = [];
  19196. this.forEachCellCompFiltered(params.rowNodes, params.columns, function (cellComp) {
  19197. var cellEditor = cellComp.getCellEditor();
  19198. if (cellEditor) {
  19199. res.push(cellEditor);
  19200. }
  19201. });
  19202. return res;
  19203. };
  19204. RowRenderer.prototype.getEditingCells = function () {
  19205. var res = [];
  19206. this.forEachCellComp(function (cellComp) {
  19207. if (cellComp.isEditing()) {
  19208. var cellPosition = cellComp.getCellPosition();
  19209. res.push(cellPosition);
  19210. }
  19211. });
  19212. return res;
  19213. };
  19214. // calls the callback for each cellComp that match the provided rowNodes and columns. eg if one row node
  19215. // and two columns provided, that identifies 4 cells, so callback gets called 4 times, once for each cell.
  19216. RowRenderer.prototype.forEachCellCompFiltered = function (rowNodes, columns, callback) {
  19217. var _this = this;
  19218. var rowIdsMap;
  19219. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowNodes)) {
  19220. rowIdsMap = {
  19221. top: {},
  19222. bottom: {},
  19223. normal: {}
  19224. };
  19225. rowNodes.forEach(function (rowNode) {
  19226. if (rowNode.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP) {
  19227. rowIdsMap.top[rowNode.id] = true;
  19228. }
  19229. else if (rowNode.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM) {
  19230. rowIdsMap.bottom[rowNode.id] = true;
  19231. }
  19232. else {
  19233. rowIdsMap.normal[rowNode.id] = true;
  19234. }
  19235. });
  19236. }
  19237. var colIdsMap;
  19238. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(columns)) {
  19239. colIdsMap = {};
  19240. columns.forEach(function (colKey) {
  19241. var column = _this.columnController.getGridColumn(colKey);
  19242. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(column)) {
  19243. colIdsMap[column.getId()] = true;
  19244. }
  19245. });
  19246. }
  19247. var processRow = function (rowComp) {
  19248. var rowNode = rowComp.getRowNode();
  19249. var id = rowNode.id;
  19250. var floating = rowNode.rowPinned;
  19251. // skip this row if it is missing from the provided list
  19252. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowIdsMap)) {
  19253. if (floating === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM) {
  19254. if (!rowIdsMap.bottom[id]) {
  19255. return;
  19256. }
  19257. }
  19258. else if (floating === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP) {
  19259. if (!rowIdsMap.top[id]) {
  19260. return;
  19261. }
  19262. }
  19263. else {
  19264. if (!rowIdsMap.normal[id]) {
  19265. return;
  19266. }
  19267. }
  19268. }
  19269. rowComp.forEachCellComp(function (cellComp) {
  19270. var colId = cellComp.getColumn().getId();
  19271. var excludeColFromRefresh = colIdsMap && !colIdsMap[colId];
  19272. if (excludeColFromRefresh) {
  19273. return;
  19274. }
  19275. callback(cellComp);
  19276. });
  19277. };
  19278. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, function (index, rowComp) {
  19279. processRow(rowComp);
  19280. });
  19281. if (this.floatingTopRowComps) {
  19282. this.floatingTopRowComps.forEach(processRow);
  19283. }
  19284. if (this.floatingBottomRowComps) {
  19285. this.floatingBottomRowComps.forEach(processRow);
  19286. }
  19287. };
  19288. RowRenderer.prototype.destroy = function () {
  19289. var rowIndexesToRemove = Object.keys(this.rowCompsByIndex);
  19290. this.removeRowComps(rowIndexesToRemove);
  19291. _super.prototype.destroy.call(this);
  19292. };
  19293. RowRenderer.prototype.binRowComps = function (recycleRows) {
  19294. var _this = this;
  19295. var rowsToRecycle = {};
  19296. var indexesToRemove;
  19297. if (recycleRows) {
  19298. indexesToRemove = [];
  19299. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, function (index, rowComp) {
  19300. var rowNode = rowComp.getRowNode();
  19301. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowNode.id)) {
  19302. rowsToRecycle[rowNode.id] = rowComp;
  19303. delete _this.rowCompsByIndex[index];
  19304. }
  19305. else {
  19306. indexesToRemove.push(index);
  19307. }
  19308. });
  19309. }
  19310. else {
  19311. indexesToRemove = Object.keys(this.rowCompsByIndex);
  19312. }
  19313. this.removeRowComps(indexesToRemove);
  19314. return rowsToRecycle;
  19315. };
  19316. // takes array of row indexes
  19317. RowRenderer.prototype.removeRowComps = function (rowsToRemove) {
  19318. var _this = this;
  19319. // if no fromIndex then set to -1, which will refresh everything
  19320. // let realFromIndex = -1;
  19321. rowsToRemove.forEach(function (indexToRemove) {
  19322. var renderedRow = _this.rowCompsByIndex[indexToRemove];
  19323. renderedRow.destroy();
  19324. delete _this.rowCompsByIndex[indexToRemove];
  19325. });
  19326. };
  19327. // gets called when rows don't change, but viewport does, so after:
  19328. // 1) height of grid body changes, ie number of displayed rows has changed
  19329. // 2) grid scrolled to new position
  19330. // 3) ensure index visible (which is a scroll)
  19331. RowRenderer.prototype.redrawAfterScroll = function () {
  19332. this.getLockOnRefresh();
  19333. this.redraw(null, false, true);
  19334. this.releaseLockOnRefresh();
  19335. };
  19336. RowRenderer.prototype.removeRowCompsNotToDraw = function (indexesToDraw) {
  19337. // for speedy lookup, dump into map
  19338. var indexesToDrawMap = {};
  19339. indexesToDraw.forEach(function (index) { return (indexesToDrawMap[index] = true); });
  19340. var existingIndexes = Object.keys(this.rowCompsByIndex);
  19341. var indexesNotToDraw = existingIndexes.filter(function (index) { return !indexesToDrawMap[index]; });
  19342. this.removeRowComps(indexesNotToDraw);
  19343. };
  19344. RowRenderer.prototype.calculateIndexesToDraw = function (rowsToRecycle) {
  19345. var _this = this;
  19346. // all in all indexes in the viewport
  19347. var indexesToDraw = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].createArrayOfNumbers(this.firstRenderedRow, this.lastRenderedRow);
  19348. var checkRowToDraw = function (indexStr, rowComp) {
  19349. var index = Number(indexStr);
  19350. if (index < _this.firstRenderedRow || index > _this.lastRenderedRow) {
  19351. if (_this.doNotUnVirtualiseRow(rowComp)) {
  19352. indexesToDraw.push(index);
  19353. }
  19354. }
  19355. };
  19356. // if we are redrawing due to scrolling change, then old rows are in this.rowCompsByIndex
  19357. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, checkRowToDraw);
  19358. // if we are redrawing due to model update, then old rows are in rowsToRecycle
  19359. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(rowsToRecycle, checkRowToDraw);
  19360. indexesToDraw.sort(function (a, b) { return a - b; });
  19361. return indexesToDraw;
  19362. };
  19363. RowRenderer.prototype.redraw = function (rowsToRecycle, animate, afterScroll) {
  19364. var _this = this;
  19365. if (animate === void 0) { animate = false; }
  19366. if (afterScroll === void 0) { afterScroll = false; }
  19367. this.maxDivHeightScaler.updateOffset();
  19368. this.workOutFirstAndLastRowsToRender();
  19369. // the row can already exist and be in the following:
  19370. // rowsToRecycle -> if model change, then the index may be different, however row may
  19371. // exist here from previous time (mapped by id).
  19372. // this.rowCompsByIndex -> if just a scroll, then this will contain what is currently in the viewport
  19373. // this is all the indexes we want, including those that already exist, so this method
  19374. // will end up going through each index and drawing only if the row doesn't already exist
  19375. var indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle);
  19376. this.removeRowCompsNotToDraw(indexesToDraw);
  19377. // never animate when doing print layout - as we want to get things ready to print as quickly as possible,
  19378. // otherwise we risk the printer printing a row that's half faded (half way through fading in)
  19379. if (this.printLayout) {
  19380. animate = false;
  19381. }
  19382. // add in new rows
  19383. var nextVmTurnFunctions = [];
  19384. var rowComps = [];
  19385. indexesToDraw.forEach(function (rowIndex) {
  19386. var rowComp = _this.createOrUpdateRowComp(rowIndex, rowsToRecycle, animate, afterScroll);
  19387. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowComp)) {
  19388. rowComps.push(rowComp);
  19389. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].pushAll(nextVmTurnFunctions, rowComp.getAndClearNextVMTurnFunctions());
  19390. }
  19391. });
  19392. this.flushContainers(rowComps);
  19393. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].executeNextVMTurn(nextVmTurnFunctions);
  19394. var useAnimationFrame = afterScroll && !this.gridOptionsWrapper.isSuppressAnimationFrame() && !this.printLayout;
  19395. if (useAnimationFrame) {
  19396. this.beans.taskQueue.addDestroyTask(this.destroyRowComps.bind(this, rowsToRecycle, animate));
  19397. }
  19398. else {
  19399. this.destroyRowComps(rowsToRecycle, animate);
  19400. }
  19401. this.checkAngularCompile();
  19402. this.gridPanel.updateRowCount();
  19403. };
  19404. RowRenderer.prototype.flushContainers = function (rowComps) {
  19405. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowContainers, function (key, rowContainerComp) {
  19406. if (rowContainerComp) {
  19407. rowContainerComp.flushRowTemplates();
  19408. }
  19409. });
  19410. rowComps.forEach(function (rowComp) { return rowComp.afterFlush(); });
  19411. };
  19412. RowRenderer.prototype.onDisplayedColumnsChanged = function () {
  19413. var pinningLeft = this.columnController.isPinningLeft();
  19414. var pinningRight = this.columnController.isPinningRight();
  19415. var atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight;
  19416. if (atLeastOneChanged) {
  19417. this.pinningLeft = pinningLeft;
  19418. this.pinningRight = pinningRight;
  19419. if (this.embedFullWidthRows) {
  19420. this.redrawFullWidthEmbeddedRows();
  19421. }
  19422. }
  19423. };
  19424. // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse,
  19425. // then it should go into the pinned left area if pinning left, or the center area if not pinning.
  19426. RowRenderer.prototype.redrawFullWidthEmbeddedRows = function () {
  19427. // if either of the pinned panels has shown / hidden, then need to redraw the fullWidth bits when
  19428. // embedded, as what appears in each section depends on whether we are pinned or not
  19429. var rowsToRemove = [];
  19430. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, function (id, rowComp) {
  19431. if (rowComp.isFullWidth()) {
  19432. var rowIndex = rowComp.getRowNode().rowIndex;
  19433. rowsToRemove.push(rowIndex.toString());
  19434. }
  19435. });
  19436. this.refreshFloatingRowComps();
  19437. this.removeRowComps(rowsToRemove);
  19438. this.redrawAfterScroll();
  19439. };
  19440. RowRenderer.prototype.refreshFullWidthRows = function () {
  19441. var rowsToRemove = [];
  19442. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(this.rowCompsByIndex, function (id, rowComp) {
  19443. if (rowComp.isFullWidth()) {
  19444. var fullWidthRowsRefreshed = rowComp.refreshFullWidth();
  19445. if (!fullWidthRowsRefreshed) {
  19446. var rowIndex = rowComp.getRowNode().rowIndex;
  19447. rowsToRemove.push(rowIndex.toString());
  19448. }
  19449. }
  19450. });
  19451. this.removeRowComps(rowsToRemove);
  19452. this.redrawAfterScroll();
  19453. };
  19454. RowRenderer.prototype.createOrUpdateRowComp = function (rowIndex, rowsToRecycle, animate, afterScroll) {
  19455. var rowNode;
  19456. var rowComp = this.rowCompsByIndex[rowIndex];
  19457. // if no row comp, see if we can get it from the previous rowComps
  19458. if (!rowComp) {
  19459. rowNode = this.paginationProxy.getRow(rowIndex);
  19460. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowNode) && _utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) {
  19461. rowComp = rowsToRecycle[rowNode.id];
  19462. rowsToRecycle[rowNode.id] = null;
  19463. }
  19464. }
  19465. var creatingNewRowComp = !rowComp;
  19466. if (creatingNewRowComp) {
  19467. // create a new one
  19468. if (!rowNode) {
  19469. rowNode = this.paginationProxy.getRow(rowIndex);
  19470. }
  19471. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(rowNode)) {
  19472. rowComp = this.createRowComp(rowNode, animate, afterScroll);
  19473. }
  19474. else {
  19475. // this should never happen - if somehow we are trying to create
  19476. // a row for a rowNode that does not exist.
  19477. return;
  19478. }
  19479. }
  19480. else {
  19481. // ensure row comp is in right position in DOM
  19482. rowComp.ensureDomOrder();
  19483. }
  19484. if (rowNode) {
  19485. // set node as 'alreadyRendered' to ensure we only recycle rowComps that have been rendered, this ensures
  19486. // we don't reuse rowComps that have been removed and then re-added in the same batch transaction.
  19487. rowNode.alreadyRendered = true;
  19488. }
  19489. this.rowCompsByIndex[rowIndex] = rowComp;
  19490. return rowComp;
  19491. };
  19492. RowRenderer.prototype.destroyRowComps = function (rowCompsMap, animate) {
  19493. var delayedFuncs = [];
  19494. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].iterateObject(rowCompsMap, function (nodeId, rowComp) {
  19495. // if row was used, then it's null
  19496. if (!rowComp) {
  19497. return;
  19498. }
  19499. rowComp.destroy(animate);
  19500. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].pushAll(delayedFuncs, rowComp.getAndClearDelayedDestroyFunctions());
  19501. });
  19502. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].executeInAWhile(delayedFuncs);
  19503. };
  19504. RowRenderer.prototype.checkAngularCompile = function () {
  19505. var _this = this;
  19506. // if we are doing angular compiling, then do digest the scope here
  19507. if (this.gridOptionsWrapper.isAngularCompileRows()) {
  19508. // we do it in a timeout, in case we are already in an apply
  19509. window.setTimeout(function () {
  19510. _this.$scope.$apply();
  19511. }, 0);
  19512. }
  19513. };
  19514. RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () {
  19515. var _this = this;
  19516. var newFirst;
  19517. var newLast;
  19518. if (!this.paginationProxy.isRowsToRender()) {
  19519. newFirst = 0;
  19520. newLast = -1; // setting to -1 means nothing in range
  19521. }
  19522. else if (this.printLayout) {
  19523. newFirst = this.paginationProxy.getPageFirstRow();
  19524. newLast = this.paginationProxy.getPageLastRow();
  19525. }
  19526. else {
  19527. var paginationOffset = this.paginationProxy.getPixelOffset();
  19528. var maxDivHeightScaler = this.maxDivHeightScaler.getOffset();
  19529. var bodyVRange = this.gridPanel.getVScrollPosition();
  19530. var bodyTopPixel = bodyVRange.top;
  19531. var bodyBottomPixel = bodyVRange.bottom;
  19532. var bufferPixels = this.gridOptionsWrapper.getRowBufferInPixels();
  19533. var firstPixel = bodyTopPixel + paginationOffset + maxDivHeightScaler - bufferPixels;
  19534. var lastPixel = bodyBottomPixel + paginationOffset + maxDivHeightScaler + bufferPixels;
  19535. this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel);
  19536. var firstRowIndex = this.paginationProxy.getRowIndexAtPixel(firstPixel);
  19537. var lastRowIndex = this.paginationProxy.getRowIndexAtPixel(lastPixel);
  19538. var pageFirstRow = this.paginationProxy.getPageFirstRow();
  19539. var pageLastRow = this.paginationProxy.getPageLastRow();
  19540. // adjust, in case buffer extended actual size
  19541. if (firstRowIndex < pageFirstRow) {
  19542. firstRowIndex = pageFirstRow;
  19543. }
  19544. if (lastRowIndex > pageLastRow) {
  19545. lastRowIndex = pageLastRow;
  19546. }
  19547. newFirst = firstRowIndex;
  19548. newLast = lastRowIndex;
  19549. }
  19550. // sometimes user doesn't set CSS right and ends up with grid with no height and grid ends up
  19551. // trying to render all the rows, eg 10,000+ rows. this will kill the browser. so instead of
  19552. // killing the browser, we limit the number of rows. just in case some use case we didn't think
  19553. // of, we also have a property to not do this operation.
  19554. var rowLayoutNormal = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].DOM_LAYOUT_NORMAL;
  19555. var suppressRowCountRestriction = this.gridOptionsWrapper.isSuppressMaxRenderedRowRestriction();
  19556. var rowBufferMaxSize = Math.max(this.gridOptionsWrapper.getRowBuffer(), 500);
  19557. if (rowLayoutNormal && !suppressRowCountRestriction) {
  19558. if (newLast - newFirst > rowBufferMaxSize) {
  19559. newLast = newFirst + rowBufferMaxSize;
  19560. }
  19561. }
  19562. var firstDiffers = newFirst !== this.firstRenderedRow;
  19563. var lastDiffers = newLast !== this.lastRenderedRow;
  19564. if (firstDiffers || lastDiffers) {
  19565. this.firstRenderedRow = newFirst;
  19566. this.lastRenderedRow = newLast;
  19567. var event_1 = {
  19568. type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_VIEWPORT_CHANGED,
  19569. firstRow: newFirst,
  19570. lastRow: newLast,
  19571. api: this.gridApi,
  19572. columnApi: this.columnApi
  19573. };
  19574. this.eventService.dispatchEvent(event_1);
  19575. }
  19576. // only dispatch firstDataRendered if we have actually rendered some data
  19577. if (this.paginationProxy.isRowsToRender()) {
  19578. var event_2 = {
  19579. type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_FIRST_DATA_RENDERED,
  19580. firstRow: newFirst,
  19581. lastRow: newLast,
  19582. api: this.gridApi,
  19583. columnApi: this.columnApi
  19584. };
  19585. // added a small delay here because in some scenarios this can be fired
  19586. // before the grid is actually rendered, causing component creation
  19587. // on EVENT_FIRST_DATA_RENDERED to fail.
  19588. window.setTimeout(function () { return _this.eventService.dispatchEventOnce(event_2); }, 50);
  19589. }
  19590. };
  19591. RowRenderer.prototype.ensureAllRowsInRangeHaveHeightsCalculated = function (topPixel, bottomPixel) {
  19592. // ensureRowHeightsVisible only works with CSRM, as it's the only row model that allows lazy row height calcs.
  19593. // all the other row models just hard code so the method just returns back false
  19594. var rowHeightsChanged = this.paginationProxy.ensureRowHeightsValid(topPixel, bottomPixel, -1, -1);
  19595. if (rowHeightsChanged) {
  19596. // if row heights have changed, we need to resize the containers the rows sit it
  19597. this.sizeContainerToPageHeight();
  19598. // we also need to update heightScaler as this has dependency of row container height
  19599. this.maxDivHeightScaler.updateOffset();
  19600. }
  19601. };
  19602. RowRenderer.prototype.getFirstVirtualRenderedRow = function () {
  19603. return this.firstRenderedRow;
  19604. };
  19605. RowRenderer.prototype.getLastVirtualRenderedRow = function () {
  19606. return this.lastRenderedRow;
  19607. };
  19608. // check that none of the rows to remove are editing or focused as:
  19609. // a) if editing, we want to keep them, otherwise the user will loose the context of the edit,
  19610. // eg user starts editing, enters some text, then scrolls down and then up, next time row rendered
  19611. // the edit is reset - so we want to keep it rendered.
  19612. // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard,
  19613. // otherwise the user can range select and drag (with focus cell going out of the viewport)
  19614. // and then ctrl+c, nothing will happen if cell is removed from dom.
  19615. // c) if detail record of master detail, as users complained that the context of detail rows
  19616. // was getting lost when detail row out of view. eg user expands to show detail row,
  19617. // then manipulates the detail panel (eg sorts the detail grid), then context is lost
  19618. // after detail panel is scrolled out of / into view.
  19619. RowRenderer.prototype.doNotUnVirtualiseRow = function (rowComp) {
  19620. var REMOVE_ROW = false;
  19621. var KEEP_ROW = true;
  19622. var rowNode = rowComp.getRowNode();
  19623. var rowHasFocus = this.focusController.isRowNodeFocused(rowNode);
  19624. var rowIsEditing = rowComp.isEditing();
  19625. var rowIsDetail = rowNode.detail;
  19626. var mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail;
  19627. // if we deffo don't want to keep it,
  19628. if (!mightWantToKeepRow) {
  19629. return REMOVE_ROW;
  19630. }
  19631. // editing row, only remove if it is no longer rendered, eg filtered out or new data set.
  19632. // the reason we want to keep is if user is scrolling up and down, we don't want to loose
  19633. // the context of the editing in process.
  19634. var rowNodePresent = this.paginationProxy.isRowPresent(rowNode);
  19635. return rowNodePresent ? KEEP_ROW : REMOVE_ROW;
  19636. };
  19637. RowRenderer.prototype.createRowComp = function (rowNode, animate, afterScroll) {
  19638. var suppressAnimationFrame = this.gridOptionsWrapper.isSuppressAnimationFrame();
  19639. // we don't use animations frames for printing, so the user can put the grid into print mode
  19640. // and immediately print - otherwise the user would have to wait for the rows to draw in the background
  19641. // (via the animation frames) which is awkward to do from code.
  19642. // we only do the animation frames after scrolling, as this is where we want the smooth user experience.
  19643. // having animation frames for other times makes the grid look 'jumpy'.
  19644. var useAnimationFrameForCreate = afterScroll && !suppressAnimationFrame && !this.printLayout;
  19645. var rowComp = new _rowComp__WEBPACK_IMPORTED_MODULE_1__["RowComp"](this.$scope, this.rowContainers.body, this.rowContainers.pinnedLeft, this.rowContainers.pinnedRight, this.rowContainers.fullWidth, rowNode, this.beans, animate, useAnimationFrameForCreate, this.printLayout, this.embedFullWidthRows);
  19646. rowComp.init();
  19647. return rowComp;
  19648. };
  19649. RowRenderer.prototype.getRenderedNodes = function () {
  19650. var renderedRows = this.rowCompsByIndex;
  19651. return Object.keys(renderedRows).map(function (key) { return renderedRows[key].getRowNode(); });
  19652. };
  19653. // we use index for rows, but column object for columns, as the next column (by index) might not
  19654. // be visible (header grouping) so it's not reliable, so using the column object instead.
  19655. RowRenderer.prototype.navigateToNextCell = function (event, key, currentCell, allowUserOverride) {
  19656. // we keep searching for a next cell until we find one. this is how the group rows get skipped
  19657. var nextCell = currentCell;
  19658. var hitEdgeOfGrid = false;
  19659. while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) {
  19660. // if the current cell is spanning across multiple columns, we need to move
  19661. // our current position to be the last cell on the right before finding the
  19662. // the next target.
  19663. if (this.gridOptionsWrapper.isEnableRtl()) {
  19664. if (key === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].KEY_LEFT) {
  19665. nextCell = this.getLastCellOfColSpan(nextCell);
  19666. }
  19667. }
  19668. else if (key === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].KEY_RIGHT) {
  19669. nextCell = this.getLastCellOfColSpan(nextCell);
  19670. }
  19671. nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell);
  19672. // eg if going down, and nextCell=undefined, means we are gone past the last row
  19673. hitEdgeOfGrid = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(nextCell);
  19674. }
  19675. if (hitEdgeOfGrid && event.keyCode === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].KEY_UP) {
  19676. nextCell = {
  19677. rowIndex: -1,
  19678. rowPinned: null,
  19679. column: currentCell.column
  19680. };
  19681. }
  19682. // allow user to override what cell to go to next. when doing normal cell navigation (with keys)
  19683. // we allow this, however if processing 'enter after edit' we don't allow override
  19684. if (allowUserOverride) {
  19685. var userFunc = this.gridOptionsWrapper.getNavigateToNextCellFunc();
  19686. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(userFunc)) {
  19687. var params = {
  19688. key: key,
  19689. previousCellPosition: currentCell,
  19690. nextCellPosition: nextCell ? nextCell : null,
  19691. event: event
  19692. };
  19693. var userCell = userFunc(params);
  19694. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(userCell)) {
  19695. if (userCell.floating) {
  19696. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].doOnce(function () { console.warn("ag-Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"); }, 'no floating in userCell');
  19697. userCell.rowPinned = userCell.floating;
  19698. }
  19699. nextCell = {
  19700. rowPinned: userCell.rowPinned,
  19701. rowIndex: userCell.rowIndex,
  19702. column: userCell.column
  19703. };
  19704. }
  19705. else {
  19706. nextCell = null;
  19707. }
  19708. }
  19709. }
  19710. // no next cell means we have reached a grid boundary, eg left, right, top or bottom of grid
  19711. if (!nextCell) {
  19712. return;
  19713. }
  19714. if (nextCell.rowIndex < 0) {
  19715. var headerLen = this.beans.headerNavigationService.getHeaderRowCount();
  19716. this.focusController.focusHeaderPosition({
  19717. headerRowIndex: headerLen + (nextCell.rowIndex), column: currentCell.column
  19718. });
  19719. return;
  19720. }
  19721. // in case we have col spanning we get the cellComp and use it to
  19722. // get the position. This was we always focus the first cell inside
  19723. // the spanning.
  19724. this.ensureCellVisible(nextCell); // ensureCellVisible first, to make sure nextCell is rendered
  19725. var cellComp = this.getComponentForCell(nextCell);
  19726. // not guaranteed to have a cellComp when using the SSRM as blocks are loading.
  19727. if (!cellComp) {
  19728. return;
  19729. }
  19730. nextCell = cellComp.getCellPosition();
  19731. // we call this again, as nextCell can be different to it's previous value due to Column Spanning
  19732. // (ie if cursor moving from right to left, and cell is spanning columns, then nextCell was the
  19733. // last column in the group, however now it's the first column in the group). if we didn't do
  19734. // ensureCellVisible again, then we could only be showing the last portion (last column) of the
  19735. // merged cells.
  19736. this.ensureCellVisible(nextCell);
  19737. this.focusController.setFocusedCell(nextCell.rowIndex, nextCell.column, nextCell.rowPinned, true);
  19738. if (this.rangeController) {
  19739. this.rangeController.setRangeToCell(nextCell);
  19740. }
  19741. };
  19742. RowRenderer.prototype.isValidNavigateCell = function (cell) {
  19743. var rowNode = this.rowPositionUtils.getRowNode(cell);
  19744. // we do not allow focusing on detail rows and full width rows
  19745. if (rowNode.detail || rowNode.isFullWidthCell()) {
  19746. return false;
  19747. }
  19748. // if not a group, then we have a valid row, so quit the search
  19749. if (!rowNode.group) {
  19750. return true;
  19751. }
  19752. // full width rows cannot be focused, so if it's a group and using full width rows,
  19753. // we need to skip over the row
  19754. var pivotMode = this.columnController.isPivotMode();
  19755. var usingFullWidthRows = this.gridOptionsWrapper.isGroupUseEntireRow(pivotMode);
  19756. if (!usingFullWidthRows) {
  19757. return true;
  19758. }
  19759. return false;
  19760. };
  19761. RowRenderer.prototype.getLastCellOfColSpan = function (cell) {
  19762. var cellComp = this.getComponentForCell(cell);
  19763. if (!cellComp) {
  19764. return cell;
  19765. }
  19766. var colSpanningList = cellComp.getColSpanningList();
  19767. if (colSpanningList.length === 1) {
  19768. return cell;
  19769. }
  19770. return {
  19771. rowIndex: cell.rowIndex,
  19772. column: _utils__WEBPACK_IMPORTED_MODULE_8__["_"].last(colSpanningList),
  19773. rowPinned: cell.rowPinned
  19774. };
  19775. };
  19776. RowRenderer.prototype.ensureCellVisible = function (gridCell) {
  19777. // this scrolls the row into view
  19778. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(gridCell.rowPinned)) {
  19779. this.gridPanel.ensureIndexVisible(gridCell.rowIndex);
  19780. }
  19781. if (!gridCell.column.isPinned()) {
  19782. this.gridPanel.ensureColumnVisible(gridCell.column);
  19783. }
  19784. // need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
  19785. // floating cell, the scrolls get out of sync
  19786. this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
  19787. // need to flush frames, to make sure the correct cells are rendered
  19788. this.animationFrameService.flushAllFrames();
  19789. };
  19790. RowRenderer.prototype.startEditingCell = function (gridCell, keyPress, charPress) {
  19791. var cell = this.getComponentForCell(gridCell);
  19792. if (cell) {
  19793. cell.startRowOrCellEdit(keyPress, charPress);
  19794. }
  19795. };
  19796. RowRenderer.prototype.getComponentForCell = function (cellPosition) {
  19797. var rowComponent;
  19798. switch (cellPosition.rowPinned) {
  19799. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP:
  19800. rowComponent = this.floatingTopRowComps[cellPosition.rowIndex];
  19801. break;
  19802. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM:
  19803. rowComponent = this.floatingBottomRowComps[cellPosition.rowIndex];
  19804. break;
  19805. default:
  19806. rowComponent = this.rowCompsByIndex[cellPosition.rowIndex];
  19807. break;
  19808. }
  19809. if (!rowComponent) {
  19810. return null;
  19811. }
  19812. var cellComponent = rowComponent.getRenderedCellForColumn(cellPosition.column);
  19813. return cellComponent;
  19814. };
  19815. RowRenderer.prototype.getRowNode = function (gridRow) {
  19816. switch (gridRow.rowPinned) {
  19817. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP:
  19818. return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];
  19819. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM:
  19820. return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];
  19821. default:
  19822. return this.rowModel.getRow(gridRow.rowIndex);
  19823. }
  19824. };
  19825. RowRenderer.prototype.onTabKeyDown = function (previousRenderedCell, keyboardEvent) {
  19826. var backwards = keyboardEvent.shiftKey;
  19827. var success = this.moveToCellAfter(previousRenderedCell, backwards);
  19828. if (success) {
  19829. keyboardEvent.preventDefault();
  19830. }
  19831. else if (keyboardEvent.shiftKey) {
  19832. var cellPosition = previousRenderedCell.getCellPosition();
  19833. if (cellPosition.rowIndex === 0) {
  19834. keyboardEvent.preventDefault();
  19835. this.focusController.focusHeaderPosition({
  19836. headerRowIndex: this.beans.headerNavigationService.getHeaderRowCount() - 1,
  19837. column: _utils__WEBPACK_IMPORTED_MODULE_8__["_"].last(this.columnController.getAllDisplayedColumns())
  19838. });
  19839. }
  19840. }
  19841. };
  19842. RowRenderer.prototype.tabToNextCell = function (backwards) {
  19843. var focusedCell = this.focusController.getFocusedCell();
  19844. // if no focus, then cannot navigate
  19845. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(focusedCell)) {
  19846. return false;
  19847. }
  19848. var renderedCell = this.getComponentForCell(focusedCell);
  19849. // if cell is not rendered, means user has scrolled away from the cell
  19850. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(renderedCell)) {
  19851. return false;
  19852. }
  19853. var result = this.moveToCellAfter(renderedCell, backwards);
  19854. return result;
  19855. };
  19856. RowRenderer.prototype.moveToCellAfter = function (previousRenderedCell, backwards) {
  19857. var editing = previousRenderedCell.isEditing();
  19858. var res;
  19859. if (editing) {
  19860. if (this.gridOptionsWrapper.isFullRowEdit()) {
  19861. res = this.moveToNextEditingRow(previousRenderedCell, backwards);
  19862. }
  19863. else {
  19864. res = this.moveToNextEditingCell(previousRenderedCell, backwards);
  19865. }
  19866. }
  19867. else {
  19868. res = this.moveToNextCellNotEditing(previousRenderedCell, backwards);
  19869. }
  19870. return res;
  19871. };
  19872. RowRenderer.prototype.moveToNextEditingCell = function (previousRenderedCell, backwards) {
  19873. var gridCell = previousRenderedCell.getCellPosition();
  19874. // need to do this before getting next cell to edit, in case the next cell
  19875. // has editable function (eg colDef.editable=func() ) and it depends on the
  19876. // result of this cell, so need to save updates from the first edit, in case
  19877. // the value is referenced in the function.
  19878. previousRenderedCell.stopEditing();
  19879. // find the next cell to start editing
  19880. var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, true);
  19881. var foundCell = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(nextRenderedCell);
  19882. // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
  19883. // to the normal tabbing so user can exit the grid.
  19884. if (foundCell) {
  19885. nextRenderedCell.startEditingIfEnabled(null, null, true);
  19886. nextRenderedCell.focusCell(false);
  19887. }
  19888. return foundCell;
  19889. };
  19890. RowRenderer.prototype.moveToNextEditingRow = function (previousRenderedCell, backwards) {
  19891. var gridCell = previousRenderedCell.getCellPosition();
  19892. // find the next cell to start editing
  19893. var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, true);
  19894. var foundCell = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(nextRenderedCell);
  19895. // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
  19896. // to the normal tabbing so user can exit the grid.
  19897. if (foundCell) {
  19898. this.moveEditToNextCellOrRow(previousRenderedCell, nextRenderedCell);
  19899. }
  19900. return foundCell;
  19901. };
  19902. RowRenderer.prototype.moveToNextCellNotEditing = function (previousRenderedCell, backwards) {
  19903. var gridCell = previousRenderedCell.getCellPosition();
  19904. // find the next cell to start editing
  19905. var nextRenderedCell = this.findNextCellToFocusOn(gridCell, backwards, false);
  19906. var foundCell = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(nextRenderedCell);
  19907. // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default
  19908. // to the normal tabbing so user can exit the grid.
  19909. if (foundCell) {
  19910. nextRenderedCell.focusCell(true);
  19911. }
  19912. return foundCell;
  19913. };
  19914. RowRenderer.prototype.moveEditToNextCellOrRow = function (previousRenderedCell, nextRenderedCell) {
  19915. var pGridCell = previousRenderedCell.getCellPosition();
  19916. var nGridCell = nextRenderedCell.getCellPosition();
  19917. var rowsMatch = pGridCell.rowIndex === nGridCell.rowIndex && pGridCell.rowPinned === nGridCell.rowPinned;
  19918. if (rowsMatch) {
  19919. // same row, so we don't start / stop editing, we just move the focus along
  19920. previousRenderedCell.setFocusOutOnEditor();
  19921. nextRenderedCell.setFocusInOnEditor();
  19922. }
  19923. else {
  19924. var pRow = previousRenderedCell.getRenderedRow();
  19925. var nRow = nextRenderedCell.getRenderedRow();
  19926. previousRenderedCell.setFocusOutOnEditor();
  19927. pRow.stopEditing();
  19928. nRow.startRowEditing();
  19929. nextRenderedCell.setFocusInOnEditor();
  19930. }
  19931. nextRenderedCell.focusCell();
  19932. };
  19933. // called by the cell, when tab is pressed while editing.
  19934. // @return: RenderedCell when navigation successful, otherwise null
  19935. RowRenderer.prototype.findNextCellToFocusOn = function (gridCell, backwards, startEditing) {
  19936. var nextCell = gridCell;
  19937. while (true) {
  19938. if (!backwards) {
  19939. nextCell = this.getLastCellOfColSpan(nextCell);
  19940. }
  19941. nextCell = this.cellNavigationService.getNextTabbedCell(nextCell, backwards);
  19942. // allow user to override what cell to go to next
  19943. var userFunc = this.gridOptionsWrapper.getTabToNextCellFunc();
  19944. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(userFunc)) {
  19945. var params = {
  19946. backwards: backwards,
  19947. editing: startEditing,
  19948. previousCellPosition: gridCell,
  19949. nextCellPosition: nextCell ? nextCell : null
  19950. };
  19951. var userCell = userFunc(params);
  19952. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].exists(userCell)) {
  19953. if (userCell.floating) {
  19954. _utils__WEBPACK_IMPORTED_MODULE_8__["_"].doOnce(function () { console.warn("ag-Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"); }, 'no floating in userCell');
  19955. userCell.rowPinned = userCell.floating;
  19956. }
  19957. nextCell = {
  19958. rowIndex: userCell.rowIndex,
  19959. column: userCell.column,
  19960. rowPinned: userCell.rowPinned
  19961. };
  19962. }
  19963. else {
  19964. nextCell = null;
  19965. }
  19966. }
  19967. // if no 'next cell', means we have got to last cell of grid, so nothing to move to,
  19968. // so bottom right cell going forwards, or top left going backwards
  19969. if (!nextCell) {
  19970. return null;
  19971. }
  19972. // if editing, but cell not editable, skip cell. we do this before we do all of
  19973. // the 'ensure index visible' and 'flush all frames', otherwise if we are skipping
  19974. // a bunch of cells (eg 10 rows) then all the work on ensuring cell visible is useless
  19975. // (except for the last one) which causes grid to stall for a while.
  19976. if (startEditing) {
  19977. var rowNode = this.lookupRowNodeForCell(nextCell);
  19978. var cellIsEditable = nextCell.column.isCellEditable(rowNode);
  19979. if (!cellIsEditable) {
  19980. continue;
  19981. }
  19982. }
  19983. // this scrolls the row into view
  19984. var cellIsNotFloating = _utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(nextCell.rowPinned);
  19985. if (cellIsNotFloating) {
  19986. this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
  19987. }
  19988. // pinned columns don't scroll, so no need to ensure index visible
  19989. if (!nextCell.column.isPinned()) {
  19990. this.gridPanel.ensureColumnVisible(nextCell.column);
  19991. }
  19992. // need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
  19993. // floating cell, the scrolls get out of sync
  19994. this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
  19995. // get the grid panel to flush all animation frames - otherwise the call below to get the cellComp
  19996. // could fail, if we just scrolled the grid (to make a cell visible) and the rendering hasn't finished.
  19997. this.animationFrameService.flushAllFrames();
  19998. // we have to call this after ensureColumnVisible - otherwise it could be a virtual column
  19999. // or row that is not currently in view, hence the renderedCell would not exist
  20000. var nextCellComp = this.getComponentForCell(nextCell);
  20001. // if next cell is fullWidth row, then no rendered cell,
  20002. // as fullWidth rows have no cells, so we skip it
  20003. if (_utils__WEBPACK_IMPORTED_MODULE_8__["_"].missing(nextCellComp)) {
  20004. continue;
  20005. }
  20006. if (nextCellComp.isSuppressNavigable()) {
  20007. continue;
  20008. }
  20009. // by default, when we click a cell, it gets selected into a range, so to keep keyboard navigation
  20010. // consistent, we set into range here also.
  20011. if (this.rangeController) {
  20012. this.rangeController.setRangeToCell(nextCell);
  20013. }
  20014. // we successfully tabbed onto a grid cell, so return true
  20015. return nextCellComp;
  20016. }
  20017. };
  20018. RowRenderer.prototype.lookupRowNodeForCell = function (cell) {
  20019. if (cell.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_TOP) {
  20020. return this.pinnedRowModel.getPinnedTopRow(cell.rowIndex);
  20021. }
  20022. if (cell.rowPinned === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_BOTTOM) {
  20023. return this.pinnedRowModel.getPinnedBottomRow(cell.rowIndex);
  20024. }
  20025. return this.paginationProxy.getRow(cell.rowIndex);
  20026. };
  20027. __decorate([
  20028. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("paginationProxy")
  20029. ], RowRenderer.prototype, "paginationProxy", void 0);
  20030. __decorate([
  20031. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("columnController")
  20032. ], RowRenderer.prototype, "columnController", void 0);
  20033. __decorate([
  20034. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("gridOptionsWrapper")
  20035. ], RowRenderer.prototype, "gridOptionsWrapper", void 0);
  20036. __decorate([
  20037. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("$scope")
  20038. ], RowRenderer.prototype, "$scope", void 0);
  20039. __decorate([
  20040. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("pinnedRowModel")
  20041. ], RowRenderer.prototype, "pinnedRowModel", void 0);
  20042. __decorate([
  20043. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("rowModel")
  20044. ], RowRenderer.prototype, "rowModel", void 0);
  20045. __decorate([
  20046. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("loggerFactory")
  20047. ], RowRenderer.prototype, "loggerFactory", void 0);
  20048. __decorate([
  20049. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("focusController")
  20050. ], RowRenderer.prototype, "focusController", void 0);
  20051. __decorate([
  20052. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("cellNavigationService")
  20053. ], RowRenderer.prototype, "cellNavigationService", void 0);
  20054. __decorate([
  20055. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("columnApi")
  20056. ], RowRenderer.prototype, "columnApi", void 0);
  20057. __decorate([
  20058. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("gridApi")
  20059. ], RowRenderer.prototype, "gridApi", void 0);
  20060. __decorate([
  20061. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("beans")
  20062. ], RowRenderer.prototype, "beans", void 0);
  20063. __decorate([
  20064. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("maxDivHeightScaler")
  20065. ], RowRenderer.prototype, "maxDivHeightScaler", void 0);
  20066. __decorate([
  20067. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("animationFrameService")
  20068. ], RowRenderer.prototype, "animationFrameService", void 0);
  20069. __decorate([
  20070. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Autowired"])("rowPositionUtils")
  20071. ], RowRenderer.prototype, "rowPositionUtils", void 0);
  20072. __decorate([
  20073. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Optional"])("rangeController")
  20074. ], RowRenderer.prototype, "rangeController", void 0);
  20075. __decorate([
  20076. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Qualifier"])("loggerFactory"))
  20077. ], RowRenderer.prototype, "agWire", null);
  20078. RowRenderer = __decorate([
  20079. Object(_context_context__WEBPACK_IMPORTED_MODULE_6__["Bean"])("rowRenderer")
  20080. ], RowRenderer);
  20081. return RowRenderer;
  20082. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_7__["BeanStub"]));
  20083. /***/ }),
  20084. /* 100 */
  20085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20086. "use strict";
  20087. __webpack_require__.r(__webpack_exports__);
  20088. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowComp", function() { return RowComp; });
  20089. /* harmony import */ var _cellComp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(101);
  20090. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68);
  20091. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  20092. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56);
  20093. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
  20094. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(38);
  20095. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(39);
  20096. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
  20097. /**
  20098. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  20099. * @version v23.2.1
  20100. * @link http://www.ag-grid.com/
  20101. * @license MIT
  20102. */
  20103. var __extends = (undefined && undefined.__extends) || (function () {
  20104. var extendStatics = function (d, b) {
  20105. extendStatics = Object.setPrototypeOf ||
  20106. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  20107. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  20108. return extendStatics(d, b);
  20109. };
  20110. return function (d, b) {
  20111. extendStatics(d, b);
  20112. function __() { this.constructor = d; }
  20113. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  20114. };
  20115. })();
  20116. var __assign = (undefined && undefined.__assign) || function () {
  20117. __assign = Object.assign || function(t) {
  20118. for (var s, i = 1, n = arguments.length; i < n; i++) {
  20119. s = arguments[i];
  20120. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  20121. t[p] = s[p];
  20122. }
  20123. return t;
  20124. };
  20125. return __assign.apply(this, arguments);
  20126. };
  20127. var RowComp = /** @class */ (function (_super) {
  20128. __extends(RowComp, _super);
  20129. function RowComp(parentScope, bodyContainerComp, pinnedLeftContainerComp, pinnedRightContainerComp, fullWidthContainerComp, rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout, embedFullWidth) {
  20130. var _this = _super.call(this) || this;
  20131. _this.eAllRowContainers = [];
  20132. _this.active = true;
  20133. _this.rowContainerReadyCount = 0;
  20134. _this.refreshNeeded = false;
  20135. _this.columnRefreshPending = false;
  20136. _this.cellComps = {};
  20137. // for animations, there are bits we want done in the next VM turn, to all DOM to update first.
  20138. // instead of each row doing a setTimeout(func,0), we put the functions here and the rowRenderer
  20139. // executes them all in one timeout
  20140. _this.createSecondPassFuncs = [];
  20141. // these get called before the row is destroyed - they set up the DOM for the remove animation (ie they
  20142. // set the DOM up for the animation), then the delayedDestroyFunctions get called when the animation is
  20143. // complete (ie removes from the dom).
  20144. _this.removeFirstPassFuncs = [];
  20145. // for animations, these functions get called 400ms after the row is cleared, called by the rowRenderer
  20146. // so each row isn't setting up it's own timeout
  20147. _this.removeSecondPassFuncs = [];
  20148. _this.initialised = false;
  20149. _this.elementOrderChanged = false;
  20150. _this.lastMouseDownOnDragger = false;
  20151. _this.parentScope = parentScope;
  20152. _this.beans = beans;
  20153. _this.bodyContainerComp = bodyContainerComp;
  20154. _this.pinnedLeftContainerComp = pinnedLeftContainerComp;
  20155. _this.pinnedRightContainerComp = pinnedRightContainerComp;
  20156. _this.fullWidthContainerComp = fullWidthContainerComp;
  20157. _this.rowNode = rowNode;
  20158. _this.rowIsEven = _this.rowNode.rowIndex % 2 === 0;
  20159. _this.paginationPage = _this.beans.paginationProxy.getCurrentPage();
  20160. _this.useAnimationFrameForCreate = useAnimationFrameForCreate;
  20161. _this.printLayout = printLayout;
  20162. _this.embedFullWidth = embedFullWidth;
  20163. _this.setAnimateFlags(animateIn);
  20164. return _this;
  20165. }
  20166. RowComp.prototype.init = function () {
  20167. var _this = this;
  20168. this.rowFocused = this.beans.focusController.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
  20169. this.scope = this.createChildScopeOrNull(this.rowNode.data);
  20170. this.setupRowContainers();
  20171. this.addListeners();
  20172. if (this.slideRowIn) {
  20173. this.createSecondPassFuncs.push(function () {
  20174. _this.onTopChanged();
  20175. });
  20176. }
  20177. if (this.fadeRowIn) {
  20178. this.createSecondPassFuncs.push(function () {
  20179. _this.eAllRowContainers.forEach(function (eRow) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(eRow, 'ag-opacity-zero'); });
  20180. });
  20181. }
  20182. };
  20183. RowComp.prototype.createTemplate = function (contents, extraCssClass) {
  20184. if (extraCssClass === void 0) { extraCssClass = null; }
  20185. var templateParts = [];
  20186. var rowHeight = this.rowNode.rowHeight;
  20187. var rowClasses = this.getInitialRowClasses(extraCssClass).join(' ');
  20188. var rowIdSanitised = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(this.rowNode.id);
  20189. var userRowStyles = this.preProcessStylesFromGridOptions();
  20190. var businessKey = this.getRowBusinessKey();
  20191. var businessKeySanitised = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(businessKey);
  20192. var rowTopStyle = this.getInitialRowTopStyle();
  20193. var rowIdx = this.rowNode.getRowIndexString();
  20194. var headerRowCount = this.beans.headerNavigationService.getHeaderRowCount();
  20195. templateParts.push("<div");
  20196. templateParts.push(" role=\"row\"");
  20197. templateParts.push(" row-index=\"" + rowIdx + "\" aria-rowindex=\"" + (headerRowCount + this.rowNode.rowIndex + 1) + "\"");
  20198. templateParts.push(rowIdSanitised ? " row-id=\"" + rowIdSanitised + "\"" : "");
  20199. templateParts.push(businessKey ? " row-business-key=\"" + businessKeySanitised + "\"" : "");
  20200. templateParts.push(" comp-id=\"" + this.getCompId() + "\"");
  20201. templateParts.push(" class=\"" + rowClasses + "\"");
  20202. templateParts.push(" style=\"height: " + rowHeight + "px; " + rowTopStyle + " " + userRowStyles + "\">");
  20203. // add in the template for the cells
  20204. templateParts.push(contents);
  20205. templateParts.push("</div>");
  20206. return templateParts.join('');
  20207. };
  20208. RowComp.prototype.getCellForCol = function (column) {
  20209. var cellComp = this.cellComps[column.getColId()];
  20210. return cellComp ? cellComp.getGui() : null;
  20211. };
  20212. RowComp.prototype.afterFlush = function () {
  20213. if (this.initialised) {
  20214. return;
  20215. }
  20216. this.initialised = true;
  20217. this.executeProcessRowPostCreateFunc();
  20218. };
  20219. RowComp.prototype.executeProcessRowPostCreateFunc = function () {
  20220. var func = this.beans.gridOptionsWrapper.getProcessRowPostCreateFunc();
  20221. if (!func) {
  20222. return;
  20223. }
  20224. var params = {
  20225. eRow: this.eBodyRow,
  20226. ePinnedLeftRow: this.ePinnedLeftRow,
  20227. ePinnedRightRow: this.ePinnedRightRow,
  20228. node: this.rowNode,
  20229. api: this.beans.gridOptionsWrapper.getApi(),
  20230. rowIndex: this.rowNode.rowIndex,
  20231. addRenderedRowListener: this.addEventListener.bind(this),
  20232. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  20233. context: this.beans.gridOptionsWrapper.getContext()
  20234. };
  20235. func(params);
  20236. };
  20237. RowComp.prototype.getInitialRowTopStyle = function () {
  20238. // print layout uses normal flow layout for row positioning
  20239. if (this.printLayout) {
  20240. return '';
  20241. }
  20242. // if sliding in, we take the old row top. otherwise we just set the current row top.
  20243. var pixels = this.slideRowIn ? this.roundRowTopToBounds(this.rowNode.oldRowTop) : this.rowNode.rowTop;
  20244. var afterPaginationPixels = this.applyPaginationOffset(pixels);
  20245. var afterScalingPixels = this.beans.maxDivHeightScaler.getRealPixelPosition(afterPaginationPixels);
  20246. var isSuppressRowTransform = this.beans.gridOptionsWrapper.isSuppressRowTransform();
  20247. return isSuppressRowTransform ? "top: " + afterScalingPixels + "px; " : "transform: translateY(" + afterScalingPixels + "px);";
  20248. };
  20249. RowComp.prototype.getRowBusinessKey = function () {
  20250. var businessKeyForNodeFunc = this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc();
  20251. if (typeof businessKeyForNodeFunc !== 'function') {
  20252. return;
  20253. }
  20254. return businessKeyForNodeFunc(this.rowNode);
  20255. };
  20256. RowComp.prototype.areAllContainersReady = function () {
  20257. return this.rowContainerReadyCount === 3;
  20258. };
  20259. RowComp.prototype.lazyCreateCells = function (cols, eRow) {
  20260. if (!this.active) {
  20261. return;
  20262. }
  20263. var cellTemplatesAndComps = this.createCells(cols);
  20264. eRow.innerHTML = cellTemplatesAndComps.template;
  20265. this.callAfterRowAttachedOnCells(cellTemplatesAndComps.cellComps, eRow);
  20266. this.rowContainerReadyCount++;
  20267. if (this.areAllContainersReady() && this.refreshNeeded) {
  20268. this.refreshCells();
  20269. }
  20270. };
  20271. RowComp.prototype.createRowContainer = function (rowContainerComp, cols, callback) {
  20272. var _this = this;
  20273. var useAnimationsFrameForCreate = this.useAnimationFrameForCreate;
  20274. var cellTemplatesAndComps = useAnimationsFrameForCreate ? { cellComps: [], template: '' } : this.createCells(cols);
  20275. var rowTemplate = this.createTemplate(cellTemplatesAndComps.template);
  20276. // the RowRenderer is probably inserting many rows. rather than inserting each template one
  20277. // at a time, the grid inserts all rows together - so the callback here is called by the
  20278. // rowRenderer when all RowComps are created, then all the HTML is inserted in one go,
  20279. // and then all the callbacks are called. this is NOT done in an animation frame.
  20280. rowContainerComp.appendRowTemplate(rowTemplate, function () {
  20281. var eRow = rowContainerComp.getRowElement(_this.getCompId());
  20282. _this.afterRowAttached(rowContainerComp, eRow);
  20283. callback(eRow);
  20284. if (useAnimationsFrameForCreate) {
  20285. _this.beans.taskQueue.createTask(_this.lazyCreateCells.bind(_this, cols, eRow), _this.rowNode.rowIndex, 'createTasksP1');
  20286. }
  20287. else {
  20288. _this.callAfterRowAttachedOnCells(cellTemplatesAndComps.cellComps, eRow);
  20289. _this.rowContainerReadyCount = 3;
  20290. }
  20291. });
  20292. };
  20293. RowComp.prototype.createChildScopeOrNull = function (data) {
  20294. var isAngularCompileRows = this.beans.gridOptionsWrapper.isAngularCompileRows();
  20295. if (!isAngularCompileRows) {
  20296. return null;
  20297. }
  20298. var newChildScope = this.parentScope.$new();
  20299. newChildScope.data = __assign({}, data);
  20300. newChildScope.rowNode = this.rowNode;
  20301. newChildScope.context = this.beans.gridOptionsWrapper.getContext();
  20302. this.addDestroyFunc(function () {
  20303. newChildScope.$destroy();
  20304. newChildScope.data = null;
  20305. newChildScope.rowNode = null;
  20306. newChildScope.context = null;
  20307. });
  20308. return newChildScope;
  20309. };
  20310. RowComp.prototype.setupRowContainers = function () {
  20311. var isFullWidthCell = this.rowNode.isFullWidthCell();
  20312. var isDetailCell = this.beans.doingMasterDetail && this.rowNode.detail;
  20313. var pivotMode = this.beans.columnController.isPivotMode();
  20314. // we only use full width for groups, not footers. it wouldn't make sense to include footers if not looking
  20315. // for totals. if users complain about this, then we should introduce a new property 'footerUseEntireRow'
  20316. // so each can be set independently (as a customer complained about footers getting full width, hence
  20317. // introducing this logic)
  20318. var isGroupRow = this.rowNode.group && !this.rowNode.footer;
  20319. var isFullWidthGroup = isGroupRow && this.beans.gridOptionsWrapper.isGroupUseEntireRow(pivotMode);
  20320. if (this.rowNode.stub) {
  20321. this.createFullWidthRows(RowComp.LOADING_CELL_RENDERER, RowComp.LOADING_CELL_RENDERER_COMP_NAME);
  20322. }
  20323. else if (isDetailCell) {
  20324. this.createFullWidthRows(RowComp.DETAIL_CELL_RENDERER, RowComp.DETAIL_CELL_RENDERER_COMP_NAME);
  20325. }
  20326. else if (isFullWidthCell) {
  20327. this.createFullWidthRows(RowComp.FULL_WIDTH_CELL_RENDERER, null);
  20328. }
  20329. else if (isFullWidthGroup) {
  20330. this.createFullWidthRows(RowComp.GROUP_ROW_RENDERER, RowComp.GROUP_ROW_RENDERER_COMP_NAME);
  20331. }
  20332. else {
  20333. this.setupNormalRowContainers();
  20334. }
  20335. };
  20336. RowComp.prototype.setupNormalRowContainers = function () {
  20337. var _this = this;
  20338. var centerCols;
  20339. var leftCols = [];
  20340. var rightCols = [];
  20341. if (this.printLayout) {
  20342. centerCols = this.beans.columnController.getAllDisplayedColumns();
  20343. }
  20344. else {
  20345. centerCols = this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);
  20346. leftCols = this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);
  20347. rightCols = this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);
  20348. }
  20349. this.createRowContainer(this.bodyContainerComp, centerCols, function (eRow) { return _this.eBodyRow = eRow; });
  20350. this.createRowContainer(this.pinnedRightContainerComp, rightCols, function (eRow) { return _this.ePinnedRightRow = eRow; });
  20351. this.createRowContainer(this.pinnedLeftContainerComp, leftCols, function (eRow) { return _this.ePinnedLeftRow = eRow; });
  20352. };
  20353. RowComp.prototype.createFullWidthRows = function (type, name) {
  20354. var _this = this;
  20355. this.fullWidthRow = true;
  20356. if (this.embedFullWidth) {
  20357. this.createFullWidthRowContainer(this.bodyContainerComp, null, null, type, name, function (eRow) {
  20358. _this.eFullWidthRowBody = eRow;
  20359. }, function (cellRenderer) {
  20360. _this.fullWidthRowComponentBody = cellRenderer;
  20361. });
  20362. // printLayout doesn't put components into the pinned sections
  20363. if (this.printLayout) {
  20364. return;
  20365. }
  20366. this.createFullWidthRowContainer(this.pinnedLeftContainerComp, _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT, 'ag-cell-last-left-pinned', type, name, function (eRow) {
  20367. _this.eFullWidthRowLeft = eRow;
  20368. }, function (cellRenderer) {
  20369. _this.fullWidthRowComponentLeft = cellRenderer;
  20370. });
  20371. this.createFullWidthRowContainer(this.pinnedRightContainerComp, _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT, 'ag-cell-first-right-pinned', type, name, function (eRow) {
  20372. _this.eFullWidthRowRight = eRow;
  20373. }, function (cellRenderer) {
  20374. _this.fullWidthRowComponentRight = cellRenderer;
  20375. });
  20376. }
  20377. else {
  20378. // otherwise we add to the fullWidth container as normal
  20379. // let previousFullWidth = ensureDomOrder ? this.lastPlacedElements.eFullWidth : null;
  20380. this.createFullWidthRowContainer(this.fullWidthContainerComp, null, null, type, name, function (eRow) {
  20381. _this.eFullWidthRow = eRow;
  20382. }, function (cellRenderer) {
  20383. _this.fullWidthRowComponent = cellRenderer;
  20384. });
  20385. }
  20386. };
  20387. RowComp.prototype.setAnimateFlags = function (animateIn) {
  20388. if (animateIn) {
  20389. var oldRowTopExists = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(this.rowNode.oldRowTop);
  20390. // if the row had a previous position, we slide it in (animate row top)
  20391. this.slideRowIn = oldRowTopExists;
  20392. // if the row had no previous position, we fade it in (animate
  20393. this.fadeRowIn = !oldRowTopExists;
  20394. }
  20395. else {
  20396. this.slideRowIn = false;
  20397. this.fadeRowIn = false;
  20398. }
  20399. };
  20400. RowComp.prototype.isEditing = function () {
  20401. return this.editingRow;
  20402. };
  20403. RowComp.prototype.stopRowEditing = function (cancel) {
  20404. this.stopEditing(cancel);
  20405. };
  20406. RowComp.prototype.isFullWidth = function () {
  20407. return this.fullWidthRow;
  20408. };
  20409. RowComp.prototype.refreshFullWidth = function () {
  20410. var _this = this;
  20411. // returns 'true' if refresh succeeded
  20412. var tryRefresh = function (eRow, eCellComp, pinned) {
  20413. if (!eRow || !eCellComp) {
  20414. return true;
  20415. } // no refresh needed
  20416. // no refresh method present, so can't refresh, hard refresh needed
  20417. if (!eCellComp.refresh) {
  20418. return false;
  20419. }
  20420. var params = _this.createFullWidthParams(eRow, pinned);
  20421. var refreshSucceeded = eCellComp.refresh(params);
  20422. return refreshSucceeded;
  20423. };
  20424. var normalSuccess = tryRefresh(this.eFullWidthRow, this.fullWidthRowComponent, null);
  20425. var bodySuccess = tryRefresh(this.eFullWidthRowBody, this.fullWidthRowComponentBody, null);
  20426. var leftSuccess = tryRefresh(this.eFullWidthRowLeft, this.fullWidthRowComponentLeft, _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT);
  20427. var rightSuccess = tryRefresh(this.eFullWidthRowRight, this.fullWidthRowComponentRight, _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT);
  20428. var allFullWidthRowsRefreshed = normalSuccess && bodySuccess && leftSuccess && rightSuccess;
  20429. return allFullWidthRowsRefreshed;
  20430. };
  20431. RowComp.prototype.addListeners = function () {
  20432. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_HEIGHT_CHANGED, this.onRowHeightChanged.bind(this));
  20433. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_ROW_SELECTED, this.onRowSelected.bind(this));
  20434. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_ROW_INDEX_CHANGED, this.onRowIndexChanged.bind(this));
  20435. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_TOP_CHANGED, this.onTopChanged.bind(this));
  20436. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_EXPANDED_CHANGED, this.onExpandedChanged.bind(this));
  20437. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_DATA_CHANGED, this.onRowNodeDataChanged.bind(this));
  20438. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_CELL_CHANGED, this.onRowNodeCellChanged.bind(this));
  20439. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_HIGHLIGHT_CHANGED, this.onRowNodeHighlightChanged.bind(this));
  20440. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_DRAGGING_CHANGED, this.onRowNodeDraggingChanged.bind(this));
  20441. var eventService = this.beans.eventService;
  20442. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_HEIGHT_SCALE_CHANGED, this.onTopChanged.bind(this));
  20443. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
  20444. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));
  20445. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
  20446. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_FOCUSED, this.onCellFocusChanged.bind(this));
  20447. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));
  20448. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));
  20449. this.addManagedListener(eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_MOVED, this.onColumnMoved.bind(this));
  20450. this.addListenersForCellComps();
  20451. };
  20452. RowComp.prototype.addListenersForCellComps = function () {
  20453. var _this = this;
  20454. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_ROW_INDEX_CHANGED, function () {
  20455. _this.forEachCellComp(function (cellComp) { return cellComp.onRowIndexChanged(); });
  20456. });
  20457. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_CELL_CHANGED, function (event) {
  20458. _this.forEachCellComp(function (cellComp) { return cellComp.onCellChanged(event); });
  20459. });
  20460. };
  20461. RowComp.prototype.onRowNodeDataChanged = function (event) {
  20462. // if this is an update, we want to refresh, as this will allow the user to put in a transition
  20463. // into the cellRenderer refresh method. otherwise this might be completely new data, in which case
  20464. // we will want to completely replace the cells
  20465. this.forEachCellComp(function (cellComp) {
  20466. return cellComp.refreshCell({
  20467. suppressFlash: !event.update,
  20468. newData: !event.update
  20469. });
  20470. });
  20471. // check for selected also, as this could be after lazy loading of the row data, in which case
  20472. // the id might of just gotten set inside the row and the row selected state may of changed
  20473. // as a result. this is what happens when selected rows are loaded in virtual pagination.
  20474. // - niall note - since moving to the stub component, this may no longer be true, as replacing
  20475. // the stub component now replaces the entire row
  20476. this.onRowSelected();
  20477. // as data has changed, then the style and class needs to be recomputed
  20478. this.postProcessCss();
  20479. };
  20480. RowComp.prototype.onRowNodeCellChanged = function () {
  20481. // as data has changed, then the style and class needs to be recomputed
  20482. this.postProcessCss();
  20483. };
  20484. RowComp.prototype.postProcessCss = function () {
  20485. this.postProcessStylesFromGridOptions();
  20486. this.postProcessClassesFromGridOptions();
  20487. this.postProcessRowClassRules();
  20488. this.postProcessRowDragging();
  20489. };
  20490. RowComp.prototype.onRowNodeHighlightChanged = function () {
  20491. var highlighted = this.rowNode.highlighted;
  20492. this.eAllRowContainers.forEach(function (row) {
  20493. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(row, 'ag-row-highlight-above');
  20494. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(row, 'ag-row-highlight-below');
  20495. if (highlighted) {
  20496. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(row, 'ag-row-highlight-' + highlighted);
  20497. }
  20498. });
  20499. };
  20500. RowComp.prototype.onRowNodeDraggingChanged = function () {
  20501. this.postProcessRowDragging();
  20502. };
  20503. RowComp.prototype.postProcessRowDragging = function () {
  20504. var dragging = this.rowNode.dragging;
  20505. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-dragging', dragging); });
  20506. };
  20507. RowComp.prototype.onExpandedChanged = function () {
  20508. var rowNode = this.rowNode;
  20509. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-group-expanded', rowNode.expanded); });
  20510. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-group-contracted', !rowNode.expanded); });
  20511. };
  20512. RowComp.prototype.onDisplayedColumnsChanged = function () {
  20513. if (this.fullWidthRow) {
  20514. return;
  20515. }
  20516. this.refreshCells();
  20517. };
  20518. RowComp.prototype.destroyFullWidthComponents = function () {
  20519. if (this.fullWidthRowComponent) {
  20520. this.beans.detailRowCompCache.addOrDestroy(this.rowNode, null, this.fullWidthRowComponent);
  20521. this.fullWidthRowComponent = null;
  20522. }
  20523. if (this.fullWidthRowComponentBody) {
  20524. this.beans.detailRowCompCache.addOrDestroy(this.rowNode, null, this.fullWidthRowComponentBody);
  20525. this.fullWidthRowComponent = null;
  20526. }
  20527. if (this.fullWidthRowComponentLeft) {
  20528. this.beans.detailRowCompCache.addOrDestroy(this.rowNode, _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT, this.fullWidthRowComponentLeft);
  20529. this.fullWidthRowComponentLeft = null;
  20530. }
  20531. if (this.fullWidthRowComponentRight) {
  20532. this.beans.detailRowCompCache.addOrDestroy(this.rowNode, _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT, this.fullWidthRowComponentRight);
  20533. this.fullWidthRowComponent = null;
  20534. }
  20535. };
  20536. RowComp.prototype.getContainerForCell = function (pinnedType) {
  20537. switch (pinnedType) {
  20538. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT: return this.ePinnedLeftRow;
  20539. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT: return this.ePinnedRightRow;
  20540. default: return this.eBodyRow;
  20541. }
  20542. };
  20543. RowComp.prototype.onVirtualColumnsChanged = function () {
  20544. if (this.fullWidthRow) {
  20545. return;
  20546. }
  20547. this.refreshCells();
  20548. };
  20549. RowComp.prototype.onColumnResized = function () {
  20550. if (this.fullWidthRow) {
  20551. return;
  20552. }
  20553. this.refreshCells();
  20554. };
  20555. RowComp.prototype.refreshCells = function () {
  20556. if (!this.areAllContainersReady()) {
  20557. this.refreshNeeded = true;
  20558. return;
  20559. }
  20560. var suppressAnimationFrame = this.beans.gridOptionsWrapper.isSuppressAnimationFrame();
  20561. var skipAnimationFrame = suppressAnimationFrame || this.printLayout;
  20562. if (skipAnimationFrame) {
  20563. this.refreshCellsInAnimationFrame();
  20564. }
  20565. else {
  20566. if (this.columnRefreshPending) {
  20567. return;
  20568. }
  20569. this.beans.taskQueue.createTask(this.refreshCellsInAnimationFrame.bind(this), this.rowNode.rowIndex, 'createTasksP1');
  20570. }
  20571. };
  20572. RowComp.prototype.refreshCellsInAnimationFrame = function () {
  20573. if (!this.active) {
  20574. return;
  20575. }
  20576. this.columnRefreshPending = false;
  20577. var centerCols;
  20578. var leftCols;
  20579. var rightCols;
  20580. if (this.printLayout) {
  20581. centerCols = this.beans.columnController.getAllDisplayedColumns();
  20582. leftCols = [];
  20583. rightCols = [];
  20584. }
  20585. else {
  20586. centerCols = this.beans.columnController.getAllDisplayedCenterVirtualColumnsForRow(this.rowNode);
  20587. leftCols = this.beans.columnController.getDisplayedLeftColumnsForRow(this.rowNode);
  20588. rightCols = this.beans.columnController.getDisplayedRightColumnsForRow(this.rowNode);
  20589. }
  20590. this.insertCellsIntoContainer(this.eBodyRow, centerCols);
  20591. this.insertCellsIntoContainer(this.ePinnedLeftRow, leftCols);
  20592. this.insertCellsIntoContainer(this.ePinnedRightRow, rightCols);
  20593. this.elementOrderChanged = false;
  20594. var colIdsToRemove = Object.keys(this.cellComps);
  20595. centerCols.forEach(function (col) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeFromArray(colIdsToRemove, col.getId()); });
  20596. leftCols.forEach(function (col) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeFromArray(colIdsToRemove, col.getId()); });
  20597. rightCols.forEach(function (col) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeFromArray(colIdsToRemove, col.getId()); });
  20598. // we never remove editing cells, as this would cause the cells to loose their values while editing
  20599. // as the grid is scrolling horizontally.
  20600. var eligibleToBeRemoved = colIdsToRemove.filter(this.isCellEligibleToBeRemoved.bind(this));
  20601. // remove old cells from gui, but we don't destroy them, we might use them again
  20602. this.removeRenderedCells(eligibleToBeRemoved);
  20603. };
  20604. RowComp.prototype.onColumnMoved = function () {
  20605. this.elementOrderChanged = true;
  20606. };
  20607. RowComp.prototype.removeRenderedCells = function (colIds) {
  20608. var _this = this;
  20609. colIds.forEach(function (key) {
  20610. var cellComp = _this.cellComps[key];
  20611. // could be old reference, ie removed cell
  20612. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(cellComp)) {
  20613. return;
  20614. }
  20615. cellComp.detach();
  20616. cellComp.destroy();
  20617. _this.cellComps[key] = null;
  20618. });
  20619. };
  20620. RowComp.prototype.isCellEligibleToBeRemoved = function (indexStr) {
  20621. var displayedColumns = this.beans.columnController.getAllDisplayedColumns();
  20622. var REMOVE_CELL = true;
  20623. var KEEP_CELL = false;
  20624. var renderedCell = this.cellComps[indexStr];
  20625. // always remove the cell if it's not rendered or if it's in the wrong pinned location
  20626. if (!renderedCell || this.isCellInWrongRow(renderedCell)) {
  20627. return REMOVE_CELL;
  20628. }
  20629. // we want to try and keep editing and focused cells
  20630. var editing = renderedCell.isEditing();
  20631. var focused = this.beans.focusController.isCellFocused(renderedCell.getCellPosition());
  20632. var mightWantToKeepCell = editing || focused;
  20633. if (mightWantToKeepCell) {
  20634. var column = renderedCell.getColumn();
  20635. var cellStillDisplayed = displayedColumns.indexOf(column) >= 0;
  20636. return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL;
  20637. }
  20638. return REMOVE_CELL;
  20639. };
  20640. RowComp.prototype.ensureCellInCorrectContainer = function (cellComp) {
  20641. // for print layout, we always put cells into centre, otherwise we put in correct pinned section
  20642. if (this.printLayout) {
  20643. return;
  20644. }
  20645. var element = cellComp.getGui();
  20646. var column = cellComp.getColumn();
  20647. var pinnedType = column.getPinned();
  20648. var eContainer = this.getContainerForCell(pinnedType);
  20649. // if in wrong container, remove it
  20650. var eOldContainer = cellComp.getParentRow();
  20651. var inWrongRow = eOldContainer !== eContainer;
  20652. if (inWrongRow) {
  20653. // take out from old row
  20654. if (eOldContainer) {
  20655. eOldContainer.removeChild(element);
  20656. }
  20657. eContainer.appendChild(element);
  20658. cellComp.setParentRow(eContainer);
  20659. this.elementOrderChanged = true;
  20660. }
  20661. };
  20662. RowComp.prototype.isCellInWrongRow = function (cellComp) {
  20663. var column = cellComp.getColumn();
  20664. var rowWeWant = this.getContainerForCell(column.getPinned());
  20665. var oldRow = cellComp.getParentRow(); // if in wrong container, remove it
  20666. return oldRow !== rowWeWant;
  20667. };
  20668. RowComp.prototype.insertCellsIntoContainer = function (eRow, cols) {
  20669. var _this = this;
  20670. if (!eRow) {
  20671. return;
  20672. }
  20673. var cellTemplates = [];
  20674. var newCellComps = [];
  20675. cols.forEach(function (col) {
  20676. var colId = col.getId();
  20677. var existingCell = _this.cellComps[colId];
  20678. if (existingCell) {
  20679. _this.ensureCellInCorrectContainer(existingCell);
  20680. }
  20681. else {
  20682. _this.createNewCell(col, eRow, cellTemplates, newCellComps);
  20683. }
  20684. });
  20685. if (cellTemplates.length > 0) {
  20686. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].appendHtml(eRow, cellTemplates.join(''));
  20687. this.callAfterRowAttachedOnCells(newCellComps, eRow);
  20688. }
  20689. if (this.elementOrderChanged && this.beans.gridOptionsWrapper.isEnsureDomOrder()) {
  20690. var correctChildOrder = cols.map(function (col) { return _this.getCellForCol(col); });
  20691. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].setDomChildOrder(eRow, correctChildOrder);
  20692. }
  20693. };
  20694. RowComp.prototype.addDomData = function (eRowContainer) {
  20695. var gow = this.beans.gridOptionsWrapper;
  20696. gow.setDomData(eRowContainer, RowComp.DOM_DATA_KEY_RENDERED_ROW, this);
  20697. this.addDestroyFunc(function () {
  20698. gow.setDomData(eRowContainer, RowComp.DOM_DATA_KEY_RENDERED_ROW, null);
  20699. });
  20700. };
  20701. RowComp.prototype.createNewCell = function (col, eContainer, cellTemplates, newCellComps) {
  20702. var newCellComp = new _cellComp__WEBPACK_IMPORTED_MODULE_0__["CellComp"](this.scope, this.beans, col, this.rowNode, this, false, this.printLayout);
  20703. var cellTemplate = newCellComp.getCreateTemplate();
  20704. cellTemplates.push(cellTemplate);
  20705. newCellComps.push(newCellComp);
  20706. this.cellComps[col.getId()] = newCellComp;
  20707. newCellComp.setParentRow(eContainer);
  20708. this.elementOrderChanged = true;
  20709. };
  20710. RowComp.prototype.onMouseEvent = function (eventName, mouseEvent) {
  20711. switch (eventName) {
  20712. case 'dblclick':
  20713. this.onRowDblClick(mouseEvent);
  20714. break;
  20715. case 'click':
  20716. this.onRowClick(mouseEvent);
  20717. break;
  20718. case 'mousedown':
  20719. this.onRowMouseDown(mouseEvent);
  20720. break;
  20721. }
  20722. };
  20723. RowComp.prototype.createRowEvent = function (type, domEvent) {
  20724. return {
  20725. type: type,
  20726. node: this.rowNode,
  20727. data: this.rowNode.data,
  20728. rowIndex: this.rowNode.rowIndex,
  20729. rowPinned: this.rowNode.rowPinned,
  20730. context: this.beans.gridOptionsWrapper.getContext(),
  20731. api: this.beans.gridOptionsWrapper.getApi(),
  20732. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  20733. event: domEvent
  20734. };
  20735. };
  20736. RowComp.prototype.createRowEventWithSource = function (type, domEvent) {
  20737. var event = this.createRowEvent(type, domEvent);
  20738. // when first developing this, we included the rowComp in the event.
  20739. // this seems very weird. so when introducing the event types, i left the 'source'
  20740. // out of the type, and just include the source in the two places where this event
  20741. // was fired (rowClicked and rowDoubleClicked). it doesn't make sense for any
  20742. // users to be using this, as the rowComp isn't an object we expose, so would be
  20743. // very surprising if a user was using it.
  20744. event.source = this;
  20745. return event;
  20746. };
  20747. RowComp.prototype.onRowDblClick = function (mouseEvent) {
  20748. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isStopPropagationForAgGrid(mouseEvent)) {
  20749. return;
  20750. }
  20751. var agEvent = this.createRowEventWithSource(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DOUBLE_CLICKED, mouseEvent);
  20752. this.beans.eventService.dispatchEvent(agEvent);
  20753. };
  20754. RowComp.prototype.onRowMouseDown = function (mouseEvent) {
  20755. this.lastMouseDownOnDragger = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isElementChildOfClass(mouseEvent.target, 'ag-row-drag', 3);
  20756. };
  20757. RowComp.prototype.onRowClick = function (mouseEvent) {
  20758. var stop = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isStopPropagationForAgGrid(mouseEvent) || this.lastMouseDownOnDragger;
  20759. if (stop) {
  20760. return;
  20761. }
  20762. var agEvent = this.createRowEventWithSource(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_CLICKED, mouseEvent);
  20763. this.beans.eventService.dispatchEvent(agEvent);
  20764. // ctrlKey for windows, metaKey for Apple
  20765. var multiSelectKeyPressed = mouseEvent.ctrlKey || mouseEvent.metaKey;
  20766. var shiftKeyPressed = mouseEvent.shiftKey;
  20767. if (
  20768. // we do not allow selecting groups by clicking (as the click here expands the group), or if it's a detail row,
  20769. // so return if it's a group row
  20770. this.rowNode.group ||
  20771. // this is needed so we don't unselect other rows when we click this row, eg if this row is not selectable,
  20772. // and we click it, the selection should not change (ie any currently selected row should stay selected)
  20773. !this.rowNode.selectable ||
  20774. // we also don't allow selection of pinned rows
  20775. this.rowNode.rowPinned ||
  20776. // if no selection method enabled, do nothing
  20777. !this.beans.gridOptionsWrapper.isRowSelection() ||
  20778. // if click selection suppressed, do nothing
  20779. this.beans.gridOptionsWrapper.isSuppressRowClickSelection()) {
  20780. return;
  20781. }
  20782. var multiSelectOnClick = this.beans.gridOptionsWrapper.isRowMultiSelectWithClick();
  20783. var rowDeselectionWithCtrl = this.beans.gridOptionsWrapper.isRowDeselection();
  20784. if (this.rowNode.isSelected()) {
  20785. if (multiSelectOnClick) {
  20786. this.rowNode.setSelectedParams({ newValue: false });
  20787. }
  20788. else if (multiSelectKeyPressed) {
  20789. if (rowDeselectionWithCtrl) {
  20790. this.rowNode.setSelectedParams({ newValue: false });
  20791. }
  20792. }
  20793. else {
  20794. // selected with no multi key, must make sure anything else is unselected
  20795. this.rowNode.setSelectedParams({ newValue: true, clearSelection: true });
  20796. }
  20797. }
  20798. else {
  20799. var clearSelection = multiSelectOnClick ? false : !multiSelectKeyPressed;
  20800. this.rowNode.setSelectedParams({ newValue: true, clearSelection: clearSelection, rangeSelect: shiftKeyPressed });
  20801. }
  20802. };
  20803. RowComp.prototype.createFullWidthRowContainer = function (rowContainerComp, pinned, extraCssClass, cellRendererType, cellRendererName, eRowCallback, cellRendererCallback) {
  20804. var _this = this;
  20805. var rowTemplate = this.createTemplate('', extraCssClass);
  20806. rowContainerComp.appendRowTemplate(rowTemplate, function () {
  20807. var eRow = rowContainerComp.getRowElement(_this.getCompId());
  20808. var params = _this.createFullWidthParams(eRow, pinned);
  20809. var callback = function (cellRenderer) {
  20810. if (_this.isAlive()) {
  20811. var gui = cellRenderer.getGui();
  20812. eRow.appendChild(gui);
  20813. cellRendererCallback(cellRenderer);
  20814. }
  20815. else {
  20816. _this.beans.context.destroyBean(cellRenderer);
  20817. }
  20818. };
  20819. // if doing master detail, it's possible we have a cached row comp from last time detail was displayed
  20820. var cachedRowComp = _this.beans.detailRowCompCache.get(_this.rowNode, pinned);
  20821. if (cachedRowComp) {
  20822. callback(cachedRowComp);
  20823. }
  20824. else {
  20825. var res = _this.beans.userComponentFactory.newFullWidthCellRenderer(params, cellRendererType, cellRendererName);
  20826. if (!res) {
  20827. var masterDetailModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_6__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_5__["ModuleNames"].MasterDetailModule);
  20828. if (cellRendererName === 'agDetailCellRenderer' && !masterDetailModuleLoaded) {
  20829. console.warn("ag-Grid: cell renderer agDetailCellRenderer (for master detail) not found. Did you forget to include the master detail module?");
  20830. }
  20831. else {
  20832. console.error("ag-Grid: fullWidthCellRenderer " + cellRendererName + " not found");
  20833. }
  20834. return;
  20835. }
  20836. res.then(callback);
  20837. }
  20838. _this.afterRowAttached(rowContainerComp, eRow);
  20839. eRowCallback(eRow);
  20840. _this.angular1Compile(eRow);
  20841. });
  20842. };
  20843. RowComp.prototype.angular1Compile = function (element) {
  20844. if (!this.scope) {
  20845. return;
  20846. }
  20847. this.beans.$compile(element)(this.scope);
  20848. };
  20849. RowComp.prototype.createFullWidthParams = function (eRow, pinned) {
  20850. var params = {
  20851. fullWidth: true,
  20852. data: this.rowNode.data,
  20853. node: this.rowNode,
  20854. value: this.rowNode.key,
  20855. $scope: this.scope ? this.scope : this.parentScope,
  20856. $compile: this.beans.$compile,
  20857. rowIndex: this.rowNode.rowIndex,
  20858. api: this.beans.gridOptionsWrapper.getApi(),
  20859. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  20860. context: this.beans.gridOptionsWrapper.getContext(),
  20861. // these need to be taken out, as part of 'afterAttached' now
  20862. eGridCell: eRow,
  20863. eParentOfValue: eRow,
  20864. pinned: pinned,
  20865. addRenderedRowListener: this.addEventListener.bind(this)
  20866. };
  20867. return params;
  20868. };
  20869. RowComp.prototype.getInitialRowClasses = function (extraCssClass) {
  20870. var classes = [];
  20871. var isTreeData = this.beans.gridOptionsWrapper.isTreeData();
  20872. var rowNode = this.rowNode;
  20873. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(extraCssClass)) {
  20874. classes.push(extraCssClass);
  20875. }
  20876. classes.push('ag-row');
  20877. classes.push(this.rowFocused ? 'ag-row-focus' : 'ag-row-no-focus');
  20878. if (this.fadeRowIn) {
  20879. classes.push('ag-opacity-zero');
  20880. }
  20881. classes.push(this.rowIsEven ? 'ag-row-even' : 'ag-row-odd');
  20882. if (rowNode.isRowPinned()) {
  20883. classes.push('ag-row-pinned');
  20884. }
  20885. if (rowNode.isSelected()) {
  20886. classes.push('ag-row-selected');
  20887. }
  20888. if (rowNode.group) {
  20889. classes.push('ag-row-group');
  20890. // if a group, put the level of the group in
  20891. classes.push('ag-row-level-' + rowNode.level);
  20892. if (rowNode.footer) {
  20893. classes.push('ag-row-footer');
  20894. }
  20895. }
  20896. else {
  20897. // if a leaf, and a parent exists, put a level of the parent, else put level of 0 for top level item
  20898. classes.push('ag-row-level-' + (rowNode.parent ? (rowNode.parent.level + 1) : '0'));
  20899. }
  20900. if (rowNode.stub) {
  20901. classes.push('ag-row-loading');
  20902. }
  20903. if (this.fullWidthRow) {
  20904. classes.push('ag-full-width-row');
  20905. }
  20906. var addExpandedClass = isTreeData ?
  20907. // if doing tree data, we add the expanded classes if any children, as any node can be a parent
  20908. rowNode.allChildrenCount :
  20909. // if normal row grouping, we add expanded classes to groups only
  20910. rowNode.group && !rowNode.footer;
  20911. if (addExpandedClass) {
  20912. classes.push(rowNode.expanded ? 'ag-row-group-expanded' : 'ag-row-group-contracted');
  20913. }
  20914. if (rowNode.dragging) {
  20915. classes.push('ag-row-dragging');
  20916. }
  20917. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].pushAll(classes, this.processClassesFromGridOptions());
  20918. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].pushAll(classes, this.preProcessRowClassRules());
  20919. // we use absolute position unless we are doing print layout
  20920. classes.push(this.printLayout ? 'ag-row-position-relative' : 'ag-row-position-absolute');
  20921. this.firstRowOnPage = this.isFirstRowOnPage();
  20922. this.lastRowOnPage = this.isLastRowOnPage();
  20923. if (this.firstRowOnPage) {
  20924. classes.push('ag-row-first');
  20925. }
  20926. if (this.lastRowOnPage) {
  20927. classes.push('ag-row-last');
  20928. }
  20929. return classes;
  20930. };
  20931. RowComp.prototype.isFirstRowOnPage = function () {
  20932. return this.rowNode.rowIndex === this.beans.paginationProxy.getPageFirstRow();
  20933. };
  20934. RowComp.prototype.isLastRowOnPage = function () {
  20935. return this.rowNode.rowIndex === this.beans.paginationProxy.getPageLastRow();
  20936. };
  20937. RowComp.prototype.onModelUpdated = function () {
  20938. var newFirst = this.isFirstRowOnPage();
  20939. var newLast = this.isLastRowOnPage();
  20940. if (this.firstRowOnPage !== newFirst) {
  20941. this.firstRowOnPage = newFirst;
  20942. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-first', newFirst); });
  20943. }
  20944. if (this.lastRowOnPage !== newLast) {
  20945. this.lastRowOnPage = newLast;
  20946. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-last', newLast); });
  20947. }
  20948. };
  20949. RowComp.prototype.preProcessRowClassRules = function () {
  20950. var res = [];
  20951. this.processRowClassRules(function (className) {
  20952. res.push(className);
  20953. }, function (className) {
  20954. // not catered for, if creating, no need
  20955. // to remove class as it was never there
  20956. });
  20957. return res;
  20958. };
  20959. RowComp.prototype.processRowClassRules = function (onApplicableClass, onNotApplicableClass) {
  20960. this.beans.stylingService.processClassRules(this.beans.gridOptionsWrapper.rowClassRules(), {
  20961. value: undefined,
  20962. colDef: undefined,
  20963. data: this.rowNode.data,
  20964. node: this.rowNode,
  20965. rowIndex: this.rowNode.rowIndex,
  20966. api: this.beans.gridOptionsWrapper.getApi(),
  20967. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  20968. $scope: this.scope,
  20969. context: this.beans.gridOptionsWrapper.getContext()
  20970. }, onApplicableClass, onNotApplicableClass);
  20971. };
  20972. RowComp.prototype.stopEditing = function (cancel) {
  20973. if (cancel === void 0) { cancel = false; }
  20974. this.forEachCellComp(function (renderedCell) {
  20975. renderedCell.stopEditing(cancel);
  20976. });
  20977. if (!this.editingRow) {
  20978. return;
  20979. }
  20980. if (!cancel) {
  20981. var event_1 = this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_VALUE_CHANGED);
  20982. this.beans.eventService.dispatchEvent(event_1);
  20983. }
  20984. this.setEditingRow(false);
  20985. };
  20986. RowComp.prototype.setEditingRow = function (value) {
  20987. this.editingRow = value;
  20988. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-editing', value); });
  20989. var event = value ?
  20990. this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_EDITING_STARTED)
  20991. : this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_EDITING_STOPPED);
  20992. this.beans.eventService.dispatchEvent(event);
  20993. };
  20994. RowComp.prototype.startRowEditing = function (keyPress, charPress, sourceRenderedCell) {
  20995. if (keyPress === void 0) { keyPress = null; }
  20996. if (charPress === void 0) { charPress = null; }
  20997. if (sourceRenderedCell === void 0) { sourceRenderedCell = null; }
  20998. // don't do it if already editing
  20999. if (this.editingRow) {
  21000. return;
  21001. }
  21002. this.forEachCellComp(function (renderedCell) {
  21003. var cellStartedEdit = renderedCell === sourceRenderedCell;
  21004. if (cellStartedEdit) {
  21005. renderedCell.startEditingIfEnabled(keyPress, charPress, cellStartedEdit);
  21006. }
  21007. else {
  21008. renderedCell.startEditingIfEnabled(null, null, cellStartedEdit);
  21009. }
  21010. });
  21011. this.setEditingRow(true);
  21012. };
  21013. RowComp.prototype.forEachCellComp = function (callback) {
  21014. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].iterateObject(this.cellComps, function (key, cellComp) {
  21015. if (!cellComp) {
  21016. return;
  21017. }
  21018. callback(cellComp);
  21019. });
  21020. };
  21021. RowComp.prototype.postProcessClassesFromGridOptions = function () {
  21022. var _this = this;
  21023. var cssClasses = this.processClassesFromGridOptions();
  21024. if (!cssClasses || !cssClasses.length) {
  21025. return;
  21026. }
  21027. cssClasses.forEach(function (classStr) {
  21028. _this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(row, classStr); });
  21029. });
  21030. };
  21031. RowComp.prototype.postProcessRowClassRules = function () {
  21032. var _this = this;
  21033. this.processRowClassRules(function (className) {
  21034. _this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(row, className); });
  21035. }, function (className) {
  21036. _this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(row, className); });
  21037. });
  21038. };
  21039. RowComp.prototype.processClassesFromGridOptions = function () {
  21040. var res = [];
  21041. var process = function (rowCls) {
  21042. if (typeof rowCls === 'string') {
  21043. res.push(rowCls);
  21044. }
  21045. else if (Array.isArray(rowCls)) {
  21046. rowCls.forEach(function (e) { return res.push(e); });
  21047. }
  21048. };
  21049. // part 1 - rowClass
  21050. var rowClass = this.beans.gridOptionsWrapper.getRowClass();
  21051. if (rowClass) {
  21052. if (typeof rowClass === 'function') {
  21053. console.warn('ag-Grid: rowClass should not be a function, please use getRowClass instead');
  21054. return;
  21055. }
  21056. process(rowClass);
  21057. }
  21058. // part 2 - rowClassFunc
  21059. var rowClassFunc = this.beans.gridOptionsWrapper.getRowClassFunc();
  21060. if (rowClassFunc) {
  21061. var params = {
  21062. node: this.rowNode,
  21063. data: this.rowNode.data,
  21064. rowIndex: this.rowNode.rowIndex,
  21065. context: this.beans.gridOptionsWrapper.getContext(),
  21066. api: this.beans.gridOptionsWrapper.getApi()
  21067. };
  21068. var rowClassFuncResult = rowClassFunc(params);
  21069. process(rowClassFuncResult);
  21070. }
  21071. return res;
  21072. };
  21073. RowComp.prototype.preProcessStylesFromGridOptions = function () {
  21074. var rowStyles = this.processStylesFromGridOptions();
  21075. return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].cssStyleObjectToMarkup(rowStyles);
  21076. };
  21077. RowComp.prototype.postProcessStylesFromGridOptions = function () {
  21078. var rowStyles = this.processStylesFromGridOptions();
  21079. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addStylesToElement(row, rowStyles); });
  21080. };
  21081. RowComp.prototype.processStylesFromGridOptions = function () {
  21082. // part 1 - rowStyle
  21083. var rowStyle = this.beans.gridOptionsWrapper.getRowStyle();
  21084. if (rowStyle && typeof rowStyle === 'function') {
  21085. console.warn('ag-Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead');
  21086. return;
  21087. }
  21088. // part 1 - rowStyleFunc
  21089. var rowStyleFunc = this.beans.gridOptionsWrapper.getRowStyleFunc();
  21090. var rowStyleFuncResult;
  21091. if (rowStyleFunc) {
  21092. var params = {
  21093. data: this.rowNode.data,
  21094. node: this.rowNode,
  21095. api: this.beans.gridOptionsWrapper.getApi(),
  21096. context: this.beans.gridOptionsWrapper.getContext(),
  21097. $scope: this.scope
  21098. };
  21099. rowStyleFuncResult = rowStyleFunc(params);
  21100. }
  21101. return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].assign({}, rowStyle, rowStyleFuncResult);
  21102. };
  21103. RowComp.prototype.createCells = function (cols) {
  21104. var _this = this;
  21105. var templateParts = [];
  21106. var newCellComps = [];
  21107. cols.forEach(function (col) {
  21108. var newCellComp = new _cellComp__WEBPACK_IMPORTED_MODULE_0__["CellComp"](_this.scope, _this.beans, col, _this.rowNode, _this, false, _this.printLayout);
  21109. var cellTemplate = newCellComp.getCreateTemplate();
  21110. templateParts.push(cellTemplate);
  21111. newCellComps.push(newCellComp);
  21112. _this.cellComps[col.getId()] = newCellComp;
  21113. });
  21114. var templateAndComps = {
  21115. template: templateParts.join(''),
  21116. cellComps: newCellComps
  21117. };
  21118. return templateAndComps;
  21119. };
  21120. RowComp.prototype.onRowSelected = function () {
  21121. var selected = this.rowNode.isSelected();
  21122. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-selected', selected); });
  21123. };
  21124. // called:
  21125. // + after row created for first time
  21126. // + after horizontal scroll, so new cells due to column virtualisation
  21127. RowComp.prototype.callAfterRowAttachedOnCells = function (newCellComps, eRow) {
  21128. var _this = this;
  21129. newCellComps.forEach(function (cellComp) {
  21130. cellComp.setParentRow(eRow);
  21131. cellComp.afterAttached();
  21132. // if we are editing the row, then the cell needs to turn
  21133. // into edit mode
  21134. if (_this.editingRow) {
  21135. cellComp.startEditingIfEnabled();
  21136. }
  21137. });
  21138. };
  21139. RowComp.prototype.afterRowAttached = function (rowContainerComp, eRow) {
  21140. var _this = this;
  21141. this.addDomData(eRow);
  21142. this.removeSecondPassFuncs.push(function () {
  21143. rowContainerComp.removeRowElement(eRow);
  21144. });
  21145. this.removeFirstPassFuncs.push(function () {
  21146. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(_this.rowNode.rowTop)) {
  21147. // the row top is updated anyway, however we set it here again
  21148. // to something more reasonable for the animation - ie if the
  21149. // row top is 10000px away, the row will flash out, so this
  21150. // gives it a rounded value, so row animates out more slowly
  21151. var rowTop = _this.roundRowTopToBounds(_this.rowNode.rowTop);
  21152. _this.setRowTop(rowTop);
  21153. }
  21154. else {
  21155. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(eRow, 'ag-opacity-zero');
  21156. }
  21157. });
  21158. this.eAllRowContainers.push(eRow);
  21159. // adding hover functionality adds listener to this row, so we
  21160. // do it lazily in an animation frame
  21161. if (this.useAnimationFrameForCreate) {
  21162. this.beans.taskQueue.createTask(this.addHoverFunctionality.bind(this, eRow), this.rowNode.rowIndex, 'createTasksP2');
  21163. }
  21164. else {
  21165. this.addHoverFunctionality(eRow);
  21166. }
  21167. };
  21168. RowComp.prototype.addHoverFunctionality = function (eRow) {
  21169. var _this = this;
  21170. // because we use animation frames to do this, it's possible the row no longer exists
  21171. // by the time we get to add it
  21172. if (!this.active) {
  21173. return;
  21174. }
  21175. // because mouseenter and mouseleave do not propagate, we cannot listen on the gridPanel
  21176. // like we do for all the other mouse events.
  21177. // because of the pinning, we cannot simply add / remove the class based on the eRow. we
  21178. // have to check all eRow's (body & pinned). so the trick is if any of the rows gets a
  21179. // mouse hover, it sets such in the rowNode, and then all three reflect the change as
  21180. // all are listening for event on the row node.
  21181. // step 1 - add listener, to set flag on row node
  21182. this.addManagedListener(eRow, 'mouseenter', function () { return _this.rowNode.onMouseEnter(); });
  21183. this.addManagedListener(eRow, 'mouseleave', function () { return _this.rowNode.onMouseLeave(); });
  21184. // step 2 - listen for changes on row node (which any eRow can trigger)
  21185. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_MOUSE_ENTER, function () {
  21186. // if hover turned off, we don't add the class. we do this here so that if the application
  21187. // toggles this property mid way, we remove the hover form the last row, but we stop
  21188. // adding hovers from that point onwards.
  21189. if (!_this.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()) {
  21190. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(eRow, 'ag-row-hover');
  21191. }
  21192. });
  21193. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"].EVENT_MOUSE_LEAVE, function () {
  21194. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(eRow, 'ag-row-hover');
  21195. });
  21196. };
  21197. // for animation, we don't want to animate entry or exit to a very far away pixel,
  21198. // otherwise the row would move so fast, it would appear to disappear. so this method
  21199. // moves the row closer to the viewport if it is far away, so the row slide in / out
  21200. // at a speed the user can see.
  21201. RowComp.prototype.roundRowTopToBounds = function (rowTop) {
  21202. var range = this.beans.gridPanel.getVScrollPosition();
  21203. var minPixel = this.applyPaginationOffset(range.top, true) - 100;
  21204. var maxPixel = this.applyPaginationOffset(range.bottom, true) + 100;
  21205. return Math.min(Math.max(minPixel, rowTop), maxPixel);
  21206. };
  21207. RowComp.prototype.getFrameworkOverrides = function () {
  21208. return this.beans.frameworkOverrides;
  21209. };
  21210. RowComp.prototype.onRowHeightChanged = function () {
  21211. // check for exists first - if the user is resetting the row height, then
  21212. // it will be null (or undefined) momentarily until the next time the flatten
  21213. // stage is called where the row will then update again with a new height
  21214. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(this.rowNode.rowHeight)) {
  21215. var heightPx_1 = this.rowNode.rowHeight + "px";
  21216. this.eAllRowContainers.forEach(function (row) { return row.style.height = heightPx_1; });
  21217. }
  21218. };
  21219. RowComp.prototype.addEventListener = function (eventType, listener) {
  21220. if (eventType === 'renderedRowRemoved' || eventType === 'rowRemoved') {
  21221. eventType = _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED;
  21222. console.warn('ag-Grid: Since version 11, event renderedRowRemoved is now called ' + _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED);
  21223. }
  21224. _super.prototype.addEventListener.call(this, eventType, listener);
  21225. };
  21226. RowComp.prototype.removeEventListener = function (eventType, listener) {
  21227. if (eventType === 'renderedRowRemoved' || eventType === 'rowRemoved') {
  21228. eventType = _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED;
  21229. console.warn('ag-Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called ' + _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED);
  21230. }
  21231. _super.prototype.removeEventListener.call(this, eventType, listener);
  21232. };
  21233. // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.
  21234. RowComp.prototype.destroy = function (animate) {
  21235. if (animate === void 0) { animate = false; }
  21236. this.active = false;
  21237. // why do we have this method? shouldn't everything below be added as a destroy func beside
  21238. // the corresponding create logic?
  21239. this.destroyFullWidthComponents();
  21240. if (animate) {
  21241. this.removeFirstPassFuncs.forEach(function (func) { return func(); });
  21242. this.removeSecondPassFuncs.push(this.destroyContainingCells.bind(this));
  21243. }
  21244. else {
  21245. this.destroyContainingCells();
  21246. // we are not animating, so execute the second stage of removal now.
  21247. // we call getAndClear, so that they are only called once
  21248. var delayedDestroyFunctions = this.getAndClearDelayedDestroyFunctions();
  21249. delayedDestroyFunctions.forEach(function (func) { return func(); });
  21250. }
  21251. var event = this.createRowEvent(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_ROW_REMOVED);
  21252. this.dispatchEvent(event);
  21253. this.beans.eventService.dispatchEvent(event);
  21254. _super.prototype.destroy.call(this);
  21255. };
  21256. RowComp.prototype.destroyContainingCells = function () {
  21257. this.forEachCellComp(function (renderedCell) { return renderedCell.destroy(); });
  21258. this.destroyFullWidthComponents();
  21259. };
  21260. // we clear so that the functions are never executed twice
  21261. RowComp.prototype.getAndClearDelayedDestroyFunctions = function () {
  21262. var result = this.removeSecondPassFuncs;
  21263. this.removeSecondPassFuncs = [];
  21264. return result;
  21265. };
  21266. RowComp.prototype.onCellFocusChanged = function () {
  21267. var rowFocused = this.beans.focusController.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned);
  21268. if (rowFocused !== this.rowFocused) {
  21269. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-focus', rowFocused); });
  21270. this.eAllRowContainers.forEach(function (row) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(row, 'ag-row-no-focus', !rowFocused); });
  21271. this.rowFocused = rowFocused;
  21272. }
  21273. // if we are editing, then moving the focus out of a row will stop editing
  21274. if (!rowFocused && this.editingRow) {
  21275. this.stopEditing(false);
  21276. }
  21277. };
  21278. RowComp.prototype.onPaginationChanged = function () {
  21279. var currentPage = this.beans.paginationProxy.getCurrentPage();
  21280. // it is possible this row is in the new page, but the page number has changed, which means
  21281. // it needs to reposition itself relative to the new page
  21282. if (this.paginationPage !== currentPage) {
  21283. this.paginationPage = currentPage;
  21284. this.onTopChanged();
  21285. }
  21286. };
  21287. RowComp.prototype.onTopChanged = function () {
  21288. this.setRowTop(this.rowNode.rowTop);
  21289. };
  21290. // applies pagination offset, eg if on second page, and page height is 500px, then removes
  21291. // 500px from the top position, so a row with rowTop 600px is displayed at location 100px.
  21292. // reverse will take the offset away rather than add.
  21293. RowComp.prototype.applyPaginationOffset = function (topPx, reverse) {
  21294. if (reverse === void 0) { reverse = false; }
  21295. if (this.rowNode.isRowPinned()) {
  21296. return topPx;
  21297. }
  21298. var pixelOffset = this.beans.paginationProxy.getPixelOffset();
  21299. var multiplier = reverse ? 1 : -1;
  21300. return topPx + (pixelOffset * multiplier);
  21301. };
  21302. RowComp.prototype.setRowTop = function (pixels) {
  21303. // print layout uses normal flow layout for row positioning
  21304. if (this.printLayout) {
  21305. return;
  21306. }
  21307. // need to make sure rowTop is not null, as this can happen if the node was once
  21308. // visible (ie parent group was expanded) but is now not visible
  21309. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(pixels)) {
  21310. var afterPaginationPixels = this.applyPaginationOffset(pixels);
  21311. var afterScalingPixels = this.beans.maxDivHeightScaler.getRealPixelPosition(afterPaginationPixels);
  21312. var topPx_1 = afterScalingPixels + "px";
  21313. if (this.beans.gridOptionsWrapper.isSuppressRowTransform()) {
  21314. this.eAllRowContainers.forEach(function (row) { return row.style.top = topPx_1; });
  21315. }
  21316. else {
  21317. this.eAllRowContainers.forEach(function (row) { return row.style.transform = "translateY(" + topPx_1 + ")"; });
  21318. }
  21319. }
  21320. };
  21321. // we clear so that the functions are never executed twice
  21322. RowComp.prototype.getAndClearNextVMTurnFunctions = function () {
  21323. var result = this.createSecondPassFuncs;
  21324. this.createSecondPassFuncs = [];
  21325. return result;
  21326. };
  21327. RowComp.prototype.getRowNode = function () {
  21328. return this.rowNode;
  21329. };
  21330. RowComp.prototype.getRenderedCellForColumn = function (column) {
  21331. var _this = this;
  21332. var cellComp = this.cellComps[column.getColId()];
  21333. if (cellComp) {
  21334. return cellComp;
  21335. }
  21336. var spanList = Object.keys(this.cellComps)
  21337. .map(function (name) { return _this.cellComps[name]; })
  21338. .filter(function (cmp) { return cmp && cmp.getColSpanningList().indexOf(column) !== -1; });
  21339. return spanList.length ? spanList[0] : undefined;
  21340. };
  21341. RowComp.prototype.onRowIndexChanged = function () {
  21342. // we only bother updating if the rowIndex is present. if it is not present, it means this row
  21343. // is child of a group node, and the group node was closed, it's the only way to have no row index.
  21344. // when this happens, row is about to be de-rendered, so we don't care, rowComp is about to die!
  21345. if (this.rowNode.rowIndex != null) {
  21346. this.onCellFocusChanged();
  21347. this.updateRowIndexes();
  21348. }
  21349. };
  21350. RowComp.prototype.updateRowIndexes = function () {
  21351. var _this = this;
  21352. var rowIndexStr = this.rowNode.getRowIndexString();
  21353. var rowIsEven = this.rowNode.rowIndex % 2 === 0;
  21354. var rowIsEvenChanged = this.rowIsEven !== rowIsEven;
  21355. var headerRowCount = this.beans.headerNavigationService.getHeaderRowCount();
  21356. if (rowIsEvenChanged) {
  21357. this.rowIsEven = rowIsEven;
  21358. }
  21359. this.eAllRowContainers.forEach(function (eRow) {
  21360. eRow.setAttribute('row-index', rowIndexStr);
  21361. eRow.setAttribute('aria-rowindex', (headerRowCount + _this.rowNode.rowIndex + 1).toString());
  21362. if (!rowIsEvenChanged) {
  21363. return;
  21364. }
  21365. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(eRow, 'ag-row-even', rowIsEven);
  21366. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(eRow, 'ag-row-odd', !rowIsEven);
  21367. });
  21368. };
  21369. RowComp.prototype.ensureDomOrder = function () {
  21370. var sides = [
  21371. {
  21372. el: this.getBodyRowElement(),
  21373. ct: this.bodyContainerComp
  21374. },
  21375. {
  21376. el: this.getPinnedLeftRowElement(),
  21377. ct: this.pinnedLeftContainerComp
  21378. }, {
  21379. el: this.getPinnedRightRowElement(),
  21380. ct: this.pinnedRightContainerComp
  21381. }, {
  21382. el: this.getFullWidthRowElement(),
  21383. ct: this.fullWidthContainerComp
  21384. }
  21385. ];
  21386. sides.forEach(function (side) {
  21387. if (!side.el) {
  21388. return;
  21389. }
  21390. side.ct.ensureDomOrder(side.el);
  21391. });
  21392. };
  21393. // returns the pinned left container, either the normal one, or the embedded full with one if exists
  21394. RowComp.prototype.getPinnedLeftRowElement = function () {
  21395. return this.ePinnedLeftRow ? this.ePinnedLeftRow : this.eFullWidthRowLeft;
  21396. };
  21397. // returns the pinned right container, either the normal one, or the embedded full with one if exists
  21398. RowComp.prototype.getPinnedRightRowElement = function () {
  21399. return this.ePinnedRightRow ? this.ePinnedRightRow : this.eFullWidthRowRight;
  21400. };
  21401. // returns the body container, either the normal one, or the embedded full with one if exists
  21402. RowComp.prototype.getBodyRowElement = function () {
  21403. return this.eBodyRow ? this.eBodyRow : this.eFullWidthRowBody;
  21404. };
  21405. // returns the full width container
  21406. RowComp.prototype.getFullWidthRowElement = function () {
  21407. return this.eFullWidthRow;
  21408. };
  21409. RowComp.DOM_DATA_KEY_RENDERED_ROW = 'renderedRow';
  21410. RowComp.FULL_WIDTH_CELL_RENDERER = 'fullWidthCellRenderer';
  21411. RowComp.GROUP_ROW_RENDERER = 'groupRowRenderer';
  21412. RowComp.GROUP_ROW_RENDERER_COMP_NAME = 'agGroupRowRenderer';
  21413. RowComp.LOADING_CELL_RENDERER = 'loadingCellRenderer';
  21414. RowComp.LOADING_CELL_RENDERER_COMP_NAME = 'agLoadingCellRenderer';
  21415. RowComp.DETAIL_CELL_RENDERER = 'detailCellRenderer';
  21416. RowComp.DETAIL_CELL_RENDERER_COMP_NAME = 'agDetailCellRenderer';
  21417. return RowComp;
  21418. }(_widgets_component__WEBPACK_IMPORTED_MODULE_3__["Component"]));
  21419. /***/ }),
  21420. /* 101 */
  21421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21422. "use strict";
  21423. __webpack_require__.r(__webpack_exports__);
  21424. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellComp", function() { return CellComp; });
  21425. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
  21426. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  21427. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
  21428. /* harmony import */ var _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69);
  21429. /* harmony import */ var _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(102);
  21430. /* harmony import */ var _rowDragComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(103);
  21431. /* harmony import */ var _cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(105);
  21432. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
  21433. /* harmony import */ var _dndSourceComp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(106);
  21434. /* harmony import */ var _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(107);
  21435. /**
  21436. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  21437. * @version v23.2.1
  21438. * @link http://www.ag-grid.com/
  21439. * @license MIT
  21440. */
  21441. var __extends = (undefined && undefined.__extends) || (function () {
  21442. var extendStatics = function (d, b) {
  21443. extendStatics = Object.setPrototypeOf ||
  21444. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  21445. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  21446. return extendStatics(d, b);
  21447. };
  21448. return function (d, b) {
  21449. extendStatics(d, b);
  21450. function __() { this.constructor = d; }
  21451. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  21452. };
  21453. })();
  21454. var __assign = (undefined && undefined.__assign) || function () {
  21455. __assign = Object.assign || function(t) {
  21456. for (var s, i = 1, n = arguments.length; i < n; i++) {
  21457. s = arguments[i];
  21458. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  21459. t[p] = s[p];
  21460. }
  21461. return t;
  21462. };
  21463. return __assign.apply(this, arguments);
  21464. };
  21465. var CellComp = /** @class */ (function (_super) {
  21466. __extends(CellComp, _super);
  21467. function CellComp(scope, beans, column, rowNode, rowComp, autoHeightCell, printLayout) {
  21468. var _this = _super.call(this) || this;
  21469. _this.hasChartRange = false;
  21470. _this.editingCell = false;
  21471. _this.suppressRefreshCell = false;
  21472. _this.scope = null;
  21473. // every time we go into edit mode, or back again, this gets incremented.
  21474. // it's the components way of dealing with the async nature of framework components,
  21475. // so if a framework component takes a while to be created, we know if the object
  21476. // is still relevant when creating is finished. eg we could click edit / un-edit 20
  21477. // times before the first React edit component comes back - we should discard
  21478. // the first 19.
  21479. _this.cellEditorVersion = 0;
  21480. _this.cellRendererVersion = 0;
  21481. _this.scope = scope;
  21482. _this.beans = beans;
  21483. _this.column = column;
  21484. _this.rowNode = rowNode;
  21485. _this.rowComp = rowComp;
  21486. _this.autoHeightCell = autoHeightCell;
  21487. _this.printLayout = printLayout;
  21488. _this.createGridCellVo();
  21489. _this.rangeSelectionEnabled = _this.beans.rangeController && beans.gridOptionsWrapper.isEnableRangeSelection();
  21490. _this.cellFocused = _this.beans.focusController.isCellFocused(_this.cellPosition);
  21491. _this.firstRightPinned = _this.column.isFirstRightPinned();
  21492. _this.lastLeftPinned = _this.column.isLastLeftPinned();
  21493. if (_this.rangeSelectionEnabled && _this.beans.rangeController) {
  21494. var rangeController = _this.beans.rangeController;
  21495. _this.rangeCount = rangeController.getCellRangeCount(_this.cellPosition);
  21496. _this.hasChartRange = _this.getHasChartRange();
  21497. }
  21498. _this.getValueAndFormat();
  21499. _this.setUsingWrapper();
  21500. _this.chooseCellRenderer();
  21501. _this.setupColSpan();
  21502. _this.rowSpan = _this.column.getRowSpan(_this.rowNode);
  21503. return _this;
  21504. }
  21505. CellComp.prototype.getCreateTemplate = function () {
  21506. var unselectable = !this.beans.gridOptionsWrapper.isEnableCellTextSelection() ? 'unselectable="on"' : '';
  21507. var templateParts = [];
  21508. var col = this.column;
  21509. var width = this.getCellWidth();
  21510. var left = this.modifyLeftForPrintLayout(this.getCellLeft());
  21511. var valueToRender = this.getInitialValueToRender();
  21512. var valueSanitised = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].get(this.column, 'colDef.template', null) ? valueToRender : _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(valueToRender);
  21513. this.tooltip = this.getToolTip();
  21514. var tooltipSanitised = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(this.tooltip);
  21515. var colIdSanitised = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(col.getId());
  21516. var wrapperStartTemplate = '';
  21517. var wrapperEndTemplate = '';
  21518. var stylesFromColDef = this.preProcessStylesFromColDef();
  21519. var cssClasses = this.getInitialCssClasses();
  21520. var stylesForRowSpanning = this.getStylesForRowSpanning();
  21521. var colIdxSanitised = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(this.getAriaColumnIndex());
  21522. if (this.usingWrapper) {
  21523. wrapperStartTemplate = "<div ref=\"eCellWrapper\" class=\"ag-cell-wrapper\" role=\"presentation\">\n <span ref=\"eCellValue\" role=\"gridcell\" aria-colindex=\"" + colIdxSanitised + "\" class=\"ag-cell-value\" " + unselectable + ">";
  21524. wrapperEndTemplate = '</span></div>';
  21525. }
  21526. templateParts.push("<div");
  21527. templateParts.push(" tabindex=\"-1\"");
  21528. templateParts.push(" " + unselectable); // THIS IS FOR IE ONLY so text selection doesn't bubble outside of the grid
  21529. templateParts.push(" role=\"" + (this.usingWrapper ? 'presentation' : 'gridcell') + "\"");
  21530. if (!this.usingWrapper) {
  21531. templateParts.push(" aria-colindex=" + colIdxSanitised);
  21532. }
  21533. templateParts.push(" comp-id=\"" + this.getCompId() + "\" ");
  21534. templateParts.push(" col-id=\"" + colIdSanitised + "\"");
  21535. templateParts.push(" class=\"" + _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(cssClasses.join(' ')) + "\"");
  21536. if (this.beans.gridOptionsWrapper.isEnableBrowserTooltips() && _utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(tooltipSanitised)) {
  21537. templateParts.push("title=\"" + tooltipSanitised + "\"");
  21538. }
  21539. templateParts.push(" style=\"width: " + Number(width) + "px; left: " + Number(left) + "px; " + _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(stylesFromColDef) + " " + _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(stylesForRowSpanning) + "\" >");
  21540. templateParts.push(wrapperStartTemplate);
  21541. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(valueSanitised, true)) {
  21542. templateParts.push(valueSanitised);
  21543. }
  21544. templateParts.push(wrapperEndTemplate);
  21545. templateParts.push("</div>");
  21546. return templateParts.join('');
  21547. };
  21548. CellComp.prototype.getStylesForRowSpanning = function () {
  21549. if (this.rowSpan === 1) {
  21550. return '';
  21551. }
  21552. var singleRowHeight = this.beans.gridOptionsWrapper.getRowHeightAsNumber();
  21553. var totalRowHeight = singleRowHeight * this.rowSpan;
  21554. return "height: " + totalRowHeight + "px; z-index: 1;";
  21555. };
  21556. CellComp.prototype.afterAttached = function () {
  21557. var querySelector = "[comp-id=\"" + this.getCompId() + "\"]";
  21558. var eGui = this.eParentRow.querySelector(querySelector);
  21559. this.setGui(eGui);
  21560. // all of these have dependencies on the eGui, so only do them after eGui is set
  21561. this.addDomData();
  21562. this.populateTemplate();
  21563. this.createCellRendererInstance(true);
  21564. this.angular1Compile();
  21565. this.refreshHandle();
  21566. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(this.tooltip) && !this.beans.gridOptionsWrapper.isEnableBrowserTooltips()) {
  21567. this.createManagedBean(new _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_9__["TooltipFeature"](this, 'cell'), this.beans.context);
  21568. }
  21569. };
  21570. CellComp.prototype.onColumnHover = function () {
  21571. var isHovered = this.beans.columnHoverService.isHovered(this.column);
  21572. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), 'ag-column-hover', isHovered);
  21573. };
  21574. CellComp.prototype.onCellChanged = function (event) {
  21575. var eventImpactsThisCell = event.column === this.column;
  21576. if (eventImpactsThisCell) {
  21577. this.refreshCell({});
  21578. }
  21579. };
  21580. CellComp.prototype.getCellLeft = function () {
  21581. var mostLeftCol;
  21582. if (this.beans.gridOptionsWrapper.isEnableRtl() && this.colsSpanning) {
  21583. mostLeftCol = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].last(this.colsSpanning);
  21584. }
  21585. else {
  21586. mostLeftCol = this.column;
  21587. }
  21588. return mostLeftCol.getLeft();
  21589. };
  21590. CellComp.prototype.getCellWidth = function () {
  21591. if (!this.colsSpanning) {
  21592. return this.column.getActualWidth();
  21593. }
  21594. return this.colsSpanning.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);
  21595. };
  21596. CellComp.prototype.onFlashCells = function (event) {
  21597. var cellId = this.beans.cellPositionUtils.createId(this.cellPosition);
  21598. var shouldFlash = event.cells[cellId];
  21599. if (shouldFlash) {
  21600. this.animateCell('highlight');
  21601. }
  21602. };
  21603. CellComp.prototype.setupColSpan = function () {
  21604. // if no col span is active, then we don't set it up, as it would be wasteful of CPU
  21605. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(this.getComponentHolder().colSpan)) {
  21606. return;
  21607. }
  21608. // because we are col spanning, a reorder of the cols can change what cols we are spanning over
  21609. this.addManagedListener(this.beans.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayColumnsChanged.bind(this));
  21610. // because we are spanning over multiple cols, we check for width any time any cols width changes.
  21611. // this is expensive - really we should be explicitly checking only the cols we are spanning over
  21612. // instead of every col, however it would be tricky code to track the cols we are spanning over, so
  21613. // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code.
  21614. this.addManagedListener(this.beans.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onWidthChanged.bind(this));
  21615. this.colsSpanning = this.getColSpanningList();
  21616. };
  21617. CellComp.prototype.getColSpanningList = function () {
  21618. var colSpan = this.column.getColSpan(this.rowNode);
  21619. var colsSpanning = [];
  21620. // if just one col, the col span is just the column we are in
  21621. if (colSpan === 1) {
  21622. colsSpanning.push(this.column);
  21623. }
  21624. else {
  21625. var pointer = this.column;
  21626. var pinned = this.column.getPinned();
  21627. for (var i = 0; pointer && i < colSpan; i++) {
  21628. colsSpanning.push(pointer);
  21629. pointer = this.beans.columnController.getDisplayedColAfter(pointer);
  21630. if (!pointer || _utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(pointer)) {
  21631. break;
  21632. }
  21633. // we do not allow col spanning to span outside of pinned areas
  21634. if (pinned !== pointer.getPinned()) {
  21635. break;
  21636. }
  21637. }
  21638. }
  21639. return colsSpanning;
  21640. };
  21641. CellComp.prototype.onDisplayColumnsChanged = function () {
  21642. var colsSpanning = this.getColSpanningList();
  21643. if (!_utils__WEBPACK_IMPORTED_MODULE_7__["_"].areEqual(this.colsSpanning, colsSpanning)) {
  21644. this.colsSpanning = colsSpanning;
  21645. this.onWidthChanged();
  21646. this.onLeftChanged(); // left changes when doing RTL
  21647. }
  21648. };
  21649. CellComp.prototype.getAriaColumnIndex = function () {
  21650. var allColumns = this.beans.columnController.getAllDisplayedColumns();
  21651. return (allColumns.indexOf(this.column) + 1).toString();
  21652. };
  21653. CellComp.prototype.refreshAriaIndex = function () {
  21654. var colIdx = this.getAriaColumnIndex();
  21655. var el = this.usingWrapper ? this.eCellValue : this.getGui();
  21656. el.setAttribute('aria-colindex', colIdx);
  21657. };
  21658. CellComp.prototype.getInitialCssClasses = function () {
  21659. var cssClasses = ["ag-cell", "ag-cell-not-inline-editing"];
  21660. // if we are putting the cell into a dummy container, to work out it's height,
  21661. // then we don't put the height css in, as we want cell to fit height in that case.
  21662. if (!this.autoHeightCell) {
  21663. cssClasses.push('ag-cell-auto-height');
  21664. }
  21665. var doingFocusCss = !this.beans.gridOptionsWrapper.isSuppressCellSelection();
  21666. if (doingFocusCss && this.cellFocused) {
  21667. // otherwise the class depends on the focus state
  21668. cssClasses.push('ag-cell-focus');
  21669. }
  21670. if (this.firstRightPinned) {
  21671. cssClasses.push('ag-cell-first-right-pinned');
  21672. }
  21673. if (this.lastLeftPinned) {
  21674. cssClasses.push('ag-cell-last-left-pinned');
  21675. }
  21676. if (this.beans.columnHoverService.isHovered(this.column)) {
  21677. cssClasses.push('ag-column-hover');
  21678. }
  21679. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].pushAll(cssClasses, this.preProcessClassesFromColDef());
  21680. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].pushAll(cssClasses, this.preProcessCellClassRules());
  21681. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].pushAll(cssClasses, this.getInitialRangeClasses());
  21682. // if using the wrapper, this class goes on the wrapper instead
  21683. if (!this.usingWrapper) {
  21684. cssClasses.push('ag-cell-value');
  21685. }
  21686. return cssClasses;
  21687. };
  21688. CellComp.prototype.getInitialValueToRender = function () {
  21689. // if using a cellRenderer, then render the html from the cell renderer if it exists
  21690. if (this.usingCellRenderer) {
  21691. if (typeof this.cellRendererGui === 'string') {
  21692. return this.cellRendererGui;
  21693. }
  21694. return '';
  21695. }
  21696. var colDef = this.getComponentHolder();
  21697. if (colDef.template) {
  21698. // template is really only used for angular 1 - as people using ng1 are used to providing templates with
  21699. // bindings in it. in ng2, people will hopefully want to provide components, not templates.
  21700. return colDef.template;
  21701. }
  21702. if (colDef.templateUrl) {
  21703. // likewise for templateUrl - it's for ng1 really - when we move away from ng1, we can take these out.
  21704. // niall was pro angular 1 when writing template and templateUrl, if writing from scratch now, would
  21705. // not do these, but would follow a pattern that was friendly towards components, not templates.
  21706. var template = this.beans.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
  21707. return template || '';
  21708. }
  21709. return this.getValueToUse();
  21710. };
  21711. CellComp.prototype.getRenderedRow = function () {
  21712. return this.rowComp;
  21713. };
  21714. CellComp.prototype.isSuppressNavigable = function () {
  21715. return this.column.isSuppressNavigable(this.rowNode);
  21716. };
  21717. CellComp.prototype.getCellRenderer = function () {
  21718. return this.cellRenderer;
  21719. };
  21720. CellComp.prototype.getCellEditor = function () {
  21721. return this.cellEditor;
  21722. };
  21723. // + stop editing {forceRefresh: true, suppressFlash: true}
  21724. // + event cellChanged {}
  21725. // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything
  21726. // + rowComp: event dataChanged {animate: update, newData: !update}
  21727. // + rowComp: api refreshCells() {animate: true/false}
  21728. // + rowRenderer: api softRefreshView() {}
  21729. CellComp.prototype.refreshCell = function (params) {
  21730. // if we are in the middle of 'stopEditing', then we don't refresh here, as refresh gets called explicitly
  21731. if (this.suppressRefreshCell || this.editingCell) {
  21732. return;
  21733. }
  21734. var colDef = this.getComponentHolder();
  21735. var newData = params && params.newData;
  21736. var suppressFlash = (params && params.suppressFlash) || colDef.suppressCellFlash;
  21737. var forceRefresh = params && params.forceRefresh;
  21738. var oldValue = this.value;
  21739. // get latest value without invoking the value formatter as we may not be updating the cell
  21740. this.value = this.getValue();
  21741. // for simple values only (not objects), see if the value is the same, and if it is, skip the refresh.
  21742. // when never allow skipping after an edit, as after editing, we need to put the GUI back to the way
  21743. // if was before the edit.
  21744. var valuesDifferent = !this.valuesAreEqual(oldValue, this.value);
  21745. var dataNeedsUpdating = forceRefresh || valuesDifferent;
  21746. if (dataNeedsUpdating) {
  21747. // now invoke the value formatter as we are going to update cell
  21748. this.valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, this.value);
  21749. // if it's 'new data', then we don't refresh the cellRenderer, even if refresh method is available.
  21750. // this is because if the whole data is new (ie we are showing stock price 'BBA' now and not 'SSD')
  21751. // then we are not showing a movement in the stock price, rather we are showing different stock.
  21752. var cellRendererRefreshed = newData ? false : this.attemptCellRendererRefresh();
  21753. // we do the replace if not doing refresh, or if refresh was unsuccessful.
  21754. // the refresh can be unsuccessful if we are using a framework (eg ng2 or react) and the framework
  21755. // wrapper has the refresh method, but the underlying component doesn't
  21756. if (!cellRendererRefreshed) {
  21757. this.replaceContentsAfterRefresh();
  21758. }
  21759. // we don't want to flash the cells when processing a filter change, as otherwise the UI would
  21760. // be to busy. see comment in FilterManager with regards processingFilterChange
  21761. var processingFilterChange = this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();
  21762. var flashCell = !suppressFlash && !processingFilterChange &&
  21763. (this.beans.gridOptionsWrapper.isEnableCellChangeFlash() || colDef.enableCellChangeFlash);
  21764. if (flashCell) {
  21765. this.flashCell();
  21766. }
  21767. // need to check rules. note, we ignore colDef classes and styles, these are assumed to be static
  21768. this.postProcessStylesFromColDef();
  21769. this.postProcessClassesFromColDef();
  21770. }
  21771. // we can't readily determine if the data in an angularjs template has changed, so here we just update
  21772. // and recompile (if applicable)
  21773. this.updateAngular1ScopeAndCompile();
  21774. this.refreshToolTip();
  21775. // we do cellClassRules even if the value has not changed, so that users who have rules that
  21776. // look at other parts of the row (where the other part of the row might of changed) will work.
  21777. this.postProcessCellClassRules();
  21778. };
  21779. // user can also call this via API
  21780. CellComp.prototype.flashCell = function (delays) {
  21781. var flashDelay = delays && delays.flashDelay;
  21782. var fadeDelay = delays && delays.fadeDelay;
  21783. this.animateCell('data-changed', flashDelay, fadeDelay);
  21784. };
  21785. CellComp.prototype.animateCell = function (cssName, flashDelay, fadeDelay) {
  21786. var fullName = "ag-cell-" + cssName;
  21787. var animationFullName = "ag-cell-" + cssName + "-animation";
  21788. var element = this.getGui();
  21789. var gridOptionsWrapper = this.beans.gridOptionsWrapper;
  21790. if (!flashDelay) {
  21791. flashDelay = gridOptionsWrapper.getCellFlashDelay();
  21792. }
  21793. if (!fadeDelay) {
  21794. fadeDelay = gridOptionsWrapper.getCellFadeDelay();
  21795. }
  21796. // we want to highlight the cells, without any animation
  21797. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(element, fullName);
  21798. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(element, animationFullName);
  21799. // then once that is applied, we remove the highlight with animation
  21800. window.setTimeout(function () {
  21801. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(element, fullName);
  21802. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(element, animationFullName);
  21803. element.style.transition = "background-color " + fadeDelay + "ms";
  21804. window.setTimeout(function () {
  21805. // and then to leave things as we got them, we remove the animation
  21806. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(element, animationFullName);
  21807. element.style.transition = null;
  21808. }, fadeDelay);
  21809. }, flashDelay);
  21810. };
  21811. CellComp.prototype.replaceContentsAfterRefresh = function () {
  21812. // otherwise we rip out the cell and replace it
  21813. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].clearElement(this.eParentOfValue);
  21814. // remove old renderer component if it exists
  21815. this.cellRenderer = this.beans.context.destroyBean(this.cellRenderer);
  21816. this.cellRendererGui = null;
  21817. // populate
  21818. this.putDataIntoCellAfterRefresh();
  21819. this.updateAngular1ScopeAndCompile();
  21820. };
  21821. CellComp.prototype.updateAngular1ScopeAndCompile = function () {
  21822. if (this.beans.gridOptionsWrapper.isAngularCompileRows() && this.scope) {
  21823. this.scope.data = __assign({}, this.rowNode.data);
  21824. this.angular1Compile();
  21825. }
  21826. };
  21827. CellComp.prototype.angular1Compile = function () {
  21828. // if angular compiling, then need to also compile the cell again (angular compiling sucks, please wait...)
  21829. if (this.beans.gridOptionsWrapper.isAngularCompileRows()) {
  21830. var eGui = this.getGui();
  21831. // only compile the node if it hasn't already been done
  21832. // this prevents "orphaned" node leaks
  21833. if (!eGui.classList.contains('ng-scope') || eGui.childElementCount === 0) {
  21834. var compiledElement_1 = this.beans.$compile(eGui)(this.scope);
  21835. this.addDestroyFunc(function () { return compiledElement_1.remove(); });
  21836. }
  21837. }
  21838. };
  21839. CellComp.prototype.postProcessStylesFromColDef = function () {
  21840. var stylesToUse = this.processStylesFromColDef();
  21841. if (stylesToUse) {
  21842. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addStylesToElement(this.getGui(), stylesToUse);
  21843. }
  21844. };
  21845. CellComp.prototype.preProcessStylesFromColDef = function () {
  21846. return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].cssStyleObjectToMarkup(this.processStylesFromColDef());
  21847. };
  21848. CellComp.prototype.processStylesFromColDef = function () {
  21849. var colDef = this.getComponentHolder();
  21850. if (colDef.cellStyle) {
  21851. var cssToUse = void 0;
  21852. if (typeof colDef.cellStyle === 'function') {
  21853. var cellStyleParams = {
  21854. value: this.value,
  21855. data: this.rowNode.data,
  21856. node: this.rowNode,
  21857. colDef: colDef,
  21858. column: this.column,
  21859. $scope: this.scope,
  21860. context: this.beans.gridOptionsWrapper.getContext(),
  21861. api: this.beans.gridOptionsWrapper.getApi()
  21862. };
  21863. var cellStyleFunc = colDef.cellStyle;
  21864. cssToUse = cellStyleFunc(cellStyleParams);
  21865. }
  21866. else {
  21867. cssToUse = colDef.cellStyle;
  21868. }
  21869. return cssToUse;
  21870. }
  21871. };
  21872. CellComp.prototype.postProcessClassesFromColDef = function () {
  21873. var _this = this;
  21874. this.processClassesFromColDef(function (className) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(_this.getGui(), className); });
  21875. };
  21876. CellComp.prototype.preProcessClassesFromColDef = function () {
  21877. var res = [];
  21878. this.processClassesFromColDef(function (className) { return res.push(className); });
  21879. return res;
  21880. };
  21881. CellComp.prototype.processClassesFromColDef = function (onApplicableClass) {
  21882. var colDef = this.getComponentHolder();
  21883. this.beans.stylingService.processStaticCellClasses(colDef, {
  21884. value: this.value,
  21885. data: this.rowNode.data,
  21886. node: this.rowNode,
  21887. colDef: colDef,
  21888. rowIndex: this.rowNode.rowIndex,
  21889. $scope: this.scope,
  21890. api: this.beans.gridOptionsWrapper.getApi(),
  21891. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  21892. context: this.beans.gridOptionsWrapper.getContext()
  21893. }, onApplicableClass);
  21894. };
  21895. CellComp.prototype.putDataIntoCellAfterRefresh = function () {
  21896. // template gets preference, then cellRenderer, then do it ourselves
  21897. var colDef = this.getComponentHolder();
  21898. if (colDef.template) {
  21899. // template is really only used for angular 1 - as people using ng1 are used to providing templates with
  21900. // bindings in it. in ng2, people will hopefully want to provide components, not templates.
  21901. this.eParentOfValue.innerHTML = colDef.template;
  21902. }
  21903. else if (colDef.templateUrl) {
  21904. // likewise for templateUrl - it's for ng1 really - when we move away from ng1, we can take these out.
  21905. // niall was pro angular 1 when writing template and templateUrl, if writing from scratch now, would
  21906. // not do these, but would follow a pattern that was friendly towards components, not templates.
  21907. var template = this.beans.templateService.getTemplate(colDef.templateUrl, this.refreshCell.bind(this, true));
  21908. if (template) {
  21909. this.eParentOfValue.innerHTML = template;
  21910. }
  21911. }
  21912. else {
  21913. // we can switch from using a cell renderer back to the default if a user
  21914. // is using cellRendererSelect
  21915. this.chooseCellRenderer();
  21916. if (this.usingCellRenderer) {
  21917. this.createCellRendererInstance();
  21918. }
  21919. else {
  21920. var valueToUse = this.getValueToUse();
  21921. if (valueToUse != null) {
  21922. this.eParentOfValue.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(valueToUse);
  21923. }
  21924. }
  21925. }
  21926. };
  21927. CellComp.prototype.attemptCellRendererRefresh = function () {
  21928. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(this.cellRenderer) || !this.cellRenderer || _utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(this.cellRenderer.refresh)) {
  21929. return false;
  21930. }
  21931. // if the cell renderer has a refresh method, we call this instead of doing a refresh
  21932. var params = this.createCellRendererParams();
  21933. // take any custom params off of the user
  21934. var finalParams = this.beans.userComponentFactory.createFinalParams(this.getComponentHolder(), this.cellRendererType, params);
  21935. var result = this.cellRenderer.refresh(finalParams);
  21936. // NOTE on undefined: previous version of the cellRenderer.refresh() interface
  21937. // returned nothing, if the method existed, we assumed it refreshed. so for
  21938. // backwards compatibility, we assume if method exists and returns nothing,
  21939. // that it was successful.
  21940. return result === true || result === undefined;
  21941. };
  21942. CellComp.prototype.refreshToolTip = function () {
  21943. var newTooltip = this.getToolTip();
  21944. if (this.tooltip === newTooltip) {
  21945. return;
  21946. }
  21947. var hasNewTooltip = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(newTooltip);
  21948. if (hasNewTooltip && this.tooltip === newTooltip.toString()) {
  21949. return;
  21950. }
  21951. var hadTooltip = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(this.tooltip);
  21952. this.tooltip = newTooltip;
  21953. if (this.beans.gridOptionsWrapper.isEnableBrowserTooltips()) {
  21954. if (hasNewTooltip) {
  21955. this.eParentOfValue.setAttribute('title', this.tooltip);
  21956. }
  21957. else {
  21958. this.eParentOfValue.removeAttribute('title');
  21959. }
  21960. }
  21961. };
  21962. CellComp.prototype.valuesAreEqual = function (val1, val2) {
  21963. // if the user provided an equals method, use that, otherwise do simple comparison
  21964. var colDef = this.getComponentHolder();
  21965. var equalsMethod = colDef ? colDef.equals : null;
  21966. return equalsMethod ? equalsMethod(val1, val2) : val1 === val2;
  21967. };
  21968. CellComp.prototype.getToolTip = function () {
  21969. var colDef = this.getComponentHolder();
  21970. var data = this.rowNode.data;
  21971. if (colDef.tooltipField && _utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(data)) {
  21972. return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].getValueUsingField(data, colDef.tooltipField, this.column.isTooltipFieldContainsDots());
  21973. }
  21974. var valueGetter = colDef.tooltipValueGetter || colDef.tooltip;
  21975. if (valueGetter) {
  21976. return valueGetter({
  21977. api: this.beans.gridOptionsWrapper.getApi(),
  21978. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  21979. colDef: colDef,
  21980. column: this.getColumn(),
  21981. context: this.beans.gridOptionsWrapper.getContext(),
  21982. value: this.value,
  21983. valueFormatted: this.valueFormatted,
  21984. rowIndex: this.cellPosition.rowIndex,
  21985. node: this.rowNode,
  21986. data: this.rowNode.data
  21987. });
  21988. }
  21989. return null;
  21990. };
  21991. CellComp.prototype.getTooltipText = function (escape) {
  21992. if (escape === void 0) { escape = true; }
  21993. return escape ? _utils__WEBPACK_IMPORTED_MODULE_7__["_"].escape(this.tooltip) : this.tooltip;
  21994. };
  21995. CellComp.prototype.processCellClassRules = function (onApplicableClass, onNotApplicableClass) {
  21996. var colDef = this.getComponentHolder();
  21997. this.beans.stylingService.processClassRules(colDef.cellClassRules, {
  21998. value: this.value,
  21999. data: this.rowNode.data,
  22000. node: this.rowNode,
  22001. colDef: colDef,
  22002. rowIndex: this.cellPosition.rowIndex,
  22003. api: this.beans.gridOptionsWrapper.getApi(),
  22004. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  22005. $scope: this.scope,
  22006. context: this.beans.gridOptionsWrapper.getContext()
  22007. }, onApplicableClass, onNotApplicableClass);
  22008. };
  22009. CellComp.prototype.postProcessCellClassRules = function () {
  22010. var _this = this;
  22011. this.processCellClassRules(function (className) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(_this.getGui(), className); }, function (className) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(_this.getGui(), className); });
  22012. };
  22013. CellComp.prototype.preProcessCellClassRules = function () {
  22014. var res = [];
  22015. this.processCellClassRules(function (className) { return res.push(className); }, function (_) {
  22016. // not catered for, if creating, no need
  22017. // to remove class as it was never there
  22018. });
  22019. return res;
  22020. };
  22021. // a wrapper is used when we are putting a selection checkbox in the cell with the value
  22022. CellComp.prototype.setUsingWrapper = function () {
  22023. var colDef = this.getComponentHolder();
  22024. // never allow selection or dragging on pinned rows
  22025. if (this.rowNode.rowPinned) {
  22026. this.usingWrapper = false;
  22027. this.includeSelectionComponent = false;
  22028. this.includeRowDraggingComponent = false;
  22029. this.includeDndSourceComponent = false;
  22030. return;
  22031. }
  22032. var cbSelectionIsFunc = typeof colDef.checkboxSelection === 'function';
  22033. var rowDraggableIsFunc = typeof colDef.rowDrag === 'function';
  22034. var dndSourceIsFunc = typeof colDef.dndSource === 'function';
  22035. this.includeSelectionComponent = cbSelectionIsFunc || colDef.checkboxSelection === true;
  22036. this.includeRowDraggingComponent = rowDraggableIsFunc || colDef.rowDrag === true;
  22037. this.includeDndSourceComponent = dndSourceIsFunc || colDef.dndSource === true;
  22038. var enableTextSelection = this.beans.gridOptionsWrapper.isEnableCellTextSelection();
  22039. this.usingWrapper = enableTextSelection || this.includeRowDraggingComponent || this.includeSelectionComponent || this.includeDndSourceComponent;
  22040. };
  22041. CellComp.prototype.chooseCellRenderer = function () {
  22042. // template gets preference, then cellRenderer, then do it ourselves
  22043. var colDef = this.getComponentHolder();
  22044. // templates are for ng1, ideally we wouldn't have these, they are ng1 support
  22045. // inside the core which is bad
  22046. if (colDef.template || colDef.templateUrl) {
  22047. this.usingCellRenderer = false;
  22048. return;
  22049. }
  22050. var params = this.createCellRendererParams();
  22051. var cellRenderer = this.beans.userComponentFactory.lookupComponentClassDef(colDef, 'cellRenderer', params);
  22052. var pinnedRowCellRenderer = this.beans.userComponentFactory.lookupComponentClassDef(colDef, 'pinnedRowCellRenderer', params);
  22053. if (pinnedRowCellRenderer && this.rowNode.rowPinned) {
  22054. this.cellRendererType = CellComp.CELL_RENDERER_TYPE_PINNED;
  22055. this.usingCellRenderer = true;
  22056. }
  22057. else if (cellRenderer) {
  22058. this.cellRendererType = CellComp.CELL_RENDERER_TYPE_NORMAL;
  22059. this.usingCellRenderer = true;
  22060. }
  22061. else {
  22062. this.usingCellRenderer = false;
  22063. }
  22064. };
  22065. CellComp.prototype.createCellRendererInstance = function (useTaskService) {
  22066. var _this = this;
  22067. if (useTaskService === void 0) { useTaskService = false; }
  22068. if (!this.usingCellRenderer) {
  22069. return;
  22070. }
  22071. // never use task service if angularCompileRows=true, as that assume the cell renderers
  22072. // are finished when the row is created. also we never use it if animation frame service
  22073. // is turned off.
  22074. // and lastly we never use it if doing auto-height, as the auto-height service checks the
  22075. // row height directly after the cell is created, it doesn't wait around for the tasks to complete
  22076. var angularCompileRows = this.beans.gridOptionsWrapper.isAngularCompileRows();
  22077. var suppressAnimationFrame = this.beans.gridOptionsWrapper.isSuppressAnimationFrame();
  22078. if (angularCompileRows || suppressAnimationFrame || this.autoHeightCell) {
  22079. useTaskService = false;
  22080. }
  22081. var params = this.createCellRendererParams();
  22082. this.cellRendererVersion++;
  22083. var callback = this.afterCellRendererCreated.bind(this, this.cellRendererVersion);
  22084. var cellRendererTypeNormal = this.cellRendererType === CellComp.CELL_RENDERER_TYPE_NORMAL;
  22085. this.createCellRendererFunc = function () {
  22086. _this.createCellRendererFunc = null;
  22087. // this can return null in the event that the user has switched from a renderer component to nothing, for example
  22088. // when using a cellRendererSelect to return a component or null depending on row data etc
  22089. var componentPromise = _this.beans.userComponentFactory.newCellRenderer(_this.getComponentHolder(), params, !cellRendererTypeNormal);
  22090. if (componentPromise) {
  22091. componentPromise.then(callback);
  22092. }
  22093. };
  22094. if (useTaskService) {
  22095. this.beans.taskQueue.createTask(this.createCellRendererFunc, this.rowNode.rowIndex, 'createTasksP2');
  22096. }
  22097. else {
  22098. this.createCellRendererFunc();
  22099. }
  22100. };
  22101. CellComp.prototype.afterCellRendererCreated = function (cellRendererVersion, cellRenderer) {
  22102. var cellRendererNotRequired = !this.isAlive() || (cellRendererVersion !== this.cellRendererVersion);
  22103. if (cellRendererNotRequired) {
  22104. this.beans.context.destroyBean(cellRenderer);
  22105. return;
  22106. }
  22107. this.cellRenderer = cellRenderer;
  22108. this.cellRendererGui = this.cellRenderer.getGui();
  22109. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(this.cellRendererGui)) {
  22110. return;
  22111. }
  22112. // if async components, then it's possible the user started editing since this call was made
  22113. if (!this.editingCell) {
  22114. this.eParentOfValue.appendChild(this.cellRendererGui);
  22115. }
  22116. };
  22117. CellComp.prototype.createCellRendererParams = function () {
  22118. var _this = this;
  22119. return {
  22120. value: this.value,
  22121. valueFormatted: this.valueFormatted,
  22122. getValue: this.getValue.bind(this),
  22123. setValue: function (value) { return _this.beans.valueService.setValue(_this.rowNode, _this.column, value); },
  22124. formatValue: this.formatValue.bind(this),
  22125. data: this.rowNode.data,
  22126. node: this.rowNode,
  22127. colDef: this.getComponentHolder(),
  22128. column: this.column,
  22129. $scope: this.scope,
  22130. rowIndex: this.cellPosition.rowIndex,
  22131. api: this.beans.gridOptionsWrapper.getApi(),
  22132. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  22133. context: this.beans.gridOptionsWrapper.getContext(),
  22134. refreshCell: this.refreshCell.bind(this),
  22135. eGridCell: this.getGui(),
  22136. eParentOfValue: this.eParentOfValue,
  22137. // these bits are not documented anywhere, so we could drop them?
  22138. // it was in the olden days to allow user to register for when rendered
  22139. // row was removed (the row comp was removed), however now that the user
  22140. // can provide components for cells, the destroy method gets call when this
  22141. // happens so no longer need to fire event.
  22142. addRowCompListener: this.rowComp ? this.rowComp.addEventListener.bind(this.rowComp) : null,
  22143. addRenderedRowListener: function (eventType, listener) {
  22144. console.warn('ag-Grid: since ag-Grid .v11, params.addRenderedRowListener() is now params.addRowCompListener()');
  22145. if (_this.rowComp) {
  22146. _this.rowComp.addEventListener(eventType, listener);
  22147. }
  22148. }
  22149. };
  22150. };
  22151. CellComp.prototype.formatValue = function (value) {
  22152. var valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, value);
  22153. return valueFormatted != null ? valueFormatted : value;
  22154. };
  22155. CellComp.prototype.getValueToUse = function () {
  22156. return this.valueFormatted != null ? this.valueFormatted : this.value;
  22157. };
  22158. CellComp.prototype.getValueAndFormat = function () {
  22159. this.value = this.getValue();
  22160. this.valueFormatted = this.beans.valueFormatterService.formatValue(this.column, this.rowNode, this.scope, this.value);
  22161. };
  22162. CellComp.prototype.getValue = function () {
  22163. // if we don't check this, then the grid will render leaf groups as open even if we are not
  22164. // allowing the user to open leaf groups. confused? remember for pivot mode we don't allow
  22165. // opening leaf groups, so we have to force leafGroups to be closed in case the user expanded
  22166. // them via the API, or user user expanded them in the UI before turning on pivot mode
  22167. var lockedClosedGroup = this.rowNode.leafGroup && this.beans.columnController.isPivotMode();
  22168. var isOpenGroup = this.rowNode.group && this.rowNode.expanded && !this.rowNode.footer && !lockedClosedGroup;
  22169. // are we showing group footers
  22170. var groupFootersEnabled = this.beans.gridOptionsWrapper.isGroupIncludeFooter();
  22171. // if doing footers, we normally don't show agg data at group level when group is open
  22172. var groupAlwaysShowAggData = this.beans.gridOptionsWrapper.isGroupSuppressBlankHeader();
  22173. // if doing grouping and footers, we don't want to include the agg value
  22174. // in the header when the group is open
  22175. var ignoreAggData = (isOpenGroup && groupFootersEnabled) && !groupAlwaysShowAggData;
  22176. return this.beans.valueService.getValue(this.column, this.rowNode, false, ignoreAggData);
  22177. };
  22178. CellComp.prototype.onMouseEvent = function (eventName, mouseEvent) {
  22179. if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isStopPropagationForAgGrid(mouseEvent)) {
  22180. return;
  22181. }
  22182. switch (eventName) {
  22183. case 'click':
  22184. this.onCellClicked(mouseEvent);
  22185. break;
  22186. case 'mousedown':
  22187. this.onMouseDown(mouseEvent);
  22188. break;
  22189. case 'dblclick':
  22190. this.onCellDoubleClicked(mouseEvent);
  22191. break;
  22192. case 'mouseout':
  22193. this.onMouseOut(mouseEvent);
  22194. break;
  22195. case 'mouseover':
  22196. this.onMouseOver(mouseEvent);
  22197. break;
  22198. }
  22199. };
  22200. CellComp.prototype.dispatchCellContextMenuEvent = function (event) {
  22201. var colDef = this.getComponentHolder();
  22202. var cellContextMenuEvent = this.createEvent(event, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_CONTEXT_MENU);
  22203. this.beans.eventService.dispatchEvent(cellContextMenuEvent);
  22204. if (colDef.onCellContextMenu) {
  22205. // to make the callback async, do in a timeout
  22206. window.setTimeout(function () { return colDef.onCellContextMenu(cellContextMenuEvent); }, 0);
  22207. }
  22208. };
  22209. CellComp.prototype.createEvent = function (domEvent, eventType) {
  22210. var event = {
  22211. node: this.rowNode,
  22212. data: this.rowNode.data,
  22213. value: this.value,
  22214. column: this.column,
  22215. colDef: this.getComponentHolder(),
  22216. context: this.beans.gridOptionsWrapper.getContext(),
  22217. api: this.beans.gridApi,
  22218. columnApi: this.beans.columnApi,
  22219. rowPinned: this.rowNode.rowPinned,
  22220. event: domEvent,
  22221. type: eventType,
  22222. rowIndex: this.rowNode.rowIndex
  22223. };
  22224. // because we are hacking in $scope for angular 1, we have to de-reference
  22225. if (this.scope) {
  22226. event.$scope = this.scope;
  22227. }
  22228. return event;
  22229. };
  22230. CellComp.prototype.onMouseOut = function (mouseEvent) {
  22231. var cellMouseOutEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_MOUSE_OUT);
  22232. this.beans.eventService.dispatchEvent(cellMouseOutEvent);
  22233. this.beans.columnHoverService.clearMouseOver();
  22234. };
  22235. CellComp.prototype.onMouseOver = function (mouseEvent) {
  22236. var cellMouseOverEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_MOUSE_OVER);
  22237. this.beans.eventService.dispatchEvent(cellMouseOverEvent);
  22238. this.beans.columnHoverService.setMouseOver([this.column]);
  22239. };
  22240. CellComp.prototype.onCellDoubleClicked = function (mouseEvent) {
  22241. var colDef = this.getComponentHolder();
  22242. // always dispatch event to eventService
  22243. var cellDoubleClickedEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_DOUBLE_CLICKED);
  22244. this.beans.eventService.dispatchEvent(cellDoubleClickedEvent);
  22245. // check if colDef also wants to handle event
  22246. if (typeof colDef.onCellDoubleClicked === 'function') {
  22247. // to make the callback async, do in a timeout
  22248. window.setTimeout(function () { return colDef.onCellDoubleClicked(cellDoubleClickedEvent); }, 0);
  22249. }
  22250. var editOnDoubleClick = !this.beans.gridOptionsWrapper.isSingleClickEdit()
  22251. && !this.beans.gridOptionsWrapper.isSuppressClickEdit();
  22252. if (editOnDoubleClick) {
  22253. this.startRowOrCellEdit();
  22254. }
  22255. };
  22256. // called by rowRenderer when user navigates via tab key
  22257. CellComp.prototype.startRowOrCellEdit = function (keyPress, charPress) {
  22258. if (this.beans.gridOptionsWrapper.isFullRowEdit()) {
  22259. this.rowComp.startRowEditing(keyPress, charPress, this);
  22260. }
  22261. else {
  22262. this.startEditingIfEnabled(keyPress, charPress, true);
  22263. }
  22264. };
  22265. CellComp.prototype.isCellEditable = function () {
  22266. return this.column.isCellEditable(this.rowNode);
  22267. };
  22268. // either called internally if single cell editing, or called by rowRenderer if row editing
  22269. CellComp.prototype.startEditingIfEnabled = function (keyPress, charPress, cellStartedEdit) {
  22270. if (keyPress === void 0) { keyPress = null; }
  22271. if (charPress === void 0) { charPress = null; }
  22272. if (cellStartedEdit === void 0) { cellStartedEdit = false; }
  22273. // don't do it if not editable
  22274. if (!this.isCellEditable()) {
  22275. return;
  22276. }
  22277. // don't do it if already editing
  22278. if (this.editingCell) {
  22279. return;
  22280. }
  22281. this.editingCell = true;
  22282. this.cellEditorVersion++;
  22283. var callback = this.afterCellEditorCreated.bind(this, this.cellEditorVersion);
  22284. var params = this.createCellEditorParams(keyPress, charPress, cellStartedEdit);
  22285. this.createCellEditor(params).then(callback);
  22286. // if we don't do this, and editor component is async, then there will be a period
  22287. // when the component isn't present and keyboard navigation won't work - so example
  22288. // of user hitting tab quickly (more quickly than renderers getting created) won't work
  22289. var cellEditorAsync = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(this.cellEditor);
  22290. if (cellEditorAsync && cellStartedEdit) {
  22291. this.focusCell(true);
  22292. }
  22293. };
  22294. CellComp.prototype.createCellEditor = function (params) {
  22295. var _this = this;
  22296. var cellEditorPromise = this.beans.userComponentFactory.newCellEditor(this.column.getColDef(), params);
  22297. return cellEditorPromise.then(function (cellEditor) {
  22298. var isPopup = cellEditor.isPopup && cellEditor.isPopup();
  22299. if (!isPopup) {
  22300. return cellEditor;
  22301. }
  22302. if (_this.beans.gridOptionsWrapper.isFullRowEdit()) {
  22303. console.warn('ag-Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both ' +
  22304. '- either turn off fullRowEdit, or stop using popup editors.');
  22305. }
  22306. // if a popup, then we wrap in a popup editor and return the popup
  22307. var popupEditorWrapper = new _cellEditors_popupEditorWrapper__WEBPACK_IMPORTED_MODULE_6__["PopupEditorWrapper"](cellEditor);
  22308. _this.beans.context.createBean(popupEditorWrapper);
  22309. popupEditorWrapper.init(params);
  22310. return popupEditorWrapper;
  22311. });
  22312. };
  22313. CellComp.prototype.afterCellEditorCreated = function (cellEditorVersion, cellEditor) {
  22314. // if editingCell=false, means user cancelled the editor before component was ready.
  22315. // if versionMismatch, then user cancelled the edit, then started the edit again, and this
  22316. // is the first editor which is now stale.
  22317. var versionMismatch = cellEditorVersion !== this.cellEditorVersion;
  22318. var cellEditorNotNeeded = versionMismatch || !this.editingCell;
  22319. if (cellEditorNotNeeded) {
  22320. this.beans.context.destroyBean(cellEditor);
  22321. return;
  22322. }
  22323. var editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart();
  22324. if (editingCancelledByUserComp) {
  22325. this.beans.context.destroyBean(cellEditor);
  22326. this.editingCell = false;
  22327. return;
  22328. }
  22329. if (!cellEditor.getGui) {
  22330. console.warn("ag-Grid: cellEditor for column " + this.column.getId() + " is missing getGui() method");
  22331. // no getGui, for React guys, see if they attached a react component directly
  22332. if (cellEditor.render) {
  22333. console.warn("ag-Grid: we found 'render' on the component, are you trying to set a React renderer but added it as colDef.cellEditor instead of colDef.cellEditorFmk?");
  22334. }
  22335. this.beans.context.destroyBean(cellEditor);
  22336. this.editingCell = false;
  22337. return;
  22338. }
  22339. this.cellEditor = cellEditor;
  22340. this.cellEditorInPopup = cellEditor.isPopup !== undefined && cellEditor.isPopup();
  22341. this.setInlineEditingClass();
  22342. if (this.cellEditorInPopup) {
  22343. this.addPopupCellEditor();
  22344. }
  22345. else {
  22346. this.addInCellEditor();
  22347. }
  22348. if (cellEditor.afterGuiAttached) {
  22349. cellEditor.afterGuiAttached();
  22350. }
  22351. var event = this.createEvent(null, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_EDITING_STARTED);
  22352. this.beans.eventService.dispatchEvent(event);
  22353. };
  22354. CellComp.prototype.addInCellEditor = function () {
  22355. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].clearElement(this.getGui());
  22356. if (this.cellEditor) {
  22357. this.getGui().appendChild(this.cellEditor.getGui());
  22358. }
  22359. this.angular1Compile();
  22360. };
  22361. CellComp.prototype.addPopupCellEditor = function () {
  22362. var _this = this;
  22363. var ePopupGui = this.cellEditor ? this.cellEditor.getGui() : null;
  22364. var useModelPopup = this.beans.gridOptionsWrapper.isStopEditingWhenGridLosesFocus();
  22365. this.hideEditorPopup = this.beans.popupService.addPopup(useModelPopup, ePopupGui, true,
  22366. // callback for when popup disappears
  22367. function () {
  22368. _this.onPopupEditorClosed();
  22369. });
  22370. var params = {
  22371. column: this.column,
  22372. rowNode: this.rowNode,
  22373. type: 'popupCellEditor',
  22374. eventSource: this.getGui(),
  22375. ePopup: ePopupGui,
  22376. keepWithinBounds: true
  22377. };
  22378. var position = this.cellEditor && this.cellEditor.getPopupPosition ? this.cellEditor.getPopupPosition() : 'over';
  22379. if (position === 'under') {
  22380. this.beans.popupService.positionPopupUnderComponent(params);
  22381. }
  22382. else {
  22383. this.beans.popupService.positionPopupOverComponent(params);
  22384. }
  22385. this.angular1Compile();
  22386. };
  22387. CellComp.prototype.onPopupEditorClosed = function () {
  22388. // we only call stopEditing if we are editing, as
  22389. // it's possible the popup called 'stop editing'
  22390. // before this, eg if 'enter key' was pressed on
  22391. // the editor.
  22392. if (this.editingCell) {
  22393. // note: this only happens when use clicks outside of the grid. if use clicks on another
  22394. // cell, then the editing will have already stopped on this cell
  22395. this.stopRowOrCellEdit();
  22396. // we only focus cell again if this cell is still focused. it is possible
  22397. // it is not focused if the user cancelled the edit by clicking on another
  22398. // cell outside of this one
  22399. if (this.beans.focusController.isCellFocused(this.cellPosition)) {
  22400. this.focusCell(true);
  22401. }
  22402. }
  22403. };
  22404. // if we are editing inline, then we don't have the padding in the cell (set in the themes)
  22405. // to allow the text editor full access to the entire cell
  22406. CellComp.prototype.setInlineEditingClass = function () {
  22407. if (!this.isAlive()) {
  22408. return;
  22409. }
  22410. // ag-cell-inline-editing - appears when user is inline editing
  22411. // ag-cell-not-inline-editing - appears when user is no inline editing
  22412. // ag-cell-popup-editing - appears when user is editing cell in popup (appears on the cell, not on the popup)
  22413. // note: one of {ag-cell-inline-editing, ag-cell-not-inline-editing} is always present, they toggle.
  22414. // however {ag-cell-popup-editing} shows when popup, so you have both {ag-cell-popup-editing}
  22415. // and {ag-cell-not-inline-editing} showing at the same time.
  22416. var editingInline = this.editingCell && !this.cellEditorInPopup;
  22417. var popupEditorShowing = this.editingCell && this.cellEditorInPopup;
  22418. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), "ag-cell-inline-editing", editingInline);
  22419. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), "ag-cell-not-inline-editing", !editingInline);
  22420. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), "ag-cell-popup-editing", popupEditorShowing);
  22421. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui().parentNode, "ag-row-inline-editing", editingInline);
  22422. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui().parentNode, "ag-row-not-inline-editing", !editingInline);
  22423. };
  22424. CellComp.prototype.createCellEditorParams = function (keyPress, charPress, cellStartedEdit) {
  22425. return {
  22426. value: this.getValue(),
  22427. keyPress: keyPress,
  22428. charPress: charPress,
  22429. column: this.column,
  22430. colDef: this.column.getColDef(),
  22431. rowIndex: this.cellPosition.rowIndex,
  22432. node: this.rowNode,
  22433. data: this.rowNode.data,
  22434. api: this.beans.gridOptionsWrapper.getApi(),
  22435. cellStartedEdit: cellStartedEdit,
  22436. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  22437. context: this.beans.gridOptionsWrapper.getContext(),
  22438. $scope: this.scope,
  22439. onKeyDown: this.onKeyDown.bind(this),
  22440. stopEditing: this.stopEditingAndFocus.bind(this),
  22441. eGridCell: this.getGui(),
  22442. parseValue: this.parseValue.bind(this),
  22443. formatValue: this.formatValue.bind(this)
  22444. };
  22445. };
  22446. // cell editors call this, when they want to stop for reasons other
  22447. // than what we pick up on. eg selecting from a dropdown ends editing.
  22448. CellComp.prototype.stopEditingAndFocus = function (suppressNavigateAfterEdit) {
  22449. if (suppressNavigateAfterEdit === void 0) { suppressNavigateAfterEdit = false; }
  22450. this.stopRowOrCellEdit();
  22451. this.focusCell(true);
  22452. if (!suppressNavigateAfterEdit) {
  22453. this.navigateAfterEdit();
  22454. }
  22455. };
  22456. CellComp.prototype.parseValue = function (newValue) {
  22457. var colDef = this.getComponentHolder();
  22458. var params = {
  22459. node: this.rowNode,
  22460. data: this.rowNode.data,
  22461. oldValue: this.value,
  22462. newValue: newValue,
  22463. colDef: colDef,
  22464. column: this.column,
  22465. api: this.beans.gridOptionsWrapper.getApi(),
  22466. columnApi: this.beans.gridOptionsWrapper.getColumnApi(),
  22467. context: this.beans.gridOptionsWrapper.getContext()
  22468. };
  22469. var valueParser = colDef.valueParser;
  22470. return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].exists(valueParser) ? this.beans.expressionService.evaluate(valueParser, params) : newValue;
  22471. };
  22472. CellComp.prototype.focusCell = function (forceBrowserFocus) {
  22473. if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
  22474. this.beans.focusController.setFocusedCell(this.cellPosition.rowIndex, this.column, this.rowNode.rowPinned, forceBrowserFocus);
  22475. };
  22476. CellComp.prototype.setFocusInOnEditor = function () {
  22477. if (this.editingCell) {
  22478. if (this.cellEditor && this.cellEditor.focusIn) {
  22479. // if the editor is present, then we just focus it
  22480. this.cellEditor.focusIn();
  22481. }
  22482. else {
  22483. // if the editor is not present, it means async cell editor (eg React fibre)
  22484. // and we are trying to set focus before the cell editor is present, so we
  22485. // focus the cell instead
  22486. this.focusCell(true);
  22487. }
  22488. }
  22489. };
  22490. CellComp.prototype.isEditing = function () {
  22491. return this.editingCell;
  22492. };
  22493. CellComp.prototype.onKeyDown = function (event) {
  22494. var key = event.which || event.keyCode;
  22495. switch (key) {
  22496. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_ENTER:
  22497. this.onEnterKeyDown(event);
  22498. break;
  22499. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_F2:
  22500. this.onF2KeyDown();
  22501. break;
  22502. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_ESCAPE:
  22503. this.onEscapeKeyDown();
  22504. break;
  22505. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_TAB:
  22506. this.onTabKeyDown(event);
  22507. break;
  22508. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_BACKSPACE:
  22509. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_DELETE:
  22510. this.onBackspaceOrDeleteKeyPressed(key);
  22511. break;
  22512. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_DOWN:
  22513. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_UP:
  22514. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_RIGHT:
  22515. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_LEFT:
  22516. this.onNavigationKeyPressed(event, key);
  22517. break;
  22518. }
  22519. };
  22520. CellComp.prototype.setFocusOutOnEditor = function () {
  22521. if (this.editingCell && this.cellEditor && this.cellEditor.focusOut) {
  22522. this.cellEditor.focusOut();
  22523. }
  22524. };
  22525. CellComp.prototype.onNavigationKeyPressed = function (event, key) {
  22526. if (this.editingCell) {
  22527. return;
  22528. }
  22529. if (event.shiftKey && this.rangeSelectionEnabled) {
  22530. this.onShiftRangeSelect(key);
  22531. }
  22532. else {
  22533. this.beans.rowRenderer.navigateToNextCell(event, key, this.cellPosition, true);
  22534. }
  22535. // if we don't prevent default, the grid will scroll with the navigation keys
  22536. event.preventDefault();
  22537. };
  22538. CellComp.prototype.onShiftRangeSelect = function (key) {
  22539. if (!this.beans.rangeController) {
  22540. return;
  22541. }
  22542. var endCell = this.beans.rangeController.extendLatestRangeInDirection(key);
  22543. if (endCell) {
  22544. this.beans.rowRenderer.ensureCellVisible(endCell);
  22545. }
  22546. };
  22547. CellComp.prototype.onTabKeyDown = function (event) {
  22548. this.beans.rowRenderer.onTabKeyDown(this, event);
  22549. };
  22550. CellComp.prototype.onBackspaceOrDeleteKeyPressed = function (key) {
  22551. if (!this.editingCell) {
  22552. this.startRowOrCellEdit(key);
  22553. }
  22554. };
  22555. CellComp.prototype.onEnterKeyDown = function (e) {
  22556. if (this.editingCell || this.rowComp.isEditing()) {
  22557. this.stopEditingAndFocus();
  22558. }
  22559. else {
  22560. if (this.beans.gridOptionsWrapper.isEnterMovesDown()) {
  22561. this.beans.rowRenderer.navigateToNextCell(null, _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_DOWN, this.cellPosition, false);
  22562. }
  22563. else {
  22564. e.preventDefault();
  22565. this.startRowOrCellEdit(_constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_ENTER);
  22566. }
  22567. }
  22568. };
  22569. CellComp.prototype.navigateAfterEdit = function () {
  22570. var fullRowEdit = this.beans.gridOptionsWrapper.isFullRowEdit();
  22571. if (fullRowEdit) {
  22572. return;
  22573. }
  22574. var enterMovesDownAfterEdit = this.beans.gridOptionsWrapper.isEnterMovesDownAfterEdit();
  22575. if (enterMovesDownAfterEdit) {
  22576. this.beans.rowRenderer.navigateToNextCell(null, _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_DOWN, this.cellPosition, false);
  22577. }
  22578. };
  22579. CellComp.prototype.onF2KeyDown = function () {
  22580. if (!this.editingCell) {
  22581. this.startRowOrCellEdit(_constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_F2);
  22582. }
  22583. };
  22584. CellComp.prototype.onEscapeKeyDown = function () {
  22585. if (this.editingCell) {
  22586. this.stopRowOrCellEdit(true);
  22587. this.focusCell(true);
  22588. }
  22589. };
  22590. CellComp.prototype.onKeyPress = function (event) {
  22591. // check this, in case focus is on a (for example) a text field inside the cell,
  22592. // in which cse we should not be listening for these key pressed
  22593. var eventTarget = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].getTarget(event);
  22594. var eventOnChildComponent = eventTarget !== this.getGui();
  22595. if (eventOnChildComponent || this.editingCell) {
  22596. return;
  22597. }
  22598. var pressedChar = String.fromCharCode(event.charCode);
  22599. if (pressedChar === ' ') {
  22600. this.onSpaceKeyPressed(event);
  22601. }
  22602. else if (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isEventFromPrintableCharacter(event)) {
  22603. this.startRowOrCellEdit(null, pressedChar);
  22604. // if we don't prevent default, then the keypress also gets applied to the text field
  22605. // (at least when doing the default editor), but we need to allow the editor to decide
  22606. // what it wants to do. we only do this IF editing was started - otherwise it messes
  22607. // up when the use is not doing editing, but using rendering with text fields in cellRenderer
  22608. // (as it would block the the user from typing into text fields).
  22609. event.preventDefault();
  22610. }
  22611. };
  22612. CellComp.prototype.onSpaceKeyPressed = function (event) {
  22613. var gridOptionsWrapper = this.beans.gridOptionsWrapper;
  22614. if (!this.editingCell && gridOptionsWrapper.isRowSelection()) {
  22615. var newSelection = !this.rowNode.isSelected();
  22616. if (newSelection || gridOptionsWrapper.isRowDeselection()) {
  22617. this.rowNode.setSelected(newSelection);
  22618. }
  22619. }
  22620. // prevent default as space key, by default, moves browser scroll down
  22621. event.preventDefault();
  22622. };
  22623. CellComp.prototype.onMouseDown = function (mouseEvent) {
  22624. var ctrlKey = mouseEvent.ctrlKey, metaKey = mouseEvent.metaKey, shiftKey = mouseEvent.shiftKey;
  22625. var target = mouseEvent.target;
  22626. var _a = this.beans, eventService = _a.eventService, rangeController = _a.rangeController;
  22627. // do not change the range for right-clicks inside an existing range
  22628. if (this.isRightClickInExistingRange(mouseEvent)) {
  22629. return;
  22630. }
  22631. if (!shiftKey || (rangeController && !rangeController.getCellRanges().length)) {
  22632. // We only need to pass true to focusCell when the browser is IE/Edge and we are trying
  22633. // to focus the cell itself. This should never be true if the mousedown was triggered
  22634. // due to a click on a cell editor for example.
  22635. var forceBrowserFocus = (_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isBrowserIE() || _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isBrowserEdge()) && !this.editingCell;
  22636. this.focusCell(forceBrowserFocus);
  22637. }
  22638. else {
  22639. // if a range is being changed, we need to make sure the focused cell does not change.
  22640. mouseEvent.preventDefault();
  22641. }
  22642. // if we are clicking on a checkbox, we need to make sure the cell wrapping that checkbox
  22643. // is focused but we don't want to change the range selection, so return here.
  22644. if (this.containsWidget(target)) {
  22645. return;
  22646. }
  22647. if (rangeController) {
  22648. var thisCell = this.cellPosition;
  22649. if (shiftKey) {
  22650. rangeController.extendLatestRangeToCell(thisCell);
  22651. }
  22652. else {
  22653. var ctrlKeyPressed = ctrlKey || metaKey;
  22654. rangeController.setRangeToCell(thisCell, ctrlKeyPressed);
  22655. }
  22656. }
  22657. eventService.dispatchEvent(this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_MOUSE_DOWN));
  22658. };
  22659. CellComp.prototype.isRightClickInExistingRange = function (mouseEvent) {
  22660. var rangeController = this.beans.rangeController;
  22661. if (rangeController) {
  22662. var cellInRange = rangeController.isCellInAnyRange(this.getCellPosition());
  22663. if (cellInRange && mouseEvent.button === 2) {
  22664. return true;
  22665. }
  22666. }
  22667. return false;
  22668. };
  22669. CellComp.prototype.containsWidget = function (target) {
  22670. return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isElementChildOfClass(target, 'ag-selection-checkbox', 3);
  22671. };
  22672. // returns true if on iPad and this is second 'click' event in 200ms
  22673. CellComp.prototype.isDoubleClickOnIPad = function () {
  22674. if (!_utils__WEBPACK_IMPORTED_MODULE_7__["_"].isIOSUserAgent() || _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isEventSupported('dblclick')) {
  22675. return false;
  22676. }
  22677. var nowMillis = new Date().getTime();
  22678. var res = nowMillis - this.lastIPadMouseClickEvent < 200;
  22679. this.lastIPadMouseClickEvent = nowMillis;
  22680. return res;
  22681. };
  22682. CellComp.prototype.onCellClicked = function (mouseEvent) {
  22683. // iPad doesn't have double click - so we need to mimic it to enable editing for iPad.
  22684. if (this.isDoubleClickOnIPad()) {
  22685. this.onCellDoubleClicked(mouseEvent);
  22686. mouseEvent.preventDefault(); // if we don't do this, then iPad zooms in
  22687. return;
  22688. }
  22689. var _a = this.beans, eventService = _a.eventService, gridOptionsWrapper = _a.gridOptionsWrapper;
  22690. var cellClickedEvent = this.createEvent(mouseEvent, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_CLICKED);
  22691. eventService.dispatchEvent(cellClickedEvent);
  22692. var colDef = this.getComponentHolder();
  22693. if (colDef.onCellClicked) {
  22694. // to make callback async, do in a timeout
  22695. window.setTimeout(function () { return colDef.onCellClicked(cellClickedEvent); }, 0);
  22696. }
  22697. var editOnSingleClick = (gridOptionsWrapper.isSingleClickEdit() || colDef.singleClickEdit)
  22698. && !gridOptionsWrapper.isSuppressClickEdit();
  22699. if (editOnSingleClick) {
  22700. this.startRowOrCellEdit();
  22701. }
  22702. };
  22703. CellComp.prototype.createGridCellVo = function () {
  22704. this.cellPosition = {
  22705. rowIndex: this.rowNode.rowIndex,
  22706. rowPinned: this.rowNode.rowPinned,
  22707. column: this.column
  22708. };
  22709. };
  22710. CellComp.prototype.getCellPosition = function () {
  22711. return this.cellPosition;
  22712. };
  22713. CellComp.prototype.getParentRow = function () {
  22714. return this.eParentRow;
  22715. };
  22716. CellComp.prototype.setParentRow = function (eParentRow) {
  22717. this.eParentRow = eParentRow;
  22718. };
  22719. CellComp.prototype.getColumn = function () {
  22720. return this.column;
  22721. };
  22722. CellComp.prototype.getComponentHolder = function () {
  22723. return this.column.getColDef();
  22724. };
  22725. CellComp.prototype.detach = function () {
  22726. this.eParentRow.removeChild(this.getGui());
  22727. };
  22728. // if the row is also getting destroyed, then we don't need to remove from dom,
  22729. // as the row will also get removed, so no need to take out the cells from the row
  22730. // if the row is going (removing is an expensive operation, so only need to remove
  22731. // the top part)
  22732. //
  22733. // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons.
  22734. CellComp.prototype.destroy = function () {
  22735. if (this.createCellRendererFunc) {
  22736. this.beans.taskQueue.cancelTask(this.createCellRendererFunc);
  22737. }
  22738. this.stopEditing();
  22739. this.cellRenderer = this.beans.context.destroyBean(this.cellRenderer);
  22740. this.beans.context.destroyBean(this.selectionHandle);
  22741. _super.prototype.destroy.call(this);
  22742. };
  22743. CellComp.prototype.onLeftChanged = function () {
  22744. var left = this.modifyLeftForPrintLayout(this.getCellLeft());
  22745. this.getGui().style.left = left + 'px';
  22746. this.refreshAriaIndex();
  22747. };
  22748. CellComp.prototype.modifyLeftForPrintLayout = function (leftPosition) {
  22749. if (!this.printLayout || this.column.getPinned() === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_LEFT) {
  22750. return leftPosition;
  22751. }
  22752. if (this.column.getPinned() === _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].PINNED_RIGHT) {
  22753. var leftWidth_1 = this.beans.columnController.getPinnedLeftContainerWidth();
  22754. var bodyWidth = this.beans.columnController.getBodyContainerWidth();
  22755. return leftWidth_1 + bodyWidth + leftPosition;
  22756. }
  22757. // is in body
  22758. var leftWidth = this.beans.columnController.getPinnedLeftContainerWidth();
  22759. return leftWidth + leftPosition;
  22760. };
  22761. CellComp.prototype.onWidthChanged = function () {
  22762. var width = this.getCellWidth();
  22763. this.getGui().style.width = width + 'px';
  22764. };
  22765. CellComp.prototype.getRangeBorders = function () {
  22766. var _this = this;
  22767. var isRtl = this.beans.gridOptionsWrapper.isEnableRtl();
  22768. var top = false;
  22769. var right = false;
  22770. var bottom = false;
  22771. var left = false;
  22772. var thisCol = this.cellPosition.column;
  22773. var _a = this.beans, rangeController = _a.rangeController, columnController = _a.columnController;
  22774. var leftCol;
  22775. var rightCol;
  22776. if (isRtl) {
  22777. leftCol = columnController.getDisplayedColAfter(thisCol);
  22778. rightCol = columnController.getDisplayedColBefore(thisCol);
  22779. }
  22780. else {
  22781. leftCol = columnController.getDisplayedColBefore(thisCol);
  22782. rightCol = columnController.getDisplayedColAfter(thisCol);
  22783. }
  22784. var ranges = rangeController.getCellRanges().filter(function (range) { return rangeController.isCellInSpecificRange(_this.cellPosition, range); });
  22785. // this means we are the first column in the grid
  22786. if (!leftCol) {
  22787. left = true;
  22788. }
  22789. // this means we are the last column in the grid
  22790. if (!rightCol) {
  22791. right = true;
  22792. }
  22793. for (var i = 0; i < ranges.length; i++) {
  22794. if (top && right && bottom && left) {
  22795. break;
  22796. }
  22797. var range = ranges[i];
  22798. var startRow = rangeController.getRangeStartRow(range);
  22799. var endRow = rangeController.getRangeEndRow(range);
  22800. if (!top && this.beans.rowPositionUtils.sameRow(startRow, this.cellPosition)) {
  22801. top = true;
  22802. }
  22803. if (!bottom && this.beans.rowPositionUtils.sameRow(endRow, this.cellPosition)) {
  22804. bottom = true;
  22805. }
  22806. if (!left && range.columns.indexOf(leftCol) < 0) {
  22807. left = true;
  22808. }
  22809. if (!right && range.columns.indexOf(rightCol) < 0) {
  22810. right = true;
  22811. }
  22812. }
  22813. return { top: top, right: right, bottom: bottom, left: left };
  22814. };
  22815. CellComp.prototype.getInitialRangeClasses = function () {
  22816. var classes = [];
  22817. if (!this.rangeSelectionEnabled || !this.rangeCount) {
  22818. return classes;
  22819. }
  22820. classes.push('ag-cell-range-selected');
  22821. if (this.hasChartRange) {
  22822. classes.push('ag-cell-range-chart');
  22823. }
  22824. var count = Math.min(this.rangeCount, 4);
  22825. classes.push("ag-cell-range-selected-" + count);
  22826. if (this.isSingleCell()) {
  22827. classes.push('ag-cell-range-single-cell');
  22828. }
  22829. if (this.rangeCount > 0) {
  22830. var borders = this.getRangeBorders();
  22831. if (borders.top) {
  22832. classes.push('ag-cell-range-top');
  22833. }
  22834. if (borders.right) {
  22835. classes.push('ag-cell-range-right');
  22836. }
  22837. if (borders.bottom) {
  22838. classes.push('ag-cell-range-bottom');
  22839. }
  22840. if (borders.left) {
  22841. classes.push('ag-cell-range-left');
  22842. }
  22843. }
  22844. if (!!this.selectionHandle) {
  22845. classes.push('ag-cell-range-handle');
  22846. }
  22847. return classes;
  22848. };
  22849. CellComp.prototype.onRowIndexChanged = function () {
  22850. // when index changes, this influences items that need the index, so we update the
  22851. // grid cell so they are working off the new index.
  22852. this.createGridCellVo();
  22853. // when the index of the row changes, ie means the cell may have lost or gained focus
  22854. this.onCellFocused();
  22855. // check range selection
  22856. this.onRangeSelectionChanged();
  22857. };
  22858. CellComp.prototype.onRangeSelectionChanged = function () {
  22859. var rangeController = this.beans.rangeController;
  22860. if (!rangeController) {
  22861. return;
  22862. }
  22863. var _a = this, cellPosition = _a.cellPosition, rangeCount = _a.rangeCount;
  22864. var newRangeCount = rangeController.getCellRangeCount(cellPosition);
  22865. var element = this.getGui();
  22866. if (rangeCount !== newRangeCount) {
  22867. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-selected', newRangeCount !== 0);
  22868. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-selected-1', newRangeCount === 1);
  22869. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-selected-2', newRangeCount === 2);
  22870. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-selected-3', newRangeCount === 3);
  22871. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-selected-4', newRangeCount >= 4);
  22872. this.rangeCount = newRangeCount;
  22873. }
  22874. var hasChartRange = this.getHasChartRange();
  22875. if (hasChartRange !== this.hasChartRange) {
  22876. this.hasChartRange = hasChartRange;
  22877. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-chart', this.hasChartRange);
  22878. }
  22879. this.updateRangeBorders();
  22880. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-single-cell', this.isSingleCell());
  22881. this.refreshHandle();
  22882. };
  22883. CellComp.prototype.getHasChartRange = function () {
  22884. var rangeController = this.beans.rangeController;
  22885. if (!this.rangeCount || !rangeController) {
  22886. return false;
  22887. }
  22888. var cellRanges = rangeController.getCellRanges();
  22889. return cellRanges.length > 0 && cellRanges.every(function (range) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].includes([_interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].DIMENSION, _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].VALUE], range.type); });
  22890. };
  22891. CellComp.prototype.shouldHaveSelectionHandle = function () {
  22892. var _a = this.beans, gridOptionsWrapper = _a.gridOptionsWrapper, rangeController = _a.rangeController;
  22893. var cellRanges = rangeController.getCellRanges();
  22894. var rangesLen = cellRanges.length;
  22895. if (this.rangeCount < 1 || rangesLen < 1) {
  22896. return false;
  22897. }
  22898. var cellRange = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].last(cellRanges);
  22899. var cellPosition = this.getCellPosition();
  22900. var fillHandleIsAvailable = rangesLen === 1 &&
  22901. (gridOptionsWrapper.isEnableFillHandle() || gridOptionsWrapper.isEnableRangeHandle()) &&
  22902. !this.editingCell;
  22903. if (this.hasChartRange) {
  22904. var hasCategoryRange = cellRanges[0].type === _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].DIMENSION;
  22905. var isCategoryCell = hasCategoryRange && rangeController.isCellInSpecificRange(cellPosition, cellRanges[0]);
  22906. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), 'ag-cell-range-chart-category', isCategoryCell);
  22907. fillHandleIsAvailable = cellRange.type === _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["CellRangeType"].VALUE;
  22908. }
  22909. return fillHandleIsAvailable &&
  22910. cellRange.endRow != null &&
  22911. rangeController.isContiguousRange(cellRange) &&
  22912. rangeController.isBottomRightCell(cellRange, cellPosition);
  22913. };
  22914. CellComp.prototype.addSelectionHandle = function () {
  22915. var _a = this.beans, gridOptionsWrapper = _a.gridOptionsWrapper, context = _a.context, rangeController = _a.rangeController;
  22916. var cellRangeType = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].last(rangeController.getCellRanges()).type;
  22917. var selectionHandleFill = gridOptionsWrapper.isEnableFillHandle() && _utils__WEBPACK_IMPORTED_MODULE_7__["_"].missing(cellRangeType);
  22918. var type = selectionHandleFill ? _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["SelectionHandleType"].FILL : _interfaces_iRangeController__WEBPACK_IMPORTED_MODULE_4__["SelectionHandleType"].RANGE;
  22919. if (this.selectionHandle && this.selectionHandle.getType() !== type) {
  22920. this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle);
  22921. }
  22922. if (!this.selectionHandle) {
  22923. this.selectionHandle = this.beans.selectionHandleFactory.createSelectionHandle(type);
  22924. }
  22925. this.selectionHandle.refresh(this);
  22926. };
  22927. CellComp.prototype.updateRangeBordersIfRangeCount = function () {
  22928. // we only need to update range borders if we are in a range
  22929. if (this.rangeCount > 0) {
  22930. this.updateRangeBorders();
  22931. this.refreshHandle();
  22932. }
  22933. };
  22934. CellComp.prototype.refreshHandle = function () {
  22935. if (!this.beans.rangeController) {
  22936. return;
  22937. }
  22938. var shouldHaveSelectionHandle = this.shouldHaveSelectionHandle();
  22939. if (this.selectionHandle && !shouldHaveSelectionHandle) {
  22940. this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle);
  22941. }
  22942. if (shouldHaveSelectionHandle) {
  22943. this.addSelectionHandle();
  22944. }
  22945. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), 'ag-cell-range-handle', !!this.selectionHandle);
  22946. };
  22947. CellComp.prototype.updateRangeBorders = function () {
  22948. var rangeBorders = this.getRangeBorders();
  22949. var isSingleCell = this.isSingleCell();
  22950. var isTop = !isSingleCell && rangeBorders.top;
  22951. var isRight = !isSingleCell && rangeBorders.right;
  22952. var isBottom = !isSingleCell && rangeBorders.bottom;
  22953. var isLeft = !isSingleCell && rangeBorders.left;
  22954. var element = this.getGui();
  22955. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-top', isTop);
  22956. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-right', isRight);
  22957. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-bottom', isBottom);
  22958. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(element, 'ag-cell-range-left', isLeft);
  22959. };
  22960. CellComp.prototype.onFirstRightPinnedChanged = function () {
  22961. var firstRightPinned = this.column.isFirstRightPinned();
  22962. if (this.firstRightPinned !== firstRightPinned) {
  22963. this.firstRightPinned = firstRightPinned;
  22964. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), 'ag-cell-first-right-pinned', firstRightPinned);
  22965. }
  22966. };
  22967. CellComp.prototype.onLastLeftPinnedChanged = function () {
  22968. var lastLeftPinned = this.column.isLastLeftPinned();
  22969. if (this.lastLeftPinned !== lastLeftPinned) {
  22970. this.lastLeftPinned = lastLeftPinned;
  22971. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), 'ag-cell-last-left-pinned', lastLeftPinned);
  22972. }
  22973. };
  22974. CellComp.prototype.populateTemplate = function () {
  22975. if (this.usingWrapper) {
  22976. this.eParentOfValue = this.getRefElement('eCellValue');
  22977. this.eCellWrapper = this.getRefElement('eCellWrapper');
  22978. this.eCellValue = this.getRefElement('eCellValue');
  22979. if (this.includeRowDraggingComponent) {
  22980. this.addRowDragging();
  22981. }
  22982. if (this.includeDndSourceComponent) {
  22983. this.addDndSource();
  22984. }
  22985. if (this.includeSelectionComponent) {
  22986. this.addSelectionCheckbox();
  22987. }
  22988. }
  22989. else {
  22990. this.eParentOfValue = this.getGui();
  22991. }
  22992. };
  22993. CellComp.prototype.getFrameworkOverrides = function () {
  22994. return this.beans.frameworkOverrides;
  22995. };
  22996. CellComp.prototype.addRowDragging = function () {
  22997. var pagination = this.beans.gridOptionsWrapper.isPagination();
  22998. var rowDragManaged = this.beans.gridOptionsWrapper.isRowDragManaged();
  22999. var clientSideRowModelActive = this.beans.gridOptionsWrapper.isRowModelDefault();
  23000. if (rowDragManaged) {
  23001. // row dragging only available in default row model
  23002. if (!clientSideRowModelActive) {
  23003. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].doOnce(function () { return console.warn('ag-Grid: managed row dragging is only allowed in the Client Side Row Model'); }, 'CellComp.addRowDragging');
  23004. return;
  23005. }
  23006. if (pagination) {
  23007. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].doOnce(function () { return console.warn('ag-Grid: managed row dragging is not possible when doing pagination'); }, 'CellComp.addRowDragging');
  23008. return;
  23009. }
  23010. }
  23011. var rowDraggingComp = new _rowDragComp__WEBPACK_IMPORTED_MODULE_5__["RowDragComp"](this.rowNode, this.column, this.getValueToUse(), this.beans);
  23012. this.createManagedBean(rowDraggingComp, this.beans.context);
  23013. // put the checkbox in before the value
  23014. this.eCellWrapper.insertBefore(rowDraggingComp.getGui(), this.eParentOfValue);
  23015. };
  23016. CellComp.prototype.addDndSource = function () {
  23017. var dndSourceComp = new _dndSourceComp__WEBPACK_IMPORTED_MODULE_8__["DndSourceComp"](this.rowNode, this.column, this.getValueToUse(), this.beans, this.getGui());
  23018. this.createManagedBean(dndSourceComp, this.beans.context);
  23019. // put the checkbox in before the value
  23020. this.eCellWrapper.insertBefore(dndSourceComp.getGui(), this.eParentOfValue);
  23021. };
  23022. CellComp.prototype.addSelectionCheckbox = function () {
  23023. var _this = this;
  23024. var cbSelectionComponent = new _checkboxSelectionComponent__WEBPACK_IMPORTED_MODULE_3__["CheckboxSelectionComponent"]();
  23025. this.beans.context.createBean(cbSelectionComponent);
  23026. var visibleFunc = this.getComponentHolder().checkboxSelection;
  23027. visibleFunc = typeof visibleFunc === 'function' ? visibleFunc : null;
  23028. cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column, visibleFunc: visibleFunc });
  23029. this.addDestroyFunc(function () { return _this.beans.context.destroyBean(cbSelectionComponent); });
  23030. // put the checkbox in before the value
  23031. this.eCellWrapper.insertBefore(cbSelectionComponent.getGui(), this.eParentOfValue);
  23032. };
  23033. CellComp.prototype.addDomData = function () {
  23034. var _this = this;
  23035. var element = this.getGui();
  23036. this.beans.gridOptionsWrapper.setDomData(element, CellComp.DOM_DATA_KEY_CELL_COMP, this);
  23037. this.addDestroyFunc(function () { return _this.beans.gridOptionsWrapper.setDomData(element, CellComp.DOM_DATA_KEY_CELL_COMP, null); });
  23038. };
  23039. CellComp.prototype.isSingleCell = function () {
  23040. var rangeController = this.beans.rangeController;
  23041. return this.rangeCount === 1 && rangeController && !rangeController.isMoreThanOneCell();
  23042. };
  23043. CellComp.prototype.onCellFocused = function (event) {
  23044. var cellFocused = this.beans.focusController.isCellFocused(this.cellPosition);
  23045. // see if we need to change the classes on this cell
  23046. if (cellFocused !== this.cellFocused) {
  23047. // if we are not doing cell selection, then the focus class does not change
  23048. var doingFocusCss = !this.beans.gridOptionsWrapper.isSuppressCellSelection();
  23049. if (doingFocusCss) {
  23050. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addOrRemoveCssClass(this.getGui(), 'ag-cell-focus', cellFocused);
  23051. }
  23052. this.cellFocused = cellFocused;
  23053. }
  23054. // see if we need to force browser focus - this can happen if focus is programmatically set
  23055. if (cellFocused && event && event.forceBrowserFocus) {
  23056. var focusEl = this.getFocusableElement();
  23057. focusEl.focus();
  23058. // Fix for AG-3465 "IE11 - After editing cell's content, selection doesn't go one cell below on enter"
  23059. // IE can fail to focus the cell after the first call to focus(), and needs a second call
  23060. if (!document.activeElement || document.activeElement === document.body) {
  23061. focusEl.focus();
  23062. }
  23063. }
  23064. // if another cell was focused, and we are editing, then stop editing
  23065. var fullRowEdit = this.beans.gridOptionsWrapper.isFullRowEdit();
  23066. if (!cellFocused && !fullRowEdit && this.editingCell) {
  23067. this.stopRowOrCellEdit();
  23068. }
  23069. };
  23070. // pass in 'true' to cancel the editing.
  23071. CellComp.prototype.stopRowOrCellEdit = function (cancel) {
  23072. if (cancel === void 0) { cancel = false; }
  23073. if (this.beans.gridOptionsWrapper.isFullRowEdit()) {
  23074. this.rowComp.stopRowEditing(cancel);
  23075. }
  23076. else {
  23077. this.stopEditing(cancel);
  23078. }
  23079. };
  23080. CellComp.prototype.stopEditing = function (cancel) {
  23081. if (cancel === void 0) { cancel = false; }
  23082. if (!this.editingCell) {
  23083. return;
  23084. }
  23085. // if no cell editor, this means due to async, that the cell editor never got initialised,
  23086. // so we just carry on regardless as if the editing was never started.
  23087. if (!this.cellEditor) {
  23088. this.editingCell = false;
  23089. return;
  23090. }
  23091. var oldValue = this.getValue();
  23092. var newValueExists = false;
  23093. var newValue;
  23094. if (!cancel) {
  23095. // also have another option here to cancel after editing, so for example user could have a popup editor and
  23096. // it is closed by user clicking outside the editor. then the editor will close automatically (with false
  23097. // passed above) and we need to see if the editor wants to accept the new value.
  23098. var userWantsToCancel = this.cellEditor.isCancelAfterEnd && this.cellEditor.isCancelAfterEnd();
  23099. if (!userWantsToCancel) {
  23100. newValue = this.cellEditor.getValue();
  23101. newValueExists = true;
  23102. }
  23103. }
  23104. // it is important we set this after setValue() above, as otherwise the cell will flash
  23105. // when editing stops. the 'refresh' method checks editing, and doesn't refresh editing cells.
  23106. // thus it will skip the refresh on this cell until the end of this method where we call
  23107. // refresh directly and we suppress the flash.
  23108. this.editingCell = false;
  23109. // important to clear this out - as parts of the code will check for
  23110. // this to see if an async cellEditor has yet to be created
  23111. this.cellEditor = this.beans.context.destroyBean(this.cellEditor);
  23112. this.cellEditor = null;
  23113. if (this.cellEditorInPopup && this.hideEditorPopup) {
  23114. this.hideEditorPopup();
  23115. this.hideEditorPopup = null;
  23116. }
  23117. else {
  23118. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].clearElement(this.getGui());
  23119. // put the cell back the way it was before editing
  23120. if (this.usingWrapper) {
  23121. // if wrapper, then put the wrapper back
  23122. this.getGui().appendChild(this.eCellWrapper);
  23123. }
  23124. else if (this.cellRenderer) {
  23125. // if cellRenderer, then put the gui back in. if the renderer has
  23126. // a refresh, it will be called. however if it doesn't, then later
  23127. // the renderer will be destroyed and a new one will be created.
  23128. // we know it's a dom element (not a string) because we converted
  23129. // it after the gui was attached if it was a string.
  23130. var eCell = this.cellRendererGui;
  23131. // can be null if cell was previously null / contained empty string,
  23132. // this will result in new value not being rendered.
  23133. if (eCell) {
  23134. this.getGui().appendChild(eCell);
  23135. }
  23136. }
  23137. }
  23138. this.setInlineEditingClass();
  23139. this.refreshHandle();
  23140. if (newValueExists && newValue !== oldValue) {
  23141. // we suppressRefreshCell because the call to rowNode.setDataValue() results in change detection
  23142. // getting triggered, which results in all cells getting refreshed. we do not want this refresh
  23143. // to happen on this call as we want to call it explicitly below. otherwise refresh gets called twice.
  23144. // if we only did this refresh (and not the one below) then the cell would flash and not be forced.
  23145. this.suppressRefreshCell = true;
  23146. this.rowNode.setDataValue(this.column, newValue);
  23147. this.suppressRefreshCell = false;
  23148. }
  23149. // we suppress the flash, as it is not correct to flash the cell the user has finished editing,
  23150. // the user doesn't need to flash as they were the one who did the edit, the flash is pointless
  23151. // (as the flash is meant to draw the user to a change that they didn't manually do themselves).
  23152. this.refreshCell({ forceRefresh: true, suppressFlash: true });
  23153. var event = this.createEvent(null, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_EDITING_STOPPED);
  23154. this.beans.eventService.dispatchEvent(event);
  23155. };
  23156. CellComp.DOM_DATA_KEY_CELL_COMP = 'cellComp';
  23157. CellComp.CELL_RENDERER_TYPE_NORMAL = 'cellRenderer';
  23158. CellComp.CELL_RENDERER_TYPE_PINNED = 'pinnedRowCellRenderer';
  23159. return CellComp;
  23160. }(_widgets_component__WEBPACK_IMPORTED_MODULE_2__["Component"]));
  23161. /***/ }),
  23162. /* 102 */
  23163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23164. "use strict";
  23165. __webpack_require__.r(__webpack_exports__);
  23166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionHandleType", function() { return SelectionHandleType; });
  23167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellRangeType", function() { return CellRangeType; });
  23168. /**
  23169. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  23170. * @version v23.2.1
  23171. * @link http://www.ag-grid.com/
  23172. * @license MIT
  23173. */
  23174. var SelectionHandleType;
  23175. (function (SelectionHandleType) {
  23176. SelectionHandleType[SelectionHandleType["FILL"] = 0] = "FILL";
  23177. SelectionHandleType[SelectionHandleType["RANGE"] = 1] = "RANGE";
  23178. })(SelectionHandleType || (SelectionHandleType = {}));
  23179. var CellRangeType;
  23180. (function (CellRangeType) {
  23181. CellRangeType[CellRangeType["VALUE"] = 0] = "VALUE";
  23182. CellRangeType[CellRangeType["DIMENSION"] = 1] = "DIMENSION";
  23183. })(CellRangeType || (CellRangeType = {}));
  23184. /***/ }),
  23185. /* 103 */
  23186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23187. "use strict";
  23188. __webpack_require__.r(__webpack_exports__);
  23189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowDragComp", function() { return RowDragComp; });
  23190. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  23191. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  23192. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68);
  23193. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(104);
  23194. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(44);
  23195. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41);
  23196. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
  23197. /**
  23198. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  23199. * @version v23.2.1
  23200. * @link http://www.ag-grid.com/
  23201. * @license MIT
  23202. */
  23203. var __extends = (undefined && undefined.__extends) || (function () {
  23204. var extendStatics = function (d, b) {
  23205. extendStatics = Object.setPrototypeOf ||
  23206. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  23207. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23208. return extendStatics(d, b);
  23209. };
  23210. return function (d, b) {
  23211. extendStatics(d, b);
  23212. function __() { this.constructor = d; }
  23213. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  23214. };
  23215. })();
  23216. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  23217. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  23218. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  23219. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  23220. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23221. };
  23222. var RowDragComp = /** @class */ (function (_super) {
  23223. __extends(RowDragComp, _super);
  23224. function RowDragComp(rowNode, column, cellValue, beans) {
  23225. var _this = _super.call(this, "<div class=\"ag-drag-handle ag-row-drag\" role=\"presentation\"></div>") || this;
  23226. _this.rowNode = rowNode;
  23227. _this.column = column;
  23228. _this.cellValue = cellValue;
  23229. _this.beans = beans;
  23230. return _this;
  23231. }
  23232. RowDragComp.prototype.postConstruct = function () {
  23233. var eGui = this.getGui();
  23234. eGui.appendChild(_utils__WEBPACK_IMPORTED_MODULE_6__["_"].createIconNoSpan('rowDrag', this.beans.gridOptionsWrapper, null));
  23235. this.addDragSource();
  23236. this.checkCompatibility();
  23237. var strategy = this.beans.gridOptionsWrapper.isRowDragManaged() ?
  23238. new ManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column) :
  23239. new NonManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column);
  23240. this.createManagedBean(strategy, this.beans.context);
  23241. };
  23242. RowDragComp.prototype.getSelectedCount = function () {
  23243. var multiRowEnabled = this.beans.gridOptionsWrapper.isEnableMultiRowDragging();
  23244. if (!multiRowEnabled) {
  23245. return 1;
  23246. }
  23247. var selection = this.beans.selectionController.getSelectedNodes();
  23248. return selection.indexOf(this.rowNode) !== -1 ? selection.length : 1;
  23249. };
  23250. // returns true if all compatibility items work out
  23251. RowDragComp.prototype.checkCompatibility = function () {
  23252. var managed = this.beans.gridOptionsWrapper.isRowDragManaged();
  23253. var treeData = this.beans.gridOptionsWrapper.isTreeData();
  23254. if (treeData && managed) {
  23255. _utils__WEBPACK_IMPORTED_MODULE_6__["_"].doOnce(function () {
  23256. return console.warn('ag-Grid: If using row drag with tree data, you cannot have rowDragManaged=true');
  23257. }, 'RowDragComp.managedAndTreeData');
  23258. }
  23259. };
  23260. RowDragComp.prototype.addDragSource = function () {
  23261. var _this = this;
  23262. var dragItem = {
  23263. rowNode: this.rowNode,
  23264. columns: [this.column],
  23265. defaultTextValue: this.cellValue,
  23266. };
  23267. var rowDragText = this.column.getColDef().rowDragText;
  23268. var dragSource = {
  23269. type: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_3__["DragSourceType"].RowDrag,
  23270. eElement: this.getGui(),
  23271. dragItemName: function () {
  23272. var dragItemCount = _this.getSelectedCount();
  23273. if (rowDragText) {
  23274. return rowDragText(dragItem, dragItemCount);
  23275. }
  23276. return dragItemCount === 1 ? _this.cellValue : dragItemCount + " rows";
  23277. },
  23278. getDragItem: function () { return dragItem; },
  23279. dragStartPixels: 0
  23280. };
  23281. this.beans.dragAndDropService.addDragSource(dragSource, true);
  23282. this.addDestroyFunc(function () { return _this.beans.dragAndDropService.removeDragSource(dragSource); });
  23283. };
  23284. __decorate([
  23285. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  23286. ], RowDragComp.prototype, "postConstruct", null);
  23287. return RowDragComp;
  23288. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  23289. var VisibilityStrategy = /** @class */ (function (_super) {
  23290. __extends(VisibilityStrategy, _super);
  23291. function VisibilityStrategy(parent, rowNode, column) {
  23292. var _this = _super.call(this) || this;
  23293. _this.parent = parent;
  23294. _this.column = column;
  23295. _this.rowNode = rowNode;
  23296. return _this;
  23297. }
  23298. VisibilityStrategy.prototype.setDisplayedOrVisible = function (neverDisplayed) {
  23299. if (neverDisplayed) {
  23300. this.parent.setDisplayed(false);
  23301. }
  23302. else {
  23303. var shown = this.column.isRowDrag(this.rowNode);
  23304. var isShownSometimes = _utils__WEBPACK_IMPORTED_MODULE_6__["_"].isFunction(this.column.getColDef().rowDrag);
  23305. // if shown sometimes, them some rows can have drag handle while other don't,
  23306. // so we use setVisible to keep the handles horizontally aligned (as setVisible
  23307. // keeps the empty space, whereas setDisplayed looses the space)
  23308. if (isShownSometimes) {
  23309. this.parent.setDisplayed(true);
  23310. this.parent.setVisible(shown);
  23311. }
  23312. else {
  23313. this.parent.setDisplayed(shown);
  23314. }
  23315. }
  23316. };
  23317. return VisibilityStrategy;
  23318. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_5__["BeanStub"]));
  23319. // when non managed, the visibility depends on suppressRowDrag property only
  23320. var NonManagedVisibilityStrategy = /** @class */ (function (_super) {
  23321. __extends(NonManagedVisibilityStrategy, _super);
  23322. function NonManagedVisibilityStrategy(parent, beans, rowNode, column) {
  23323. var _this = _super.call(this, parent, rowNode, column) || this;
  23324. _this.beans = beans;
  23325. return _this;
  23326. }
  23327. NonManagedVisibilityStrategy.prototype.postConstruct = function () {
  23328. this.addManagedListener(this.beans.gridOptionsWrapper, 'suppressRowDrag', this.onSuppressRowDrag.bind(this));
  23329. // in case data changes, then we need to update visibility of drag item
  23330. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));
  23331. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));
  23332. this.workOutVisibility();
  23333. };
  23334. NonManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {
  23335. this.workOutVisibility();
  23336. };
  23337. NonManagedVisibilityStrategy.prototype.workOutVisibility = function () {
  23338. // only show the drag if both sort and filter are not present
  23339. var neverDisplayed = this.beans.gridOptionsWrapper.isSuppressRowDrag();
  23340. this.setDisplayedOrVisible(neverDisplayed);
  23341. };
  23342. __decorate([
  23343. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  23344. ], NonManagedVisibilityStrategy.prototype, "postConstruct", null);
  23345. return NonManagedVisibilityStrategy;
  23346. }(VisibilityStrategy));
  23347. // when managed, the visibility depends on sort, filter and row group, as well as suppressRowDrag property
  23348. var ManagedVisibilityStrategy = /** @class */ (function (_super) {
  23349. __extends(ManagedVisibilityStrategy, _super);
  23350. function ManagedVisibilityStrategy(parent, beans, rowNode, column) {
  23351. var _this = _super.call(this, parent, rowNode, column) || this;
  23352. _this.beans = beans;
  23353. return _this;
  23354. }
  23355. ManagedVisibilityStrategy.prototype.postConstruct = function () {
  23356. // we do not show the component if sort, filter or grouping is active
  23357. this.addManagedListener(this.beans.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_SORT_CHANGED, this.workOutVisibility.bind(this));
  23358. this.addManagedListener(this.beans.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_FILTER_CHANGED, this.workOutVisibility.bind(this));
  23359. this.addManagedListener(this.beans.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.workOutVisibility.bind(this));
  23360. // in case data changes, then we need to update visibility of drag item
  23361. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_DATA_CHANGED, this.workOutVisibility.bind(this));
  23362. this.addManagedListener(this.rowNode, _entities_rowNode__WEBPACK_IMPORTED_MODULE_2__["RowNode"].EVENT_CELL_CHANGED, this.workOutVisibility.bind(this));
  23363. this.addManagedListener(this.beans.gridOptionsWrapper, 'suppressRowDrag', this.onSuppressRowDrag.bind(this));
  23364. this.workOutVisibility();
  23365. };
  23366. ManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () {
  23367. this.workOutVisibility();
  23368. };
  23369. ManagedVisibilityStrategy.prototype.workOutVisibility = function () {
  23370. // only show the drag if both sort and filter are not present
  23371. var rowDragFeature = this.beans.gridPanel.getRowDragFeature();
  23372. var shouldPreventRowMove = rowDragFeature && rowDragFeature.shouldPreventRowMove();
  23373. var suppressRowDrag = this.beans.gridOptionsWrapper.isSuppressRowDrag();
  23374. var hasExternalDropZones = this.beans.dragAndDropService.hasExternalDropZones();
  23375. var neverDisplayed = (shouldPreventRowMove && !hasExternalDropZones) || suppressRowDrag;
  23376. this.setDisplayedOrVisible(neverDisplayed);
  23377. };
  23378. __decorate([
  23379. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  23380. ], ManagedVisibilityStrategy.prototype, "postConstruct", null);
  23381. return ManagedVisibilityStrategy;
  23382. }(VisibilityStrategy));
  23383. /***/ }),
  23384. /* 104 */
  23385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23386. "use strict";
  23387. __webpack_require__.r(__webpack_exports__);
  23388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragSourceType", function() { return DragSourceType; });
  23389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VerticalDirection", function() { return VerticalDirection; });
  23390. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalDirection", function() { return HorizontalDirection; });
  23391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragAndDropService", function() { return DragAndDropService; });
  23392. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  23393. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  23394. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  23395. /**
  23396. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  23397. * @version v23.2.1
  23398. * @link http://www.ag-grid.com/
  23399. * @license MIT
  23400. */
  23401. var __extends = (undefined && undefined.__extends) || (function () {
  23402. var extendStatics = function (d, b) {
  23403. extendStatics = Object.setPrototypeOf ||
  23404. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  23405. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23406. return extendStatics(d, b);
  23407. };
  23408. return function (d, b) {
  23409. extendStatics(d, b);
  23410. function __() { this.constructor = d; }
  23411. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  23412. };
  23413. })();
  23414. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  23415. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  23416. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  23417. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  23418. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23419. };
  23420. var DragSourceType;
  23421. (function (DragSourceType) {
  23422. DragSourceType[DragSourceType["ToolPanel"] = 0] = "ToolPanel";
  23423. DragSourceType[DragSourceType["HeaderCell"] = 1] = "HeaderCell";
  23424. DragSourceType[DragSourceType["RowDrag"] = 2] = "RowDrag";
  23425. DragSourceType[DragSourceType["ChartPanel"] = 3] = "ChartPanel";
  23426. })(DragSourceType || (DragSourceType = {}));
  23427. var VerticalDirection;
  23428. (function (VerticalDirection) {
  23429. VerticalDirection[VerticalDirection["Up"] = 0] = "Up";
  23430. VerticalDirection[VerticalDirection["Down"] = 1] = "Down";
  23431. })(VerticalDirection || (VerticalDirection = {}));
  23432. var HorizontalDirection;
  23433. (function (HorizontalDirection) {
  23434. HorizontalDirection[HorizontalDirection["Left"] = 0] = "Left";
  23435. HorizontalDirection[HorizontalDirection["Right"] = 1] = "Right";
  23436. })(HorizontalDirection || (HorizontalDirection = {}));
  23437. var DragAndDropService = /** @class */ (function (_super) {
  23438. __extends(DragAndDropService, _super);
  23439. function DragAndDropService() {
  23440. var _this = _super !== null && _super.apply(this, arguments) || this;
  23441. _this.dragSourceAndParamsList = [];
  23442. _this.dropTargets = [];
  23443. return _this;
  23444. }
  23445. DragAndDropService_1 = DragAndDropService;
  23446. DragAndDropService.prototype.init = function () {
  23447. this.ePinnedIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMovePin', this.gridOptionsWrapper, null);
  23448. this.eHideIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMoveHide', this.gridOptionsWrapper, null);
  23449. this.eMoveIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMoveMove', this.gridOptionsWrapper, null);
  23450. this.eLeftIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMoveLeft', this.gridOptionsWrapper, null);
  23451. this.eRightIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMoveRight', this.gridOptionsWrapper, null);
  23452. this.eGroupIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMoveGroup', this.gridOptionsWrapper, null);
  23453. this.eAggregateIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMoveValue', this.gridOptionsWrapper, null);
  23454. this.ePivotIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('columnMovePivot', this.gridOptionsWrapper, null);
  23455. this.eDropNotAllowedIcon = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIcon('dropNotAllowed', this.gridOptionsWrapper, null);
  23456. };
  23457. DragAndDropService.prototype.addDragSource = function (dragSource, allowTouch) {
  23458. if (allowTouch === void 0) { allowTouch = false; }
  23459. var params = {
  23460. eElement: dragSource.eElement,
  23461. dragStartPixels: dragSource.dragStartPixels,
  23462. onDragStart: this.onDragStart.bind(this, dragSource),
  23463. onDragStop: this.onDragStop.bind(this),
  23464. onDragging: this.onDragging.bind(this)
  23465. };
  23466. this.dragSourceAndParamsList.push({ params: params, dragSource: dragSource });
  23467. this.dragService.addDragSource(params, allowTouch);
  23468. };
  23469. DragAndDropService.prototype.removeDragSource = function (dragSource) {
  23470. var sourceAndParams = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].find(this.dragSourceAndParamsList, function (item) { return item.dragSource === dragSource; });
  23471. if (sourceAndParams) {
  23472. this.dragService.removeDragSource(sourceAndParams.params);
  23473. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].removeFromArray(this.dragSourceAndParamsList, sourceAndParams);
  23474. }
  23475. };
  23476. DragAndDropService.prototype.clearDragSourceParamsList = function () {
  23477. var _this = this;
  23478. this.dragSourceAndParamsList.forEach(function (sourceAndParams) { return _this.dragService.removeDragSource(sourceAndParams.params); });
  23479. this.dragSourceAndParamsList.length = 0;
  23480. };
  23481. DragAndDropService.prototype.nudge = function () {
  23482. if (this.dragging) {
  23483. this.onDragging(this.eventLastTime, true);
  23484. }
  23485. };
  23486. DragAndDropService.prototype.onDragStart = function (dragSource, mouseEvent) {
  23487. this.dragging = true;
  23488. this.dragSource = dragSource;
  23489. this.eventLastTime = mouseEvent;
  23490. this.dragItem = this.dragSource.getDragItem();
  23491. this.lastDropTarget = this.dragSource.dragSourceDropTarget;
  23492. if (this.dragSource.onDragStarted) {
  23493. this.dragSource.onDragStarted();
  23494. }
  23495. this.createGhost();
  23496. };
  23497. DragAndDropService.prototype.onDragStop = function (mouseEvent) {
  23498. this.eventLastTime = null;
  23499. this.dragging = false;
  23500. if (this.dragSource.onDragStopped) {
  23501. this.dragSource.onDragStopped();
  23502. }
  23503. if (this.lastDropTarget && this.lastDropTarget.onDragStop) {
  23504. var draggingEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, null, null, false);
  23505. this.lastDropTarget.onDragStop(draggingEvent);
  23506. }
  23507. this.lastDropTarget = null;
  23508. this.dragItem = null;
  23509. this.removeGhost();
  23510. };
  23511. DragAndDropService.prototype.onDragging = function (mouseEvent, fromNudge) {
  23512. var hDirection = this.getHorizontalDirection(mouseEvent);
  23513. var vDirection = this.getVerticalDirection(mouseEvent);
  23514. this.eventLastTime = mouseEvent;
  23515. this.positionGhost(mouseEvent);
  23516. // check if mouseEvent intersects with any of the drop targets
  23517. var dropTarget = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].find(this.dropTargets, this.isMouseOnDropTarget.bind(this, mouseEvent));
  23518. if (dropTarget !== this.lastDropTarget) {
  23519. this.leaveLastTargetIfExists(mouseEvent, hDirection, vDirection, fromNudge);
  23520. this.enterDragTargetIfExists(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
  23521. this.lastDropTarget = dropTarget;
  23522. }
  23523. else if (dropTarget && dropTarget.onDragging) {
  23524. var draggingEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
  23525. dropTarget.onDragging(draggingEvent);
  23526. }
  23527. };
  23528. DragAndDropService.prototype.enterDragTargetIfExists = function (dropTarget, mouseEvent, hDirection, vDirection, fromNudge) {
  23529. if (!dropTarget) {
  23530. return;
  23531. }
  23532. if (dropTarget.onDragEnter) {
  23533. var dragEnterEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
  23534. dropTarget.onDragEnter(dragEnterEvent);
  23535. }
  23536. this.setGhostIcon(dropTarget.getIconName ? dropTarget.getIconName() : null);
  23537. };
  23538. DragAndDropService.prototype.leaveLastTargetIfExists = function (mouseEvent, hDirection, vDirection, fromNudge) {
  23539. if (!this.lastDropTarget) {
  23540. return;
  23541. }
  23542. if (this.lastDropTarget.onDragLeave) {
  23543. var dragLeaveEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, hDirection, vDirection, fromNudge);
  23544. this.lastDropTarget.onDragLeave(dragLeaveEvent);
  23545. }
  23546. this.setGhostIcon(null);
  23547. };
  23548. DragAndDropService.prototype.getAllContainersFromDropTarget = function (dropTarget) {
  23549. var containers = [dropTarget.getContainer()];
  23550. var secondaryContainers = dropTarget.getSecondaryContainers ? dropTarget.getSecondaryContainers() : null;
  23551. if (secondaryContainers) {
  23552. containers = containers.concat(secondaryContainers);
  23553. }
  23554. return containers;
  23555. };
  23556. // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers
  23557. DragAndDropService.prototype.isMouseOnDropTarget = function (mouseEvent, dropTarget) {
  23558. var mouseOverTarget = false;
  23559. this.getAllContainersFromDropTarget(dropTarget)
  23560. .filter(function (eContainer) { return eContainer; }) // secondary can be missing
  23561. .forEach(function (eContainer) {
  23562. var rect = eContainer.getBoundingClientRect();
  23563. // if element is not visible, then width and height are zero
  23564. if (rect.width === 0 || rect.height === 0) {
  23565. return;
  23566. }
  23567. var horizontalFit = mouseEvent.clientX >= rect.left && mouseEvent.clientX <= rect.right;
  23568. var verticalFit = mouseEvent.clientY >= rect.top && mouseEvent.clientY <= rect.bottom;
  23569. if (horizontalFit && verticalFit) {
  23570. mouseOverTarget = true;
  23571. }
  23572. });
  23573. return mouseOverTarget && dropTarget.isInterestedIn(this.dragSource.type);
  23574. };
  23575. DragAndDropService.prototype.addDropTarget = function (dropTarget) {
  23576. this.dropTargets.push(dropTarget);
  23577. };
  23578. DragAndDropService.prototype.removeDropTarget = function (dropTarget) {
  23579. this.dropTargets = this.dropTargets.filter(function (target) { return target.getContainer() !== dropTarget.getContainer(); });
  23580. };
  23581. DragAndDropService.prototype.hasExternalDropZones = function () {
  23582. return this.dropTargets.some(function (zones) { return zones.external; });
  23583. };
  23584. DragAndDropService.prototype.findExternalZone = function (params) {
  23585. var externalTargets = this.dropTargets.filter(function (target) { return target.external; });
  23586. return _utils__WEBPACK_IMPORTED_MODULE_2__["_"].find(externalTargets, function (zone) { return zone.getContainer() === params.getContainer(); });
  23587. };
  23588. DragAndDropService.prototype.getHorizontalDirection = function (event) {
  23589. var clientX = this.eventLastTime.clientX;
  23590. var eClientX = event.clientX;
  23591. if (clientX === eClientX) {
  23592. return null;
  23593. }
  23594. return clientX > eClientX ? HorizontalDirection.Left : HorizontalDirection.Right;
  23595. };
  23596. DragAndDropService.prototype.getVerticalDirection = function (event) {
  23597. var clientY = this.eventLastTime.clientY;
  23598. var eClientY = event.clientY;
  23599. if (clientY === eClientY) {
  23600. return null;
  23601. }
  23602. return clientY > eClientY ? VerticalDirection.Up : VerticalDirection.Down;
  23603. };
  23604. DragAndDropService.prototype.createDropTargetEvent = function (dropTarget, event, hDirection, vDirection, fromNudge) {
  23605. // localise x and y to the target
  23606. var dropZoneTarget = dropTarget.getContainer();
  23607. var rect = dropZoneTarget.getBoundingClientRect();
  23608. var _a = this, api = _a.gridApi, columnApi = _a.columnApi, dragItem = _a.dragItem, dragSource = _a.dragSource;
  23609. var x = event.clientX - rect.left;
  23610. var y = event.clientY - rect.top;
  23611. return { event: event, x: x, y: y, vDirection: vDirection, hDirection: hDirection, dragSource: dragSource, fromNudge: fromNudge, dragItem: dragItem, api: api, columnApi: columnApi, dropZoneTarget: dropZoneTarget };
  23612. };
  23613. DragAndDropService.prototype.positionGhost = function (event) {
  23614. var ghost = this.eGhost;
  23615. var ghostRect = ghost.getBoundingClientRect();
  23616. var ghostHeight = ghostRect.height;
  23617. // for some reason, without the '-2', it still overlapped by 1 or 2 pixels, which
  23618. // then brought in scrollbars to the browser. no idea why, but putting in -2 here
  23619. // works around it which is good enough for me.
  23620. var browserWidth = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].getBodyWidth() - 2;
  23621. var browserHeight = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].getBodyHeight() - 2;
  23622. var top = event.pageY - (ghostHeight / 2);
  23623. var left = event.pageX - 10;
  23624. var usrDocument = this.gridOptionsWrapper.getDocument();
  23625. var windowScrollY = window.pageYOffset || usrDocument.documentElement.scrollTop;
  23626. var windowScrollX = window.pageXOffset || usrDocument.documentElement.scrollLeft;
  23627. // check ghost is not positioned outside of the browser
  23628. if (browserWidth > 0 && ((left + ghost.clientWidth) > (browserWidth + windowScrollX))) {
  23629. left = browserWidth + windowScrollX - ghost.clientWidth;
  23630. }
  23631. if (left < 0) {
  23632. left = 0;
  23633. }
  23634. if (browserHeight > 0 && ((top + ghost.clientHeight) > (browserHeight + windowScrollY))) {
  23635. top = browserHeight + windowScrollY - ghost.clientHeight;
  23636. }
  23637. if (top < 0) {
  23638. top = 0;
  23639. }
  23640. ghost.style.left = left + "px";
  23641. ghost.style.top = top + "px";
  23642. };
  23643. DragAndDropService.prototype.removeGhost = function () {
  23644. if (this.eGhost && this.eGhostParent) {
  23645. this.eGhostParent.removeChild(this.eGhost);
  23646. }
  23647. this.eGhost = null;
  23648. };
  23649. DragAndDropService.prototype.createGhost = function () {
  23650. this.eGhost = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].loadTemplate(DragAndDropService_1.GHOST_TEMPLATE);
  23651. var theme = this.environment.getTheme().theme;
  23652. if (theme) {
  23653. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.eGhost, theme);
  23654. }
  23655. this.eGhostIcon = this.eGhost.querySelector('.ag-dnd-ghost-icon');
  23656. this.setGhostIcon(null);
  23657. var eText = this.eGhost.querySelector('.ag-dnd-ghost-label');
  23658. var dragItemName = this.dragSource.dragItemName;
  23659. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].isFunction(dragItemName)) {
  23660. dragItemName = dragItemName();
  23661. }
  23662. eText.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].escape(dragItemName);
  23663. this.eGhost.style.height = '25px';
  23664. this.eGhost.style.top = '20px';
  23665. this.eGhost.style.left = '20px';
  23666. var usrDocument = this.gridOptionsWrapper.getDocument();
  23667. this.eGhostParent = usrDocument.querySelector('body');
  23668. if (!this.eGhostParent) {
  23669. console.warn('ag-Grid: could not find document body, it is needed for dragging columns');
  23670. }
  23671. else {
  23672. this.eGhostParent.appendChild(this.eGhost);
  23673. }
  23674. };
  23675. DragAndDropService.prototype.setGhostIcon = function (iconName, shake) {
  23676. if (shake === void 0) { shake = false; }
  23677. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].clearElement(this.eGhostIcon);
  23678. var eIcon;
  23679. if (!iconName) {
  23680. iconName = this.dragSource.defaultIconName || DragAndDropService_1.ICON_NOT_ALLOWED;
  23681. }
  23682. switch (iconName) {
  23683. case DragAndDropService_1.ICON_PINNED:
  23684. eIcon = this.ePinnedIcon;
  23685. break;
  23686. case DragAndDropService_1.ICON_MOVE:
  23687. eIcon = this.eMoveIcon;
  23688. break;
  23689. case DragAndDropService_1.ICON_LEFT:
  23690. eIcon = this.eLeftIcon;
  23691. break;
  23692. case DragAndDropService_1.ICON_RIGHT:
  23693. eIcon = this.eRightIcon;
  23694. break;
  23695. case DragAndDropService_1.ICON_GROUP:
  23696. eIcon = this.eGroupIcon;
  23697. break;
  23698. case DragAndDropService_1.ICON_AGGREGATE:
  23699. eIcon = this.eAggregateIcon;
  23700. break;
  23701. case DragAndDropService_1.ICON_PIVOT:
  23702. eIcon = this.ePivotIcon;
  23703. break;
  23704. case DragAndDropService_1.ICON_NOT_ALLOWED:
  23705. eIcon = this.eDropNotAllowedIcon;
  23706. break;
  23707. case DragAndDropService_1.ICON_HIDE:
  23708. eIcon = this.eHideIcon;
  23709. break;
  23710. }
  23711. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(this.eGhostIcon, 'ag-shake-left-to-right', shake);
  23712. if (eIcon === this.eHideIcon && this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()) {
  23713. return;
  23714. }
  23715. if (eIcon) {
  23716. this.eGhostIcon.appendChild(eIcon);
  23717. }
  23718. };
  23719. var DragAndDropService_1;
  23720. DragAndDropService.ICON_PINNED = 'pinned';
  23721. DragAndDropService.ICON_MOVE = 'move';
  23722. DragAndDropService.ICON_LEFT = 'left';
  23723. DragAndDropService.ICON_RIGHT = 'right';
  23724. DragAndDropService.ICON_GROUP = 'group';
  23725. DragAndDropService.ICON_AGGREGATE = 'aggregate';
  23726. DragAndDropService.ICON_PIVOT = 'pivot';
  23727. DragAndDropService.ICON_NOT_ALLOWED = 'notAllowed';
  23728. DragAndDropService.ICON_HIDE = 'hide';
  23729. DragAndDropService.GHOST_TEMPLATE = "<div class=\"ag-dnd-ghost ag-unselectable\">\n <span class=\"ag-dnd-ghost-icon ag-shake-left-to-right\"></span>\n <div class=\"ag-dnd-ghost-label\"></div>\n </div>";
  23730. __decorate([
  23731. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  23732. ], DragAndDropService.prototype, "gridOptionsWrapper", void 0);
  23733. __decorate([
  23734. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragService')
  23735. ], DragAndDropService.prototype, "dragService", void 0);
  23736. __decorate([
  23737. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('environment')
  23738. ], DragAndDropService.prototype, "environment", void 0);
  23739. __decorate([
  23740. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
  23741. ], DragAndDropService.prototype, "columnApi", void 0);
  23742. __decorate([
  23743. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
  23744. ], DragAndDropService.prototype, "gridApi", void 0);
  23745. __decorate([
  23746. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  23747. ], DragAndDropService.prototype, "init", null);
  23748. __decorate([
  23749. _context_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
  23750. ], DragAndDropService.prototype, "clearDragSourceParamsList", null);
  23751. DragAndDropService = DragAndDropService_1 = __decorate([
  23752. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('dragAndDropService')
  23753. ], DragAndDropService);
  23754. return DragAndDropService;
  23755. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  23756. /***/ }),
  23757. /* 105 */
  23758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23759. "use strict";
  23760. __webpack_require__.r(__webpack_exports__);
  23761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupEditorWrapper", function() { return PopupEditorWrapper; });
  23762. /* harmony import */ var _widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55);
  23763. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  23764. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  23765. /**
  23766. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  23767. * @version v23.2.1
  23768. * @link http://www.ag-grid.com/
  23769. * @license MIT
  23770. */
  23771. var __extends = (undefined && undefined.__extends) || (function () {
  23772. var extendStatics = function (d, b) {
  23773. extendStatics = Object.setPrototypeOf ||
  23774. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  23775. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23776. return extendStatics(d, b);
  23777. };
  23778. return function (d, b) {
  23779. extendStatics(d, b);
  23780. function __() { this.constructor = d; }
  23781. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  23782. };
  23783. })();
  23784. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  23785. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  23786. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  23787. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  23788. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23789. };
  23790. var PopupEditorWrapper = /** @class */ (function (_super) {
  23791. __extends(PopupEditorWrapper, _super);
  23792. function PopupEditorWrapper(cellEditor) {
  23793. var _this = _super.call(this, "<div class=\"ag-popup-editor\" tabindex=\"-1\"/>") || this;
  23794. _this.getGuiCalledOnChild = false;
  23795. _this.cellEditor = cellEditor;
  23796. return _this;
  23797. }
  23798. PopupEditorWrapper.prototype.onKeyDown = function (event) {
  23799. if (!_utils__WEBPACK_IMPORTED_MODULE_2__["_"].isUserSuppressingKeyboardEvent(this.gridOptionsWrapper, event, this.params.node, this.params.column, true)) {
  23800. this.params.onKeyDown(event);
  23801. }
  23802. };
  23803. PopupEditorWrapper.prototype.getGui = function () {
  23804. // we call getGui() on child here (rather than in the constructor)
  23805. // as we should wait for 'init' to be called on child first.
  23806. if (!this.getGuiCalledOnChild) {
  23807. this.appendChild(this.cellEditor.getGui());
  23808. this.getGuiCalledOnChild = true;
  23809. }
  23810. return _super.prototype.getGui.call(this);
  23811. };
  23812. PopupEditorWrapper.prototype.init = function (params) {
  23813. var _this = this;
  23814. this.params = params;
  23815. this.gridOptionsWrapper.setDomData(this.getGui(), PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER, true);
  23816. this.addDestroyFunc(function () { return _this.destroyBean(_this.cellEditor); });
  23817. this.addManagedListener(
  23818. // this needs to be 'super' and not 'this' as if we call 'this',
  23819. // it ends up called 'getGui()' on the child before 'init' was called,
  23820. // which is not good
  23821. _super.prototype.getGui.call(this), 'keydown', this.onKeyDown.bind(this));
  23822. };
  23823. PopupEditorWrapper.prototype.afterGuiAttached = function () {
  23824. if (this.cellEditor.afterGuiAttached) {
  23825. this.cellEditor.afterGuiAttached();
  23826. }
  23827. };
  23828. PopupEditorWrapper.prototype.getValue = function () {
  23829. return this.cellEditor.getValue();
  23830. };
  23831. PopupEditorWrapper.prototype.isCancelBeforeStart = function () {
  23832. if (this.cellEditor.isCancelBeforeStart) {
  23833. return this.cellEditor.isCancelBeforeStart();
  23834. }
  23835. };
  23836. PopupEditorWrapper.prototype.isCancelAfterEnd = function () {
  23837. if (this.cellEditor.isCancelAfterEnd) {
  23838. return this.cellEditor.isCancelAfterEnd();
  23839. }
  23840. };
  23841. PopupEditorWrapper.prototype.getPopupPosition = function () {
  23842. if (this.cellEditor.getPopupPosition) {
  23843. return this.cellEditor.getPopupPosition();
  23844. }
  23845. };
  23846. PopupEditorWrapper.prototype.focusIn = function () {
  23847. if (this.cellEditor.focusIn) {
  23848. this.cellEditor.focusIn();
  23849. }
  23850. };
  23851. PopupEditorWrapper.prototype.focusOut = function () {
  23852. if (this.cellEditor.focusOut) {
  23853. this.cellEditor.focusOut();
  23854. }
  23855. };
  23856. PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER = 'popupEditorWrapper';
  23857. __decorate([
  23858. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  23859. ], PopupEditorWrapper.prototype, "gridOptionsWrapper", void 0);
  23860. return PopupEditorWrapper;
  23861. }(_widgets_popupComponent__WEBPACK_IMPORTED_MODULE_0__["PopupComponent"]));
  23862. /***/ }),
  23863. /* 106 */
  23864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23865. "use strict";
  23866. __webpack_require__.r(__webpack_exports__);
  23867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DndSourceComp", function() { return DndSourceComp; });
  23868. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  23869. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  23870. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  23871. /**
  23872. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  23873. * @version v23.2.1
  23874. * @link http://www.ag-grid.com/
  23875. * @license MIT
  23876. */
  23877. var __extends = (undefined && undefined.__extends) || (function () {
  23878. var extendStatics = function (d, b) {
  23879. extendStatics = Object.setPrototypeOf ||
  23880. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  23881. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23882. return extendStatics(d, b);
  23883. };
  23884. return function (d, b) {
  23885. extendStatics(d, b);
  23886. function __() { this.constructor = d; }
  23887. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  23888. };
  23889. })();
  23890. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  23891. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  23892. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  23893. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  23894. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23895. };
  23896. var DndSourceComp = /** @class */ (function (_super) {
  23897. __extends(DndSourceComp, _super);
  23898. function DndSourceComp(rowNode, column, cellValue, beans, eCell) {
  23899. var _this = _super.call(this, "<div class=\"ag-drag-handle ag-row-drag\" draggable=\"true\"></div>") || this;
  23900. _this.rowNode = rowNode;
  23901. _this.column = column;
  23902. _this.cellValue = cellValue;
  23903. _this.beans = beans;
  23904. _this.eCell = eCell;
  23905. return _this;
  23906. }
  23907. DndSourceComp.prototype.postConstruct = function () {
  23908. var eGui = this.getGui();
  23909. eGui.appendChild(_utils__WEBPACK_IMPORTED_MODULE_2__["_"].createIconNoSpan('rowDrag', this.beans.gridOptionsWrapper, null));
  23910. this.addDragSource();
  23911. this.checkVisibility();
  23912. };
  23913. DndSourceComp.prototype.addDragSource = function () {
  23914. this.addGuiEventListener('dragstart', this.onDragStart.bind(this));
  23915. };
  23916. DndSourceComp.prototype.onDragStart = function (dragEvent) {
  23917. var _this = this;
  23918. var providedOnRowDrag = this.column.getColDef().dndSourceOnRowDrag;
  23919. var isIE = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].isBrowserIE();
  23920. if (!isIE) {
  23921. dragEvent.dataTransfer.setDragImage(this.eCell, 0, 0);
  23922. }
  23923. // default behaviour is to convert data to json and set into drag component
  23924. var defaultOnRowDrag = function () {
  23925. try {
  23926. var jsonData = JSON.stringify(_this.rowNode.data);
  23927. if (isIE) {
  23928. dragEvent.dataTransfer.setData('text', jsonData);
  23929. }
  23930. else {
  23931. dragEvent.dataTransfer.setData('application/json', jsonData);
  23932. dragEvent.dataTransfer.setData('text/plain', jsonData);
  23933. }
  23934. }
  23935. catch (e) {
  23936. // if we cannot convert the data to json, then we do not set the type
  23937. }
  23938. };
  23939. if (providedOnRowDrag) {
  23940. providedOnRowDrag({ rowNode: this.rowNode, dragEvent: dragEvent });
  23941. }
  23942. else {
  23943. defaultOnRowDrag();
  23944. }
  23945. };
  23946. DndSourceComp.prototype.checkVisibility = function () {
  23947. var visible = this.column.isDndSource(this.rowNode);
  23948. this.setDisplayed(visible);
  23949. };
  23950. __decorate([
  23951. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  23952. ], DndSourceComp.prototype, "postConstruct", null);
  23953. return DndSourceComp;
  23954. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  23955. /***/ }),
  23956. /* 107 */
  23957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23958. "use strict";
  23959. __webpack_require__.r(__webpack_exports__);
  23960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TooltipFeature", function() { return TooltipFeature; });
  23961. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  23962. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  23963. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  23964. /**
  23965. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  23966. * @version v23.2.1
  23967. * @link http://www.ag-grid.com/
  23968. * @license MIT
  23969. */
  23970. var __extends = (undefined && undefined.__extends) || (function () {
  23971. var extendStatics = function (d, b) {
  23972. extendStatics = Object.setPrototypeOf ||
  23973. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  23974. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  23975. return extendStatics(d, b);
  23976. };
  23977. return function (d, b) {
  23978. extendStatics(d, b);
  23979. function __() { this.constructor = d; }
  23980. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  23981. };
  23982. })();
  23983. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  23984. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  23985. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  23986. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  23987. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23988. };
  23989. var TooltipStates;
  23990. (function (TooltipStates) {
  23991. TooltipStates[TooltipStates["NOTHING"] = 0] = "NOTHING";
  23992. TooltipStates[TooltipStates["WAITING_TO_SHOW"] = 1] = "WAITING_TO_SHOW";
  23993. TooltipStates[TooltipStates["SHOWING"] = 2] = "SHOWING";
  23994. })(TooltipStates || (TooltipStates = {}));
  23995. var TooltipFeature = /** @class */ (function (_super) {
  23996. __extends(TooltipFeature, _super);
  23997. function TooltipFeature(parentComp, location) {
  23998. var _this = _super.call(this) || this;
  23999. _this.DEFAULT_HIDE_TOOLTIP_TIMEOUT = 10000;
  24000. _this.SHOW_QUICK_TOOLTIP_DIFF = 1000;
  24001. _this.FADE_OUT_TOOLTIP_TIMEOUT = 1000;
  24002. _this.state = TooltipStates.NOTHING;
  24003. // when showing the tooltip, we need to make sure it's the most recent instance we request, as due to
  24004. // async we could request two tooltips before the first instance returns, in which case we should
  24005. // disregard the second instance.
  24006. _this.tooltipInstanceCount = 0;
  24007. _this.tooltipMouseTrack = false;
  24008. _this.parentComp = parentComp;
  24009. _this.location = location;
  24010. return _this;
  24011. }
  24012. TooltipFeature.prototype.postConstruct = function () {
  24013. this.tooltipShowDelay = this.gridOptionsWrapper.getTooltipShowDelay() || 2000;
  24014. this.tooltipMouseTrack = this.gridOptionsWrapper.isTooltipMouseTrack();
  24015. var el = this.parentComp.getGui();
  24016. this.addManagedListener(el, 'mouseenter', this.onMouseEnter.bind(this));
  24017. this.addManagedListener(el, 'mouseleave', this.onMouseLeave.bind(this));
  24018. this.addManagedListener(el, 'mousemove', this.onMouseMove.bind(this));
  24019. this.addManagedListener(el, 'mousedown', this.onMouseDown.bind(this));
  24020. };
  24021. TooltipFeature.prototype.destroy = function () {
  24022. // if this component gets destroyed while tooltip is showing, need to make sure
  24023. // we don't end with no mouseLeave event resulting in zombie tooltip
  24024. this.setToDoNothing();
  24025. _super.prototype.destroy.call(this);
  24026. };
  24027. TooltipFeature.prototype.onMouseEnter = function (e) {
  24028. // if another tooltip was hidden very recently, we only wait 200ms to show, not the normal waiting time
  24029. var delay = this.isLastTooltipHiddenRecently() ? 200 : this.tooltipShowDelay;
  24030. this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);
  24031. this.lastMouseEvent = e;
  24032. this.state = TooltipStates.WAITING_TO_SHOW;
  24033. };
  24034. TooltipFeature.prototype.onMouseLeave = function () {
  24035. this.setToDoNothing();
  24036. };
  24037. TooltipFeature.prototype.setToDoNothing = function () {
  24038. if (this.state === TooltipStates.SHOWING) {
  24039. this.hideTooltip();
  24040. }
  24041. this.clearTimeouts();
  24042. this.state = TooltipStates.NOTHING;
  24043. };
  24044. TooltipFeature.prototype.onMouseMove = function (e) {
  24045. // there is a delay from the time we mouseOver a component and the time the
  24046. // tooltip is displayed, so we need to track mousemove to be able to correctly
  24047. // position the tooltip when showTooltip is called.
  24048. this.lastMouseEvent = e;
  24049. if (this.tooltipMouseTrack &&
  24050. this.state === TooltipStates.SHOWING &&
  24051. this.tooltipComp) {
  24052. this.positionTooltipUnderLastMouseEvent();
  24053. }
  24054. };
  24055. TooltipFeature.prototype.onMouseDown = function () {
  24056. this.setToDoNothing();
  24057. };
  24058. TooltipFeature.prototype.hideTooltip = function () {
  24059. // check if comp exists - due to async, although we asked for
  24060. // one, the instance may not be back yet
  24061. if (this.tooltipComp) {
  24062. this.destroyTooltipComp();
  24063. TooltipFeature.lastTooltipHideTime = new Date().getTime();
  24064. }
  24065. this.state = TooltipStates.NOTHING;
  24066. };
  24067. TooltipFeature.prototype.destroyTooltipComp = function () {
  24068. var _this = this;
  24069. // add class to fade out the tooltip
  24070. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.tooltipComp.getGui(), 'ag-tooltip-hiding');
  24071. // make local copies of these variables, as we use them in the async function below,
  24072. // and we clear then to 'undefined' later, so need to take a copy before they are undefined.
  24073. var tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;
  24074. var tooltipComp = this.tooltipComp;
  24075. window.setTimeout(function () {
  24076. tooltipPopupDestroyFunc();
  24077. _this.getContext().destroyBean(tooltipComp);
  24078. }, this.FADE_OUT_TOOLTIP_TIMEOUT);
  24079. this.tooltipPopupDestroyFunc = undefined;
  24080. this.tooltipComp = undefined;
  24081. };
  24082. TooltipFeature.prototype.isLastTooltipHiddenRecently = function () {
  24083. // return true if <1000ms since last time we hid a tooltip
  24084. var now = new Date().getTime();
  24085. var then = TooltipFeature.lastTooltipHideTime;
  24086. return (now - then) < this.SHOW_QUICK_TOOLTIP_DIFF;
  24087. };
  24088. TooltipFeature.prototype.showTooltip = function () {
  24089. var tooltipText = this.parentComp.getTooltipText();
  24090. if (!tooltipText) {
  24091. this.setToDoNothing();
  24092. return;
  24093. }
  24094. this.state = TooltipStates.SHOWING;
  24095. this.tooltipInstanceCount++;
  24096. var params = {
  24097. location: this.location,
  24098. api: this.gridApi,
  24099. columnApi: this.columnApi,
  24100. colDef: this.parentComp.getComponentHolder(),
  24101. column: this.parentComp.getColumn,
  24102. context: this.gridOptionsWrapper.getContext(),
  24103. rowIndex: this.parentComp.getCellPosition && this.parentComp.getCellPosition().rowIndex,
  24104. value: tooltipText
  24105. };
  24106. // we pass in tooltipInstanceCount so the callback knows what the count was when
  24107. // we requested the tooltip, so if another tooltip was requested in the mean time
  24108. // we disregard it
  24109. var callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);
  24110. this.userComponentFactory.newTooltipComponent(params).then(callback);
  24111. };
  24112. TooltipFeature.prototype.newTooltipComponentCallback = function (tooltipInstanceCopy, tooltipComp) {
  24113. var compNoLongerNeeded = this.state !== TooltipStates.SHOWING || this.tooltipInstanceCount !== tooltipInstanceCopy;
  24114. if (compNoLongerNeeded) {
  24115. this.getContext().destroyBean(tooltipComp);
  24116. return;
  24117. }
  24118. var eGui = tooltipComp.getGui();
  24119. this.tooltipComp = tooltipComp;
  24120. if (!_utils__WEBPACK_IMPORTED_MODULE_2__["_"].containsClass(eGui, 'ag-tooltip')) {
  24121. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(eGui, 'ag-tooltip-custom');
  24122. }
  24123. this.tooltipPopupDestroyFunc = this.popupService.addPopup(false, eGui, false);
  24124. this.positionTooltipUnderLastMouseEvent();
  24125. this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.DEFAULT_HIDE_TOOLTIP_TIMEOUT);
  24126. };
  24127. TooltipFeature.prototype.positionTooltipUnderLastMouseEvent = function () {
  24128. this.popupService.positionPopupUnderMouseEvent({
  24129. type: 'tooltip',
  24130. mouseEvent: this.lastMouseEvent,
  24131. ePopup: this.tooltipComp.getGui(),
  24132. nudgeY: 18
  24133. });
  24134. };
  24135. TooltipFeature.prototype.clearTimeouts = function () {
  24136. if (this.showTooltipTimeoutId) {
  24137. window.clearTimeout(this.showTooltipTimeoutId);
  24138. this.showTooltipTimeoutId = undefined;
  24139. }
  24140. if (this.hideTooltipTimeoutId) {
  24141. window.clearTimeout(this.hideTooltipTimeoutId);
  24142. this.hideTooltipTimeoutId = undefined;
  24143. }
  24144. };
  24145. __decorate([
  24146. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
  24147. ], TooltipFeature.prototype, "popupService", void 0);
  24148. __decorate([
  24149. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
  24150. ], TooltipFeature.prototype, "userComponentFactory", void 0);
  24151. __decorate([
  24152. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  24153. ], TooltipFeature.prototype, "columnApi", void 0);
  24154. __decorate([
  24155. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  24156. ], TooltipFeature.prototype, "gridApi", void 0);
  24157. __decorate([
  24158. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  24159. ], TooltipFeature.prototype, "gridOptionsWrapper", void 0);
  24160. __decorate([
  24161. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  24162. ], TooltipFeature.prototype, "postConstruct", null);
  24163. return TooltipFeature;
  24164. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  24165. /***/ }),
  24166. /* 108 */
  24167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24168. "use strict";
  24169. __webpack_require__.r(__webpack_exports__);
  24170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRootComp", function() { return HeaderRootComp; });
  24171. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
  24172. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  24173. /* harmony import */ var _headerContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(109);
  24174. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  24175. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57);
  24176. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25);
  24177. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(12);
  24178. /* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(117);
  24179. /* harmony import */ var _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(124);
  24180. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7);
  24181. /**
  24182. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  24183. * @version v23.2.1
  24184. * @link http://www.ag-grid.com/
  24185. * @license MIT
  24186. */
  24187. var __extends = (undefined && undefined.__extends) || (function () {
  24188. var extendStatics = function (d, b) {
  24189. extendStatics = Object.setPrototypeOf ||
  24190. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  24191. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  24192. return extendStatics(d, b);
  24193. };
  24194. return function (d, b) {
  24195. extendStatics(d, b);
  24196. function __() { this.constructor = d; }
  24197. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  24198. };
  24199. })();
  24200. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  24201. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  24202. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  24203. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  24204. return c > 3 && r && Object.defineProperty(target, key, r), r;
  24205. };
  24206. var HeaderRootComp = /** @class */ (function (_super) {
  24207. __extends(HeaderRootComp, _super);
  24208. function HeaderRootComp() {
  24209. var _this = _super.call(this, HeaderRootComp.TEMPLATE) || this;
  24210. _this.headerContainers = new Map();
  24211. return _this;
  24212. }
  24213. HeaderRootComp.prototype.postConstruct = function () {
  24214. var _this = this;
  24215. _super.prototype.postConstruct.call(this);
  24216. this.printLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].DOM_LAYOUT_PRINT;
  24217. this.gridApi.registerHeaderRootComp(this);
  24218. this.autoWidthCalculator.registerHeaderRootComp(this);
  24219. this.registerHeaderContainer(new _headerContainer__WEBPACK_IMPORTED_MODULE_2__["HeaderContainer"](this.eHeaderContainer, this.eHeaderViewport, null), 'center');
  24220. this.registerHeaderContainer(new _headerContainer__WEBPACK_IMPORTED_MODULE_2__["HeaderContainer"](this.ePinnedLeftHeader, null, _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].PINNED_LEFT), 'left');
  24221. this.registerHeaderContainer(new _headerContainer__WEBPACK_IMPORTED_MODULE_2__["HeaderContainer"](this.ePinnedRightHeader, null, _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].PINNED_RIGHT), 'right');
  24222. this.headerContainers.forEach(function (container) { return _this.createManagedBean(container); });
  24223. this.headerNavigationService.registerHeaderRoot(this);
  24224. // shotgun way to get labels to change, eg from sum(amount) to avg(amount)
  24225. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_VALUE_CHANGED, this.refreshHeader.bind(this));
  24226. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.onDomLayoutChanged.bind(this));
  24227. // for setting ag-pivot-on / ag-pivot-off CSS classes
  24228. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onPivotModeChanged.bind(this));
  24229. this.onPivotModeChanged();
  24230. this.addPreventHeaderScroll();
  24231. if (this.columnController.isReady()) {
  24232. this.refreshHeader();
  24233. }
  24234. };
  24235. HeaderRootComp.prototype.registerGridComp = function (gridPanel) {
  24236. this.gridPanel = gridPanel;
  24237. this.headerContainers.forEach(function (c) { return c.setupDragAndDrop(gridPanel); });
  24238. };
  24239. HeaderRootComp.prototype.registerHeaderContainer = function (headerContainer, type) {
  24240. this.headerContainers.set(type, headerContainer);
  24241. };
  24242. HeaderRootComp.prototype.onTabKeyDown = function (e) {
  24243. var isRtl = this.gridOptionsWrapper.isEnableRtl();
  24244. var direction = e.shiftKey !== isRtl
  24245. ? _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].LEFT
  24246. : _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].RIGHT;
  24247. if (this.headerNavigationService.navigateHorizontally(direction, true) ||
  24248. this.focusController.focusNextGridCoreContainer(e.shiftKey)) {
  24249. e.preventDefault();
  24250. }
  24251. };
  24252. HeaderRootComp.prototype.handleKeyDown = function (e) {
  24253. var direction;
  24254. switch (e.keyCode) {
  24255. case _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].KEY_LEFT:
  24256. direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].LEFT;
  24257. case _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].KEY_RIGHT:
  24258. if (!_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(direction)) {
  24259. direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].RIGHT;
  24260. }
  24261. this.headerNavigationService.navigateHorizontally(direction);
  24262. break;
  24263. case _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].KEY_UP:
  24264. direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].UP;
  24265. case _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].KEY_DOWN:
  24266. if (!_utils__WEBPACK_IMPORTED_MODULE_9__["_"].exists(direction)) {
  24267. direction = _header_headerNavigationService__WEBPACK_IMPORTED_MODULE_8__["HeaderNavigationDirection"].DOWN;
  24268. }
  24269. if (this.headerNavigationService.navigateVertically(direction)) {
  24270. e.preventDefault();
  24271. }
  24272. break;
  24273. default:
  24274. return;
  24275. }
  24276. };
  24277. HeaderRootComp.prototype.onFocusOut = function (e) {
  24278. var relatedTarget = e.relatedTarget;
  24279. var eGui = this.getGui();
  24280. if (!relatedTarget && eGui.contains(document.activeElement)) {
  24281. return;
  24282. }
  24283. if (!eGui.contains(relatedTarget)) {
  24284. this.focusController.clearFocusedHeader();
  24285. }
  24286. };
  24287. HeaderRootComp.prototype.onDomLayoutChanged = function () {
  24288. var newValue = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].DOM_LAYOUT_PRINT;
  24289. if (this.printLayout !== newValue) {
  24290. this.printLayout = newValue;
  24291. this.refreshHeader();
  24292. }
  24293. };
  24294. HeaderRootComp.prototype.setHorizontalScroll = function (offset) {
  24295. this.eHeaderContainer.style.transform = "translateX(" + offset + "px)";
  24296. };
  24297. HeaderRootComp.prototype.forEachHeaderElement = function (callback) {
  24298. this.headerContainers.forEach(function (childContainer) { return childContainer.forEachHeaderElement(callback); });
  24299. };
  24300. HeaderRootComp.prototype.refreshHeader = function () {
  24301. this.headerContainers.forEach(function (container) { return container.refresh(); });
  24302. };
  24303. HeaderRootComp.prototype.onPivotModeChanged = function () {
  24304. var pivotMode = this.columnController.isPivotMode();
  24305. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["addOrRemoveCssClass"])(this.getGui(), 'ag-pivot-on', pivotMode);
  24306. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["addOrRemoveCssClass"])(this.getGui(), 'ag-pivot-off', !pivotMode);
  24307. };
  24308. HeaderRootComp.prototype.setHeight = function (height) {
  24309. // one extra pixel is needed here to account for the
  24310. // height of the border
  24311. var px = height + 1 + "px";
  24312. this.getGui().style.height = px;
  24313. this.getGui().style.minHeight = px;
  24314. };
  24315. // if the user is in floating filter and hits tab a few times, the header can
  24316. // end up scrolling to show items off the screen, leaving the grid and header
  24317. // and the grid columns no longer in sync.
  24318. HeaderRootComp.prototype.addPreventHeaderScroll = function () {
  24319. var _this = this;
  24320. this.addManagedListener(this.eHeaderViewport, 'scroll', function () {
  24321. // if the header scrolls, the header will be out of sync. so we reset the
  24322. // header scroll, and then scroll the body, which will in turn set the offset
  24323. // on the header, giving the impression that the header scrolled as expected.
  24324. var scrollLeft = _this.eHeaderViewport.scrollLeft;
  24325. if (scrollLeft !== 0) {
  24326. _this.gridPanel.scrollHorizontally(scrollLeft);
  24327. _this.eHeaderViewport.scrollLeft = 0;
  24328. }
  24329. });
  24330. };
  24331. HeaderRootComp.prototype.getHeaderContainers = function () {
  24332. return this.headerContainers;
  24333. };
  24334. HeaderRootComp.prototype.setHeaderContainerWidth = function (width) {
  24335. this.eHeaderContainer.style.width = width + "px";
  24336. };
  24337. HeaderRootComp.prototype.setLeftVisible = function (visible) {
  24338. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.ePinnedLeftHeader, visible);
  24339. };
  24340. HeaderRootComp.prototype.setRightVisible = function (visible) {
  24341. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_6__["setDisplayed"])(this.ePinnedRightHeader, visible);
  24342. };
  24343. HeaderRootComp.TEMPLATE = "<div class=\"ag-header\" role=\"presentation\">\n <div class=\"ag-pinned-left-header\" ref=\"ePinnedLeftHeader\" role=\"presentation\"></div>\n <div class=\"ag-header-viewport\" ref=\"eHeaderViewport\" role=\"presentation\">\n <div class=\"ag-header-container\" ref=\"eHeaderContainer\" role=\"rowgroup\"></div>\n </div>\n <div class=\"ag-pinned-right-header\" ref=\"ePinnedRightHeader\" role=\"presentation\"></div>\n </div>";
  24344. __decorate([
  24345. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('ePinnedLeftHeader')
  24346. ], HeaderRootComp.prototype, "ePinnedLeftHeader", void 0);
  24347. __decorate([
  24348. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('ePinnedRightHeader')
  24349. ], HeaderRootComp.prototype, "ePinnedRightHeader", void 0);
  24350. __decorate([
  24351. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eHeaderContainer')
  24352. ], HeaderRootComp.prototype, "eHeaderContainer", void 0);
  24353. __decorate([
  24354. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_4__["RefSelector"])('eHeaderViewport')
  24355. ], HeaderRootComp.prototype, "eHeaderViewport", void 0);
  24356. __decorate([
  24357. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  24358. ], HeaderRootComp.prototype, "gridOptionsWrapper", void 0);
  24359. __decorate([
  24360. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  24361. ], HeaderRootComp.prototype, "columnController", void 0);
  24362. __decorate([
  24363. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
  24364. ], HeaderRootComp.prototype, "gridApi", void 0);
  24365. __decorate([
  24366. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('autoWidthCalculator')
  24367. ], HeaderRootComp.prototype, "autoWidthCalculator", void 0);
  24368. __decorate([
  24369. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('headerNavigationService')
  24370. ], HeaderRootComp.prototype, "headerNavigationService", void 0);
  24371. return HeaderRootComp;
  24372. }(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_7__["ManagedFocusComponent"]));
  24373. /***/ }),
  24374. /* 109 */
  24375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24376. "use strict";
  24377. __webpack_require__.r(__webpack_exports__);
  24378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderContainer", function() { return HeaderContainer; });
  24379. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  24380. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  24381. /* harmony import */ var _headerRowComp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(110);
  24382. /* harmony import */ var _bodyDropTarget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(121);
  24383. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
  24384. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);
  24385. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(41);
  24386. /**
  24387. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  24388. * @version v23.2.1
  24389. * @link http://www.ag-grid.com/
  24390. * @license MIT
  24391. */
  24392. var __extends = (undefined && undefined.__extends) || (function () {
  24393. var extendStatics = function (d, b) {
  24394. extendStatics = Object.setPrototypeOf ||
  24395. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  24396. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  24397. return extendStatics(d, b);
  24398. };
  24399. return function (d, b) {
  24400. extendStatics(d, b);
  24401. function __() { this.constructor = d; }
  24402. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  24403. };
  24404. })();
  24405. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  24406. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  24407. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  24408. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  24409. return c > 3 && r && Object.defineProperty(target, key, r), r;
  24410. };
  24411. var HeaderContainer = /** @class */ (function (_super) {
  24412. __extends(HeaderContainer, _super);
  24413. function HeaderContainer(eContainer, eViewport, pinned) {
  24414. var _this = _super.call(this) || this;
  24415. _this.headerRowComps = [];
  24416. _this.eContainer = eContainer;
  24417. _this.pinned = pinned;
  24418. _this.eViewport = eViewport;
  24419. return _this;
  24420. }
  24421. HeaderContainer.prototype.forEachHeaderElement = function (callback) {
  24422. this.headerRowComps.forEach(function (headerRowComp) { return headerRowComp.forEachHeaderElement(callback); });
  24423. };
  24424. HeaderContainer.prototype.init = function () {
  24425. this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
  24426. // if value changes, then if not pivoting, we at least need to change the label eg from sum() to avg(),
  24427. // if pivoting, then the columns have changed
  24428. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_VALUE_CHANGED, this.onColumnValueChanged.bind(this)),
  24429. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this)),
  24430. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this)),
  24431. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this)),
  24432. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this)),
  24433. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
  24434. };
  24435. // if row group changes, that means we may need to add aggFuncs to the column headers,
  24436. // if the grid goes from no aggregation (ie no grouping) to grouping
  24437. HeaderContainer.prototype.onColumnRowGroupChanged = function () {
  24438. this.onGridColumnsChanged();
  24439. };
  24440. // if the agg func of a column changes, then we may need to update the agg func in columns header
  24441. HeaderContainer.prototype.onColumnValueChanged = function () {
  24442. this.onGridColumnsChanged();
  24443. };
  24444. HeaderContainer.prototype.onColumnResized = function () {
  24445. this.setWidthOfPinnedContainer();
  24446. };
  24447. HeaderContainer.prototype.onDisplayedColumnsChanged = function () {
  24448. this.setWidthOfPinnedContainer();
  24449. };
  24450. HeaderContainer.prototype.onScrollVisibilityChanged = function () {
  24451. this.setWidthOfPinnedContainer();
  24452. };
  24453. HeaderContainer.prototype.setWidthOfPinnedContainer = function () {
  24454. var pinningLeft = this.pinned === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT;
  24455. var pinningRight = this.pinned === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT;
  24456. var controller = this.columnController;
  24457. var isRtl = this.gridOptionsWrapper.isEnableRtl();
  24458. if (pinningLeft || pinningRight) {
  24459. // size to fit all columns
  24460. var width = controller[pinningLeft ? 'getPinnedLeftContainerWidth' : 'getPinnedRightContainerWidth']();
  24461. // if there is a scroll showing (and taking up space, so Windows, and not iOS)
  24462. // in the body, then we add extra space to keep header aligned with the body,
  24463. // as body width fits the cols and the scrollbar
  24464. var addPaddingForScrollbar = this.scrollVisibleService.isVerticalScrollShowing() && ((isRtl && pinningLeft) || (!isRtl && pinningRight));
  24465. if (addPaddingForScrollbar) {
  24466. width += this.scrollWidth;
  24467. }
  24468. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["setFixedWidth"])(this.eContainer, width);
  24469. }
  24470. };
  24471. HeaderContainer.prototype.getRowComps = function () {
  24472. return this.headerRowComps;
  24473. };
  24474. // grid cols have changed - this also means the number of rows in the header can have
  24475. // changed. so we remove all the old rows and insert new ones for a complete refresh
  24476. HeaderContainer.prototype.onGridColumnsChanged = function () {
  24477. this.removeAndCreateAllRowComps();
  24478. };
  24479. HeaderContainer.prototype.removeAndCreateAllRowComps = function () {
  24480. this.removeHeaderRowComps();
  24481. this.createHeaderRowComps();
  24482. };
  24483. // we expose this for gridOptions.api.refreshHeader() to call
  24484. HeaderContainer.prototype.refresh = function () {
  24485. this.removeAndCreateAllRowComps();
  24486. };
  24487. HeaderContainer.prototype.setupDragAndDrop = function (gridComp) {
  24488. var dropContainer = this.eViewport ? this.eViewport : this.eContainer;
  24489. var bodyDropTarget = new _bodyDropTarget__WEBPACK_IMPORTED_MODULE_3__["BodyDropTarget"](this.pinned, dropContainer);
  24490. this.createManagedBean(bodyDropTarget);
  24491. bodyDropTarget.registerGridComp(gridComp);
  24492. };
  24493. HeaderContainer.prototype.removeHeaderRowComps = function () {
  24494. var _this = this;
  24495. this.headerRowComps.forEach(function (headerRowComp) { return _this.destroyBean(headerRowComp); });
  24496. this.headerRowComps.length = 0;
  24497. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_5__["clearElement"])(this.eContainer);
  24498. };
  24499. HeaderContainer.prototype.createHeaderRowComps = function () {
  24500. // if we are displaying header groups, then we have many rows here.
  24501. // go through each row of the header, one by one.
  24502. var rowCount = this.columnController.getHeaderRowCount();
  24503. for (var dept = 0; dept < rowCount; dept++) {
  24504. var groupRow = dept !== (rowCount - 1);
  24505. var type = groupRow ? _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowType"].COLUMN_GROUP : _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowType"].COLUMN;
  24506. var headerRowComp = new _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowComp"](dept, type, this.pinned, this.dropTarget);
  24507. this.createBean(headerRowComp);
  24508. this.headerRowComps.push(headerRowComp);
  24509. headerRowComp.setRowIndex(this.headerRowComps.length - 1);
  24510. this.eContainer.appendChild(headerRowComp.getGui());
  24511. }
  24512. if (!this.columnController.isPivotMode() && this.columnController.hasFloatingFilters()) {
  24513. var headerRowComp = new _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowComp"](rowCount, _headerRowComp__WEBPACK_IMPORTED_MODULE_2__["HeaderRowType"].FLOATING_FILTER, this.pinned, this.dropTarget);
  24514. this.createBean(headerRowComp);
  24515. this.headerRowComps.push(headerRowComp);
  24516. headerRowComp.setRowIndex(this.headerRowComps.length - 1);
  24517. this.eContainer.appendChild(headerRowComp.getGui());
  24518. }
  24519. };
  24520. __decorate([
  24521. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  24522. ], HeaderContainer.prototype, "gridOptionsWrapper", void 0);
  24523. __decorate([
  24524. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  24525. ], HeaderContainer.prototype, "columnController", void 0);
  24526. __decorate([
  24527. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('scrollVisibleService')
  24528. ], HeaderContainer.prototype, "scrollVisibleService", void 0);
  24529. __decorate([
  24530. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  24531. ], HeaderContainer.prototype, "init", null);
  24532. __decorate([
  24533. _context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
  24534. ], HeaderContainer.prototype, "removeHeaderRowComps", null);
  24535. return HeaderContainer;
  24536. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_6__["BeanStub"]));
  24537. /***/ }),
  24538. /* 110 */
  24539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24540. "use strict";
  24541. __webpack_require__.r(__webpack_exports__);
  24542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRowType", function() { return HeaderRowType; });
  24543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderRowComp", function() { return HeaderRowComp; });
  24544. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  24545. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  24546. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50);
  24547. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  24548. /* harmony import */ var _header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(111);
  24549. /* harmony import */ var _headerGroup_headerGroupWrapperComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(118);
  24550. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(25);
  24551. /* harmony import */ var _filter_floating_floatingFilterWrapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(119);
  24552. /* harmony import */ var _utils_browser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13);
  24553. /* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(14);
  24554. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17);
  24555. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(12);
  24556. /**
  24557. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  24558. * @version v23.2.1
  24559. * @link http://www.ag-grid.com/
  24560. * @license MIT
  24561. */
  24562. var __extends = (undefined && undefined.__extends) || (function () {
  24563. var extendStatics = function (d, b) {
  24564. extendStatics = Object.setPrototypeOf ||
  24565. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  24566. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  24567. return extendStatics(d, b);
  24568. };
  24569. return function (d, b) {
  24570. extendStatics(d, b);
  24571. function __() { this.constructor = d; }
  24572. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  24573. };
  24574. })();
  24575. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  24576. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  24577. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  24578. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  24579. return c > 3 && r && Object.defineProperty(target, key, r), r;
  24580. };
  24581. var HeaderRowType;
  24582. (function (HeaderRowType) {
  24583. HeaderRowType[HeaderRowType["COLUMN_GROUP"] = 0] = "COLUMN_GROUP";
  24584. HeaderRowType[HeaderRowType["COLUMN"] = 1] = "COLUMN";
  24585. HeaderRowType[HeaderRowType["FLOATING_FILTER"] = 2] = "FLOATING_FILTER";
  24586. })(HeaderRowType || (HeaderRowType = {}));
  24587. var HeaderRowComp = /** @class */ (function (_super) {
  24588. __extends(HeaderRowComp, _super);
  24589. function HeaderRowComp(dept, type, pinned, dropTarget) {
  24590. var _this = _super.call(this, /* html */ "<div class=\"ag-header-row\" role=\"row\" />") || this;
  24591. _this.headerComps = {};
  24592. _this.dept = dept;
  24593. _this.type = type;
  24594. _this.pinned = pinned;
  24595. _this.dropTarget = dropTarget;
  24596. var niceClassName = HeaderRowType[type].toLowerCase().replace(/_/g, '-');
  24597. _this.addCssClass("ag-header-row-" + niceClassName);
  24598. if (Object(_utils_browser__WEBPACK_IMPORTED_MODULE_8__["isBrowserSafari"])()) {
  24599. // fix for a Safari rendering bug that caused the header to flicker above chart panels
  24600. // as you move the mouse over the header
  24601. _this.getGui().style.transform = 'translateZ(0)';
  24602. }
  24603. return _this;
  24604. }
  24605. HeaderRowComp.prototype.forEachHeaderElement = function (callback) {
  24606. var _this = this;
  24607. Object.keys(this.headerComps).forEach(function (key) {
  24608. callback(_this.headerComps[key]);
  24609. });
  24610. };
  24611. HeaderRowComp.prototype.setRowIndex = function (idx) {
  24612. this.rowIndex = idx;
  24613. this.getGui().setAttribute('aria-rowindex', (idx + 1).toString());
  24614. };
  24615. HeaderRowComp.prototype.getRowIndex = function () {
  24616. return this.rowIndex;
  24617. };
  24618. HeaderRowComp.prototype.getType = function () {
  24619. return this.type;
  24620. };
  24621. HeaderRowComp.prototype.destroyAllChildComponents = function () {
  24622. var idsOfAllChildren = Object.keys(this.headerComps);
  24623. this.destroyChildComponents(idsOfAllChildren);
  24624. };
  24625. HeaderRowComp.prototype.destroyChildComponents = function (idsToDestroy, keepFocused) {
  24626. var _this = this;
  24627. idsToDestroy.forEach(function (id) {
  24628. var childHeaderWrapper = _this.headerComps[id];
  24629. if (keepFocused &&
  24630. !childHeaderWrapper.getColumn().isMoving() &&
  24631. _this.focusController.isHeaderWrapperFocused(childHeaderWrapper)) {
  24632. return;
  24633. }
  24634. _this.getGui().removeChild(childHeaderWrapper.getGui());
  24635. _this.destroyBean(childHeaderWrapper);
  24636. delete _this.headerComps[id];
  24637. });
  24638. };
  24639. HeaderRowComp.prototype.onRowHeightChanged = function () {
  24640. var headerRowCount = this.columnController.getHeaderRowCount();
  24641. var sizes = [];
  24642. var numberOfFloating = 0;
  24643. var groupHeight;
  24644. var headerHeight;
  24645. if (this.columnController.isPivotMode()) {
  24646. groupHeight = this.gridOptionsWrapper.getPivotGroupHeaderHeight();
  24647. headerHeight = this.gridOptionsWrapper.getPivotHeaderHeight();
  24648. }
  24649. else {
  24650. if (this.columnController.hasFloatingFilters()) {
  24651. headerRowCount++;
  24652. numberOfFloating = 1;
  24653. }
  24654. groupHeight = this.gridOptionsWrapper.getGroupHeaderHeight();
  24655. headerHeight = this.gridOptionsWrapper.getHeaderHeight();
  24656. }
  24657. var numberOfNonGroups = 1 + numberOfFloating;
  24658. var numberOfGroups = headerRowCount - numberOfNonGroups;
  24659. for (var i = 0; i < numberOfGroups; i++) {
  24660. sizes.push(groupHeight);
  24661. }
  24662. sizes.push(headerHeight);
  24663. for (var i = 0; i < numberOfFloating; i++) {
  24664. sizes.push(this.gridOptionsWrapper.getFloatingFiltersHeight());
  24665. }
  24666. var rowHeight = 0;
  24667. for (var i = 0; i < this.dept; i++) {
  24668. rowHeight += sizes[i];
  24669. }
  24670. this.getGui().style.top = rowHeight + 'px';
  24671. this.getGui().style.height = sizes[this.dept] + 'px';
  24672. };
  24673. //noinspection JSUnusedLocalSymbols
  24674. HeaderRowComp.prototype.init = function () {
  24675. this.onRowHeightChanged();
  24676. this.onVirtualColumnsChanged();
  24677. this.setWidth();
  24678. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
  24679. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_PIVOT_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
  24680. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_GROUP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
  24681. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_PIVOT_GROUP_HEADER_HEIGHT, this.onRowHeightChanged.bind(this));
  24682. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_2__["GridOptionsWrapper"].PROP_FLOATING_FILTERS_HEIGHT, this.onRowHeightChanged.bind(this));
  24683. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this));
  24684. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
  24685. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
  24686. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this));
  24687. };
  24688. HeaderRowComp.prototype.onColumnResized = function () {
  24689. this.setWidth();
  24690. };
  24691. HeaderRowComp.prototype.setWidth = function () {
  24692. var width = this.getWidthForRow();
  24693. this.getGui().style.width = width + 'px';
  24694. };
  24695. HeaderRowComp.prototype.getWidthForRow = function () {
  24696. var printLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].DOM_LAYOUT_PRINT;
  24697. if (printLayout) {
  24698. var centerRow = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.pinned);
  24699. if (centerRow) {
  24700. return this.columnController.getContainerWidth(_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_RIGHT)
  24701. + this.columnController.getContainerWidth(_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_LEFT)
  24702. + this.columnController.getContainerWidth(null);
  24703. }
  24704. return 0;
  24705. }
  24706. // if not printing, just return the width as normal
  24707. return this.columnController.getContainerWidth(this.pinned);
  24708. };
  24709. HeaderRowComp.prototype.onGridColumnsChanged = function () {
  24710. this.removeAndDestroyAllChildComponents();
  24711. };
  24712. HeaderRowComp.prototype.removeAndDestroyAllChildComponents = function () {
  24713. var idsOfAllChildren = Object.keys(this.headerComps);
  24714. this.destroyChildComponents(idsOfAllChildren);
  24715. };
  24716. HeaderRowComp.prototype.onDisplayedColumnsChanged = function () {
  24717. this.onVirtualColumnsChanged();
  24718. this.setWidth();
  24719. };
  24720. HeaderRowComp.prototype.getItemsAtDepth = function () {
  24721. var _this = this;
  24722. var printLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].DOM_LAYOUT_PRINT;
  24723. if (printLayout) {
  24724. // for print layout, we add all columns into the center
  24725. var centerContainer = Object(_utils_generic__WEBPACK_IMPORTED_MODULE_9__["missing"])(this.pinned);
  24726. if (centerContainer) {
  24727. var result_1 = [];
  24728. [_constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_LEFT, null, _constants__WEBPACK_IMPORTED_MODULE_6__["Constants"].PINNED_RIGHT].forEach(function (pinned) {
  24729. var items = _this.columnController.getVirtualHeaderGroupRow(pinned, _this.type == HeaderRowType.FLOATING_FILTER ?
  24730. _this.dept - 1 :
  24731. _this.dept);
  24732. result_1 = result_1.concat(items);
  24733. });
  24734. return result_1;
  24735. }
  24736. return [];
  24737. }
  24738. // when in normal layout, we add the columns for that container only
  24739. return this.columnController.getVirtualHeaderGroupRow(this.pinned, this.type == HeaderRowType.FLOATING_FILTER ?
  24740. this.dept - 1 :
  24741. this.dept);
  24742. };
  24743. HeaderRowComp.prototype.onVirtualColumnsChanged = function () {
  24744. var _this = this;
  24745. var currentChildIds = Object.keys(this.headerComps);
  24746. var correctChildIds = [];
  24747. var itemsAtDepth = this.getItemsAtDepth();
  24748. itemsAtDepth.forEach(function (child) {
  24749. // skip groups that have no displayed children. this can happen when the group is broken,
  24750. // and this section happens to have nothing to display for the open / closed state.
  24751. // (a broken group is one that is split, ie columns in the group have a non-group column
  24752. // in between them)
  24753. if (child.isEmptyGroup()) {
  24754. return;
  24755. }
  24756. var idOfChild = child.getUniqueId();
  24757. var eParentContainer = _this.getGui();
  24758. // if we already have this cell rendered, do nothing
  24759. var colAlreadyInDom = currentChildIds.indexOf(idOfChild) >= 0;
  24760. var headerComp;
  24761. var eHeaderCompGui;
  24762. if (colAlreadyInDom) {
  24763. Object(_utils_array__WEBPACK_IMPORTED_MODULE_10__["removeFromArray"])(currentChildIds, idOfChild);
  24764. }
  24765. else {
  24766. headerComp = _this.createHeaderComp(child);
  24767. _this.headerComps[idOfChild] = headerComp;
  24768. eHeaderCompGui = headerComp.getGui();
  24769. eParentContainer.appendChild(eHeaderCompGui);
  24770. }
  24771. correctChildIds.push(idOfChild);
  24772. });
  24773. // at this point, anything left in currentChildIds is an element that is no longer in the viewport
  24774. this.destroyChildComponents(currentChildIds, true);
  24775. var ensureDomOrder = this.gridOptionsWrapper.isEnsureDomOrder();
  24776. if (ensureDomOrder) {
  24777. var correctChildOrder = correctChildIds.map(function (id) { return _this.headerComps[id].getGui(); });
  24778. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_11__["setDomChildOrder"])(this.getGui(), correctChildOrder);
  24779. }
  24780. };
  24781. HeaderRowComp.prototype.createHeaderComp = function (columnGroupChild) {
  24782. var result;
  24783. switch (this.type) {
  24784. case HeaderRowType.COLUMN:
  24785. result = new _header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_4__["HeaderWrapperComp"](columnGroupChild, this.dropTarget, this.pinned);
  24786. break;
  24787. case HeaderRowType.COLUMN_GROUP:
  24788. result = new _headerGroup_headerGroupWrapperComp__WEBPACK_IMPORTED_MODULE_5__["HeaderGroupWrapperComp"](columnGroupChild, this.dropTarget, this.pinned);
  24789. break;
  24790. case HeaderRowType.FLOATING_FILTER:
  24791. result = new _filter_floating_floatingFilterWrapper__WEBPACK_IMPORTED_MODULE_7__["FloatingFilterWrapper"](columnGroupChild, this.pinned);
  24792. break;
  24793. }
  24794. this.createBean(result);
  24795. result.setParentComponent(this);
  24796. return result;
  24797. };
  24798. HeaderRowComp.prototype.getHeaderComps = function () {
  24799. return this.headerComps;
  24800. };
  24801. __decorate([
  24802. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  24803. ], HeaderRowComp.prototype, "gridOptionsWrapper", void 0);
  24804. __decorate([
  24805. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  24806. ], HeaderRowComp.prototype, "columnController", void 0);
  24807. __decorate([
  24808. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('focusController')
  24809. ], HeaderRowComp.prototype, "focusController", void 0);
  24810. __decorate([
  24811. _context_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
  24812. ], HeaderRowComp.prototype, "destroyAllChildComponents", null);
  24813. __decorate([
  24814. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  24815. ], HeaderRowComp.prototype, "init", null);
  24816. return HeaderRowComp;
  24817. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  24818. /***/ }),
  24819. /* 111 */
  24820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24821. "use strict";
  24822. __webpack_require__.r(__webpack_exports__);
  24823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderWrapperComp", function() { return HeaderWrapperComp; });
  24824. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  24825. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
  24826. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(104);
  24827. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  24828. /* harmony import */ var _cssClassApplier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(112);
  24829. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43);
  24830. /* harmony import */ var _hoverFeature__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(113);
  24831. /* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(114);
  24832. /* harmony import */ var _selectAllFeature__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(115);
  24833. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57);
  24834. /* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65);
  24835. /* harmony import */ var _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(107);
  24836. /* harmony import */ var _abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(116);
  24837. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7);
  24838. /**
  24839. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  24840. * @version v23.2.1
  24841. * @link http://www.ag-grid.com/
  24842. * @license MIT
  24843. */
  24844. var __extends = (undefined && undefined.__extends) || (function () {
  24845. var extendStatics = function (d, b) {
  24846. extendStatics = Object.setPrototypeOf ||
  24847. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  24848. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  24849. return extendStatics(d, b);
  24850. };
  24851. return function (d, b) {
  24852. extendStatics(d, b);
  24853. function __() { this.constructor = d; }
  24854. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  24855. };
  24856. })();
  24857. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  24858. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  24859. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  24860. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  24861. return c > 3 && r && Object.defineProperty(target, key, r), r;
  24862. };
  24863. var HeaderWrapperComp = /** @class */ (function (_super) {
  24864. __extends(HeaderWrapperComp, _super);
  24865. function HeaderWrapperComp(column, dragSourceDropTarget, pinned) {
  24866. var _this = _super.call(this, HeaderWrapperComp.TEMPLATE) || this;
  24867. _this.column = column;
  24868. _this.dragSourceDropTarget = dragSourceDropTarget;
  24869. _this.pinned = pinned;
  24870. return _this;
  24871. }
  24872. HeaderWrapperComp.prototype.postConstruct = function () {
  24873. _super.prototype.postConstruct.call(this);
  24874. var colDef = this.getComponentHolder();
  24875. var displayName = this.columnController.getDisplayNameForColumn(this.column, 'header', true);
  24876. var enableSorting = colDef.sortable;
  24877. var enableMenu = this.menuEnabled = this.menuFactory.isMenuEnabled(this.column) && !colDef.suppressMenu;
  24878. this.appendHeaderComp(displayName, enableSorting, enableMenu);
  24879. this.setupWidth();
  24880. this.setupMovingCss();
  24881. this.setupTooltip();
  24882. this.setupResize();
  24883. this.setupMenuClass();
  24884. this.setupSortableClass(enableSorting);
  24885. this.addColumnHoverListener();
  24886. this.addDisplayMenuListeners();
  24887. this.cbSelectAll.setInputAriaLabel('Toggle Selection of All Rows');
  24888. this.createManagedBean(new _hoverFeature__WEBPACK_IMPORTED_MODULE_6__["HoverFeature"]([this.column], this.getGui()));
  24889. this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_FILTER_ACTIVE_CHANGED, this.onFilterChanged.bind(this));
  24890. this.onFilterChanged();
  24891. this.createManagedBean(new _selectAllFeature__WEBPACK_IMPORTED_MODULE_8__["SelectAllFeature"](this.cbSelectAll, this.column));
  24892. var setLeftFeature = new _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_7__["SetLeftFeature"](this.column, this.getGui(), this.beans);
  24893. this.createManagedBean(setLeftFeature);
  24894. this.addAttributes();
  24895. _cssClassApplier__WEBPACK_IMPORTED_MODULE_4__["CssClassApplier"].addHeaderClassesFromColDef(colDef, this.getGui(), this.gridOptionsWrapper, this.column, null);
  24896. };
  24897. HeaderWrapperComp.prototype.addDisplayMenuListeners = function () {
  24898. var mouseListener = this.onMouseOverOut.bind(this);
  24899. this.addGuiEventListener('mouseenter', mouseListener);
  24900. this.addGuiEventListener('mouseleave', mouseListener);
  24901. };
  24902. HeaderWrapperComp.prototype.onMouseOverOut = function (e) {
  24903. if (this.headerComp && this.headerComp.setActiveParent) {
  24904. this.headerComp.setActiveParent(e.type === 'mouseenter');
  24905. }
  24906. };
  24907. HeaderWrapperComp.prototype.onFocusIn = function (e) {
  24908. if (!this.getGui().contains(e.relatedTarget)) {
  24909. var headerRow = this.getParentComponent();
  24910. this.focusController.setFocusedHeader(headerRow.getRowIndex(), this.getColumn());
  24911. }
  24912. if (this.headerComp && this.headerComp.setActiveParent) {
  24913. this.headerComp.setActiveParent(true);
  24914. }
  24915. };
  24916. HeaderWrapperComp.prototype.onFocusOut = function (e) {
  24917. if (!this.headerComp ||
  24918. !this.headerComp.setActiveParent ||
  24919. this.getGui().contains(e.relatedTarget)) {
  24920. return;
  24921. }
  24922. this.headerComp.setActiveParent(false);
  24923. };
  24924. HeaderWrapperComp.prototype.handleKeyDown = function (e) {
  24925. var headerComp = this.headerComp;
  24926. if (!headerComp) {
  24927. return;
  24928. }
  24929. if (e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_SPACE) {
  24930. var checkbox = this.cbSelectAll;
  24931. if (checkbox.isDisplayed() && !checkbox.getGui().contains(document.activeElement)) {
  24932. checkbox.setValue(!checkbox.getValue());
  24933. }
  24934. }
  24935. if (e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_ENTER) {
  24936. if (e.ctrlKey || e.metaKey) {
  24937. if (this.menuEnabled && headerComp.showMenu) {
  24938. e.preventDefault();
  24939. headerComp.showMenu();
  24940. }
  24941. }
  24942. else if (this.sortable) {
  24943. var multiSort = e.shiftKey;
  24944. this.sortController.progressSort(this.column, multiSort, "uiColumnSorted");
  24945. }
  24946. }
  24947. };
  24948. HeaderWrapperComp.prototype.getComponentHolder = function () {
  24949. return this.column.getColDef();
  24950. };
  24951. HeaderWrapperComp.prototype.addColumnHoverListener = function () {
  24952. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
  24953. this.onColumnHover();
  24954. };
  24955. HeaderWrapperComp.prototype.onColumnHover = function () {
  24956. var isHovered = this.columnHoverService.isHovered(this.column);
  24957. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].addOrRemoveCssClass(this.getGui(), 'ag-column-hover', isHovered);
  24958. };
  24959. HeaderWrapperComp.prototype.setupSortableClass = function (enableSorting) {
  24960. if (!enableSorting) {
  24961. return;
  24962. }
  24963. var element = this.getGui();
  24964. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].addCssClass(element, 'ag-header-cell-sortable');
  24965. this.sortable = true;
  24966. };
  24967. HeaderWrapperComp.prototype.onFilterChanged = function () {
  24968. var filterPresent = this.column.isFilterActive();
  24969. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].addOrRemoveCssClass(this.getGui(), 'ag-header-cell-filtered', filterPresent);
  24970. };
  24971. HeaderWrapperComp.prototype.appendHeaderComp = function (displayName, enableSorting, enableMenu) {
  24972. var _this = this;
  24973. var params = {
  24974. column: this.column,
  24975. displayName: displayName,
  24976. enableSorting: enableSorting,
  24977. enableMenu: enableMenu,
  24978. showColumnMenu: function (source) {
  24979. _this.gridApi.showColumnMenuAfterButtonClick(_this.column, source);
  24980. },
  24981. progressSort: function (multiSort) {
  24982. _this.sortController.progressSort(_this.column, !!multiSort, "uiColumnSorted");
  24983. },
  24984. setSort: function (sort, multiSort) {
  24985. _this.sortController.setSortForColumn(_this.column, sort, !!multiSort, "uiColumnSorted");
  24986. },
  24987. api: this.gridApi,
  24988. columnApi: this.columnApi,
  24989. context: this.gridOptionsWrapper.getContext()
  24990. };
  24991. var callback = this.afterHeaderCompCreated.bind(this, displayName);
  24992. this.userComponentFactory.newHeaderComponent(params).then(callback);
  24993. };
  24994. HeaderWrapperComp.prototype.afterHeaderCompCreated = function (displayName, headerComp) {
  24995. var _this = this;
  24996. this.getGui().appendChild(headerComp.getGui());
  24997. this.addDestroyFunc(function () {
  24998. _this.getContext().destroyBean(headerComp);
  24999. });
  25000. this.setupMove(headerComp.getGui(), displayName);
  25001. this.headerComp = headerComp;
  25002. };
  25003. HeaderWrapperComp.prototype.onColumnMovingChanged = function () {
  25004. // this function adds or removes the moving css, based on if the col is moving.
  25005. // this is what makes the header go dark when it is been moved (gives impression to
  25006. // user that the column was picked up).
  25007. if (this.column.isMoving()) {
  25008. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].addCssClass(this.getGui(), 'ag-header-cell-moving');
  25009. }
  25010. else {
  25011. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].removeCssClass(this.getGui(), 'ag-header-cell-moving');
  25012. }
  25013. };
  25014. HeaderWrapperComp.prototype.setupMove = function (eHeaderCellLabel, displayName) {
  25015. var _this = this;
  25016. var colDef = this.column.getColDef();
  25017. var suppressMove = this.gridOptionsWrapper.isSuppressMovableColumns()
  25018. || this.getComponentHolder().suppressMovable
  25019. || colDef.lockPosition;
  25020. if (suppressMove &&
  25021. !colDef.enableRowGroup &&
  25022. !colDef.enablePivot) {
  25023. return;
  25024. }
  25025. if (eHeaderCellLabel) {
  25026. var dragSource_1 = {
  25027. type: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragSourceType"].HeaderCell,
  25028. eElement: eHeaderCellLabel,
  25029. defaultIconName: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_HIDE,
  25030. getDragItem: function () { return _this.createDragItem(); },
  25031. dragItemName: displayName,
  25032. dragSourceDropTarget: this.dragSourceDropTarget,
  25033. onDragStarted: function () { return !suppressMove && _this.column.setMoving(true, "uiColumnMoved"); },
  25034. onDragStopped: function () { return !suppressMove && _this.column.setMoving(false, "uiColumnMoved"); }
  25035. };
  25036. this.dragAndDropService.addDragSource(dragSource_1, true);
  25037. this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource_1); });
  25038. }
  25039. };
  25040. HeaderWrapperComp.prototype.createDragItem = function () {
  25041. var visibleState = {};
  25042. visibleState[this.column.getId()] = this.column.isVisible();
  25043. return {
  25044. columns: [this.column],
  25045. visibleState: visibleState
  25046. };
  25047. };
  25048. HeaderWrapperComp.prototype.setupResize = function () {
  25049. var _this = this;
  25050. var colDef = this.getComponentHolder();
  25051. // if no eResize in template, do nothing
  25052. if (!this.eResize) {
  25053. return;
  25054. }
  25055. if (!this.column.isResizable()) {
  25056. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].removeFromParent(this.eResize);
  25057. return;
  25058. }
  25059. var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({
  25060. eResizeBar: this.eResize,
  25061. onResizeStart: this.onResizeStart.bind(this),
  25062. onResizing: this.onResizing.bind(this, false),
  25063. onResizeEnd: this.onResizing.bind(this, true)
  25064. });
  25065. this.addDestroyFunc(finishedWithResizeFunc);
  25066. var weWantAutoSize = !this.gridOptionsWrapper.isSuppressAutoSize() && !colDef.suppressAutoSize;
  25067. var skipHeaderOnAutoSize = this.gridOptionsWrapper.isSkipHeaderOnAutoSize();
  25068. if (weWantAutoSize) {
  25069. this.addManagedListener(this.eResize, 'dblclick', function () {
  25070. _this.columnController.autoSizeColumn(_this.column, skipHeaderOnAutoSize, "uiColumnResized");
  25071. });
  25072. var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__["TouchListener"](this.eResize);
  25073. this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_10__["TouchListener"].EVENT_DOUBLE_TAP, function () {
  25074. _this.columnController.autoSizeColumn(_this.column, skipHeaderOnAutoSize, "uiColumnResized");
  25075. });
  25076. this.addDestroyFunc(touchListener.destroy.bind(touchListener));
  25077. }
  25078. };
  25079. HeaderWrapperComp.prototype.onResizing = function (finished, resizeAmount) {
  25080. var resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount);
  25081. var columnWidths = [{ key: this.column, newWidth: this.resizeStartWidth + resizeAmountNormalised }];
  25082. this.columnController.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, "uiColumnDragged");
  25083. if (finished) {
  25084. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].removeCssClass(this.getGui(), 'ag-column-resizing');
  25085. }
  25086. };
  25087. HeaderWrapperComp.prototype.onResizeStart = function (shiftKey) {
  25088. this.resizeStartWidth = this.column.getActualWidth();
  25089. this.resizeWithShiftKey = shiftKey;
  25090. _utils__WEBPACK_IMPORTED_MODULE_13__["_"].addCssClass(this.getGui(), 'ag-column-resizing');
  25091. };
  25092. HeaderWrapperComp.prototype.getTooltipText = function () {
  25093. var colDef = this.getComponentHolder();
  25094. return colDef.headerTooltip;
  25095. };
  25096. HeaderWrapperComp.prototype.setupTooltip = function () {
  25097. var tooltipText = this.getTooltipText();
  25098. // add tooltip if exists
  25099. if (tooltipText == null) {
  25100. return;
  25101. }
  25102. if (this.gridOptionsWrapper.isEnableBrowserTooltips()) {
  25103. this.getGui().setAttribute('title', tooltipText);
  25104. }
  25105. else {
  25106. this.createManagedBean(new _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_11__["TooltipFeature"](this, 'header'));
  25107. }
  25108. };
  25109. HeaderWrapperComp.prototype.setupMovingCss = function () {
  25110. this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_MOVING_CHANGED, this.onColumnMovingChanged.bind(this));
  25111. this.onColumnMovingChanged();
  25112. };
  25113. HeaderWrapperComp.prototype.addAttributes = function () {
  25114. this.getGui().setAttribute("col-id", this.column.getColId());
  25115. };
  25116. HeaderWrapperComp.prototype.setupWidth = function () {
  25117. this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_WIDTH_CHANGED, this.onColumnWidthChanged.bind(this));
  25118. this.onColumnWidthChanged();
  25119. };
  25120. HeaderWrapperComp.prototype.setupMenuClass = function () {
  25121. this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_MENU_VISIBLE_CHANGED, this.onMenuVisible.bind(this));
  25122. this.onColumnWidthChanged();
  25123. };
  25124. HeaderWrapperComp.prototype.onMenuVisible = function () {
  25125. this.addOrRemoveCssClass('ag-column-menu-visible', this.column.isMenuVisible());
  25126. };
  25127. HeaderWrapperComp.prototype.onColumnWidthChanged = function () {
  25128. this.getGui().style.width = this.column.getActualWidth() + 'px';
  25129. };
  25130. // optionally inverts the drag, depending on pinned and RTL
  25131. // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out?
  25132. HeaderWrapperComp.prototype.normaliseResizeAmount = function (dragChange) {
  25133. var result = dragChange;
  25134. if (this.gridOptionsWrapper.isEnableRtl()) {
  25135. // for RTL, dragging left makes the col bigger, except when pinning left
  25136. if (this.pinned !== _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_LEFT) {
  25137. result *= -1;
  25138. }
  25139. }
  25140. else {
  25141. // for LTR (ie normal), dragging left makes the col smaller, except when pinning right
  25142. if (this.pinned === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_RIGHT) {
  25143. result *= -1;
  25144. }
  25145. }
  25146. return result;
  25147. };
  25148. HeaderWrapperComp.TEMPLATE = "<div class=\"ag-header-cell\" role=\"presentation\" unselectable=\"on\" tabindex=\"-1\">\n <div ref=\"eResize\" class=\"ag-header-cell-resize\" role=\"presentation\"></div>\n <ag-checkbox ref=\"cbSelectAll\" class=\"ag-header-select-all\" role=\"presentation\"></ag-checkbox>\n </div>";
  25149. __decorate([
  25150. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  25151. ], HeaderWrapperComp.prototype, "gridOptionsWrapper", void 0);
  25152. __decorate([
  25153. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragAndDropService')
  25154. ], HeaderWrapperComp.prototype, "dragAndDropService", void 0);
  25155. __decorate([
  25156. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  25157. ], HeaderWrapperComp.prototype, "columnController", void 0);
  25158. __decorate([
  25159. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('horizontalResizeService')
  25160. ], HeaderWrapperComp.prototype, "horizontalResizeService", void 0);
  25161. __decorate([
  25162. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('menuFactory')
  25163. ], HeaderWrapperComp.prototype, "menuFactory", void 0);
  25164. __decorate([
  25165. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  25166. ], HeaderWrapperComp.prototype, "gridApi", void 0);
  25167. __decorate([
  25168. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  25169. ], HeaderWrapperComp.prototype, "columnApi", void 0);
  25170. __decorate([
  25171. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
  25172. ], HeaderWrapperComp.prototype, "sortController", void 0);
  25173. __decorate([
  25174. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
  25175. ], HeaderWrapperComp.prototype, "userComponentFactory", void 0);
  25176. __decorate([
  25177. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnHoverService')
  25178. ], HeaderWrapperComp.prototype, "columnHoverService", void 0);
  25179. __decorate([
  25180. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('beans')
  25181. ], HeaderWrapperComp.prototype, "beans", void 0);
  25182. __decorate([
  25183. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eResize')
  25184. ], HeaderWrapperComp.prototype, "eResize", void 0);
  25185. __decorate([
  25186. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('cbSelectAll')
  25187. ], HeaderWrapperComp.prototype, "cbSelectAll", void 0);
  25188. return HeaderWrapperComp;
  25189. }(_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_12__["AbstractHeaderWrapper"]));
  25190. /***/ }),
  25191. /* 112 */
  25192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25193. "use strict";
  25194. __webpack_require__.r(__webpack_exports__);
  25195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CssClassApplier", function() { return CssClassApplier; });
  25196. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  25197. /**
  25198. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25199. * @version v23.2.1
  25200. * @link http://www.ag-grid.com/
  25201. * @license MIT
  25202. */
  25203. var CssClassApplier = /** @class */ (function () {
  25204. function CssClassApplier() {
  25205. }
  25206. CssClassApplier.addHeaderClassesFromColDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
  25207. if (_utils__WEBPACK_IMPORTED_MODULE_0__["_"].missing(abstractColDef)) {
  25208. return;
  25209. }
  25210. this.addColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup);
  25211. };
  25212. CssClassApplier.addToolPanelClassesFromColDef = function (abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
  25213. if (_utils__WEBPACK_IMPORTED_MODULE_0__["_"].missing(abstractColDef)) {
  25214. return;
  25215. }
  25216. this.addColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup);
  25217. };
  25218. CssClassApplier.addColumnClassesFromCollDef = function (classesOrFunc, abstractColDef, eHeaderCell, gridOptionsWrapper, column, columnGroup) {
  25219. if (_utils__WEBPACK_IMPORTED_MODULE_0__["_"].missing(classesOrFunc)) {
  25220. return;
  25221. }
  25222. var classToUse;
  25223. if (typeof classesOrFunc === 'function') {
  25224. var params = {
  25225. // bad naming, as colDef here can be a group or a column,
  25226. // however most people won't appreciate the difference,
  25227. // so keeping it as colDef to avoid confusion.
  25228. colDef: abstractColDef,
  25229. column: column,
  25230. columnGroup: columnGroup,
  25231. context: gridOptionsWrapper.getContext(),
  25232. api: gridOptionsWrapper.getApi()
  25233. };
  25234. var headerClassFunc = classesOrFunc;
  25235. classToUse = headerClassFunc(params);
  25236. }
  25237. else {
  25238. classToUse = classesOrFunc;
  25239. }
  25240. if (typeof classToUse === 'string') {
  25241. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].addCssClass(eHeaderCell, classToUse);
  25242. }
  25243. else if (Array.isArray(classToUse)) {
  25244. classToUse.forEach(function (cssClassItem) {
  25245. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].addCssClass(eHeaderCell, cssClassItem);
  25246. });
  25247. }
  25248. };
  25249. return CssClassApplier;
  25250. }());
  25251. /***/ }),
  25252. /* 113 */
  25253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25254. "use strict";
  25255. __webpack_require__.r(__webpack_exports__);
  25256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HoverFeature", function() { return HoverFeature; });
  25257. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  25258. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  25259. /**
  25260. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25261. * @version v23.2.1
  25262. * @link http://www.ag-grid.com/
  25263. * @license MIT
  25264. */
  25265. var __extends = (undefined && undefined.__extends) || (function () {
  25266. var extendStatics = function (d, b) {
  25267. extendStatics = Object.setPrototypeOf ||
  25268. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25269. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  25270. return extendStatics(d, b);
  25271. };
  25272. return function (d, b) {
  25273. extendStatics(d, b);
  25274. function __() { this.constructor = d; }
  25275. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  25276. };
  25277. })();
  25278. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  25279. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  25280. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  25281. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  25282. return c > 3 && r && Object.defineProperty(target, key, r), r;
  25283. };
  25284. var HoverFeature = /** @class */ (function (_super) {
  25285. __extends(HoverFeature, _super);
  25286. function HoverFeature(columns, element) {
  25287. var _this = _super.call(this) || this;
  25288. _this.columns = columns;
  25289. _this.element = element;
  25290. return _this;
  25291. }
  25292. HoverFeature.prototype.postConstruct = function () {
  25293. this.addMouseHoverListeners();
  25294. };
  25295. HoverFeature.prototype.addMouseHoverListeners = function () {
  25296. this.addManagedListener(this.element, 'mouseout', this.onMouseOut.bind(this));
  25297. this.addManagedListener(this.element, 'mouseover', this.onMouseOver.bind(this));
  25298. };
  25299. HoverFeature.prototype.onMouseOut = function () {
  25300. this.columnHoverService.clearMouseOver();
  25301. };
  25302. HoverFeature.prototype.onMouseOver = function () {
  25303. this.columnHoverService.setMouseOver(this.columns);
  25304. };
  25305. __decorate([
  25306. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnHoverService')
  25307. ], HoverFeature.prototype, "columnHoverService", void 0);
  25308. __decorate([
  25309. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  25310. ], HoverFeature.prototype, "postConstruct", null);
  25311. return HoverFeature;
  25312. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  25313. /***/ }),
  25314. /* 114 */
  25315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25316. "use strict";
  25317. __webpack_require__.r(__webpack_exports__);
  25318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SetLeftFeature", function() { return SetLeftFeature; });
  25319. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
  25320. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  25321. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  25322. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  25323. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  25324. /**
  25325. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25326. * @version v23.2.1
  25327. * @link http://www.ag-grid.com/
  25328. * @license MIT
  25329. */
  25330. var __extends = (undefined && undefined.__extends) || (function () {
  25331. var extendStatics = function (d, b) {
  25332. extendStatics = Object.setPrototypeOf ||
  25333. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25334. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  25335. return extendStatics(d, b);
  25336. };
  25337. return function (d, b) {
  25338. extendStatics(d, b);
  25339. function __() { this.constructor = d; }
  25340. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  25341. };
  25342. })();
  25343. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  25344. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  25345. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  25346. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  25347. return c > 3 && r && Object.defineProperty(target, key, r), r;
  25348. };
  25349. var SetLeftFeature = /** @class */ (function (_super) {
  25350. __extends(SetLeftFeature, _super);
  25351. function SetLeftFeature(columnOrGroup, eCell, beans, colsSpanning) {
  25352. var _this = _super.call(this) || this;
  25353. _this.columnOrGroup = columnOrGroup;
  25354. _this.eCell = eCell;
  25355. _this.ariaEl = _this.eCell.querySelector('[role=columnheader]') || _this.eCell;
  25356. _this.colsSpanning = colsSpanning;
  25357. _this.beans = beans;
  25358. _this.printLayout = beans.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].DOM_LAYOUT_PRINT;
  25359. return _this;
  25360. }
  25361. SetLeftFeature.prototype.setColsSpanning = function (colsSpanning) {
  25362. this.colsSpanning = colsSpanning;
  25363. this.onLeftChanged();
  25364. };
  25365. SetLeftFeature.prototype.getColumnOrGroup = function () {
  25366. if (this.beans.gridOptionsWrapper.isEnableRtl() && this.colsSpanning) {
  25367. return _utils__WEBPACK_IMPORTED_MODULE_4__["_"].last(this.colsSpanning);
  25368. }
  25369. return this.columnOrGroup;
  25370. };
  25371. SetLeftFeature.prototype.postConstruct = function () {
  25372. this.addManagedListener(this.columnOrGroup, _entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_LEFT_CHANGED, this.onLeftChanged.bind(this));
  25373. this.setLeftFirstTime();
  25374. };
  25375. SetLeftFeature.prototype.setLeftFirstTime = function () {
  25376. var suppressMoveAnimation = this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation();
  25377. var oldLeftExists = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(this.columnOrGroup.getOldLeft());
  25378. var animateColumnMove = this.beans.columnAnimationService.isActive() && oldLeftExists && !suppressMoveAnimation;
  25379. if (animateColumnMove) {
  25380. this.animateInLeft();
  25381. }
  25382. else {
  25383. this.onLeftChanged();
  25384. }
  25385. };
  25386. SetLeftFeature.prototype.animateInLeft = function () {
  25387. var _this = this;
  25388. var left = this.getColumnOrGroup().getLeft();
  25389. var oldLeft = this.getColumnOrGroup().getOldLeft();
  25390. this.setLeft(oldLeft);
  25391. // we must keep track of the left we want to set to, as this would otherwise lead to a race
  25392. // condition, if the user changed the left value many times in one VM turn, then we want to make
  25393. // make sure the actualLeft we set in the timeout below (in the next VM turn) is the correct left
  25394. // position. eg if user changes column position twice, then setLeft() below executes twice in next
  25395. // VM turn, but only one (the correct one) should get applied.
  25396. this.actualLeft = left;
  25397. this.beans.columnAnimationService.executeNextVMTurn(function () {
  25398. // test this left value is the latest one to be applied, and if not, do nothing
  25399. if (_this.actualLeft === left) {
  25400. _this.setLeft(left);
  25401. }
  25402. });
  25403. };
  25404. SetLeftFeature.prototype.onLeftChanged = function () {
  25405. var colOrGroup = this.getColumnOrGroup();
  25406. var left = colOrGroup.getLeft();
  25407. this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left);
  25408. this.setLeft(this.actualLeft);
  25409. };
  25410. SetLeftFeature.prototype.modifyLeftForPrintLayout = function (colOrGroup, leftPosition) {
  25411. if (!this.printLayout) {
  25412. return leftPosition;
  25413. }
  25414. if (colOrGroup.getPinned() === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT) {
  25415. return leftPosition;
  25416. }
  25417. if (colOrGroup.getPinned() === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT) {
  25418. var leftWidth_1 = this.beans.columnController.getPinnedLeftContainerWidth();
  25419. var bodyWidth = this.beans.columnController.getBodyContainerWidth();
  25420. return leftWidth_1 + bodyWidth + leftPosition;
  25421. }
  25422. // is in body
  25423. var leftWidth = this.beans.columnController.getPinnedLeftContainerWidth();
  25424. return leftWidth + leftPosition;
  25425. };
  25426. SetLeftFeature.prototype.setLeft = function (value) {
  25427. // if the value is null, then that means the column is no longer
  25428. // displayed. there is logic in the rendering to fade these columns
  25429. // out, so we don't try and change their left positions.
  25430. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(value)) {
  25431. this.eCell.style.left = value + "px";
  25432. }
  25433. if (this.columnOrGroup instanceof _entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"]) {
  25434. var colIndex = this.beans.columnController.getAllDisplayedColumns().indexOf(this.columnOrGroup);
  25435. this.ariaEl.setAttribute('aria-colindex', (colIndex + 1).toString());
  25436. }
  25437. else {
  25438. this.ariaEl.removeAttribute('aria-colindex');
  25439. }
  25440. };
  25441. __decorate([
  25442. _context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
  25443. ], SetLeftFeature.prototype, "postConstruct", null);
  25444. return SetLeftFeature;
  25445. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  25446. /***/ }),
  25447. /* 115 */
  25448. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25449. "use strict";
  25450. __webpack_require__.r(__webpack_exports__);
  25451. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectAllFeature", function() { return SelectAllFeature; });
  25452. /* harmony import */ var _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70);
  25453. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  25454. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  25455. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  25456. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
  25457. /**
  25458. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25459. * @version v23.2.1
  25460. * @link http://www.ag-grid.com/
  25461. * @license MIT
  25462. */
  25463. var __extends = (undefined && undefined.__extends) || (function () {
  25464. var extendStatics = function (d, b) {
  25465. extendStatics = Object.setPrototypeOf ||
  25466. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25467. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  25468. return extendStatics(d, b);
  25469. };
  25470. return function (d, b) {
  25471. extendStatics(d, b);
  25472. function __() { this.constructor = d; }
  25473. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  25474. };
  25475. })();
  25476. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  25477. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  25478. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  25479. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  25480. return c > 3 && r && Object.defineProperty(target, key, r), r;
  25481. };
  25482. var SelectAllFeature = /** @class */ (function (_super) {
  25483. __extends(SelectAllFeature, _super);
  25484. function SelectAllFeature(cbSelectAll, column) {
  25485. var _this = _super.call(this) || this;
  25486. _this.cbSelectAllVisible = false;
  25487. _this.processingEventFromCheckbox = false;
  25488. _this.cbSelectAll = cbSelectAll;
  25489. _this.column = column;
  25490. var colDef = column.getColDef();
  25491. _this.filteredOnly = colDef ? !!colDef.headerCheckboxSelectionFilteredOnly : false;
  25492. return _this;
  25493. }
  25494. SelectAllFeature.prototype.postConstruct = function () {
  25495. this.showOrHideSelectAll();
  25496. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelectAll.bind(this));
  25497. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_SELECTION_CHANGED, this.onSelectionChanged.bind(this));
  25498. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_MODEL_UPDATED, this.onModelChanged.bind(this));
  25499. this.addManagedListener(this.cbSelectAll, _widgets_agCheckbox__WEBPACK_IMPORTED_MODULE_0__["AgCheckbox"].EVENT_CHANGED, this.onCbSelectAll.bind(this));
  25500. };
  25501. SelectAllFeature.prototype.showOrHideSelectAll = function () {
  25502. this.cbSelectAllVisible = this.isCheckboxSelection();
  25503. this.cbSelectAll.setDisplayed(this.cbSelectAllVisible);
  25504. if (this.cbSelectAllVisible) {
  25505. // in case user is trying this feature with the wrong model type
  25506. this.checkRightRowModelType();
  25507. // make sure checkbox is showing the right state
  25508. this.updateStateOfCheckbox();
  25509. }
  25510. };
  25511. SelectAllFeature.prototype.onModelChanged = function () {
  25512. if (!this.cbSelectAllVisible) {
  25513. return;
  25514. }
  25515. this.updateStateOfCheckbox();
  25516. };
  25517. SelectAllFeature.prototype.onSelectionChanged = function () {
  25518. if (!this.cbSelectAllVisible) {
  25519. return;
  25520. }
  25521. this.updateStateOfCheckbox();
  25522. };
  25523. SelectAllFeature.prototype.getNextCheckboxState = function (selectionCount) {
  25524. // if no rows, always have it unselected
  25525. if (selectionCount.selected === 0 && selectionCount.notSelected === 0) {
  25526. return false;
  25527. }
  25528. // if mix of selected and unselected, this is the tri-state
  25529. if (selectionCount.selected > 0 && selectionCount.notSelected > 0) {
  25530. return null;
  25531. }
  25532. // only selected
  25533. if (selectionCount.selected > 0) {
  25534. return true;
  25535. }
  25536. // nothing selected
  25537. return false;
  25538. };
  25539. SelectAllFeature.prototype.updateStateOfCheckbox = function () {
  25540. if (this.processingEventFromCheckbox) {
  25541. return;
  25542. }
  25543. this.processingEventFromCheckbox = true;
  25544. var selectionCount = this.getSelectionCount();
  25545. var allSelected = this.getNextCheckboxState(selectionCount);
  25546. this.cbSelectAll.setValue(allSelected);
  25547. this.processingEventFromCheckbox = false;
  25548. };
  25549. SelectAllFeature.prototype.getSelectionCount = function () {
  25550. var _this = this;
  25551. var selectedCount = 0;
  25552. var notSelectedCount = 0;
  25553. var callback = function (node) {
  25554. if (_this.gridOptionsWrapper.isGroupSelectsChildren() && node.group) {
  25555. return;
  25556. }
  25557. if (node.isSelected()) {
  25558. selectedCount++;
  25559. }
  25560. else if (!node.selectable) {
  25561. // don't count non-selectable nodes!
  25562. }
  25563. else {
  25564. notSelectedCount++;
  25565. }
  25566. };
  25567. if (this.filteredOnly) {
  25568. this.gridApi.forEachNodeAfterFilter(callback);
  25569. }
  25570. else {
  25571. this.gridApi.forEachNode(callback);
  25572. }
  25573. return {
  25574. notSelected: notSelectedCount,
  25575. selected: selectedCount
  25576. };
  25577. };
  25578. SelectAllFeature.prototype.checkRightRowModelType = function () {
  25579. var rowModelType = this.rowModel.getType();
  25580. var rowModelMatches = rowModelType === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
  25581. if (!rowModelMatches) {
  25582. console.warn("ag-Grid: selectAllCheckbox is only available if using normal row model, you are using " + rowModelType);
  25583. }
  25584. };
  25585. SelectAllFeature.prototype.onCbSelectAll = function () {
  25586. if (this.processingEventFromCheckbox) {
  25587. return;
  25588. }
  25589. if (!this.cbSelectAllVisible) {
  25590. return;
  25591. }
  25592. var value = this.cbSelectAll.getValue();
  25593. if (value) {
  25594. this.selectionController.selectAllRowNodes(this.filteredOnly);
  25595. }
  25596. else {
  25597. this.selectionController.deselectAllRowNodes(this.filteredOnly);
  25598. }
  25599. };
  25600. SelectAllFeature.prototype.isCheckboxSelection = function () {
  25601. var result = this.column.getColDef().headerCheckboxSelection;
  25602. if (typeof result === 'function') {
  25603. var func = result;
  25604. result = func({
  25605. column: this.column,
  25606. colDef: this.column.getColDef(),
  25607. columnApi: this.columnApi,
  25608. api: this.gridApi
  25609. });
  25610. }
  25611. if (result) {
  25612. if (this.gridOptionsWrapper.isRowModelServerSide()) {
  25613. console.warn('headerCheckboxSelection is not supported for Server Side Row Model');
  25614. return false;
  25615. }
  25616. if (this.gridOptionsWrapper.isRowModelInfinite()) {
  25617. console.warn('headerCheckboxSelection is not supported for Infinite Row Model');
  25618. return false;
  25619. }
  25620. if (this.gridOptionsWrapper.isRowModelViewport()) {
  25621. console.warn('headerCheckboxSelection is not supported for Viewport Row Model');
  25622. return false;
  25623. }
  25624. // otherwise the row model is compatible, so return true
  25625. return true;
  25626. }
  25627. return false;
  25628. };
  25629. __decorate([
  25630. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
  25631. ], SelectAllFeature.prototype, "gridApi", void 0);
  25632. __decorate([
  25633. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
  25634. ], SelectAllFeature.prototype, "columnApi", void 0);
  25635. __decorate([
  25636. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
  25637. ], SelectAllFeature.prototype, "rowModel", void 0);
  25638. __decorate([
  25639. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
  25640. ], SelectAllFeature.prototype, "selectionController", void 0);
  25641. __decorate([
  25642. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  25643. ], SelectAllFeature.prototype, "gridOptionsWrapper", void 0);
  25644. __decorate([
  25645. _context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
  25646. ], SelectAllFeature.prototype, "postConstruct", null);
  25647. return SelectAllFeature;
  25648. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  25649. /***/ }),
  25650. /* 116 */
  25651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25652. "use strict";
  25653. __webpack_require__.r(__webpack_exports__);
  25654. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractHeaderWrapper", function() { return AbstractHeaderWrapper; });
  25655. /* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(117);
  25656. /**
  25657. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25658. * @version v23.2.1
  25659. * @link http://www.ag-grid.com/
  25660. * @license MIT
  25661. */
  25662. var __extends = (undefined && undefined.__extends) || (function () {
  25663. var extendStatics = function (d, b) {
  25664. extendStatics = Object.setPrototypeOf ||
  25665. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25666. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  25667. return extendStatics(d, b);
  25668. };
  25669. return function (d, b) {
  25670. extendStatics(d, b);
  25671. function __() { this.constructor = d; }
  25672. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  25673. };
  25674. })();
  25675. var AbstractHeaderWrapper = /** @class */ (function (_super) {
  25676. __extends(AbstractHeaderWrapper, _super);
  25677. function AbstractHeaderWrapper() {
  25678. return _super !== null && _super.apply(this, arguments) || this;
  25679. }
  25680. AbstractHeaderWrapper.prototype.getColumn = function () {
  25681. return this.column;
  25682. };
  25683. AbstractHeaderWrapper.prototype.getPinned = function () {
  25684. return this.pinned;
  25685. };
  25686. return AbstractHeaderWrapper;
  25687. }(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_0__["ManagedFocusComponent"]));
  25688. /***/ }),
  25689. /* 117 */
  25690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25691. "use strict";
  25692. __webpack_require__.r(__webpack_exports__);
  25693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagedFocusComponent", function() { return ManagedFocusComponent; });
  25694. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  25695. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  25696. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  25697. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  25698. /**
  25699. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25700. * @version v23.2.1
  25701. * @link http://www.ag-grid.com/
  25702. * @license MIT
  25703. */
  25704. var __extends = (undefined && undefined.__extends) || (function () {
  25705. var extendStatics = function (d, b) {
  25706. extendStatics = Object.setPrototypeOf ||
  25707. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25708. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  25709. return extendStatics(d, b);
  25710. };
  25711. return function (d, b) {
  25712. extendStatics(d, b);
  25713. function __() { this.constructor = d; }
  25714. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  25715. };
  25716. })();
  25717. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  25718. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  25719. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  25720. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  25721. return c > 3 && r && Object.defineProperty(target, key, r), r;
  25722. };
  25723. /**
  25724. * This provides logic to override the default browser focus logic.
  25725. *
  25726. * When the component gets focus, it uses the grid logic to find out what should be focused,
  25727. * and then focuses that instead.
  25728. *
  25729. * This is how we ensure when user tabs into the relevant section, we focus the correct item.
  25730. * For example GridCore extends ManagedFocusComponent, and it ensures when it receives focus
  25731. * that focus goes to the first cell of the first header row.
  25732. */
  25733. var ManagedFocusComponent = /** @class */ (function (_super) {
  25734. __extends(ManagedFocusComponent, _super);
  25735. function ManagedFocusComponent() {
  25736. var _this = _super !== null && _super.apply(this, arguments) || this;
  25737. _this.skipTabGuardFocus = false;
  25738. return _this;
  25739. }
  25740. ManagedFocusComponent.prototype.postConstruct = function () {
  25741. var focusableElement = this.getFocusableElement();
  25742. if (!focusableElement) {
  25743. return;
  25744. }
  25745. this.wireFocusManagement();
  25746. };
  25747. ManagedFocusComponent.prototype.wireFocusManagement = function () {
  25748. var _this = this;
  25749. var focusableElement = this.getFocusableElement();
  25750. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(focusableElement, ManagedFocusComponent.FOCUS_MANAGED_CLASS);
  25751. if (this.isFocusableContainer()) {
  25752. this.topTabGuard = this.createTabGuard('top');
  25753. this.bottomTabGuard = this.createTabGuard('bottom');
  25754. this.addTabGuards();
  25755. this.activateTabGuards();
  25756. this.forEachTabGuard(function (tabGuards) {
  25757. _this.addManagedListener(tabGuards, 'focus', _this.onFocus.bind(_this));
  25758. });
  25759. }
  25760. if (this.onTabKeyDown || this.handleKeyDown) {
  25761. this.addKeyDownListeners(focusableElement);
  25762. }
  25763. this.addManagedListener(focusableElement, 'focusin', this.onFocusIn.bind(this));
  25764. this.addManagedListener(focusableElement, 'focusout', this.onFocusOut.bind(this));
  25765. };
  25766. /*
  25767. * Override this method to return true if this component will contain multiple focus-managed
  25768. * elements within. When set to true, this component will add tabGuards that will be responsible
  25769. * for receiving focus from outside and focusing an internal element using the focusInnerElementMethod
  25770. */
  25771. ManagedFocusComponent.prototype.isFocusableContainer = function () {
  25772. return false;
  25773. };
  25774. /*
  25775. * Override this method if focusing the default element requires special logic.
  25776. */
  25777. ManagedFocusComponent.prototype.focusInnerElement = function (fromBottom) {
  25778. var focusable = this.focusController.findFocusableElements(this.getFocusableElement(), '.ag-tab-guard, :not([tabindex="-1"])');
  25779. if (!focusable.length) {
  25780. return;
  25781. }
  25782. focusable[fromBottom ? focusable.length - 1 : 0].focus();
  25783. };
  25784. ManagedFocusComponent.prototype.onFocusIn = function (e) {
  25785. if (!this.isFocusableContainer()) {
  25786. return;
  25787. }
  25788. this.deactivateTabGuards();
  25789. };
  25790. ManagedFocusComponent.prototype.onFocusOut = function (e) {
  25791. if (!this.isFocusableContainer()) {
  25792. return;
  25793. }
  25794. var focusEl = this.getFocusableElement();
  25795. if (!focusEl.contains(e.relatedTarget)) {
  25796. this.activateTabGuards();
  25797. }
  25798. };
  25799. ManagedFocusComponent.prototype.forceFocusOutOfContainer = function () {
  25800. this.activateTabGuards();
  25801. this.skipTabGuardFocus = true;
  25802. this.bottomTabGuard.focus();
  25803. };
  25804. ManagedFocusComponent.prototype.appendChild = function (newChild, container) {
  25805. if (!this.isFocusableContainer()) {
  25806. _super.prototype.appendChild.call(this, newChild, container);
  25807. }
  25808. else {
  25809. if (!_utils__WEBPACK_IMPORTED_MODULE_3__["_"].isNodeOrElement(newChild)) {
  25810. newChild = newChild.getGui();
  25811. }
  25812. var bottomTabGuard = this.bottomTabGuard;
  25813. if (bottomTabGuard) {
  25814. bottomTabGuard.insertAdjacentElement('beforebegin', newChild);
  25815. }
  25816. else {
  25817. _super.prototype.appendChild.call(this, newChild, container);
  25818. }
  25819. }
  25820. };
  25821. ManagedFocusComponent.prototype.createTabGuard = function (side) {
  25822. var tabGuard = document.createElement('div');
  25823. tabGuard.classList.add('ag-tab-guard');
  25824. tabGuard.classList.add("ag-tab-guard-" + side);
  25825. return tabGuard;
  25826. };
  25827. ManagedFocusComponent.prototype.addTabGuards = function () {
  25828. var focusableEl = this.getFocusableElement();
  25829. focusableEl.insertAdjacentElement('afterbegin', this.topTabGuard);
  25830. focusableEl.insertAdjacentElement('beforeend', this.bottomTabGuard);
  25831. };
  25832. ManagedFocusComponent.prototype.forEachTabGuard = function (callback) {
  25833. [this.topTabGuard, this.bottomTabGuard].forEach(callback);
  25834. };
  25835. ManagedFocusComponent.prototype.addKeyDownListeners = function (eGui) {
  25836. var _this = this;
  25837. this.addManagedListener(eGui, 'keydown', function (e) {
  25838. if (e.defaultPrevented) {
  25839. return;
  25840. }
  25841. if (e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_TAB && _this.onTabKeyDown) {
  25842. _this.onTabKeyDown(e);
  25843. }
  25844. else if (_this.handleKeyDown) {
  25845. _this.handleKeyDown(e);
  25846. }
  25847. });
  25848. };
  25849. ManagedFocusComponent.prototype.onFocus = function (e) {
  25850. if (!this.isFocusableContainer()) {
  25851. return;
  25852. }
  25853. if (this.skipTabGuardFocus) {
  25854. this.skipTabGuardFocus = false;
  25855. return;
  25856. }
  25857. this.focusInnerElement(e.target === this.bottomTabGuard);
  25858. };
  25859. ManagedFocusComponent.prototype.activateTabGuards = function () {
  25860. this.forEachTabGuard(function (tabGuard) { return tabGuard.setAttribute('tabIndex', '0'); });
  25861. };
  25862. ManagedFocusComponent.prototype.deactivateTabGuards = function () {
  25863. this.forEachTabGuard(function (tabGuards) { return tabGuards.removeAttribute('tabindex'); });
  25864. };
  25865. ManagedFocusComponent.FOCUS_MANAGED_CLASS = 'ag-focus-managed';
  25866. __decorate([
  25867. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
  25868. ], ManagedFocusComponent.prototype, "focusController", void 0);
  25869. __decorate([
  25870. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  25871. ], ManagedFocusComponent.prototype, "postConstruct", null);
  25872. return ManagedFocusComponent;
  25873. }(_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  25874. /***/ }),
  25875. /* 118 */
  25876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25877. "use strict";
  25878. __webpack_require__.r(__webpack_exports__);
  25879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderGroupWrapperComp", function() { return HeaderGroupWrapperComp; });
  25880. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
  25881. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
  25882. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  25883. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  25884. /* harmony import */ var _cssClassApplier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(112);
  25885. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(104);
  25886. /* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(114);
  25887. /* harmony import */ var _hoverFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(113);
  25888. /* harmony import */ var _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(107);
  25889. /* harmony import */ var _header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(116);
  25890. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7);
  25891. /**
  25892. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  25893. * @version v23.2.1
  25894. * @link http://www.ag-grid.com/
  25895. * @license MIT
  25896. */
  25897. var __extends = (undefined && undefined.__extends) || (function () {
  25898. var extendStatics = function (d, b) {
  25899. extendStatics = Object.setPrototypeOf ||
  25900. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25901. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  25902. return extendStatics(d, b);
  25903. };
  25904. return function (d, b) {
  25905. extendStatics(d, b);
  25906. function __() { this.constructor = d; }
  25907. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  25908. };
  25909. })();
  25910. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  25911. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  25912. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  25913. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  25914. return c > 3 && r && Object.defineProperty(target, key, r), r;
  25915. };
  25916. var HeaderGroupWrapperComp = /** @class */ (function (_super) {
  25917. __extends(HeaderGroupWrapperComp, _super);
  25918. function HeaderGroupWrapperComp(columnGroup, dragSourceDropTarget, pinned) {
  25919. var _this = _super.call(this, HeaderGroupWrapperComp.TEMPLATE) || this;
  25920. // the children can change, we keep destroy functions related to listening to the children here
  25921. _this.removeChildListenersFuncs = [];
  25922. _this.column = columnGroup;
  25923. _this.dragSourceDropTarget = dragSourceDropTarget;
  25924. _this.pinned = pinned;
  25925. return _this;
  25926. }
  25927. HeaderGroupWrapperComp.prototype.postConstruct = function () {
  25928. _super.prototype.postConstruct.call(this);
  25929. _cssClassApplier__WEBPACK_IMPORTED_MODULE_4__["CssClassApplier"].addHeaderClassesFromColDef(this.getComponentHolder(), this.getGui(), this.gridOptionsWrapper, null, this.column);
  25930. var displayName = this.columnController.getDisplayNameForColumnGroup(this.column, 'header');
  25931. this.appendHeaderGroupComp(displayName);
  25932. this.setupResize();
  25933. this.addClasses();
  25934. this.setupWidth();
  25935. this.addAttributes();
  25936. this.setupMovingCss();
  25937. this.setupTooltip();
  25938. this.createManagedBean(new _hoverFeature__WEBPACK_IMPORTED_MODULE_7__["HoverFeature"](this.column.getOriginalColumnGroup().getLeafColumns(), this.getGui()));
  25939. this.createManagedBean(new _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_6__["SetLeftFeature"](this.column, this.getGui(), this.beans));
  25940. };
  25941. HeaderGroupWrapperComp.prototype.onFocusIn = function (e) {
  25942. if (!this.getGui().contains(e.relatedTarget)) {
  25943. var headerRow = this.getParentComponent();
  25944. this.beans.focusController.setFocusedHeader(headerRow.getRowIndex(), this.getColumn());
  25945. }
  25946. };
  25947. HeaderGroupWrapperComp.prototype.handleKeyDown = function (e) {
  25948. var activeEl = document.activeElement;
  25949. var eGui = this.getGui();
  25950. var wrapperHasFocus = activeEl === eGui;
  25951. switch (e.keyCode) {
  25952. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_ENTER:
  25953. if (wrapperHasFocus) {
  25954. var column = this.getColumn();
  25955. var expandable = column.isExpandable();
  25956. if (expandable) {
  25957. var newExpandedValue = !column.isExpanded();
  25958. this.columnController.setColumnGroupOpened(column.getOriginalColumnGroup(), newExpandedValue, "uiColumnExpanded");
  25959. }
  25960. }
  25961. }
  25962. };
  25963. HeaderGroupWrapperComp.prototype.setupMovingCss = function () {
  25964. var _this = this;
  25965. var originalColumnGroup = this.column.getOriginalColumnGroup();
  25966. var leafColumns = originalColumnGroup.getLeafColumns();
  25967. leafColumns.forEach(function (col) {
  25968. _this.addManagedListener(col, _entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_MOVING_CHANGED, _this.onColumnMovingChanged.bind(_this));
  25969. });
  25970. this.onColumnMovingChanged();
  25971. };
  25972. HeaderGroupWrapperComp.prototype.getComponentHolder = function () {
  25973. return this.column.getColGroupDef();
  25974. };
  25975. HeaderGroupWrapperComp.prototype.getTooltipText = function () {
  25976. var colGroupDef = this.getComponentHolder();
  25977. return colGroupDef && colGroupDef.headerTooltip;
  25978. };
  25979. HeaderGroupWrapperComp.prototype.setupTooltip = function () {
  25980. var tooltipText = this.getTooltipText();
  25981. if (tooltipText == null) {
  25982. return;
  25983. }
  25984. if (this.gridOptionsWrapper.isEnableBrowserTooltips()) {
  25985. this.getGui().setAttribute('title', tooltipText);
  25986. }
  25987. else {
  25988. this.createManagedBean(new _widgets_tooltipFeature__WEBPACK_IMPORTED_MODULE_8__["TooltipFeature"](this, 'headerGroup'));
  25989. }
  25990. };
  25991. HeaderGroupWrapperComp.prototype.onColumnMovingChanged = function () {
  25992. // this function adds or removes the moving css, based on if the col is moving.
  25993. // this is what makes the header go dark when it is been moved (gives impression to
  25994. // user that the column was picked up).
  25995. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].addOrRemoveCssClass(this.getGui(), 'ag-header-cell-moving', this.column.isMoving());
  25996. };
  25997. HeaderGroupWrapperComp.prototype.addAttributes = function () {
  25998. this.getGui().setAttribute("col-id", this.column.getUniqueId());
  25999. };
  26000. HeaderGroupWrapperComp.prototype.appendHeaderGroupComp = function (displayName) {
  26001. var _this = this;
  26002. var params = {
  26003. displayName: displayName,
  26004. columnGroup: this.column,
  26005. setExpanded: function (expanded) {
  26006. _this.columnController.setColumnGroupOpened(_this.column.getOriginalColumnGroup(), expanded, "gridInitializing");
  26007. },
  26008. api: this.gridApi,
  26009. columnApi: this.columnApi,
  26010. context: this.gridOptionsWrapper.getContext()
  26011. };
  26012. if (!displayName) {
  26013. var columnGroup = this.column;
  26014. var leafCols = columnGroup.getLeafColumns();
  26015. // find the top most column group that represents the same columns. so if we are dragging a group, we also
  26016. // want to visually show the parent groups dragging for the same column set. for example imaging 5 levels
  26017. // of grouping, with each group only containing the next group, and the last group containing three columns,
  26018. // then when you move any group (even the lowest level group) you are in-fact moving all the groups, as all
  26019. // the groups represent the same column set.
  26020. while (columnGroup.getParent() && columnGroup.getParent().getLeafColumns().length === leafCols.length) {
  26021. columnGroup = columnGroup.getParent();
  26022. }
  26023. var colGroupDef = columnGroup.getColGroupDef();
  26024. if (colGroupDef) {
  26025. displayName = colGroupDef.headerName;
  26026. }
  26027. if (!displayName) {
  26028. displayName = leafCols ? this.columnController.getDisplayNameForColumn(leafCols[0], 'header', true) : '';
  26029. }
  26030. }
  26031. var callback = this.afterHeaderCompCreated.bind(this, displayName);
  26032. this.userComponentFactory.newHeaderGroupComponent(params).then(callback);
  26033. };
  26034. HeaderGroupWrapperComp.prototype.afterHeaderCompCreated = function (displayName, headerGroupComp) {
  26035. var _this = this;
  26036. this.getGui().appendChild(headerGroupComp.getGui());
  26037. this.addDestroyFunc(function () {
  26038. _this.getContext().destroyBean(headerGroupComp);
  26039. });
  26040. this.setupMove(headerGroupComp.getGui(), displayName);
  26041. };
  26042. HeaderGroupWrapperComp.prototype.addClasses = function () {
  26043. // having different classes below allows the style to not have a bottom border
  26044. // on the group header, if no group is specified
  26045. // columnGroup.getColGroupDef
  26046. var style = this.column.isPadding() ? 'no' : 'with';
  26047. this.addCssClass("ag-header-group-cell-" + style + "-group");
  26048. };
  26049. HeaderGroupWrapperComp.prototype.setupMove = function (eHeaderGroup, displayName) {
  26050. var _this = this;
  26051. if (!eHeaderGroup) {
  26052. return;
  26053. }
  26054. if (this.isSuppressMoving()) {
  26055. return;
  26056. }
  26057. var allLeafColumns = this.column.getOriginalColumnGroup().getLeafColumns();
  26058. var dragSource = {
  26059. type: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_5__["DragSourceType"].HeaderCell,
  26060. eElement: eHeaderGroup,
  26061. defaultIconName: _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_5__["DragAndDropService"].ICON_HIDE,
  26062. dragItemName: displayName,
  26063. // we add in the original group leaf columns, so we move both visible and non-visible items
  26064. getDragItem: this.getDragItemForGroup.bind(this),
  26065. dragSourceDropTarget: this.dragSourceDropTarget,
  26066. onDragStarted: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(true, "uiColumnDragged"); }); },
  26067. onDragStopped: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(false, "uiColumnDragged"); }); }
  26068. };
  26069. this.dragAndDropService.addDragSource(dragSource, true);
  26070. this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });
  26071. };
  26072. // when moving the columns, we want to move all the columns (contained within the DragItem) in this group in one go,
  26073. // and in the order they are currently in the screen.
  26074. HeaderGroupWrapperComp.prototype.getDragItemForGroup = function () {
  26075. var allColumnsOriginalOrder = this.column.getOriginalColumnGroup().getLeafColumns();
  26076. // capture visible state, used when re-entering grid to dictate which columns should be visible
  26077. var visibleState = {};
  26078. allColumnsOriginalOrder.forEach(function (column) { return visibleState[column.getId()] = column.isVisible(); });
  26079. var allColumnsCurrentOrder = [];
  26080. this.columnController.getAllDisplayedColumns().forEach(function (column) {
  26081. if (allColumnsOriginalOrder.indexOf(column) >= 0) {
  26082. allColumnsCurrentOrder.push(column);
  26083. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].removeFromArray(allColumnsOriginalOrder, column);
  26084. }
  26085. });
  26086. // we are left with non-visible columns, stick these in at the end
  26087. allColumnsOriginalOrder.forEach(function (column) { return allColumnsCurrentOrder.push(column); });
  26088. // create and return dragItem
  26089. return {
  26090. columns: allColumnsCurrentOrder,
  26091. visibleState: visibleState
  26092. };
  26093. };
  26094. HeaderGroupWrapperComp.prototype.isSuppressMoving = function () {
  26095. // if any child is fixed, then don't allow moving
  26096. var childSuppressesMoving = false;
  26097. this.column.getLeafColumns().forEach(function (column) {
  26098. if (column.getColDef().suppressMovable || column.getColDef().lockPosition) {
  26099. childSuppressesMoving = true;
  26100. }
  26101. });
  26102. var result = childSuppressesMoving || this.gridOptionsWrapper.isSuppressMovableColumns();
  26103. return result;
  26104. };
  26105. HeaderGroupWrapperComp.prototype.setupWidth = function () {
  26106. // we need to listen to changes in child columns, as they impact our width
  26107. this.addListenersToChildrenColumns();
  26108. // the children belonging to this group can change, so we need to add and remove listeners as they change
  26109. this.addManagedListener(this.column, _entities_columnGroup__WEBPACK_IMPORTED_MODULE_1__["ColumnGroup"].EVENT_DISPLAYED_CHILDREN_CHANGED, this.onDisplayedChildrenChanged.bind(this));
  26110. this.onWidthChanged();
  26111. // the child listeners are not tied to this components life-cycle, as children can get added and removed
  26112. // to the group - hence they are on a different life-cycle. so we must make sure the existing children
  26113. // listeners are removed when we finally get destroyed
  26114. this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this));
  26115. };
  26116. HeaderGroupWrapperComp.prototype.onDisplayedChildrenChanged = function () {
  26117. this.addListenersToChildrenColumns();
  26118. this.onWidthChanged();
  26119. };
  26120. HeaderGroupWrapperComp.prototype.addListenersToChildrenColumns = function () {
  26121. var _this = this;
  26122. // first destroy any old listeners
  26123. this.removeListenersOnChildrenColumns();
  26124. // now add new listeners to the new set of children
  26125. var widthChangedListener = this.onWidthChanged.bind(this);
  26126. this.column.getLeafColumns().forEach(function (column) {
  26127. column.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
  26128. column.addEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_VISIBLE_CHANGED, widthChangedListener);
  26129. _this.removeChildListenersFuncs.push(function () {
  26130. column.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_WIDTH_CHANGED, widthChangedListener);
  26131. column.removeEventListener(_entities_column__WEBPACK_IMPORTED_MODULE_0__["Column"].EVENT_VISIBLE_CHANGED, widthChangedListener);
  26132. });
  26133. });
  26134. };
  26135. HeaderGroupWrapperComp.prototype.removeListenersOnChildrenColumns = function () {
  26136. this.removeChildListenersFuncs.forEach(function (func) { return func(); });
  26137. this.removeChildListenersFuncs = [];
  26138. };
  26139. HeaderGroupWrapperComp.prototype.onWidthChanged = function () {
  26140. this.getGui().style.width = this.column.getActualWidth() + 'px';
  26141. };
  26142. HeaderGroupWrapperComp.prototype.setupResize = function () {
  26143. var _this = this;
  26144. this.eHeaderCellResize = this.getRefElement('agResize');
  26145. if (!this.column.isResizable()) {
  26146. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].removeFromParent(this.eHeaderCellResize);
  26147. return;
  26148. }
  26149. var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({
  26150. eResizeBar: this.eHeaderCellResize,
  26151. onResizeStart: this.onResizeStart.bind(this),
  26152. onResizing: this.onResizing.bind(this, false),
  26153. onResizeEnd: this.onResizing.bind(this, true)
  26154. });
  26155. this.addDestroyFunc(finishedWithResizeFunc);
  26156. if (!this.gridOptionsWrapper.isSuppressAutoSize()) {
  26157. var skipHeaderOnAutoSize_1 = this.gridOptionsWrapper.isSkipHeaderOnAutoSize();
  26158. this.eHeaderCellResize.addEventListener('dblclick', function (event) {
  26159. // get list of all the column keys we are responsible for
  26160. var keys = [];
  26161. _this.column.getDisplayedLeafColumns().forEach(function (column) {
  26162. // not all cols in the group may be participating with auto-resize
  26163. if (!column.getColDef().suppressAutoSize) {
  26164. keys.push(column.getColId());
  26165. }
  26166. });
  26167. if (keys.length > 0) {
  26168. _this.columnController.autoSizeColumns(keys, skipHeaderOnAutoSize_1, "uiColumnResized");
  26169. }
  26170. });
  26171. }
  26172. };
  26173. HeaderGroupWrapperComp.prototype.onResizeStart = function (shiftKey) {
  26174. var _this = this;
  26175. var leafCols = this.column.getDisplayedLeafColumns();
  26176. this.resizeCols = leafCols.filter(function (col) { return col.isResizable(); });
  26177. this.resizeStartWidth = 0;
  26178. this.resizeCols.forEach(function (col) { return _this.resizeStartWidth += col.getActualWidth(); });
  26179. this.resizeRatios = [];
  26180. this.resizeCols.forEach(function (col) { return _this.resizeRatios.push(col.getActualWidth() / _this.resizeStartWidth); });
  26181. var takeFromGroup = null;
  26182. if (shiftKey) {
  26183. takeFromGroup = this.columnController.getDisplayedGroupAfter(this.column);
  26184. }
  26185. if (takeFromGroup) {
  26186. var takeFromLeafCols = takeFromGroup.getDisplayedLeafColumns();
  26187. this.resizeTakeFromCols = takeFromLeafCols.filter(function (col) { return col.isResizable(); });
  26188. this.resizeTakeFromStartWidth = 0;
  26189. this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromStartWidth += col.getActualWidth(); });
  26190. this.resizeTakeFromRatios = [];
  26191. this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromRatios.push(col.getActualWidth() / _this.resizeTakeFromStartWidth); });
  26192. }
  26193. else {
  26194. this.resizeTakeFromCols = null;
  26195. this.resizeTakeFromStartWidth = null;
  26196. this.resizeTakeFromRatios = null;
  26197. }
  26198. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].addCssClass(this.getGui(), 'ag-column-resizing');
  26199. };
  26200. HeaderGroupWrapperComp.prototype.onResizing = function (finished, resizeAmount) {
  26201. var resizeSets = [];
  26202. var resizeAmountNormalised = this.normaliseDragChange(resizeAmount);
  26203. resizeSets.push({
  26204. columns: this.resizeCols,
  26205. ratios: this.resizeRatios,
  26206. width: this.resizeStartWidth + resizeAmountNormalised
  26207. });
  26208. if (this.resizeTakeFromCols) {
  26209. resizeSets.push({
  26210. columns: this.resizeTakeFromCols,
  26211. ratios: this.resizeTakeFromRatios,
  26212. width: this.resizeTakeFromStartWidth - resizeAmountNormalised
  26213. });
  26214. }
  26215. this.columnController.resizeColumnSets(resizeSets, finished, 'uiColumnDragged');
  26216. if (finished) {
  26217. _utils__WEBPACK_IMPORTED_MODULE_10__["_"].removeCssClass(this.getGui(), 'ag-column-resizing');
  26218. }
  26219. };
  26220. // optionally inverts the drag, depending on pinned and RTL
  26221. // note - this method is duplicated in RenderedHeaderCell - should refactor out?
  26222. HeaderGroupWrapperComp.prototype.normaliseDragChange = function (dragChange) {
  26223. var result = dragChange;
  26224. if (this.gridOptionsWrapper.isEnableRtl()) {
  26225. // for RTL, dragging left makes the col bigger, except when pinning left
  26226. if (this.pinned !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_LEFT) {
  26227. result *= -1;
  26228. }
  26229. }
  26230. else if (this.pinned === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_RIGHT) {
  26231. // for LTR (ie normal), dragging left makes the col smaller, except when pinning right
  26232. result *= -1;
  26233. }
  26234. return result;
  26235. };
  26236. HeaderGroupWrapperComp.TEMPLATE = "<div class=\"ag-header-group-cell\" role=\"presentation\" tabindex=\"-1\">\n <div ref=\"agResize\" class=\"ag-header-cell-resize\" role=\"presentation\"></div>\n </div>";
  26237. __decorate([
  26238. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('gridOptionsWrapper')
  26239. ], HeaderGroupWrapperComp.prototype, "gridOptionsWrapper", void 0);
  26240. __decorate([
  26241. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnController')
  26242. ], HeaderGroupWrapperComp.prototype, "columnController", void 0);
  26243. __decorate([
  26244. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('horizontalResizeService')
  26245. ], HeaderGroupWrapperComp.prototype, "horizontalResizeService", void 0);
  26246. __decorate([
  26247. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('dragAndDropService')
  26248. ], HeaderGroupWrapperComp.prototype, "dragAndDropService", void 0);
  26249. __decorate([
  26250. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('userComponentFactory')
  26251. ], HeaderGroupWrapperComp.prototype, "userComponentFactory", void 0);
  26252. __decorate([
  26253. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('beans')
  26254. ], HeaderGroupWrapperComp.prototype, "beans", void 0);
  26255. __decorate([
  26256. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('gridApi')
  26257. ], HeaderGroupWrapperComp.prototype, "gridApi", void 0);
  26258. __decorate([
  26259. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('columnApi')
  26260. ], HeaderGroupWrapperComp.prototype, "columnApi", void 0);
  26261. return HeaderGroupWrapperComp;
  26262. }(_header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_9__["AbstractHeaderWrapper"]));
  26263. /***/ }),
  26264. /* 119 */
  26265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26266. "use strict";
  26267. __webpack_require__.r(__webpack_exports__);
  26268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FloatingFilterWrapper", function() { return FloatingFilterWrapper; });
  26269. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  26270. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
  26271. /* harmony import */ var _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(114);
  26272. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
  26273. /* harmony import */ var _headerRendering_hoverFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(113);
  26274. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43);
  26275. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);
  26276. /* harmony import */ var _provided_readOnlyFloatingFilter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(120);
  26277. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38);
  26278. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39);
  26279. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(12);
  26280. /* harmony import */ var _utils_icon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(23);
  26281. /* harmony import */ var _headerRendering_header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(116);
  26282. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(25);
  26283. /**
  26284. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  26285. * @version v23.2.1
  26286. * @link http://www.ag-grid.com/
  26287. * @license MIT
  26288. */
  26289. var __extends = (undefined && undefined.__extends) || (function () {
  26290. var extendStatics = function (d, b) {
  26291. extendStatics = Object.setPrototypeOf ||
  26292. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  26293. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  26294. return extendStatics(d, b);
  26295. };
  26296. return function (d, b) {
  26297. extendStatics(d, b);
  26298. function __() { this.constructor = d; }
  26299. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  26300. };
  26301. })();
  26302. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  26303. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  26304. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  26305. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  26306. return c > 3 && r && Object.defineProperty(target, key, r), r;
  26307. };
  26308. var FloatingFilterWrapper = /** @class */ (function (_super) {
  26309. __extends(FloatingFilterWrapper, _super);
  26310. function FloatingFilterWrapper(column, pinned) {
  26311. var _this = _super.call(this, FloatingFilterWrapper.TEMPLATE) || this;
  26312. _this.column = column;
  26313. _this.pinned = pinned;
  26314. return _this;
  26315. }
  26316. FloatingFilterWrapper.prototype.postConstruct = function () {
  26317. _super.prototype.postConstruct.call(this);
  26318. this.setupFloatingFilter();
  26319. this.setupWidth();
  26320. this.setupLeftPositioning();
  26321. this.setupColumnHover();
  26322. this.createManagedBean(new _headerRendering_hoverFeature__WEBPACK_IMPORTED_MODULE_4__["HoverFeature"]([this.column], this.getGui()));
  26323. this.addManagedListener(this.eButtonShowMainFilter, 'click', this.showParentFilter.bind(this));
  26324. };
  26325. FloatingFilterWrapper.prototype.onTabKeyDown = function (e) {
  26326. var activeEl = document.activeElement;
  26327. var eGui = this.getGui();
  26328. var wrapperHasFocus = activeEl === eGui;
  26329. if (wrapperHasFocus) {
  26330. return;
  26331. }
  26332. e.preventDefault();
  26333. var nextFocusableEl = this.focusController.findNextFocusableElement(eGui, null, e.shiftKey);
  26334. if (nextFocusableEl) {
  26335. nextFocusableEl.focus();
  26336. }
  26337. else {
  26338. eGui.focus();
  26339. }
  26340. };
  26341. FloatingFilterWrapper.prototype.handleKeyDown = function (e) {
  26342. var activeEl = document.activeElement;
  26343. var eGui = this.getGui();
  26344. var wrapperHasFocus = activeEl === eGui;
  26345. switch (e.keyCode) {
  26346. case _constants__WEBPACK_IMPORTED_MODULE_13__["Constants"].KEY_UP:
  26347. case _constants__WEBPACK_IMPORTED_MODULE_13__["Constants"].KEY_DOWN:
  26348. if (!wrapperHasFocus) {
  26349. e.preventDefault();
  26350. }
  26351. case _constants__WEBPACK_IMPORTED_MODULE_13__["Constants"].KEY_LEFT:
  26352. case _constants__WEBPACK_IMPORTED_MODULE_13__["Constants"].KEY_RIGHT:
  26353. if (wrapperHasFocus) {
  26354. return;
  26355. }
  26356. e.stopPropagation();
  26357. case _constants__WEBPACK_IMPORTED_MODULE_13__["Constants"].KEY_ENTER:
  26358. if (wrapperHasFocus) {
  26359. if (this.focusController.focusFirstFocusableElement(eGui)) {
  26360. e.preventDefault();
  26361. }
  26362. }
  26363. break;
  26364. case _constants__WEBPACK_IMPORTED_MODULE_13__["Constants"].KEY_ESCAPE:
  26365. if (!wrapperHasFocus) {
  26366. this.getGui().focus();
  26367. }
  26368. }
  26369. };
  26370. FloatingFilterWrapper.prototype.onFocusIn = function (e) {
  26371. var eGui = this.getGui();
  26372. if (!eGui.contains(e.relatedTarget)) {
  26373. var headerRow = this.getParentComponent();
  26374. this.beans.focusController.setFocusedHeader(headerRow.getRowIndex(), this.getColumn());
  26375. }
  26376. };
  26377. FloatingFilterWrapper.prototype.setupFloatingFilter = function () {
  26378. var _this = this;
  26379. var colDef = this.column.getColDef();
  26380. if (colDef.filter && colDef.floatingFilter) {
  26381. this.floatingFilterCompPromise = this.getFloatingFilterInstance();
  26382. if (this.floatingFilterCompPromise) {
  26383. this.floatingFilterCompPromise.then(function (compInstance) {
  26384. if (compInstance) {
  26385. _this.setupWithFloatingFilter(compInstance);
  26386. _this.setupSyncWithFilter();
  26387. }
  26388. else {
  26389. _this.setupEmpty();
  26390. }
  26391. });
  26392. }
  26393. else {
  26394. this.setupEmpty();
  26395. }
  26396. }
  26397. else {
  26398. this.setupEmpty();
  26399. }
  26400. };
  26401. FloatingFilterWrapper.prototype.setupLeftPositioning = function () {
  26402. var setLeftFeature = new _rendering_features_setLeftFeature__WEBPACK_IMPORTED_MODULE_2__["SetLeftFeature"](this.column, this.getGui(), this.beans);
  26403. this.createManagedBean(setLeftFeature);
  26404. };
  26405. FloatingFilterWrapper.prototype.setupSyncWithFilter = function () {
  26406. var _this = this;
  26407. var syncWithFilter = function (filterChangedEvent) {
  26408. var parentModel = _this.getFilterComponent().resolveNow(null, function (filter) { return filter.getModel(); });
  26409. _this.onParentModelChanged(parentModel, filterChangedEvent);
  26410. };
  26411. this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_FILTER_CHANGED, syncWithFilter);
  26412. if (this.filterManager.isFilterActive(this.column)) {
  26413. syncWithFilter(null);
  26414. }
  26415. };
  26416. // linked to event listener in template
  26417. FloatingFilterWrapper.prototype.showParentFilter = function () {
  26418. this.menuFactory.showMenuAfterButtonClick(this.column, this.eButtonShowMainFilter, 'filterMenuTab', ['filterMenuTab']);
  26419. };
  26420. FloatingFilterWrapper.prototype.setupColumnHover = function () {
  26421. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_5__["Events"].EVENT_COLUMN_HOVER_CHANGED, this.onColumnHover.bind(this));
  26422. this.onColumnHover();
  26423. };
  26424. FloatingFilterWrapper.prototype.onColumnHover = function () {
  26425. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.getGui(), 'ag-column-hover', this.columnHoverService.isHovered(this.column));
  26426. };
  26427. FloatingFilterWrapper.prototype.setupWidth = function () {
  26428. this.addManagedListener(this.column, _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"].EVENT_WIDTH_CHANGED, this.onColumnWidthChanged.bind(this));
  26429. this.onColumnWidthChanged();
  26430. };
  26431. FloatingFilterWrapper.prototype.onColumnWidthChanged = function () {
  26432. this.getGui().style.width = this.column.getActualWidth() + "px";
  26433. };
  26434. FloatingFilterWrapper.prototype.setupWithFloatingFilter = function (floatingFilterComp) {
  26435. var _this = this;
  26436. var disposeFunc = function () {
  26437. _this.getContext().destroyBean(floatingFilterComp);
  26438. };
  26439. if (!this.isAlive()) {
  26440. disposeFunc();
  26441. return;
  26442. }
  26443. this.addDestroyFunc(disposeFunc);
  26444. var floatingFilterCompUi = floatingFilterComp.getGui();
  26445. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eFloatingFilterBody, 'ag-floating-filter-body', !this.suppressFilterButton);
  26446. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["addOrRemoveCssClass"])(this.eFloatingFilterBody, 'ag-floating-filter-full-body', this.suppressFilterButton);
  26447. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(this.eButtonWrapper, !this.suppressFilterButton);
  26448. var eIcon = Object(_utils_icon__WEBPACK_IMPORTED_MODULE_11__["createIconNoSpan"])('filter', this.gridOptionsWrapper, this.column);
  26449. this.eButtonShowMainFilter.appendChild(eIcon);
  26450. this.eFloatingFilterBody.appendChild(floatingFilterCompUi);
  26451. if (floatingFilterComp.afterGuiAttached) {
  26452. floatingFilterComp.afterGuiAttached();
  26453. }
  26454. };
  26455. FloatingFilterWrapper.prototype.parentFilterInstance = function (callback) {
  26456. this.getFilterComponent().then(callback);
  26457. };
  26458. FloatingFilterWrapper.prototype.getFilterComponent = function () {
  26459. return this.filterManager.getFilterComponent(this.column, 'NO_UI');
  26460. };
  26461. FloatingFilterWrapper.prototype.getFloatingFilterInstance = function () {
  26462. var colDef = this.column.getColDef();
  26463. var defaultFloatingFilterType;
  26464. if (typeof colDef.filter === 'string') {
  26465. // will be undefined if not in the map
  26466. defaultFloatingFilterType = FloatingFilterWrapper.filterToFloatingFilterNames[colDef.filter];
  26467. }
  26468. else if (colDef.filterFramework) {
  26469. // If filterFramework, then grid is NOT using one of the provided filters, hence no default.
  26470. // Note: We could combine this with another part of the 'if' statement, however explicitly
  26471. // having this section makes the code easier to read.
  26472. }
  26473. else if (colDef.filter === true) {
  26474. var setFilterModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_9__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_8__["ModuleNames"].SetFilterModule);
  26475. defaultFloatingFilterType = setFilterModuleLoaded ? 'agSetColumnFloatingFilter' : 'agTextColumnFloatingFilter';
  26476. }
  26477. var filterParams = this.filterManager.createFilterParams(this.column, this.column.getColDef());
  26478. var finalFilterParams = this.userComponentFactory.createFinalParams(colDef, 'filter', filterParams);
  26479. var params = {
  26480. api: this.gridApi,
  26481. column: this.column,
  26482. filterParams: finalFilterParams,
  26483. currentParentModel: this.currentParentModel.bind(this),
  26484. parentFilterInstance: this.parentFilterInstance.bind(this),
  26485. onFloatingFilterChanged: this.onFloatingFilterChanged.bind(this),
  26486. suppressFilterButton: false // This one might be overridden from the colDef
  26487. };
  26488. // this is unusual - we need a params value OUTSIDE the component the params are for.
  26489. // the params are for the floating filter component, but this property is actually for the wrapper.
  26490. this.suppressFilterButton = colDef.floatingFilterComponentParams ? !!colDef.floatingFilterComponentParams.suppressFilterButton : false;
  26491. var promise = this.userComponentFactory.newFloatingFilterComponent(colDef, params, defaultFloatingFilterType);
  26492. if (!promise) {
  26493. var filterComponent = this.getFilterComponentPrototype(colDef);
  26494. var getModelAsStringExists = filterComponent && filterComponent.prototype && filterComponent.prototype.getModelAsString;
  26495. if (getModelAsStringExists) {
  26496. var compInstance = this.userComponentFactory.createUserComponentFromConcreteClass(_provided_readOnlyFloatingFilter__WEBPACK_IMPORTED_MODULE_7__["ReadOnlyFloatingFilter"], params);
  26497. promise = _utils__WEBPACK_IMPORTED_MODULE_6__["Promise"].resolve(compInstance);
  26498. }
  26499. }
  26500. return promise;
  26501. };
  26502. FloatingFilterWrapper.prototype.createDynamicParams = function () {
  26503. return {
  26504. column: this.column,
  26505. colDef: this.column.getColDef(),
  26506. api: this.gridApi,
  26507. columnApi: this.columnApi
  26508. };
  26509. };
  26510. FloatingFilterWrapper.prototype.getFilterComponentPrototype = function (colDef) {
  26511. var resolvedComponent = this.userComponentFactory.lookupComponentClassDef(colDef, 'filter', this.createDynamicParams());
  26512. return resolvedComponent ? resolvedComponent.component : null;
  26513. };
  26514. FloatingFilterWrapper.prototype.setupEmpty = function () {
  26515. Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["setDisplayed"])(this.eButtonWrapper, false);
  26516. };
  26517. FloatingFilterWrapper.prototype.currentParentModel = function () {
  26518. return this.getFilterComponent().resolveNow(null, function (filter) { return filter.getModel(); });
  26519. };
  26520. FloatingFilterWrapper.prototype.onParentModelChanged = function (model, filterChangedEvent) {
  26521. if (!this.floatingFilterCompPromise) {
  26522. return;
  26523. }
  26524. this.floatingFilterCompPromise.then(function (comp) { return comp.onParentModelChanged(model, filterChangedEvent); });
  26525. };
  26526. FloatingFilterWrapper.prototype.onFloatingFilterChanged = function () {
  26527. console.warn('ag-Grid: since version 21.x, how floating filters are implemented has changed. ' +
  26528. 'Instead of calling params.onFloatingFilterChanged(), get a reference to the main filter via ' +
  26529. 'params.parentFilterInstance() and then set a value on the parent filter directly.');
  26530. };
  26531. FloatingFilterWrapper.filterToFloatingFilterNames = {
  26532. set: 'agSetColumnFloatingFilter',
  26533. agSetColumnFilter: 'agSetColumnFloatingFilter',
  26534. number: 'agNumberColumnFloatingFilter',
  26535. agNumberColumnFilter: 'agNumberColumnFloatingFilter',
  26536. date: 'agDateColumnFloatingFilter',
  26537. agDateColumnFilter: 'agDateColumnFloatingFilter',
  26538. text: 'agTextColumnFloatingFilter',
  26539. agTextColumnFilter: 'agTextColumnFloatingFilter'
  26540. };
  26541. FloatingFilterWrapper.TEMPLATE = "<div class=\"ag-header-cell\" role=\"presentation\" tabindex=\"-1\">\n <div ref=\"eFloatingFilterBody\" role=\"columnheader\"></div>\n <div class=\"ag-floating-filter-button\" ref=\"eButtonWrapper\" role=\"presentation\">\n <button type=\"button\" aria-label=\"Open Filter Menu\" class=\"ag-floating-filter-button-button\" ref=\"eButtonShowMainFilter\" tabindex=\"-1\"></button>\n </div>\n </div>";
  26542. __decorate([
  26543. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnHoverService')
  26544. ], FloatingFilterWrapper.prototype, "columnHoverService", void 0);
  26545. __decorate([
  26546. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  26547. ], FloatingFilterWrapper.prototype, "gridOptionsWrapper", void 0);
  26548. __decorate([
  26549. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
  26550. ], FloatingFilterWrapper.prototype, "userComponentFactory", void 0);
  26551. __decorate([
  26552. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  26553. ], FloatingFilterWrapper.prototype, "gridApi", void 0);
  26554. __decorate([
  26555. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  26556. ], FloatingFilterWrapper.prototype, "columnApi", void 0);
  26557. __decorate([
  26558. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  26559. ], FloatingFilterWrapper.prototype, "filterManager", void 0);
  26560. __decorate([
  26561. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('menuFactory')
  26562. ], FloatingFilterWrapper.prototype, "menuFactory", void 0);
  26563. __decorate([
  26564. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('beans')
  26565. ], FloatingFilterWrapper.prototype, "beans", void 0);
  26566. __decorate([
  26567. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eFloatingFilterBody')
  26568. ], FloatingFilterWrapper.prototype, "eFloatingFilterBody", void 0);
  26569. __decorate([
  26570. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eButtonWrapper')
  26571. ], FloatingFilterWrapper.prototype, "eButtonWrapper", void 0);
  26572. __decorate([
  26573. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eButtonShowMainFilter')
  26574. ], FloatingFilterWrapper.prototype, "eButtonShowMainFilter", void 0);
  26575. return FloatingFilterWrapper;
  26576. }(_headerRendering_header_abstractHeaderWrapper__WEBPACK_IMPORTED_MODULE_12__["AbstractHeaderWrapper"]));
  26577. /***/ }),
  26578. /* 120 */
  26579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26580. "use strict";
  26581. __webpack_require__.r(__webpack_exports__);
  26582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReadOnlyFloatingFilter", function() { return ReadOnlyFloatingFilter; });
  26583. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  26584. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  26585. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  26586. /**
  26587. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  26588. * @version v23.2.1
  26589. * @link http://www.ag-grid.com/
  26590. * @license MIT
  26591. */
  26592. var __extends = (undefined && undefined.__extends) || (function () {
  26593. var extendStatics = function (d, b) {
  26594. extendStatics = Object.setPrototypeOf ||
  26595. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  26596. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  26597. return extendStatics(d, b);
  26598. };
  26599. return function (d, b) {
  26600. extendStatics(d, b);
  26601. function __() { this.constructor = d; }
  26602. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  26603. };
  26604. })();
  26605. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  26606. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  26607. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  26608. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  26609. return c > 3 && r && Object.defineProperty(target, key, r), r;
  26610. };
  26611. // optional floating filter for user provided filters - instead of providing a floating filter,
  26612. // they can provide a getModelAsString() method on the filter instead. this class just displays
  26613. // the string returned from getModelAsString()
  26614. var ReadOnlyFloatingFilter = /** @class */ (function (_super) {
  26615. __extends(ReadOnlyFloatingFilter, _super);
  26616. function ReadOnlyFloatingFilter() {
  26617. return _super.call(this, /* html */ "\n <div class=\"ag-floating-filter-input\" role=\"presentation\">\n <ag-input-text-field ref=\"eFloatingFilterText\"></ag-input-text-field>\n </div>") || this;
  26618. }
  26619. // this is a user component, and IComponent has "public destroy()" as part of the interface.
  26620. // so we need to override destroy() just to make the method public.
  26621. ReadOnlyFloatingFilter.prototype.destroy = function () {
  26622. _super.prototype.destroy.call(this);
  26623. };
  26624. ReadOnlyFloatingFilter.prototype.init = function (params) {
  26625. this.params = params;
  26626. var displayName = this.columnController.getDisplayNameForColumn(params.column, 'header', true);
  26627. this.eFloatingFilterText
  26628. .setDisabled(true)
  26629. .setInputAriaLabel(displayName + " Filter Input");
  26630. };
  26631. ReadOnlyFloatingFilter.prototype.onParentModelChanged = function (parentModel) {
  26632. var _this = this;
  26633. if (!parentModel) {
  26634. this.eFloatingFilterText.setValue('');
  26635. return;
  26636. }
  26637. this.params.parentFilterInstance(function (filterInstance) {
  26638. // getModelAsString should be present, as we check this
  26639. // in floatingFilterWrapper
  26640. if (filterInstance.getModelAsString) {
  26641. var modelAsString = filterInstance.getModelAsString(parentModel);
  26642. _this.eFloatingFilterText.setValue(modelAsString);
  26643. }
  26644. });
  26645. };
  26646. __decorate([
  26647. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eFloatingFilterText')
  26648. ], ReadOnlyFloatingFilter.prototype, "eFloatingFilterText", void 0);
  26649. __decorate([
  26650. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnController')
  26651. ], ReadOnlyFloatingFilter.prototype, "columnController", void 0);
  26652. return ReadOnlyFloatingFilter;
  26653. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  26654. /***/ }),
  26655. /* 121 */
  26656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26657. "use strict";
  26658. __webpack_require__.r(__webpack_exports__);
  26659. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BodyDropTarget", function() { return BodyDropTarget; });
  26660. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(104);
  26661. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  26662. /* harmony import */ var _moveColumnController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(122);
  26663. /* harmony import */ var _bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(123);
  26664. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
  26665. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41);
  26666. /**
  26667. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  26668. * @version v23.2.1
  26669. * @link http://www.ag-grid.com/
  26670. * @license MIT
  26671. */
  26672. var __extends = (undefined && undefined.__extends) || (function () {
  26673. var extendStatics = function (d, b) {
  26674. extendStatics = Object.setPrototypeOf ||
  26675. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  26676. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  26677. return extendStatics(d, b);
  26678. };
  26679. return function (d, b) {
  26680. extendStatics(d, b);
  26681. function __() { this.constructor = d; }
  26682. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  26683. };
  26684. })();
  26685. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  26686. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  26687. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  26688. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  26689. return c > 3 && r && Object.defineProperty(target, key, r), r;
  26690. };
  26691. var DropType;
  26692. (function (DropType) {
  26693. DropType[DropType["ColumnMove"] = 0] = "ColumnMove";
  26694. DropType[DropType["Pivot"] = 1] = "Pivot";
  26695. })(DropType || (DropType = {}));
  26696. var BodyDropTarget = /** @class */ (function (_super) {
  26697. __extends(BodyDropTarget, _super);
  26698. function BodyDropTarget(pinned, eContainer) {
  26699. var _this = _super.call(this) || this;
  26700. _this.dropListeners = {};
  26701. _this.pinned = pinned;
  26702. _this.eContainer = eContainer;
  26703. return _this;
  26704. }
  26705. BodyDropTarget.prototype.registerGridComp = function (gridPanel) {
  26706. this.gridPanel = gridPanel;
  26707. this.moveColumnController.registerGridComp(gridPanel);
  26708. switch (this.pinned) {
  26709. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_LEFT:
  26710. this.eSecondaryContainers = this.gridPanel.getDropTargetLeftContainers();
  26711. break;
  26712. case _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].PINNED_RIGHT:
  26713. this.eSecondaryContainers = this.gridPanel.getDropTargetRightContainers();
  26714. break;
  26715. default:
  26716. this.eSecondaryContainers = this.gridPanel.getDropTargetBodyContainers();
  26717. break;
  26718. }
  26719. };
  26720. BodyDropTarget.prototype.isInterestedIn = function (type) {
  26721. return type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].HeaderCell ||
  26722. (type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].ToolPanel && this.gridOptionsWrapper.isAllowDragFromColumnsToolPanel());
  26723. };
  26724. BodyDropTarget.prototype.getSecondaryContainers = function () {
  26725. return this.eSecondaryContainers;
  26726. };
  26727. BodyDropTarget.prototype.getContainer = function () {
  26728. return this.eContainer;
  26729. };
  26730. BodyDropTarget.prototype.init = function () {
  26731. this.moveColumnController = this.createBean(new _moveColumnController__WEBPACK_IMPORTED_MODULE_2__["MoveColumnController"](this.pinned, this.eContainer));
  26732. var bodyDropPivotTarget = new _bodyDropPivotTarget__WEBPACK_IMPORTED_MODULE_3__["BodyDropPivotTarget"](this.pinned);
  26733. this.createBean(bodyDropPivotTarget);
  26734. this.dropListeners[DropType.ColumnMove] = this.moveColumnController;
  26735. this.dropListeners[DropType.Pivot] = bodyDropPivotTarget;
  26736. this.dragAndDropService.addDropTarget(this);
  26737. };
  26738. BodyDropTarget.prototype.getIconName = function () {
  26739. return this.currentDropListener.getIconName();
  26740. };
  26741. // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel
  26742. // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when
  26743. // dropped into the grid's body.
  26744. BodyDropTarget.prototype.getDropType = function (draggingEvent) {
  26745. if (this.columnController.isPivotMode()) {
  26746. // in pivot mode, then if moving a column (ie didn't come from toolpanel) then it's
  26747. // a standard column move, however if it came from the toolpanel, then we are introducing
  26748. // dimensions or values to the grid
  26749. if (draggingEvent.dragSource.type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].ToolPanel) {
  26750. return DropType.Pivot;
  26751. }
  26752. return DropType.ColumnMove;
  26753. }
  26754. // it's a column, and not pivot mode, so always moving
  26755. return DropType.ColumnMove;
  26756. };
  26757. BodyDropTarget.prototype.onDragEnter = function (draggingEvent) {
  26758. // we pick the drop listener depending on whether we are in pivot mode are not. if we are
  26759. // in pivot mode, then dropping cols changes the row group, pivot, value stats. otherwise
  26760. // we change visibility state and position.
  26761. // if (this.columnController.isPivotMode()) {
  26762. var dropType = this.getDropType(draggingEvent);
  26763. this.currentDropListener = this.dropListeners[dropType];
  26764. this.currentDropListener.onDragEnter(draggingEvent);
  26765. };
  26766. BodyDropTarget.prototype.onDragLeave = function (params) {
  26767. this.currentDropListener.onDragLeave(params);
  26768. };
  26769. BodyDropTarget.prototype.onDragging = function (params) {
  26770. this.currentDropListener.onDragging(params);
  26771. };
  26772. BodyDropTarget.prototype.onDragStop = function (params) {
  26773. this.currentDropListener.onDragStop(params);
  26774. };
  26775. __decorate([
  26776. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragAndDropService')
  26777. ], BodyDropTarget.prototype, "dragAndDropService", void 0);
  26778. __decorate([
  26779. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  26780. ], BodyDropTarget.prototype, "columnController", void 0);
  26781. __decorate([
  26782. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  26783. ], BodyDropTarget.prototype, "gridOptionsWrapper", void 0);
  26784. __decorate([
  26785. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  26786. ], BodyDropTarget.prototype, "init", null);
  26787. return BodyDropTarget;
  26788. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_5__["BeanStub"]));
  26789. /***/ }),
  26790. /* 122 */
  26791. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26792. "use strict";
  26793. __webpack_require__.r(__webpack_exports__);
  26794. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MoveColumnController", function() { return MoveColumnController; });
  26795. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  26796. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
  26797. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(104);
  26798. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  26799. /**
  26800. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  26801. * @version v23.2.1
  26802. * @link http://www.ag-grid.com/
  26803. * @license MIT
  26804. */
  26805. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  26806. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  26807. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  26808. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  26809. return c > 3 && r && Object.defineProperty(target, key, r), r;
  26810. };
  26811. var MoveColumnController = /** @class */ (function () {
  26812. function MoveColumnController(pinned, eContainer) {
  26813. this.needToMoveLeft = false;
  26814. this.needToMoveRight = false;
  26815. this.pinned = pinned;
  26816. this.eContainer = eContainer;
  26817. this.centerContainer = !_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(pinned);
  26818. }
  26819. MoveColumnController.prototype.registerGridComp = function (gridPanel) {
  26820. this.gridPanel = gridPanel;
  26821. };
  26822. MoveColumnController.prototype.init = function () {
  26823. this.logger = this.loggerFactory.create('MoveColumnController');
  26824. };
  26825. MoveColumnController.prototype.getIconName = function () {
  26826. return this.pinned ? _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_PINNED : _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_MOVE;
  26827. };
  26828. MoveColumnController.prototype.onDragEnter = function (draggingEvent) {
  26829. // we do dummy drag, so make sure column appears in the right location when first placed
  26830. var columns = draggingEvent.dragItem.columns;
  26831. var dragCameFromToolPanel = draggingEvent.dragSource.type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragSourceType"].ToolPanel;
  26832. if (dragCameFromToolPanel) {
  26833. // the if statement doesn't work if drag leaves grid, then enters again
  26834. this.setColumnsVisible(columns, true, "uiColumnDragged");
  26835. }
  26836. else {
  26837. // restore previous state of visible columns upon re-entering. this means if the user drags
  26838. // a group out, and then drags the group back in, only columns that were originally visible
  26839. // will be visible again. otherwise a group with three columns (but only two visible) could
  26840. // be dragged out, then when it's dragged in again, all three are visible. this stops that.
  26841. var visibleState_1 = draggingEvent.dragItem.visibleState;
  26842. var visibleColumns = columns.filter(function (column) { return visibleState_1[column.getId()]; });
  26843. this.setColumnsVisible(visibleColumns, true, "uiColumnDragged");
  26844. }
  26845. this.setColumnsPinned(columns, this.pinned, "uiColumnDragged");
  26846. this.onDragging(draggingEvent, true);
  26847. };
  26848. MoveColumnController.prototype.onDragLeave = function (draggingEvent) {
  26849. var hideColumnOnExit = !this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns() && !draggingEvent.fromNudge;
  26850. if (hideColumnOnExit) {
  26851. var dragItem = draggingEvent.dragSource.getDragItem();
  26852. var columns = dragItem.columns;
  26853. this.setColumnsVisible(columns, false, "uiColumnDragged");
  26854. }
  26855. this.ensureIntervalCleared();
  26856. };
  26857. MoveColumnController.prototype.setColumnsVisible = function (columns, visible, source) {
  26858. if (source === void 0) { source = "api"; }
  26859. if (columns) {
  26860. var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; });
  26861. this.columnController.setColumnsVisible(allowedCols, visible, source);
  26862. }
  26863. };
  26864. MoveColumnController.prototype.setColumnsPinned = function (columns, pinned, source) {
  26865. if (source === void 0) { source = "api"; }
  26866. if (columns) {
  26867. var allowedCols = columns.filter(function (c) { return !c.getColDef().lockPinned; });
  26868. this.columnController.setColumnsPinned(allowedCols, pinned, source);
  26869. }
  26870. };
  26871. MoveColumnController.prototype.onDragStop = function () {
  26872. this.ensureIntervalCleared();
  26873. };
  26874. MoveColumnController.prototype.normaliseX = function (x) {
  26875. // flip the coordinate if doing RTL
  26876. if (this.gridOptionsWrapper.isEnableRtl()) {
  26877. var clientWidth = this.eContainer.clientWidth;
  26878. x = clientWidth - x;
  26879. }
  26880. // adjust for scroll only if centre container (the pinned containers don't scroll)
  26881. if (this.centerContainer) {
  26882. x += this.gridPanel.getCenterViewportScrollLeft();
  26883. }
  26884. return x;
  26885. };
  26886. MoveColumnController.prototype.checkCenterForScrolling = function (xAdjustedForScroll) {
  26887. if (this.centerContainer) {
  26888. // scroll if the mouse has gone outside the grid (or just outside the scrollable part if pinning)
  26889. // putting in 50 buffer, so even if user gets to edge of grid, a scroll will happen
  26890. var firstVisiblePixel = this.gridPanel.getCenterViewportScrollLeft();
  26891. var lastVisiblePixel = firstVisiblePixel + this.gridPanel.getCenterWidth();
  26892. if (this.gridOptionsWrapper.isEnableRtl()) {
  26893. this.needToMoveRight = xAdjustedForScroll < (firstVisiblePixel + 50);
  26894. this.needToMoveLeft = xAdjustedForScroll > (lastVisiblePixel - 50);
  26895. }
  26896. else {
  26897. this.needToMoveLeft = xAdjustedForScroll < (firstVisiblePixel + 50);
  26898. this.needToMoveRight = xAdjustedForScroll > (lastVisiblePixel - 50);
  26899. }
  26900. if (this.needToMoveLeft || this.needToMoveRight) {
  26901. this.ensureIntervalStarted();
  26902. }
  26903. else {
  26904. this.ensureIntervalCleared();
  26905. }
  26906. }
  26907. };
  26908. MoveColumnController.prototype.onDragging = function (draggingEvent, fromEnter) {
  26909. var _this = this;
  26910. if (fromEnter === void 0) { fromEnter = false; }
  26911. this.lastDraggingEvent = draggingEvent;
  26912. // if moving up or down (ie not left or right) then do nothing
  26913. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].missing(draggingEvent.hDirection)) {
  26914. return;
  26915. }
  26916. var mouseXNormalised = this.normaliseX(draggingEvent.x);
  26917. // if the user is dragging into the panel, ie coming from the side panel into the main grid,
  26918. // we don't want to scroll the grid this time, it would appear like the table is jumping
  26919. // each time a column is dragged in.
  26920. if (!fromEnter) {
  26921. this.checkCenterForScrolling(mouseXNormalised);
  26922. }
  26923. var hDirectionNormalised = this.normaliseDirection(draggingEvent.hDirection);
  26924. var dragSourceType = draggingEvent.dragSource.type;
  26925. var columnsToMove = draggingEvent.dragSource.getDragItem().columns;
  26926. columnsToMove = columnsToMove.filter(function (col) {
  26927. if (col.getColDef().lockPinned) {
  26928. // if locked return true only if both col and container are same pin type.
  26929. // double equals (==) here on purpose so that null==undefined is true (for not pinned options)
  26930. return col.getPinned() == _this.pinned;
  26931. }
  26932. else {
  26933. // if not pin locked, then always allowed to be in this container
  26934. return true;
  26935. }
  26936. });
  26937. this.attemptMoveColumns(dragSourceType, columnsToMove, hDirectionNormalised, mouseXNormalised, fromEnter);
  26938. };
  26939. MoveColumnController.prototype.normaliseDirection = function (hDirection) {
  26940. if (this.gridOptionsWrapper.isEnableRtl()) {
  26941. switch (hDirection) {
  26942. case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Left: return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Right;
  26943. case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Right: return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Left;
  26944. default: console.error("ag-Grid: Unknown direction " + hDirection);
  26945. }
  26946. }
  26947. else {
  26948. return hDirection;
  26949. }
  26950. };
  26951. // returns the index of the first column in the list ONLY if the cols are all beside
  26952. // each other. if the cols are not beside each other, then returns null
  26953. MoveColumnController.prototype.calculateOldIndex = function (movingCols) {
  26954. var gridCols = this.columnController.getAllGridColumns();
  26955. var indexes = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].sortNumerically(movingCols.map(function (col) { return gridCols.indexOf(col); }));
  26956. var firstIndex = indexes[0];
  26957. var lastIndex = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].last(indexes);
  26958. var spread = lastIndex - firstIndex;
  26959. var gapsExist = spread !== indexes.length - 1;
  26960. return gapsExist ? null : firstIndex;
  26961. };
  26962. MoveColumnController.prototype.attemptMoveColumns = function (dragSourceType, allMovingColumns, hDirection, mouseX, fromEnter) {
  26963. var draggingLeft = hDirection === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Left;
  26964. var draggingRight = hDirection === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["HorizontalDirection"].Right;
  26965. var validMoves = this.calculateValidMoves(allMovingColumns, draggingRight, mouseX);
  26966. // if cols are not adjacent, then this returns null. when moving, we constrain the direction of the move
  26967. // (ie left or right) to the mouse direction. however
  26968. var oldIndex = this.calculateOldIndex(allMovingColumns);
  26969. if (validMoves.length === 0) {
  26970. return;
  26971. }
  26972. var firstValidMove = validMoves[0];
  26973. // the two check below stop an error when the user grabs a group my a middle column, then
  26974. // it is possible the mouse pointer is to the right of a column while been dragged left.
  26975. // so we need to make sure that the mouse pointer is actually left of the left most column
  26976. // if moving left, and right of the right most column if moving right
  26977. // we check 'fromEnter' below so we move the column to the new spot if the mouse is coming from
  26978. // outside the grid, eg if the column is moving from side panel, mouse is moving left, then we should
  26979. // place the column to the RHS even if the mouse is moving left and the column is already on
  26980. // the LHS. otherwise we stick to the rule described above.
  26981. var constrainDirection = oldIndex !== null && !fromEnter;
  26982. // don't consider 'fromEnter' when dragging header cells, otherwise group can jump to opposite direction of drag
  26983. if (dragSourceType == _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragSourceType"].HeaderCell) {
  26984. constrainDirection = oldIndex !== null;
  26985. }
  26986. if (constrainDirection) {
  26987. // only allow left drag if this column is moving left
  26988. if (draggingLeft && firstValidMove >= oldIndex) {
  26989. return;
  26990. }
  26991. // only allow right drag if this column is moving right
  26992. if (draggingRight && firstValidMove <= oldIndex) {
  26993. return;
  26994. }
  26995. }
  26996. for (var i = 0; i < validMoves.length; i++) {
  26997. var move = validMoves[i];
  26998. if (!this.columnController.doesMovePassRules(allMovingColumns, move)) {
  26999. continue;
  27000. }
  27001. this.columnController.moveColumns(allMovingColumns, move, "uiColumnDragged");
  27002. // important to return here, so once we do the first valid move, we don't try do any more
  27003. return;
  27004. }
  27005. };
  27006. MoveColumnController.prototype.calculateValidMoves = function (movingCols, draggingRight, mouseX) {
  27007. var isMoveBlocked = this.gridOptionsWrapper.isSuppressMovableColumns() || movingCols.some(function (col) { return col.getColDef().suppressMovable; });
  27008. if (isMoveBlocked) {
  27009. return [];
  27010. }
  27011. // this is the list of cols on the screen, so it's these we use when comparing the x mouse position
  27012. var allDisplayedCols = this.columnController.getDisplayedColumns(this.pinned);
  27013. // but this list is the list of all cols, when we move a col it's the index within this list that gets used,
  27014. // so the result we return has to be and index location for this list
  27015. var allGridCols = this.columnController.getAllGridColumns();
  27016. var movingDisplayedCols = allDisplayedCols.filter(function (col) { return _utils__WEBPACK_IMPORTED_MODULE_3__["_"].includes(movingCols, col); });
  27017. var otherDisplayedCols = allDisplayedCols.filter(function (col) { return !_utils__WEBPACK_IMPORTED_MODULE_3__["_"].includes(movingCols, col); });
  27018. var otherGridCols = allGridCols.filter(function (col) { return !_utils__WEBPACK_IMPORTED_MODULE_3__["_"].includes(movingCols, col); });
  27019. // work out how many DISPLAYED columns fit before the 'x' position. this gives us the displayIndex.
  27020. // for example, if cols are a,b,c,d and we find a,b fit before 'x', then we want to place the moving
  27021. // col between b and c (so that it is under the mouse position).
  27022. var displayIndex = 0;
  27023. var availableWidth = mouseX;
  27024. // if we are dragging right, then the columns will be to the left of the mouse, so we also want to
  27025. // include the width of the moving columns
  27026. if (draggingRight) {
  27027. var widthOfMovingDisplayedCols_1 = 0;
  27028. movingDisplayedCols.forEach(function (col) { return widthOfMovingDisplayedCols_1 += col.getActualWidth(); });
  27029. availableWidth -= widthOfMovingDisplayedCols_1;
  27030. }
  27031. if (availableWidth > 0) {
  27032. // now count how many of the displayed columns will fit to the left
  27033. for (var i = 0; i < otherDisplayedCols.length; i++) {
  27034. var col = otherDisplayedCols[i];
  27035. availableWidth -= col.getActualWidth();
  27036. if (availableWidth < 0) {
  27037. break;
  27038. }
  27039. displayIndex++;
  27040. }
  27041. // trial and error, if going right, we adjust by one, i didn't manage to quantify why, but it works
  27042. if (draggingRight) {
  27043. displayIndex++;
  27044. }
  27045. }
  27046. // the display index is with respect to all the showing columns, however when we move, it's with
  27047. // respect to all grid columns, so we need to translate from display index to grid index
  27048. var firstValidMove;
  27049. if (displayIndex > 0) {
  27050. var leftColumn = otherDisplayedCols[displayIndex - 1];
  27051. firstValidMove = otherGridCols.indexOf(leftColumn) + 1;
  27052. }
  27053. else {
  27054. firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]);
  27055. if (firstValidMove === -1) {
  27056. firstValidMove = 0;
  27057. }
  27058. }
  27059. var validMoves = [firstValidMove];
  27060. // add in other valid moves due to hidden columns and married children. for example, a particular
  27061. // move might break a group that has married children (so move isn't valid), however there could
  27062. // be hidden columns (not displayed) that we could jump over to make the move valid. because
  27063. // they are hidden, user doesn't see any different, however it allows moves that would otherwise
  27064. // not work. for example imagine a group with 9 columns and all columns are hidden except the
  27065. // middle one (so 4 hidden to left, 4 hidden to right), then when moving 'firstValidMove' will
  27066. // be relative to the not-shown column, however we need to consider the move jumping over all the
  27067. // hidden children. if we didn't do this, then if the group just described was at the end (RHS) of the
  27068. // grid, there would be no way to put a column after it (as the grid would only consider beside the
  27069. // visible column, which would fail valid move rules).
  27070. if (draggingRight) {
  27071. // if dragging right, then we add all the additional moves to the right. so in other words
  27072. // if the next move is not valid, find the next move to the right that is valid.
  27073. var pointer = firstValidMove + 1;
  27074. var lastIndex = allGridCols.length - 1;
  27075. while (pointer <= lastIndex) {
  27076. validMoves.push(pointer);
  27077. pointer++;
  27078. }
  27079. }
  27080. else {
  27081. // if dragging left we do the reverse of dragging right, we add in all the valid moves to the
  27082. // left. however we also have to consider moves to the right for all hidden columns first.
  27083. // (this logic is hard to reason with, it was worked out with trial and error,
  27084. // move observation rather than science).
  27085. // add moves to the right
  27086. var pointer = firstValidMove;
  27087. var lastIndex = allGridCols.length - 1;
  27088. var displacedCol = allGridCols[pointer];
  27089. while (pointer <= lastIndex && this.isColumnHidden(allDisplayedCols, displacedCol)) {
  27090. pointer++;
  27091. validMoves.push(pointer);
  27092. displacedCol = allGridCols[pointer];
  27093. }
  27094. // add moves to the left
  27095. pointer = firstValidMove - 1;
  27096. var firstDisplayIndex = 0;
  27097. while (pointer >= firstDisplayIndex) {
  27098. validMoves.push(pointer);
  27099. pointer--;
  27100. }
  27101. }
  27102. return validMoves;
  27103. };
  27104. // isHidden takes into account visible=false and group=closed, ie it is not displayed
  27105. MoveColumnController.prototype.isColumnHidden = function (displayedColumns, col) {
  27106. return displayedColumns.indexOf(col) < 0;
  27107. };
  27108. MoveColumnController.prototype.ensureIntervalStarted = function () {
  27109. if (!this.movingIntervalId) {
  27110. this.intervalCount = 0;
  27111. this.failedMoveAttempts = 0;
  27112. this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), 100);
  27113. if (this.needToMoveLeft) {
  27114. this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_LEFT, true);
  27115. }
  27116. else {
  27117. this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_RIGHT, true);
  27118. }
  27119. }
  27120. };
  27121. MoveColumnController.prototype.ensureIntervalCleared = function () {
  27122. if (this.moveInterval) {
  27123. window.clearInterval(this.movingIntervalId);
  27124. this.movingIntervalId = null;
  27125. this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_MOVE);
  27126. }
  27127. };
  27128. MoveColumnController.prototype.moveInterval = function () {
  27129. // the amounts we move get bigger at each interval, so the speed accelerates, starting a bit slow
  27130. // and getting faster. this is to give smoother user experience. we max at 100px to limit the speed.
  27131. var pixelsToMove;
  27132. this.intervalCount++;
  27133. pixelsToMove = 10 + (this.intervalCount * 5);
  27134. if (pixelsToMove > 100) {
  27135. pixelsToMove = 100;
  27136. }
  27137. var pixelsMoved;
  27138. if (this.needToMoveLeft) {
  27139. pixelsMoved = this.gridPanel.scrollHorizontally(-pixelsToMove);
  27140. }
  27141. else if (this.needToMoveRight) {
  27142. pixelsMoved = this.gridPanel.scrollHorizontally(pixelsToMove);
  27143. }
  27144. if (pixelsMoved !== 0) {
  27145. this.onDragging(this.lastDraggingEvent);
  27146. this.failedMoveAttempts = 0;
  27147. }
  27148. else {
  27149. // we count the failed move attempts. if we fail to move 7 times, then we pin the column.
  27150. // this is how we achieve pining by dragging the column to the edge of the grid.
  27151. this.failedMoveAttempts++;
  27152. var columns = this.lastDraggingEvent.dragItem.columns;
  27153. var columnsThatCanPin = columns.filter(function (c) { return !c.getColDef().lockPinned; });
  27154. if (columnsThatCanPin.length > 0) {
  27155. this.dragAndDropService.setGhostIcon(_dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_2__["DragAndDropService"].ICON_PINNED);
  27156. if (this.failedMoveAttempts > 7) {
  27157. var pinType = this.needToMoveLeft ? _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_LEFT : _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_RIGHT;
  27158. this.setColumnsPinned(columnsThatCanPin, pinType, "uiColumnDragged");
  27159. this.dragAndDropService.nudge();
  27160. }
  27161. }
  27162. }
  27163. };
  27164. __decorate([
  27165. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('loggerFactory')
  27166. ], MoveColumnController.prototype, "loggerFactory", void 0);
  27167. __decorate([
  27168. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  27169. ], MoveColumnController.prototype, "columnController", void 0);
  27170. __decorate([
  27171. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragAndDropService')
  27172. ], MoveColumnController.prototype, "dragAndDropService", void 0);
  27173. __decorate([
  27174. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  27175. ], MoveColumnController.prototype, "gridOptionsWrapper", void 0);
  27176. __decorate([
  27177. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  27178. ], MoveColumnController.prototype, "init", null);
  27179. return MoveColumnController;
  27180. }());
  27181. /***/ }),
  27182. /* 123 */
  27183. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27184. "use strict";
  27185. __webpack_require__.r(__webpack_exports__);
  27186. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BodyDropPivotTarget", function() { return BodyDropPivotTarget; });
  27187. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(104);
  27188. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  27189. /**
  27190. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  27191. * @version v23.2.1
  27192. * @link http://www.ag-grid.com/
  27193. * @license MIT
  27194. */
  27195. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  27196. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  27197. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  27198. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  27199. return c > 3 && r && Object.defineProperty(target, key, r), r;
  27200. };
  27201. var BodyDropPivotTarget = /** @class */ (function () {
  27202. function BodyDropPivotTarget(pinned) {
  27203. this.columnsToAggregate = [];
  27204. this.columnsToGroup = [];
  27205. this.columnsToPivot = [];
  27206. this.pinned = pinned;
  27207. }
  27208. /** Callback for when drag enters */
  27209. BodyDropPivotTarget.prototype.onDragEnter = function (draggingEvent) {
  27210. var _this = this;
  27211. this.clearColumnsList();
  27212. // in pivot mode, we don't accept any drops if functions are read only
  27213. if (this.gridOptionsWrapper.isFunctionsReadOnly()) {
  27214. return;
  27215. }
  27216. var dragColumns = draggingEvent.dragItem.columns;
  27217. dragColumns.forEach(function (column) {
  27218. // we don't allow adding secondary columns
  27219. if (!column.isPrimary()) {
  27220. return;
  27221. }
  27222. if (column.isAnyFunctionActive()) {
  27223. return;
  27224. }
  27225. if (column.isAllowValue()) {
  27226. _this.columnsToAggregate.push(column);
  27227. }
  27228. else if (column.isAllowRowGroup()) {
  27229. _this.columnsToGroup.push(column);
  27230. }
  27231. else if (column.isAllowRowGroup()) {
  27232. _this.columnsToPivot.push(column);
  27233. }
  27234. });
  27235. };
  27236. BodyDropPivotTarget.prototype.getIconName = function () {
  27237. var totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length;
  27238. if (totalColumns > 0) {
  27239. return this.pinned ? _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_PINNED : _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_MOVE;
  27240. }
  27241. else {
  27242. return null;
  27243. }
  27244. };
  27245. /** Callback for when drag leaves */
  27246. BodyDropPivotTarget.prototype.onDragLeave = function (draggingEvent) {
  27247. // if we are taking columns out of the center, then we remove them from the report
  27248. this.clearColumnsList();
  27249. };
  27250. BodyDropPivotTarget.prototype.clearColumnsList = function () {
  27251. this.columnsToAggregate.length = 0;
  27252. this.columnsToGroup.length = 0;
  27253. this.columnsToPivot.length = 0;
  27254. };
  27255. /** Callback for when dragging */
  27256. BodyDropPivotTarget.prototype.onDragging = function (draggingEvent) {
  27257. };
  27258. /** Callback for when drag stops */
  27259. BodyDropPivotTarget.prototype.onDragStop = function (draggingEvent) {
  27260. if (this.columnsToAggregate.length > 0) {
  27261. this.columnController.addValueColumns(this.columnsToAggregate, "toolPanelDragAndDrop");
  27262. }
  27263. if (this.columnsToGroup.length > 0) {
  27264. this.columnController.addRowGroupColumns(this.columnsToGroup, "toolPanelDragAndDrop");
  27265. }
  27266. if (this.columnsToPivot.length > 0) {
  27267. this.columnController.addPivotColumns(this.columnsToPivot, "toolPanelDragAndDrop");
  27268. }
  27269. };
  27270. __decorate([
  27271. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  27272. ], BodyDropPivotTarget.prototype, "columnController", void 0);
  27273. __decorate([
  27274. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  27275. ], BodyDropPivotTarget.prototype, "gridOptionsWrapper", void 0);
  27276. return BodyDropPivotTarget;
  27277. }());
  27278. /***/ }),
  27279. /* 124 */
  27280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27281. "use strict";
  27282. __webpack_require__.r(__webpack_exports__);
  27283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationDirection", function() { return HeaderNavigationDirection; });
  27284. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationService", function() { return HeaderNavigationService; });
  27285. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  27286. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  27287. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34);
  27288. /* harmony import */ var _headerRowComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(110);
  27289. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  27290. /**
  27291. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  27292. * @version v23.2.1
  27293. * @link http://www.ag-grid.com/
  27294. * @license MIT
  27295. */
  27296. var __extends = (undefined && undefined.__extends) || (function () {
  27297. var extendStatics = function (d, b) {
  27298. extendStatics = Object.setPrototypeOf ||
  27299. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  27300. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  27301. return extendStatics(d, b);
  27302. };
  27303. return function (d, b) {
  27304. extendStatics(d, b);
  27305. function __() { this.constructor = d; }
  27306. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  27307. };
  27308. })();
  27309. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  27310. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  27311. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  27312. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  27313. return c > 3 && r && Object.defineProperty(target, key, r), r;
  27314. };
  27315. var HeaderNavigationDirection;
  27316. (function (HeaderNavigationDirection) {
  27317. HeaderNavigationDirection[HeaderNavigationDirection["UP"] = 0] = "UP";
  27318. HeaderNavigationDirection[HeaderNavigationDirection["DOWN"] = 1] = "DOWN";
  27319. HeaderNavigationDirection[HeaderNavigationDirection["LEFT"] = 2] = "LEFT";
  27320. HeaderNavigationDirection[HeaderNavigationDirection["RIGHT"] = 3] = "RIGHT";
  27321. })(HeaderNavigationDirection || (HeaderNavigationDirection = {}));
  27322. var HeaderNavigationService = /** @class */ (function (_super) {
  27323. __extends(HeaderNavigationService, _super);
  27324. function HeaderNavigationService() {
  27325. return _super !== null && _super.apply(this, arguments) || this;
  27326. }
  27327. HeaderNavigationService.prototype.registerGridComp = function (gridPanel) {
  27328. this.gridPanel = gridPanel;
  27329. };
  27330. HeaderNavigationService.prototype.registerHeaderRoot = function (headerRoot) {
  27331. this.headerRoot = headerRoot;
  27332. };
  27333. HeaderNavigationService.prototype.getHeaderRowCount = function () {
  27334. var headerContainers = this.headerRoot.getHeaderContainers();
  27335. return headerContainers.size === 0 ? 0 : this.getHeaderContainer().getRowComps().length;
  27336. };
  27337. HeaderNavigationService.prototype.getHeaderRowType = function (idx) {
  27338. if (this.getHeaderRowCount()) {
  27339. return this.getHeaderContainer().getRowComps()[idx].getType();
  27340. }
  27341. };
  27342. HeaderNavigationService.prototype.getHeaderContainer = function (position) {
  27343. if (position === void 0) { position = 'center'; }
  27344. if (position === null) {
  27345. position = 'center';
  27346. }
  27347. return this.headerRoot.getHeaderContainers().get(position);
  27348. };
  27349. /*
  27350. * This method navigates grid header vertically
  27351. * @return {boolean} true to preventDefault on the event that caused this navigation.
  27352. */
  27353. HeaderNavigationService.prototype.navigateVertically = function (direction, fromHeader) {
  27354. if (!fromHeader) {
  27355. fromHeader = this.focusController.getFocusedHeader();
  27356. }
  27357. if (!fromHeader) {
  27358. return false;
  27359. }
  27360. var headerRowIndex = fromHeader.headerRowIndex, column = fromHeader.column;
  27361. var rowLen = this.getHeaderRowCount();
  27362. var isUp = direction === HeaderNavigationDirection.UP;
  27363. var nextRow = isUp ? headerRowIndex - 1 : headerRowIndex + 1;
  27364. if (nextRow < 0) {
  27365. return false;
  27366. }
  27367. if (nextRow >= rowLen) {
  27368. // focusGridView returns false when the grid has no cells rendered.
  27369. return this.focusController.focusGridView();
  27370. }
  27371. var currentRowType = this.getHeaderRowType(headerRowIndex);
  27372. var nextFocusColumn;
  27373. if (currentRowType === _headerRowComp__WEBPACK_IMPORTED_MODULE_3__["HeaderRowType"].COLUMN_GROUP) {
  27374. var currentColumn = column;
  27375. nextFocusColumn = isUp ? column.getParent() : currentColumn.getDisplayedChildren()[0];
  27376. }
  27377. else if (currentRowType === _headerRowComp__WEBPACK_IMPORTED_MODULE_3__["HeaderRowType"].FLOATING_FILTER) {
  27378. nextFocusColumn = column;
  27379. }
  27380. else {
  27381. var currentColumn = column;
  27382. nextFocusColumn = isUp ? currentColumn.getParent() : currentColumn;
  27383. }
  27384. if (!nextFocusColumn) {
  27385. return false;
  27386. }
  27387. this.focusController.focusHeaderPosition({
  27388. headerRowIndex: nextRow,
  27389. column: nextFocusColumn
  27390. });
  27391. return true;
  27392. };
  27393. /*
  27394. * This method navigates grid header horizontally
  27395. * @return {boolean} true to preventDefault on the event that caused this navigation.
  27396. */
  27397. HeaderNavigationService.prototype.navigateHorizontally = function (direction, fromTab) {
  27398. var focusedHeader = this.focusController.getFocusedHeader();
  27399. var isLeft = direction === HeaderNavigationDirection.LEFT;
  27400. var isRtl = this.gridOptionsWrapper.isEnableRtl();
  27401. var nextHeader;
  27402. var normalisedDirection;
  27403. // either navigating to the left or isRtl (cannot be both)
  27404. if (isLeft !== isRtl) {
  27405. normalisedDirection = 'Before';
  27406. nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection);
  27407. }
  27408. else {
  27409. normalisedDirection = 'After';
  27410. nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection);
  27411. }
  27412. if (nextHeader) {
  27413. this.focusController.focusHeaderPosition(nextHeader, normalisedDirection);
  27414. return true;
  27415. }
  27416. if (!fromTab) {
  27417. return true;
  27418. }
  27419. return this.focusNextHeaderRow(focusedHeader, normalisedDirection);
  27420. };
  27421. HeaderNavigationService.prototype.focusNextHeaderRow = function (focusedHeader, direction) {
  27422. var currentIndex = focusedHeader.headerRowIndex;
  27423. var nextPosition;
  27424. var nextRowIndex;
  27425. if (direction === 'Before') {
  27426. if (currentIndex === 0) {
  27427. return false;
  27428. }
  27429. nextRowIndex = currentIndex - 1;
  27430. nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'end');
  27431. }
  27432. else {
  27433. nextRowIndex = currentIndex + 1;
  27434. nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'start');
  27435. }
  27436. if (nextPosition) {
  27437. if (nextPosition.headerRowIndex === -1) {
  27438. return this.focusController.focusGridView(nextPosition.column);
  27439. }
  27440. return this.focusController.focusHeaderPosition(nextPosition, direction);
  27441. }
  27442. return false;
  27443. };
  27444. HeaderNavigationService.prototype.scrollToColumn = function (column, direction) {
  27445. if (direction === void 0) { direction = 'After'; }
  27446. if (column.getPinned()) {
  27447. return;
  27448. }
  27449. var columnToScrollTo;
  27450. if (column instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_2__["ColumnGroup"]) {
  27451. var columns = column.getDisplayedLeafColumns();
  27452. columnToScrollTo = direction === 'Before' ? _utils__WEBPACK_IMPORTED_MODULE_4__["_"].last(columns) : columns[0];
  27453. }
  27454. else {
  27455. columnToScrollTo = column;
  27456. }
  27457. this.gridPanel.ensureColumnVisible(columnToScrollTo);
  27458. // need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
  27459. // floating cell, the scrolls get out of sync
  27460. this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
  27461. // need to flush frames, to make sure the correct cells are rendered
  27462. this.animationFrameService.flushAllFrames();
  27463. };
  27464. __decorate([
  27465. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  27466. ], HeaderNavigationService.prototype, "gridOptionsWrapper", void 0);
  27467. __decorate([
  27468. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
  27469. ], HeaderNavigationService.prototype, "focusController", void 0);
  27470. __decorate([
  27471. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('headerPositionUtils')
  27472. ], HeaderNavigationService.prototype, "headerPositionUtils", void 0);
  27473. __decorate([
  27474. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('animationFrameService')
  27475. ], HeaderNavigationService.prototype, "animationFrameService", void 0);
  27476. HeaderNavigationService = __decorate([
  27477. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('headerNavigationService')
  27478. ], HeaderNavigationService);
  27479. return HeaderNavigationService;
  27480. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  27481. /***/ }),
  27482. /* 125 */
  27483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27484. "use strict";
  27485. __webpack_require__.r(__webpack_exports__);
  27486. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterManager", function() { return FilterManager; });
  27487. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  27488. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  27489. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  27490. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38);
  27491. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39);
  27492. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17);
  27493. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(41);
  27494. /* harmony import */ var _utils_set__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(29);
  27495. /* harmony import */ var _utils_generic__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(14);
  27496. /* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(16);
  27497. /* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(12);
  27498. /**
  27499. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  27500. * @version v23.2.1
  27501. * @link http://www.ag-grid.com/
  27502. * @license MIT
  27503. */
  27504. var __extends = (undefined && undefined.__extends) || (function () {
  27505. var extendStatics = function (d, b) {
  27506. extendStatics = Object.setPrototypeOf ||
  27507. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  27508. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  27509. return extendStatics(d, b);
  27510. };
  27511. return function (d, b) {
  27512. extendStatics(d, b);
  27513. function __() { this.constructor = d; }
  27514. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  27515. };
  27516. })();
  27517. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  27518. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  27519. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  27520. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  27521. return c > 3 && r && Object.defineProperty(target, key, r), r;
  27522. };
  27523. var FilterManager = /** @class */ (function (_super) {
  27524. __extends(FilterManager, _super);
  27525. function FilterManager() {
  27526. var _this = _super !== null && _super.apply(this, arguments) || this;
  27527. _this.allFilters = new Map();
  27528. _this.quickFilter = null;
  27529. _this.quickFilterParts = null;
  27530. // this is true when the grid is processing the filter change. this is used by the cell comps, so that they
  27531. // don't flash when data changes due to filter changes. there is no need to flash when filter changes as the
  27532. // user is in control, so doesn't make sense to show flashing changes. for example, go to main demo where
  27533. // this feature is turned off (hack code to always return false for isSuppressFlashingCellsBecauseFiltering(), put in)
  27534. // 100,000 rows and group by country. then do some filtering. all the cells flash, which is silly.
  27535. _this.processingFilterChange = false;
  27536. return _this;
  27537. }
  27538. FilterManager_1 = FilterManager;
  27539. FilterManager.prototype.init = function () {
  27540. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_CHANGED, this.onNewRowsLoaded.bind(this));
  27541. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
  27542. this.quickFilter = this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText());
  27543. this.setQuickFilterParts();
  27544. this.allowShowChangeAfterFilter = this.gridOptionsWrapper.isAllowShowChangeAfterFilter();
  27545. // check this here, in case there is a filter from the start
  27546. this.checkExternalFilter();
  27547. };
  27548. FilterManager.prototype.setQuickFilterParts = function () {
  27549. this.quickFilterParts = this.quickFilter ? this.quickFilter.split(' ') : null;
  27550. };
  27551. FilterManager.prototype.setFilterModel = function (model) {
  27552. var _this = this;
  27553. var allPromises = [];
  27554. if (model) {
  27555. // mark the filters as we set them, so any active filters left over we stop
  27556. var modelKeys_1 = Object(_utils_set__WEBPACK_IMPORTED_MODULE_7__["convertToSet"])(Object.keys(model));
  27557. this.allFilters.forEach(function (filterWrapper, colId) {
  27558. var newModel = model[colId];
  27559. allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, newModel));
  27560. modelKeys_1.delete(colId);
  27561. });
  27562. // at this point, processedFields contains data for which we don't have a filter working yet
  27563. modelKeys_1.forEach(function (colId) {
  27564. var column = _this.columnController.getPrimaryColumn(colId);
  27565. if (!column) {
  27566. console.warn('Warning ag-grid setFilterModel - no column found for colId ' + colId);
  27567. return;
  27568. }
  27569. var filterWrapper = _this.getOrCreateFilterWrapper(column, 'NO_UI');
  27570. allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, model[colId]));
  27571. });
  27572. }
  27573. else {
  27574. this.allFilters.forEach(function (filterWrapper) {
  27575. allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, null));
  27576. });
  27577. }
  27578. _utils__WEBPACK_IMPORTED_MODULE_0__["Promise"].all(allPromises).then(function () { return _this.onFilterChanged(); });
  27579. };
  27580. FilterManager.prototype.setModelOnFilterWrapper = function (filterPromise, newModel) {
  27581. return new _utils__WEBPACK_IMPORTED_MODULE_0__["Promise"](function (resolve) {
  27582. filterPromise.then(function (filter) {
  27583. if (typeof filter.setModel !== 'function') {
  27584. console.warn('Warning ag-grid - filter missing setModel method, which is needed for setFilterModel');
  27585. resolve();
  27586. }
  27587. var promise = filter.setModel(newModel);
  27588. if (promise == null) {
  27589. resolve();
  27590. }
  27591. else {
  27592. promise.then(function () { return resolve(); });
  27593. }
  27594. });
  27595. });
  27596. };
  27597. FilterManager.prototype.getFilterModel = function () {
  27598. var result = {};
  27599. this.allFilters.forEach(function (filterWrapper, key) {
  27600. // because user can provide filters, we provide useful error checking and messages
  27601. var filterPromise = filterWrapper.filterPromise;
  27602. var filter = filterPromise.resolveNow(null, function (filter) { return filter; });
  27603. if (filter == null) {
  27604. return null;
  27605. }
  27606. if (typeof filter.getModel !== 'function') {
  27607. console.warn('Warning ag-grid - filter API missing getModel method, which is needed for getFilterModel');
  27608. return;
  27609. }
  27610. var model = filter.getModel();
  27611. if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(model)) {
  27612. result[key] = model;
  27613. }
  27614. });
  27615. return result;
  27616. };
  27617. // returns true if any advanced filter (ie not quick filter) active
  27618. FilterManager.prototype.isAdvancedFilterPresent = function () {
  27619. return this.advancedFilterPresent;
  27620. };
  27621. // called by:
  27622. // 1) onFilterChanged()
  27623. // 2) onNewRowsLoaded()
  27624. FilterManager.prototype.setAdvancedFilterPresent = function () {
  27625. var atLeastOneActive = false;
  27626. this.allFilters.forEach(function (filterWrapper) {
  27627. if (atLeastOneActive) {
  27628. return;
  27629. } // no need to check any more
  27630. if (filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); })) {
  27631. atLeastOneActive = true;
  27632. }
  27633. });
  27634. this.advancedFilterPresent = atLeastOneActive;
  27635. };
  27636. FilterManager.prototype.updateFilterFlagInColumns = function (source, additionalEventAttributes) {
  27637. this.allFilters.forEach(function (filterWrapper) {
  27638. var isFilterActive = filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });
  27639. filterWrapper.column.setFilterActive(isFilterActive, source, additionalEventAttributes);
  27640. });
  27641. };
  27642. // returns true if quickFilter or advancedFilter
  27643. FilterManager.prototype.isAnyFilterPresent = function () {
  27644. return this.isQuickFilterPresent() || this.advancedFilterPresent || this.externalFilterPresent;
  27645. };
  27646. FilterManager.prototype.doesFilterPass = function (node, filterToSkip) {
  27647. var data = node.data;
  27648. var filterPasses = true;
  27649. this.allFilters.forEach(function (filterWrapper) {
  27650. // if a filter has already failed, no need to run any more
  27651. if (!filterPasses) {
  27652. return;
  27653. }
  27654. // if no filter, always pass
  27655. if (filterWrapper == null) {
  27656. return;
  27657. }
  27658. var filter = filterWrapper.filterPromise.resolveNow(undefined, function (filter) { return filter; });
  27659. if (filter == null || filter === filterToSkip || !filter.isFilterActive()) {
  27660. return;
  27661. }
  27662. if (!filter.doesFilterPass) { // because users can do custom filters, give nice error message
  27663. throw new Error('Filter is missing method doesFilterPass');
  27664. }
  27665. filterPasses = filter.doesFilterPass({ node: node, data: data });
  27666. });
  27667. return filterPasses;
  27668. };
  27669. FilterManager.prototype.parseQuickFilter = function (newFilter) {
  27670. if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(newFilter)) {
  27671. return null;
  27672. }
  27673. if (!this.gridOptionsWrapper.isRowModelDefault()) {
  27674. console.warn('ag-grid: quick filtering only works with the Client-Side Row Model');
  27675. return null;
  27676. }
  27677. return newFilter.toUpperCase();
  27678. };
  27679. FilterManager.prototype.setQuickFilter = function (newFilter) {
  27680. var parsedFilter = this.parseQuickFilter(newFilter);
  27681. if (this.quickFilter !== parsedFilter) {
  27682. this.quickFilter = parsedFilter;
  27683. this.setQuickFilterParts();
  27684. this.onFilterChanged();
  27685. }
  27686. };
  27687. FilterManager.prototype.checkExternalFilter = function () {
  27688. this.externalFilterPresent = this.gridOptionsWrapper.isExternalFilterPresent();
  27689. };
  27690. FilterManager.prototype.onFilterChanged = function (filterInstance, additionalEventAttributes) {
  27691. this.setAdvancedFilterPresent();
  27692. this.updateFilterFlagInColumns('filterChanged', additionalEventAttributes);
  27693. this.checkExternalFilter();
  27694. this.allFilters.forEach(function (filterWrapper) {
  27695. filterWrapper.filterPromise.then(function (filter) {
  27696. if (filter !== filterInstance && filter.onAnyFilterChanged) {
  27697. filter.onAnyFilterChanged();
  27698. }
  27699. });
  27700. });
  27701. var filterChangedEvent = {
  27702. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_CHANGED,
  27703. api: this.gridApi,
  27704. columnApi: this.columnApi
  27705. };
  27706. if (additionalEventAttributes) {
  27707. Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["mergeDeep"])(filterChangedEvent, additionalEventAttributes);
  27708. }
  27709. // because internal events are not async in ag-grid, when the dispatchEvent
  27710. // method comes back, we know all listeners have finished executing.
  27711. this.processingFilterChange = true;
  27712. this.eventService.dispatchEvent(filterChangedEvent);
  27713. this.processingFilterChange = false;
  27714. };
  27715. FilterManager.prototype.isSuppressFlashingCellsBecauseFiltering = function () {
  27716. // if user has elected to always flash cell changes, then always return false, otherwise we suppress flashing
  27717. // changes when filtering
  27718. return !this.allowShowChangeAfterFilter && this.processingFilterChange;
  27719. };
  27720. FilterManager.prototype.isQuickFilterPresent = function () {
  27721. return this.quickFilter !== null;
  27722. };
  27723. FilterManager.prototype.doesRowPassOtherFilters = function (filterToSkip, node) {
  27724. return this.doesRowPassFilter(node, filterToSkip);
  27725. };
  27726. FilterManager.prototype.doesRowPassQuickFilterNoCache = function (node, filterPart) {
  27727. var _this = this;
  27728. var columns = this.columnController.getAllColumnsForQuickFilter();
  27729. return Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["some"])(columns, function (column) {
  27730. var part = _this.getQuickFilterTextForColumn(column, node);
  27731. return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(part) && part.indexOf(filterPart) >= 0;
  27732. });
  27733. };
  27734. FilterManager.prototype.doesRowPassQuickFilterCache = function (node, filterPart) {
  27735. if (!node.quickFilterAggregateText) {
  27736. this.aggregateRowForQuickFilter(node);
  27737. }
  27738. return node.quickFilterAggregateText.indexOf(filterPart) >= 0;
  27739. };
  27740. FilterManager.prototype.doesRowPassQuickFilter = function (node) {
  27741. var _this = this;
  27742. var usingCache = this.gridOptionsWrapper.isCacheQuickFilter();
  27743. // each part must pass, if any fails, then the whole filter fails
  27744. return Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["every"])(this.quickFilterParts, function (part) {
  27745. return usingCache ? _this.doesRowPassQuickFilterCache(node, part) : _this.doesRowPassQuickFilterNoCache(node, part);
  27746. });
  27747. };
  27748. FilterManager.prototype.doesRowPassFilter = function (node, filterToSkip) {
  27749. // the row must pass ALL of the filters, so if any of them fail,
  27750. // we return true. that means if a row passes the quick filter,
  27751. // but fails the column filter, it fails overall
  27752. // first up, check quick filter
  27753. if (this.isQuickFilterPresent() && !this.doesRowPassQuickFilter(node)) {
  27754. return false;
  27755. }
  27756. // secondly, give the client a chance to reject this row
  27757. if (this.externalFilterPresent && !this.gridOptionsWrapper.doesExternalFilterPass(node)) {
  27758. return false;
  27759. }
  27760. // lastly, check our internal advanced filter
  27761. if (this.advancedFilterPresent && !this.doesFilterPass(node, filterToSkip)) {
  27762. return false;
  27763. }
  27764. // got this far, all filters pass
  27765. return true;
  27766. };
  27767. FilterManager.prototype.getQuickFilterTextForColumn = function (column, node) {
  27768. var value = this.valueService.getValue(column, node, true);
  27769. var colDef = column.getColDef();
  27770. if (colDef.getQuickFilterText) {
  27771. var params = {
  27772. value: value,
  27773. node: node,
  27774. data: node.data,
  27775. column: column,
  27776. colDef: colDef,
  27777. context: this.gridOptionsWrapper.getContext()
  27778. };
  27779. value = colDef.getQuickFilterText(params);
  27780. }
  27781. return Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(value) ? value.toString().toUpperCase() : null;
  27782. };
  27783. FilterManager.prototype.aggregateRowForQuickFilter = function (node) {
  27784. var _this = this;
  27785. var stringParts = [];
  27786. var columns = this.columnController.getAllColumnsForQuickFilter();
  27787. Object(_utils_array__WEBPACK_IMPORTED_MODULE_5__["forEach"])(columns, function (column) {
  27788. var part = _this.getQuickFilterTextForColumn(column, node);
  27789. if (Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(part)) {
  27790. stringParts.push(part);
  27791. }
  27792. });
  27793. node.quickFilterAggregateText = stringParts.join(FilterManager_1.QUICK_FILTER_SEPARATOR);
  27794. };
  27795. FilterManager.prototype.onNewRowsLoaded = function (source) {
  27796. this.allFilters.forEach(function (filterWrapper) {
  27797. filterWrapper.filterPromise.then(function (filter) {
  27798. if (filter.onNewRowsLoaded) {
  27799. filter.onNewRowsLoaded();
  27800. }
  27801. });
  27802. });
  27803. this.updateFilterFlagInColumns(source);
  27804. this.setAdvancedFilterPresent();
  27805. };
  27806. FilterManager.prototype.createValueGetter = function (column) {
  27807. var _this = this;
  27808. return function (node) { return _this.valueService.getValue(column, node, true); };
  27809. };
  27810. FilterManager.prototype.getFilterComponent = function (column, source) {
  27811. return this.getOrCreateFilterWrapper(column, source).filterPromise;
  27812. };
  27813. FilterManager.prototype.isFilterActive = function (column) {
  27814. var filterWrapper = this.cachedFilter(column);
  27815. return filterWrapper && filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); });
  27816. };
  27817. FilterManager.prototype.getOrCreateFilterWrapper = function (column, source) {
  27818. var filterWrapper = this.cachedFilter(column);
  27819. if (!filterWrapper) {
  27820. filterWrapper = this.createFilterWrapper(column, source);
  27821. this.allFilters.set(column.getColId(), filterWrapper);
  27822. }
  27823. else if (source !== 'NO_UI') {
  27824. this.putIntoGui(filterWrapper, source);
  27825. }
  27826. return filterWrapper;
  27827. };
  27828. FilterManager.prototype.cachedFilter = function (column) {
  27829. return this.allFilters.get(column.getColId());
  27830. };
  27831. FilterManager.prototype.createFilterInstance = function (column, $scope) {
  27832. var _this = this;
  27833. var defaultFilter = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].SetFilterModule) ? 'agSetColumnFilter' : 'agTextColumnFilter';
  27834. var sanitisedColDef = Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["cloneObject"])(column.getColDef());
  27835. var filterInstance;
  27836. var params = this.createFilterParams(column, sanitisedColDef, $scope);
  27837. params.filterModifiedCallback = function () {
  27838. var event = {
  27839. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_MODIFIED,
  27840. api: _this.gridApi,
  27841. columnApi: _this.columnApi,
  27842. column: column,
  27843. filterInstance: filterInstance
  27844. };
  27845. _this.eventService.dispatchEvent(event);
  27846. };
  27847. // we modify params in a callback as we need the filter instance, and this isn't available
  27848. // when creating the params above
  27849. var modifyParamsCallback = function (params, filterInstance) { return Object(_utils_object__WEBPACK_IMPORTED_MODULE_9__["assign"])(params, {
  27850. doesRowPassOtherFilter: function (node) { return _this.doesRowPassOtherFilters(filterInstance, node); },
  27851. filterChangedCallback: function (additionalEventAttributes) {
  27852. return _this.onFilterChanged(filterInstance, additionalEventAttributes);
  27853. }
  27854. }); };
  27855. var res = this.userComponentFactory.newFilterComponent(sanitisedColDef, params, defaultFilter, modifyParamsCallback);
  27856. if (res) {
  27857. res.then(function (r) { return filterInstance = r; });
  27858. }
  27859. return res;
  27860. };
  27861. FilterManager.prototype.createFilterParams = function (column, colDef, $scope) {
  27862. if ($scope === void 0) { $scope = null; }
  27863. var params = {
  27864. api: this.gridOptionsWrapper.getApi(),
  27865. column: column,
  27866. colDef: colDef,
  27867. rowModel: this.rowModel,
  27868. filterChangedCallback: null,
  27869. filterModifiedCallback: null,
  27870. valueGetter: this.createValueGetter(column),
  27871. context: this.gridOptionsWrapper.getContext(),
  27872. doesRowPassOtherFilter: null
  27873. };
  27874. // hack in scope if using AngularJS
  27875. if ($scope) {
  27876. params.$scope = $scope;
  27877. }
  27878. return params;
  27879. };
  27880. FilterManager.prototype.createFilterWrapper = function (column, source) {
  27881. var filterWrapper = {
  27882. column: column,
  27883. filterPromise: null,
  27884. scope: null,
  27885. compiledElement: null,
  27886. guiPromise: _utils__WEBPACK_IMPORTED_MODULE_0__["Promise"].resolve(null)
  27887. };
  27888. filterWrapper.scope = this.gridOptionsWrapper.isAngularCompileFilters() ? this.$scope.$new() : null;
  27889. filterWrapper.filterPromise = this.createFilterInstance(column, filterWrapper.scope);
  27890. if (filterWrapper.filterPromise) {
  27891. this.putIntoGui(filterWrapper, source);
  27892. }
  27893. return filterWrapper;
  27894. };
  27895. FilterManager.prototype.putIntoGui = function (filterWrapper, source) {
  27896. var _this = this;
  27897. var eFilterGui = document.createElement('div');
  27898. eFilterGui.className = 'ag-filter';
  27899. filterWrapper.guiPromise = new _utils__WEBPACK_IMPORTED_MODULE_0__["Promise"](function (resolve) {
  27900. filterWrapper.filterPromise.then(function (filter) {
  27901. var guiFromFilter = filter.getGui();
  27902. if (!Object(_utils_generic__WEBPACK_IMPORTED_MODULE_8__["exists"])(guiFromFilter)) {
  27903. console.warn("getGui method from filter returned " + guiFromFilter + ", it should be a DOM element or an HTML template string.");
  27904. }
  27905. // for backwards compatibility with Angular 1 - we
  27906. // used to allow providing back HTML from getGui().
  27907. // once we move away from supporting Angular 1
  27908. // directly, we can change this.
  27909. if (typeof guiFromFilter === 'string') {
  27910. guiFromFilter = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_10__["loadTemplate"])(guiFromFilter);
  27911. }
  27912. eFilterGui.appendChild(guiFromFilter);
  27913. if (filterWrapper.scope) {
  27914. var compiledElement = _this.$compile(eFilterGui)(filterWrapper.scope);
  27915. filterWrapper.compiledElement = compiledElement;
  27916. window.setTimeout(function () { return filterWrapper.scope.$apply(); }, 0);
  27917. }
  27918. resolve(eFilterGui);
  27919. _this.eventService.dispatchEvent({
  27920. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_OPENED,
  27921. column: filterWrapper.column,
  27922. source: source,
  27923. eGui: eFilterGui,
  27924. api: _this.gridApi,
  27925. columnApi: _this.columnApi
  27926. });
  27927. });
  27928. });
  27929. };
  27930. FilterManager.prototype.onNewColumnsLoaded = function () {
  27931. var _this = this;
  27932. var atLeastOneFilterGone = false;
  27933. this.allFilters.forEach(function (filterWrapper) {
  27934. var oldColumn = !_this.columnController.getPrimaryColumn(filterWrapper.column);
  27935. if (oldColumn) {
  27936. atLeastOneFilterGone = true;
  27937. _this.disposeFilterWrapper(filterWrapper, 'filterDestroyed');
  27938. }
  27939. });
  27940. if (atLeastOneFilterGone) {
  27941. this.onFilterChanged();
  27942. }
  27943. };
  27944. // destroys the filter, so it not longer takes part
  27945. FilterManager.prototype.destroyFilter = function (column, source) {
  27946. if (source === void 0) { source = 'api'; }
  27947. var filterWrapper = this.allFilters.get(column.getColId());
  27948. if (filterWrapper) {
  27949. this.disposeFilterWrapper(filterWrapper, source);
  27950. this.onFilterChanged();
  27951. }
  27952. };
  27953. FilterManager.prototype.disposeFilterWrapper = function (filterWrapper, source) {
  27954. var _this = this;
  27955. filterWrapper.filterPromise.then(function (filter) {
  27956. filter.setModel(null);
  27957. _this.getContext().destroyBean(filter);
  27958. filterWrapper.column.setFilterActive(false, source);
  27959. if (filterWrapper.scope) {
  27960. if (filterWrapper.compiledElement) {
  27961. filterWrapper.compiledElement.remove();
  27962. }
  27963. filterWrapper.scope.$destroy();
  27964. }
  27965. _this.allFilters.delete(filterWrapper.column.getColId());
  27966. });
  27967. };
  27968. FilterManager.prototype.destroy = function () {
  27969. var _this = this;
  27970. _super.prototype.destroy.call(this);
  27971. this.allFilters.forEach(function (filterWrapper) { return _this.disposeFilterWrapper(filterWrapper, 'filterDestroyed'); });
  27972. };
  27973. var FilterManager_1;
  27974. FilterManager.QUICK_FILTER_SEPARATOR = '\n';
  27975. __decorate([
  27976. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('$compile')
  27977. ], FilterManager.prototype, "$compile", void 0);
  27978. __decorate([
  27979. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('$scope')
  27980. ], FilterManager.prototype, "$scope", void 0);
  27981. __decorate([
  27982. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  27983. ], FilterManager.prototype, "gridOptionsWrapper", void 0);
  27984. __decorate([
  27985. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('valueService')
  27986. ], FilterManager.prototype, "valueService", void 0);
  27987. __decorate([
  27988. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  27989. ], FilterManager.prototype, "columnController", void 0);
  27990. __decorate([
  27991. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
  27992. ], FilterManager.prototype, "rowModel", void 0);
  27993. __decorate([
  27994. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
  27995. ], FilterManager.prototype, "columnApi", void 0);
  27996. __decorate([
  27997. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
  27998. ], FilterManager.prototype, "gridApi", void 0);
  27999. __decorate([
  28000. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('userComponentFactory')
  28001. ], FilterManager.prototype, "userComponentFactory", void 0);
  28002. __decorate([
  28003. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  28004. ], FilterManager.prototype, "init", null);
  28005. __decorate([
  28006. _context_context__WEBPACK_IMPORTED_MODULE_1__["PreDestroy"]
  28007. ], FilterManager.prototype, "destroy", null);
  28008. FilterManager = FilterManager_1 = __decorate([
  28009. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('filterManager')
  28010. ], FilterManager);
  28011. return FilterManager;
  28012. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_6__["BeanStub"]));
  28013. /***/ }),
  28014. /* 126 */
  28015. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28016. "use strict";
  28017. __webpack_require__.r(__webpack_exports__);
  28018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueService", function() { return ValueService; });
  28019. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  28020. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  28021. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  28022. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  28023. /**
  28024. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  28025. * @version v23.2.1
  28026. * @link http://www.ag-grid.com/
  28027. * @license MIT
  28028. */
  28029. var __extends = (undefined && undefined.__extends) || (function () {
  28030. var extendStatics = function (d, b) {
  28031. extendStatics = Object.setPrototypeOf ||
  28032. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  28033. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  28034. return extendStatics(d, b);
  28035. };
  28036. return function (d, b) {
  28037. extendStatics(d, b);
  28038. function __() { this.constructor = d; }
  28039. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  28040. };
  28041. })();
  28042. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  28043. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  28044. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  28045. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  28046. return c > 3 && r && Object.defineProperty(target, key, r), r;
  28047. };
  28048. var ValueService = /** @class */ (function (_super) {
  28049. __extends(ValueService, _super);
  28050. function ValueService() {
  28051. var _this = _super !== null && _super.apply(this, arguments) || this;
  28052. _this.initialised = false;
  28053. return _this;
  28054. }
  28055. ValueService.prototype.init = function () {
  28056. this.cellExpressions = this.gridOptionsWrapper.isEnableCellExpressions();
  28057. this.initialised = true;
  28058. };
  28059. ValueService.prototype.getValue = function (column, rowNode, forFilter, ignoreAggData) {
  28060. if (forFilter === void 0) { forFilter = false; }
  28061. if (ignoreAggData === void 0) { ignoreAggData = false; }
  28062. // hack - the grid is getting refreshed before this bean gets initialised, race condition.
  28063. // really should have a way so they get initialised in the right order???
  28064. if (!this.initialised) {
  28065. this.init();
  28066. }
  28067. if (!rowNode) {
  28068. return;
  28069. }
  28070. // pull these out to make code below easier to read
  28071. var colDef = column.getColDef();
  28072. var field = colDef.field;
  28073. var colId = column.getId();
  28074. var data = rowNode.data;
  28075. var result;
  28076. // if there is a value getter, this gets precedence over a field
  28077. var groupDataExists = rowNode.groupData && rowNode.groupData[colId] !== undefined;
  28078. var aggDataExists = !ignoreAggData && rowNode.aggData && rowNode.aggData[colId] !== undefined;
  28079. if (forFilter && colDef.filterValueGetter) {
  28080. result = this.executeFilterValueGetter(colDef.filterValueGetter, data, column, rowNode);
  28081. }
  28082. else if (this.gridOptionsWrapper.isTreeData() && aggDataExists) {
  28083. result = rowNode.aggData[colId];
  28084. }
  28085. else if (this.gridOptionsWrapper.isTreeData() && colDef.valueGetter) {
  28086. result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);
  28087. }
  28088. else if (this.gridOptionsWrapper.isTreeData() && (field && data)) {
  28089. result = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].getValueUsingField(data, field, column.isFieldContainsDots());
  28090. }
  28091. else if (groupDataExists) {
  28092. result = rowNode.groupData[colId];
  28093. }
  28094. else if (aggDataExists) {
  28095. result = rowNode.aggData[colId];
  28096. }
  28097. else if (colDef.valueGetter) {
  28098. result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode);
  28099. }
  28100. else if (field && data) {
  28101. result = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].getValueUsingField(data, field, column.isFieldContainsDots());
  28102. }
  28103. // the result could be an expression itself, if we are allowing cell values to be expressions
  28104. if (this.cellExpressions && (typeof result === 'string') && result.indexOf('=') === 0) {
  28105. var cellValueGetter = result.substring(1);
  28106. result = this.executeValueGetter(cellValueGetter, data, column, rowNode);
  28107. }
  28108. return result;
  28109. };
  28110. ValueService.prototype.setValue = function (rowNode, colKey, newValue, eventSource) {
  28111. var column = this.columnController.getPrimaryColumn(colKey);
  28112. if (!rowNode || !column) {
  28113. return;
  28114. }
  28115. // this will only happen if user is trying to paste into a group row, which doesn't make sense
  28116. // the user should not be trying to paste into group rows
  28117. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].missing(rowNode.data)) {
  28118. rowNode.data = {};
  28119. }
  28120. // for backwards compatibility we are also retrieving the newValueHandler as well as the valueSetter
  28121. var _a = column.getColDef(), field = _a.field, newValueHandler = _a.newValueHandler, valueSetter = _a.valueSetter;
  28122. // need either a field or a newValueHandler for this to work
  28123. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].missing(field) && _utils__WEBPACK_IMPORTED_MODULE_2__["_"].missing(newValueHandler) && _utils__WEBPACK_IMPORTED_MODULE_2__["_"].missing(valueSetter)) {
  28124. // we don't tell user about newValueHandler, as that is deprecated
  28125. console.warn("ag-Grid: you need either field or valueSetter set on colDef for editing to work");
  28126. return;
  28127. }
  28128. var params = {
  28129. node: rowNode,
  28130. data: rowNode.data,
  28131. oldValue: this.getValue(column, rowNode),
  28132. newValue: newValue,
  28133. colDef: column.getColDef(),
  28134. column: column,
  28135. api: this.gridOptionsWrapper.getApi(),
  28136. columnApi: this.gridOptionsWrapper.getColumnApi(),
  28137. context: this.gridOptionsWrapper.getContext()
  28138. };
  28139. params.newValue = newValue;
  28140. var valueWasDifferent;
  28141. if (newValueHandler && _utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(newValueHandler)) {
  28142. valueWasDifferent = newValueHandler(params);
  28143. }
  28144. else if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(valueSetter)) {
  28145. valueWasDifferent = this.expressionService.evaluate(valueSetter, params);
  28146. }
  28147. else {
  28148. valueWasDifferent = this.setValueUsingField(rowNode.data, field, newValue, column.isFieldContainsDots());
  28149. }
  28150. // in case user forgot to return something (possible if they are not using TypeScript
  28151. // and just forgot, or using an old newValueHandler we didn't always expect a return
  28152. // value here), we default the return value to true, so we always refresh.
  28153. if (valueWasDifferent === undefined) {
  28154. valueWasDifferent = true;
  28155. }
  28156. // if no change to the value, then no need to do the updating, or notifying via events.
  28157. // otherwise the user could be tabbing around the grid, and cellValueChange would get called
  28158. // all the time.
  28159. if (!valueWasDifferent) {
  28160. return;
  28161. }
  28162. // reset quick filter on this row
  28163. rowNode.resetQuickFilterAggregateText();
  28164. this.valueCache.onDataChanged();
  28165. params.newValue = this.getValue(column, rowNode);
  28166. var onCellValueChanged = column.getColDef().onCellValueChanged;
  28167. if (typeof onCellValueChanged === 'function') {
  28168. // to make callback async, do in a timeout
  28169. setTimeout(function () { return onCellValueChanged(params); }, 0);
  28170. }
  28171. var event = {
  28172. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_VALUE_CHANGED,
  28173. event: null,
  28174. rowIndex: rowNode.rowIndex,
  28175. rowPinned: rowNode.rowPinned,
  28176. column: params.column,
  28177. api: params.api,
  28178. colDef: params.colDef,
  28179. columnApi: params.columnApi,
  28180. context: params.context,
  28181. data: rowNode.data,
  28182. node: rowNode,
  28183. oldValue: params.oldValue,
  28184. newValue: params.newValue,
  28185. value: params.newValue,
  28186. source: eventSource
  28187. };
  28188. this.eventService.dispatchEvent(event);
  28189. };
  28190. ValueService.prototype.setValueUsingField = function (data, field, newValue, isFieldContainsDots) {
  28191. if (!field) {
  28192. return false;
  28193. }
  28194. // if no '.', then it's not a deep value
  28195. var valuesAreSame = false;
  28196. if (!isFieldContainsDots) {
  28197. data[field] = newValue;
  28198. }
  28199. else {
  28200. // otherwise it is a deep value, so need to dig for it
  28201. var fieldPieces = field.split('.');
  28202. var currentObject = data;
  28203. while (fieldPieces.length > 0 && currentObject) {
  28204. var fieldPiece = fieldPieces.shift();
  28205. if (fieldPieces.length === 0) {
  28206. currentObject[fieldPiece] = newValue;
  28207. }
  28208. else {
  28209. currentObject = currentObject[fieldPiece];
  28210. }
  28211. }
  28212. }
  28213. return !valuesAreSame;
  28214. };
  28215. ValueService.prototype.executeFilterValueGetter = function (valueGetter, data, column, rowNode) {
  28216. var params = {
  28217. data: data,
  28218. node: rowNode,
  28219. column: column,
  28220. colDef: column.getColDef(),
  28221. api: this.gridOptionsWrapper.getApi(),
  28222. columnApi: this.gridOptionsWrapper.getColumnApi(),
  28223. context: this.gridOptionsWrapper.getContext(),
  28224. getValue: this.getValueCallback.bind(this, rowNode)
  28225. };
  28226. return this.expressionService.evaluate(valueGetter, params);
  28227. };
  28228. ValueService.prototype.executeValueGetter = function (valueGetter, data, column, rowNode) {
  28229. var colId = column.getId();
  28230. // if inside the same turn, just return back the value we got last time
  28231. var valueFromCache = this.valueCache.getValue(rowNode, colId);
  28232. if (valueFromCache !== undefined) {
  28233. return valueFromCache;
  28234. }
  28235. var params = {
  28236. data: data,
  28237. node: rowNode,
  28238. column: column,
  28239. colDef: column.getColDef(),
  28240. api: this.gridOptionsWrapper.getApi(),
  28241. columnApi: this.gridOptionsWrapper.getColumnApi(),
  28242. context: this.gridOptionsWrapper.getContext(),
  28243. getValue: this.getValueCallback.bind(this, rowNode)
  28244. };
  28245. var result = this.expressionService.evaluate(valueGetter, params);
  28246. // if a turn is active, store the value in case the grid asks for it again
  28247. this.valueCache.setValue(rowNode, colId, result);
  28248. return result;
  28249. };
  28250. ValueService.prototype.getValueCallback = function (node, field) {
  28251. var otherColumn = this.columnController.getPrimaryColumn(field);
  28252. if (otherColumn) {
  28253. return this.getValue(otherColumn, node);
  28254. }
  28255. return null;
  28256. };
  28257. // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col
  28258. ValueService.prototype.getKeyForNode = function (col, rowNode) {
  28259. var value = this.getValue(col, rowNode);
  28260. var keyCreator = col.getColDef().keyCreator;
  28261. var result = keyCreator ? keyCreator({ value: value }) : value;
  28262. // if already a string, or missing, just return it
  28263. if (typeof result === 'string' || result == null) {
  28264. return result;
  28265. }
  28266. result = String(result);
  28267. if (result === '[object Object]') {
  28268. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].doOnce(function () {
  28269. console.warn('ag-Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se ag-Grid docs) or b) to toString() on the object to return a key');
  28270. }, 'getKeyForNode - warn about [object,object]');
  28271. }
  28272. return result;
  28273. };
  28274. __decorate([
  28275. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  28276. ], ValueService.prototype, "gridOptionsWrapper", void 0);
  28277. __decorate([
  28278. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
  28279. ], ValueService.prototype, "expressionService", void 0);
  28280. __decorate([
  28281. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  28282. ], ValueService.prototype, "columnController", void 0);
  28283. __decorate([
  28284. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueCache')
  28285. ], ValueService.prototype, "valueCache", void 0);
  28286. __decorate([
  28287. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  28288. ], ValueService.prototype, "init", null);
  28289. ValueService = __decorate([
  28290. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('valueService')
  28291. ], ValueService);
  28292. return ValueService;
  28293. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  28294. /***/ }),
  28295. /* 127 */
  28296. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28297. "use strict";
  28298. __webpack_require__.r(__webpack_exports__);
  28299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridPanel", function() { return GridPanel; });
  28300. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
  28301. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  28302. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  28303. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  28304. /* harmony import */ var _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(128);
  28305. /* harmony import */ var _rendering_rowComp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(100);
  28306. /* harmony import */ var _widgets_touchListener__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65);
  28307. /* harmony import */ var _rowDragFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(129);
  28308. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56);
  28309. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57);
  28310. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(39);
  28311. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(38);
  28312. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7);
  28313. /**
  28314. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  28315. * @version v23.2.1
  28316. * @link http://www.ag-grid.com/
  28317. * @license MIT
  28318. */
  28319. var __extends = (undefined && undefined.__extends) || (function () {
  28320. var extendStatics = function (d, b) {
  28321. extendStatics = Object.setPrototypeOf ||
  28322. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  28323. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  28324. return extendStatics(d, b);
  28325. };
  28326. return function (d, b) {
  28327. extendStatics(d, b);
  28328. function __() { this.constructor = d; }
  28329. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  28330. };
  28331. })();
  28332. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  28333. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  28334. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  28335. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  28336. return c > 3 && r && Object.defineProperty(target, key, r), r;
  28337. };
  28338. // in the html below, it is important that there are no white space between some of the divs, as if there is white space,
  28339. // it won't render correctly in safari, as safari renders white space as a gap
  28340. var GRID_PANEL_NORMAL_TEMPLATE = /* html */ "<div class=\"ag-root ag-unselectable\" role=\"grid\" unselectable=\"on\">\n <ag-header-root ref=\"headerRoot\" unselectable=\"on\"></ag-header-root>\n <div class=\"ag-floating-top\" ref=\"eTop\" role=\"presentation\" unselectable=\"on\">\n <div class=\"ag-pinned-left-floating-top\" ref=\"eLeftTop\" role=\"presentation\" unselectable=\"on\"></div>\n <div class=\"ag-floating-top-viewport\" ref=\"eTopViewport\" role=\"presentation\" unselectable=\"on\">\n <div class=\"ag-floating-top-container\" ref=\"eTopContainer\" role=\"presentation\" unselectable=\"on\"></div>\n </div>\n <div class=\"ag-pinned-right-floating-top\" ref=\"eRightTop\" role=\"presentation\" unselectable=\"on\"></div>\n <div class=\"ag-floating-top-full-width-container\" ref=\"eTopFullWidthContainer\" role=\"presentation\" unselectable=\"on\"></div>\n </div>\n <div class=\"ag-body-viewport\" ref=\"eBodyViewport\" role=\"presentation\">\n <div class=\"ag-pinned-left-cols-container\" ref=\"eLeftContainer\" role=\"presentation\" unselectable=\"on\"></div>\n <div class=\"ag-center-cols-clipper\" ref=\"eCenterColsClipper\" role=\"presentation\" unselectable=\"on\">\n <div class=\"ag-center-cols-viewport\" ref=\"eCenterViewport\" role=\"presentation\">\n <div class=\"ag-center-cols-container\" ref=\"eCenterContainer\" role=\"rowgroup\" unselectable=\"on\"></div>\n </div>\n </div>\n <div class=\"ag-pinned-right-cols-container\" ref=\"eRightContainer\" role=\"presentation\" unselectable=\"on\"></div>\n <div class=\"ag-full-width-container\" ref=\"eFullWidthContainer\" role=\"presentation\" unselectable=\"on\"></div>\n </div>\n <div class=\"ag-floating-bottom\" ref=\"eBottom\" role=\"presentation\" unselectable=\"on\">\n <div class=\"ag-pinned-left-floating-bottom\" ref=\"eLeftBottom\" role=\"presentation\" unselectable=\"on\"></div>\n <div class=\"ag-floating-bottom-viewport\" ref=\"eBottomViewport\" role=\"presentation\" unselectable=\"on\">\n <div class=\"ag-floating-bottom-container\" ref=\"eBottomContainer\" role=\"presentation\" unselectable=\"on\"></div>\n </div>\n <div class=\"ag-pinned-right-floating-bottom\" ref=\"eRightBottom\" role=\"presentation\" unselectable=\"on\"></div>\n <div class=\"ag-floating-bottom-full-width-container\" ref=\"eBottomFullWidthContainer\" role=\"presentation\" unselectable=\"on\"></div>\n </div>\n <div class=\"ag-body-horizontal-scroll\" ref=\"eHorizontalScrollBody\" aria-hidden=\"true\">\n <div class=\"ag-horizontal-left-spacer\" ref=\"eHorizontalLeftSpacer\"></div>\n <div class=\"ag-body-horizontal-scroll-viewport\" ref=\"eBodyHorizontalScrollViewport\">\n <div class=\"ag-body-horizontal-scroll-container\" ref=\"eBodyHorizontalScrollContainer\"></div>\n </div>\n <div class=\"ag-horizontal-right-spacer\" ref=\"eHorizontalRightSpacer\"></div>\n </div>\n <ag-overlay-wrapper ref=\"overlayWrapper\"></ag-overlay-wrapper>\n </div>";
  28341. var GridPanel = /** @class */ (function (_super) {
  28342. __extends(GridPanel, _super);
  28343. function GridPanel() {
  28344. var _this = _super.call(this, GRID_PANEL_NORMAL_TEMPLATE) || this;
  28345. _this.scrollLeft = -1;
  28346. _this.scrollTop = -1;
  28347. _this.resetLastHorizontalScrollElementDebounced = _utils__WEBPACK_IMPORTED_MODULE_12__["_"].debounce(_this.resetLastHorizontalScrollElement.bind(_this), 500);
  28348. return _this;
  28349. }
  28350. GridPanel.prototype.getVScrollPosition = function () {
  28351. var result = {
  28352. top: this.eBodyViewport.scrollTop,
  28353. bottom: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetHeight
  28354. };
  28355. return result;
  28356. };
  28357. GridPanel.prototype.getHScrollPosition = function () {
  28358. var result = {
  28359. left: this.eCenterViewport.scrollLeft,
  28360. right: this.eCenterViewport.scrollLeft + this.eCenterViewport.offsetWidth
  28361. };
  28362. return result;
  28363. };
  28364. GridPanel.prototype.onRowDataChanged = function () {
  28365. this.showOrHideOverlay();
  28366. };
  28367. GridPanel.prototype.showOrHideOverlay = function () {
  28368. var isEmpty = this.paginationProxy.isEmpty();
  28369. var isSuppressNoRowsOverlay = this.gridOptionsWrapper.isSuppressNoRowsOverlay();
  28370. var method = isEmpty && !isSuppressNoRowsOverlay ? 'showNoRowsOverlay' : 'hideOverlay';
  28371. this[method]();
  28372. };
  28373. GridPanel.prototype.onNewColumnsLoaded = function () {
  28374. // hide overlay if columns and rows exist, this can happen if columns are loaded after data.
  28375. // this problem exists before of the race condition between the services (column controller in this case)
  28376. // and the view (grid panel). if the model beans were all initialised first, and then the view beans second,
  28377. // this race condition would not happen.
  28378. if (this.beans.columnController.isReady() && !this.paginationProxy.isEmpty()) {
  28379. this.hideOverlay();
  28380. }
  28381. };
  28382. GridPanel.prototype.init = function () {
  28383. var _this = this;
  28384. this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
  28385. this.enableRtl = this.gridOptionsWrapper.isEnableRtl();
  28386. this.printLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].DOM_LAYOUT_PRINT;
  28387. // these elements have different CSS when layout changes
  28388. this.gridOptionsWrapper.addLayoutElement(this.getGui());
  28389. this.gridOptionsWrapper.addLayoutElement(this.eBodyViewport);
  28390. this.suppressScrollOnFloatingRow();
  28391. this.setupRowAnimationCssClass();
  28392. this.buildRowContainerComponents();
  28393. this.addEventListeners();
  28394. this.addDragListeners();
  28395. this.addScrollListener();
  28396. if (this.gridOptionsWrapper.isRowModelDefault() && !this.gridOptionsWrapper.getRowData()) {
  28397. this.showLoadingOverlay();
  28398. }
  28399. this.setCellTextSelection(this.gridOptionsWrapper.isEnableCellTextSelect());
  28400. this.setPinnedContainerSize();
  28401. this.setHeaderAndFloatingHeights();
  28402. this.disableBrowserDragging();
  28403. this.addMouseListeners();
  28404. this.addKeyboardEvents();
  28405. this.addBodyViewportListener();
  28406. this.addStopEditingWhenGridLosesFocus();
  28407. this.mockContextMenuForIPad();
  28408. this.addRowDragListener();
  28409. if (this.$scope) {
  28410. this.addAngularApplyCheck();
  28411. }
  28412. this.onDisplayedColumnsWidthChanged();
  28413. this.gridApi.registerGridComp(this);
  28414. this.alignedGridsService.registerGridComp(this);
  28415. this.headerRootComp.registerGridComp(this);
  28416. this.navigationService.registerGridComp(this);
  28417. this.headerNavigationService.registerGridComp(this);
  28418. this.heightScaler.registerGridComp(this);
  28419. this.autoHeightCalculator.registerGridComp(this);
  28420. this.columnAnimationService.registerGridComp(this);
  28421. this.autoWidthCalculator.registerGridComp(this);
  28422. this.paginationAutoPageSizeService.registerGridComp(this);
  28423. this.mouseEventService.registerGridComp(this);
  28424. this.beans.registerGridComp(this);
  28425. this.rowRenderer.registerGridComp(this);
  28426. if (this.rangeController) {
  28427. this.rangeController.registerGridComp(this);
  28428. }
  28429. [this.eCenterViewport, this.eBodyViewport].forEach(function (viewport) {
  28430. var unsubscribeFromResize = _this.resizeObserverService.observeResize(viewport, _this.onCenterViewportResized.bind(_this));
  28431. _this.addDestroyFunc(function () { return unsubscribeFromResize(); });
  28432. });
  28433. [this.eTop, this.eBodyViewport, this.eBottom].forEach(function (element) {
  28434. _this.addManagedListener(element, 'focusin', function () {
  28435. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addCssClass(element, 'ag-has-focus');
  28436. });
  28437. _this.addManagedListener(element, 'focusout', function (e) {
  28438. if (!element.contains(e.relatedTarget)) {
  28439. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].removeCssClass(element, 'ag-has-focus');
  28440. }
  28441. });
  28442. });
  28443. };
  28444. GridPanel.prototype.onDomLayoutChanged = function () {
  28445. var newPrintLayout = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].DOM_LAYOUT_PRINT;
  28446. if (this.printLayout !== newPrintLayout) {
  28447. this.printLayout = newPrintLayout;
  28448. this.setWidthsOfContainers();
  28449. // pinned containers are always hidden for print layout
  28450. this.setPinnedContainerSize();
  28451. }
  28452. };
  28453. GridPanel.prototype.onCenterViewportResized = function () {
  28454. if (_utils__WEBPACK_IMPORTED_MODULE_12__["_"].isVisible(this.eCenterViewport)) {
  28455. this.checkViewportAndScrolls();
  28456. this.beans.columnController.refreshFlexedColumns(this.getCenterWidth());
  28457. }
  28458. else {
  28459. this.bodyHeight = 0;
  28460. }
  28461. };
  28462. // used by ColumnAnimationService
  28463. GridPanel.prototype.setColumnMovingCss = function (moving) {
  28464. this.addOrRemoveCssClass('ag-column-moving', moving);
  28465. };
  28466. GridPanel.prototype.setCellTextSelection = function (selectable) {
  28467. if (selectable === void 0) { selectable = false; }
  28468. [this.eTop, this.eBodyViewport, this.eBottom]
  28469. .forEach(function (ct) { return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addOrRemoveCssClass(ct, 'ag-selectable', selectable); });
  28470. };
  28471. GridPanel.prototype.addRowDragListener = function () {
  28472. this.rowDragFeature = this.createManagedBean(new _rowDragFeature__WEBPACK_IMPORTED_MODULE_7__["RowDragFeature"](this.eBodyViewport, this));
  28473. this.dragAndDropService.addDropTarget(this.rowDragFeature);
  28474. };
  28475. GridPanel.prototype.getRowDragFeature = function () {
  28476. return this.rowDragFeature;
  28477. };
  28478. GridPanel.prototype.addStopEditingWhenGridLosesFocus = function () {
  28479. var _this = this;
  28480. if (!this.gridOptionsWrapper.isStopEditingWhenGridLosesFocus()) {
  28481. return;
  28482. }
  28483. var viewports = [this.eBodyViewport, this.eBottom, this.eTop];
  28484. var focusOutListener = function (event) {
  28485. // this is the element the focus is moving to
  28486. var elementWithFocus = event.relatedTarget;
  28487. if (_utils__WEBPACK_IMPORTED_MODULE_12__["_"].getTabIndex(elementWithFocus) === null) {
  28488. _this.rowRenderer.stopEditing();
  28489. return;
  28490. }
  28491. var clickInsideGrid = viewports.some(function (viewport) { return viewport.contains(elementWithFocus); });
  28492. if (!clickInsideGrid) {
  28493. var popupService = _this.beans.popupService;
  28494. clickInsideGrid =
  28495. popupService.getActivePopups().some(function (popup) { return popup.contains(elementWithFocus); }) ||
  28496. popupService.isElementWithinCustomPopup(elementWithFocus);
  28497. }
  28498. if (!clickInsideGrid) {
  28499. _this.rowRenderer.stopEditing();
  28500. }
  28501. };
  28502. viewports.forEach(function (viewport) { return _this.addManagedListener(viewport, 'focusout', focusOutListener); });
  28503. };
  28504. GridPanel.prototype.addAngularApplyCheck = function () {
  28505. var _this = this;
  28506. // this makes sure if we queue up requests, we only execute oe
  28507. var applyTriggered = false;
  28508. var listener = function () {
  28509. // only need to do one apply at a time
  28510. if (applyTriggered) {
  28511. return;
  28512. }
  28513. applyTriggered = true; // mark 'need apply' to true
  28514. window.setTimeout(function () {
  28515. applyTriggered = false;
  28516. _this.$scope.$apply();
  28517. }, 0);
  28518. };
  28519. // these are the events we need to do an apply after - these are the ones that can end up
  28520. // with columns added or removed
  28521. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
  28522. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
  28523. };
  28524. // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
  28525. // and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
  28526. GridPanel.prototype.disableBrowserDragging = function () {
  28527. this.addGuiEventListener('dragstart', function (event) {
  28528. if (event.target instanceof HTMLImageElement) {
  28529. event.preventDefault();
  28530. return false;
  28531. }
  28532. });
  28533. };
  28534. GridPanel.prototype.addEventListeners = function () {
  28535. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
  28536. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this));
  28537. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PINNED_ROW_DATA_CHANGED, this.setHeaderAndFloatingHeights.bind(this));
  28538. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_CHANGED, this.onRowDataChanged.bind(this));
  28539. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DATA_UPDATED, this.onRowDataChanged.bind(this));
  28540. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this));
  28541. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
  28542. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
  28543. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
  28544. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_GROUP_HEADER_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
  28545. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_FLOATING_FILTERS_HEIGHT, this.setHeaderAndFloatingHeights.bind(this));
  28546. this.addManagedListener(this.gridOptionsWrapper, _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.onDomLayoutChanged.bind(this));
  28547. };
  28548. GridPanel.prototype.addDragListeners = function () {
  28549. var _this = this;
  28550. if (!this.gridOptionsWrapper.isEnableRangeSelection() || // no range selection if no property
  28551. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].missing(this.rangeController) // no range selection if not enterprise version
  28552. ) {
  28553. return;
  28554. }
  28555. var containers = [
  28556. this.eLeftContainer,
  28557. this.eRightContainer,
  28558. this.eCenterContainer,
  28559. this.eTop,
  28560. this.eBottom
  28561. ];
  28562. containers.forEach(function (container) {
  28563. var params = {
  28564. eElement: container,
  28565. onDragStart: _this.rangeController.onDragStart.bind(_this.rangeController),
  28566. onDragStop: _this.rangeController.onDragStop.bind(_this.rangeController),
  28567. onDragging: _this.rangeController.onDragging.bind(_this.rangeController)
  28568. };
  28569. _this.dragService.addDragSource(params);
  28570. _this.addDestroyFunc(function () { return _this.dragService.removeDragSource(params); });
  28571. });
  28572. };
  28573. GridPanel.prototype.addMouseListeners = function () {
  28574. var _this = this;
  28575. var eventNames = ['click', 'mousedown', 'dblclick', 'contextmenu', 'mouseover', 'mouseout'];
  28576. eventNames.forEach(function (eventName) {
  28577. var listener = _this.processMouseEvent.bind(_this, eventName);
  28578. _this.eAllCellContainers.forEach(function (container) {
  28579. return _this.addManagedListener(container, eventName, listener);
  28580. });
  28581. });
  28582. };
  28583. GridPanel.prototype.addKeyboardEvents = function () {
  28584. var _this = this;
  28585. var eventNames = ['keydown', 'keypress'];
  28586. eventNames.forEach(function (eventName) {
  28587. var listener = _this.processKeyboardEvent.bind(_this, eventName);
  28588. _this.eAllCellContainers.forEach(function (container) {
  28589. _this.addManagedListener(container, eventName, listener);
  28590. });
  28591. });
  28592. };
  28593. GridPanel.prototype.addBodyViewportListener = function () {
  28594. var _this = this;
  28595. // we want to listen for clicks directly on the eBodyViewport, so the user has a way of showing
  28596. // the context menu if no rows or columns are displayed, or user simply clicks outside of a cell
  28597. var listener = function (mouseEvent) {
  28598. var target = _utils__WEBPACK_IMPORTED_MODULE_12__["_"].getTarget(mouseEvent);
  28599. if (target === _this.eBodyViewport || target === _this.eCenterViewport) {
  28600. // show it
  28601. _this.onContextMenu(mouseEvent, null, null, null, null);
  28602. _this.preventDefaultOnContextMenu(mouseEvent);
  28603. }
  28604. };
  28605. this.addManagedListener(this.eBodyViewport, 'contextmenu', listener);
  28606. };
  28607. // + rangeController - used to know when to scroll when user is dragging outside the
  28608. // main viewport while doing a range selection
  28609. GridPanel.prototype.getBodyClientRect = function () {
  28610. if (!this.eBodyViewport) {
  28611. return;
  28612. }
  28613. return this.eBodyViewport.getBoundingClientRect();
  28614. };
  28615. GridPanel.prototype.getRowForEvent = function (event) {
  28616. var sourceElement = _utils__WEBPACK_IMPORTED_MODULE_12__["_"].getTarget(event);
  28617. while (sourceElement) {
  28618. var renderedRow = this.gridOptionsWrapper.getDomData(sourceElement, _rendering_rowComp__WEBPACK_IMPORTED_MODULE_5__["RowComp"].DOM_DATA_KEY_RENDERED_ROW);
  28619. if (renderedRow) {
  28620. return renderedRow;
  28621. }
  28622. sourceElement = sourceElement.parentElement;
  28623. }
  28624. return null;
  28625. };
  28626. GridPanel.prototype.processKeyboardEvent = function (eventName, keyboardEvent) {
  28627. var cellComp = _utils__WEBPACK_IMPORTED_MODULE_12__["_"].getCellCompForEvent(this.gridOptionsWrapper, keyboardEvent);
  28628. if (!cellComp || keyboardEvent.defaultPrevented) {
  28629. return;
  28630. }
  28631. var rowNode = cellComp.getRenderedRow().getRowNode();
  28632. var column = cellComp.getColumn();
  28633. var editing = cellComp.isEditing();
  28634. var gridProcessingAllowed = !_utils__WEBPACK_IMPORTED_MODULE_12__["_"].isUserSuppressingKeyboardEvent(this.gridOptionsWrapper, keyboardEvent, rowNode, column, editing);
  28635. if (gridProcessingAllowed) {
  28636. switch (eventName) {
  28637. case 'keydown':
  28638. // first see if it's a scroll key, page up / down, home / end etc
  28639. var wasScrollKey = !editing && this.navigationService.handlePageScrollingKey(keyboardEvent);
  28640. // if not a scroll key, then we pass onto cell
  28641. if (!wasScrollKey) {
  28642. cellComp.onKeyDown(keyboardEvent);
  28643. }
  28644. // perform clipboard and undo / redo operations
  28645. this.doGridOperations(keyboardEvent, cellComp);
  28646. break;
  28647. case 'keypress':
  28648. cellComp.onKeyPress(keyboardEvent);
  28649. break;
  28650. }
  28651. }
  28652. if (eventName === 'keydown') {
  28653. var cellKeyDownEvent = cellComp.createEvent(keyboardEvent, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_KEY_DOWN);
  28654. this.beans.eventService.dispatchEvent(cellKeyDownEvent);
  28655. }
  28656. if (eventName === 'keypress') {
  28657. var cellKeyPressEvent = cellComp.createEvent(keyboardEvent, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_KEY_PRESS);
  28658. this.beans.eventService.dispatchEvent(cellKeyPressEvent);
  28659. }
  28660. };
  28661. GridPanel.prototype.doGridOperations = function (keyboardEvent, cellComp) {
  28662. // check if ctrl or meta key pressed
  28663. if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) {
  28664. return;
  28665. }
  28666. // if the cell the event came from is editing, then we do not
  28667. // want to do the default shortcut keys, otherwise the editor
  28668. // (eg a text field) would not be able to do the normal cut/copy/paste
  28669. if (cellComp.isEditing()) {
  28670. return;
  28671. }
  28672. // for copy / paste, we don't want to execute when the event
  28673. // was from a child grid (happens in master detail)
  28674. if (!this.mouseEventService.isEventFromThisGrid(keyboardEvent)) {
  28675. return;
  28676. }
  28677. switch (keyboardEvent.which) {
  28678. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_A:
  28679. return this.onCtrlAndA(keyboardEvent);
  28680. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_C:
  28681. return this.onCtrlAndC(keyboardEvent);
  28682. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_V:
  28683. return this.onCtrlAndV();
  28684. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_D:
  28685. return this.onCtrlAndD(keyboardEvent);
  28686. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_Z:
  28687. return keyboardEvent.shiftKey ? this.undoRedoService.redo() : this.undoRedoService.undo();
  28688. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_Y:
  28689. return this.undoRedoService.redo();
  28690. }
  28691. };
  28692. // gets called by rowRenderer when new data loaded, as it will want to scroll to the top
  28693. GridPanel.prototype.scrollToTop = function () {
  28694. this.eBodyViewport.scrollTop = 0;
  28695. };
  28696. GridPanel.prototype.processMouseEvent = function (eventName, mouseEvent) {
  28697. if (!this.mouseEventService.isEventFromThisGrid(mouseEvent) ||
  28698. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].isStopPropagationForAgGrid(mouseEvent)) {
  28699. return;
  28700. }
  28701. var rowComp = this.getRowForEvent(mouseEvent);
  28702. var cellComp = this.mouseEventService.getRenderedCellForEvent(mouseEvent);
  28703. if (eventName === "contextmenu") {
  28704. this.preventDefaultOnContextMenu(mouseEvent);
  28705. this.handleContextMenuMouseEvent(mouseEvent, null, rowComp, cellComp);
  28706. }
  28707. else {
  28708. if (cellComp) {
  28709. cellComp.onMouseEvent(eventName, mouseEvent);
  28710. }
  28711. if (rowComp) {
  28712. rowComp.onMouseEvent(eventName, mouseEvent);
  28713. }
  28714. }
  28715. };
  28716. GridPanel.prototype.mockContextMenuForIPad = function () {
  28717. var _this = this;
  28718. // we do NOT want this when not in iPad, otherwise we will be doing
  28719. if (!_utils__WEBPACK_IMPORTED_MODULE_12__["_"].isIOSUserAgent()) {
  28720. return;
  28721. }
  28722. this.eAllCellContainers.forEach(function (container) {
  28723. var touchListener = new _widgets_touchListener__WEBPACK_IMPORTED_MODULE_6__["TouchListener"](container);
  28724. var longTapListener = function (event) {
  28725. var rowComp = _this.getRowForEvent(event.touchEvent);
  28726. var cellComp = _this.mouseEventService.getRenderedCellForEvent(event.touchEvent);
  28727. _this.handleContextMenuMouseEvent(null, event.touchEvent, rowComp, cellComp);
  28728. };
  28729. _this.addManagedListener(touchListener, _widgets_touchListener__WEBPACK_IMPORTED_MODULE_6__["TouchListener"].EVENT_LONG_TAP, longTapListener);
  28730. _this.addDestroyFunc(function () { return touchListener.destroy(); });
  28731. });
  28732. };
  28733. GridPanel.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, rowComp, cellComp) {
  28734. var rowNode = rowComp ? rowComp.getRowNode() : null;
  28735. var column = cellComp ? cellComp.getColumn() : null;
  28736. var value = null;
  28737. if (column) {
  28738. var event_1 = mouseEvent ? mouseEvent : touchEvent;
  28739. cellComp.dispatchCellContextMenuEvent(event_1);
  28740. value = this.valueService.getValue(column, rowNode);
  28741. }
  28742. this.onContextMenu(mouseEvent, touchEvent, rowNode, column, value);
  28743. };
  28744. GridPanel.prototype.onContextMenu = function (mouseEvent, touchEvent, rowNode, column, value) {
  28745. // to allow us to debug in chrome, we ignore the event if ctrl is pressed.
  28746. // not everyone wants this, so first 'if' below allows to turn this hack off.
  28747. if (!this.gridOptionsWrapper.isAllowContextMenuWithControlKey()) {
  28748. // then do the check
  28749. if (mouseEvent && (mouseEvent.ctrlKey || mouseEvent.metaKey)) {
  28750. return;
  28751. }
  28752. }
  28753. if (this.contextMenuFactory && !this.gridOptionsWrapper.isSuppressContextMenu()) {
  28754. var eventOrTouch = mouseEvent ? mouseEvent : touchEvent.touches[0];
  28755. if (this.contextMenuFactory.showMenu(rowNode, column, value, eventOrTouch)) {
  28756. var event_2 = mouseEvent ? mouseEvent : touchEvent;
  28757. event_2.preventDefault();
  28758. }
  28759. }
  28760. };
  28761. GridPanel.prototype.preventDefaultOnContextMenu = function (mouseEvent) {
  28762. // if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'
  28763. // will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse
  28764. // button in the browser). so this property allows the user to receive middle button clicks if
  28765. // they want.
  28766. var gridOptionsWrapper = this.gridOptionsWrapper;
  28767. var which = mouseEvent.which;
  28768. if (gridOptionsWrapper.isPreventDefaultOnContextMenu() ||
  28769. (gridOptionsWrapper.isSuppressMiddleClickScrolls() && which === 2)) {
  28770. mouseEvent.preventDefault();
  28771. }
  28772. };
  28773. GridPanel.prototype.onCtrlAndA = function (event) {
  28774. var _a = this, beans = _a.beans, pinnedRowModel = _a.pinnedRowModel, paginationProxy = _a.paginationProxy, rangeController = _a.rangeController;
  28775. var PINNED_BOTTOM = _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM, PINNED_TOP = _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP;
  28776. if (rangeController && paginationProxy.isRowsToRender()) {
  28777. var _b = [
  28778. pinnedRowModel.isEmpty(PINNED_TOP),
  28779. pinnedRowModel.isEmpty(PINNED_BOTTOM)
  28780. ], isEmptyPinnedTop = _b[0], isEmptyPinnedBottom = _b[1];
  28781. var floatingStart = isEmptyPinnedTop ? null : PINNED_TOP;
  28782. var floatingEnd = void 0;
  28783. var rowEnd = void 0;
  28784. if (isEmptyPinnedBottom) {
  28785. floatingEnd = null;
  28786. rowEnd = this.paginationProxy.getRowCount() - 1;
  28787. }
  28788. else {
  28789. floatingEnd = PINNED_BOTTOM;
  28790. rowEnd = pinnedRowModel.getPinnedBottomRowData().length - 1;
  28791. }
  28792. var allDisplayedColumns = beans.columnController.getAllDisplayedColumns();
  28793. if (_utils__WEBPACK_IMPORTED_MODULE_12__["_"].missingOrEmpty(allDisplayedColumns)) {
  28794. return;
  28795. }
  28796. rangeController.setCellRange({
  28797. rowStartIndex: 0,
  28798. rowStartPinned: floatingStart,
  28799. rowEndIndex: rowEnd,
  28800. rowEndPinned: floatingEnd,
  28801. columnStart: allDisplayedColumns[0],
  28802. columnEnd: _utils__WEBPACK_IMPORTED_MODULE_12__["_"].last(allDisplayedColumns)
  28803. });
  28804. }
  28805. event.preventDefault();
  28806. };
  28807. GridPanel.prototype.onCtrlAndC = function (event) {
  28808. if (!this.clipboardService || this.gridOptionsWrapper.isEnableCellTextSelection()) {
  28809. return;
  28810. }
  28811. this.clipboardService.copyToClipboard();
  28812. event.preventDefault();
  28813. };
  28814. GridPanel.prototype.onCtrlAndV = function () {
  28815. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_11__["ModuleNames"].ClipboardModule) && !this.gridOptionsWrapper.isSuppressClipboardPaste()) {
  28816. this.clipboardService.pasteFromClipboard();
  28817. }
  28818. };
  28819. GridPanel.prototype.onCtrlAndD = function (event) {
  28820. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_10__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_11__["ModuleNames"].ClipboardModule) && !this.gridOptionsWrapper.isSuppressClipboardPaste()) {
  28821. this.clipboardService.copyRangeDown();
  28822. }
  28823. event.preventDefault();
  28824. };
  28825. // Valid values for position are bottom, middle and top
  28826. // position should be {'top','middle','bottom', or undefined/null}.
  28827. // if undefined/null, then the grid will to the minimal amount of scrolling,
  28828. // eg if grid needs to scroll up, it scrolls until row is on top,
  28829. // if grid needs to scroll down, it scrolls until row is on bottom,
  28830. // if row is already in view, grid does not scroll
  28831. GridPanel.prototype.ensureIndexVisible = function (index, position) {
  28832. // if for print or auto height, everything is always visible
  28833. if (this.printLayout) {
  28834. return;
  28835. }
  28836. var rowCount = this.paginationProxy.getRowCount();
  28837. if (typeof index !== 'number' || index < 0 || index >= rowCount) {
  28838. console.warn('invalid row index for ensureIndexVisible: ' + index);
  28839. return;
  28840. }
  28841. this.paginationProxy.goToPageWithIndex(index);
  28842. var rowNode = this.paginationProxy.getRow(index);
  28843. var rowGotShiftedDuringOperation;
  28844. do {
  28845. var startingRowTop = rowNode.rowTop;
  28846. var startingRowHeight = rowNode.rowHeight;
  28847. var paginationOffset = this.paginationProxy.getPixelOffset();
  28848. var rowTopPixel = rowNode.rowTop - paginationOffset;
  28849. var rowBottomPixel = rowTopPixel + rowNode.rowHeight;
  28850. var scrollPosition = this.getVScrollPosition();
  28851. var heightOffset = this.heightScaler.getOffset();
  28852. var vScrollTop = scrollPosition.top + heightOffset;
  28853. var vScrollBottom = scrollPosition.bottom + heightOffset;
  28854. var viewportHeight = vScrollBottom - vScrollTop;
  28855. // work out the pixels for top, middle and bottom up front,
  28856. // make the if/else below easier to read
  28857. var pxTop = this.heightScaler.getScrollPositionForPixel(rowTopPixel);
  28858. var pxBottom = this.heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight);
  28859. // make sure if middle, the row is not outside the top of the grid
  28860. var pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel);
  28861. var rowBelowViewport = vScrollTop > rowTopPixel;
  28862. var rowAboveViewport = vScrollBottom < rowBottomPixel;
  28863. var newScrollPosition = null;
  28864. if (position === 'top') {
  28865. newScrollPosition = pxTop;
  28866. }
  28867. else if (position === 'bottom') {
  28868. newScrollPosition = pxBottom;
  28869. }
  28870. else if (position === 'middle') {
  28871. newScrollPosition = pxMiddle;
  28872. }
  28873. else if (rowBelowViewport) {
  28874. // if row is before, scroll up with row at top
  28875. newScrollPosition = pxTop;
  28876. }
  28877. else if (rowAboveViewport) {
  28878. // if row is below, scroll down with row at bottom
  28879. newScrollPosition = pxBottom;
  28880. }
  28881. if (newScrollPosition !== null) {
  28882. this.eBodyViewport.scrollTop = newScrollPosition;
  28883. this.rowRenderer.redrawAfterScroll();
  28884. }
  28885. // the row can get shifted if during the rendering (during rowRenderer.redrawAfterScroll()),
  28886. // the height of a row changes due to lazy calculation of row heights when using
  28887. // colDef.autoHeight or gridOptions.getRowHeight.
  28888. // if row was shifted, then the position we scrolled to is incorrect.
  28889. rowGotShiftedDuringOperation = (startingRowTop !== rowNode.rowTop)
  28890. || (startingRowHeight !== rowNode.rowHeight);
  28891. } while (rowGotShiftedDuringOperation);
  28892. // so when we return back to user, the cells have rendered
  28893. this.animationFrameService.flushAllFrames();
  28894. };
  28895. // + moveColumnController
  28896. GridPanel.prototype.getCenterWidth = function () {
  28897. return this.eCenterViewport.clientWidth;
  28898. };
  28899. GridPanel.prototype.isVerticalScrollShowing = function () {
  28900. var isAlwaysShowVerticalScroll = this.gridOptionsWrapper.isAlwaysShowVerticalScroll();
  28901. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addOrRemoveCssClass(this.eBodyViewport, 'ag-force-vertical-scroll', isAlwaysShowVerticalScroll);
  28902. return isAlwaysShowVerticalScroll || _utils__WEBPACK_IMPORTED_MODULE_12__["_"].isVerticalScrollShowing(this.eBodyViewport);
  28903. };
  28904. GridPanel.prototype.isHorizontalScrollShowing = function () {
  28905. return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].isHorizontalScrollShowing(this.eCenterViewport);
  28906. };
  28907. // gets called every time the viewport size changes. we use this to check visibility of scrollbars
  28908. // in the grid panel, and also to check size and position of viewport for row and column virtualisation.
  28909. GridPanel.prototype.checkViewportAndScrolls = function () {
  28910. // results in updating anything that depends on scroll showing
  28911. this.updateScrollVisibleService();
  28912. // fires event if height changes, used by PaginationService, HeightScalerService, RowRenderer
  28913. this.checkBodyHeight();
  28914. // check for virtual columns for ColumnController
  28915. this.onHorizontalViewportChanged();
  28916. this.setPinnedContainerSize();
  28917. // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again.
  28918. // (which happens with some implementations of tabbing). this can result in horizontal scroll getting
  28919. // reset back to the left, however no scroll event is fired. so we need to get header to also scroll
  28920. // back to the left to be kept in sync.
  28921. // adding and removing the grid from the DOM both resets the scroll position and
  28922. // triggers a resize event, so notify listeners if the scroll position has changed
  28923. if (this.scrollLeft !== this.getCenterViewportScrollLeft()) {
  28924. this.onBodyHorizontalScroll(this.eCenterViewport);
  28925. }
  28926. };
  28927. GridPanel.prototype.updateScrollVisibleService = function () {
  28928. // because of column animation (which takes 200ms), we have to do this twice.
  28929. // eg if user removes cols anywhere except at the RHS, then the cols on the RHS
  28930. // will animate to the left to fill the gap. this animation means just after
  28931. // the cols are removed, the remaining cols are still in the original location
  28932. // at the start of the animation, so pre animation the H scrollbar is still needed,
  28933. // but post animation it is not.
  28934. this.updateScrollVisibleServiceImpl();
  28935. setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500);
  28936. };
  28937. GridPanel.prototype.updateScrollVisibleServiceImpl = function () {
  28938. var params = {
  28939. horizontalScrollShowing: false,
  28940. verticalScrollShowing: false
  28941. };
  28942. params.verticalScrollShowing = this.isVerticalScrollShowing();
  28943. params.horizontalScrollShowing = this.isHorizontalScrollShowing();
  28944. this.scrollVisibleService.setScrollsVisible(params);
  28945. this.setHorizontalScrollVisible(params.horizontalScrollShowing);
  28946. this.setVerticalScrollPaddingVisible(params.verticalScrollShowing);
  28947. };
  28948. GridPanel.prototype.setHorizontalScrollVisible = function (visible) {
  28949. var isSuppressHorizontalScroll = this.gridOptionsWrapper.isSuppressHorizontalScroll();
  28950. var scrollSize = visible ? (this.gridOptionsWrapper.getScrollbarWidth() || 0) : 0;
  28951. var scrollContainerSize = !isSuppressHorizontalScroll ? scrollSize : 0;
  28952. var addIEPadding = _utils__WEBPACK_IMPORTED_MODULE_12__["_"].isBrowserIE() && visible;
  28953. this.eCenterViewport.style.height = "calc(100% + " + scrollSize + "px)";
  28954. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedHeight(this.eHorizontalScrollBody, scrollContainerSize);
  28955. // we have to add an extra pixel to the scroller viewport on IE because
  28956. // if the container has the same size as the scrollbar, the scroll button won't work
  28957. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedHeight(this.eBodyHorizontalScrollViewport, scrollContainerSize + (addIEPadding ? 1 : 0));
  28958. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedHeight(this.eBodyHorizontalScrollContainer, scrollContainerSize);
  28959. };
  28960. GridPanel.prototype.setVerticalScrollPaddingVisible = function (show) {
  28961. var scroller = show ? 'scroll' : 'hidden';
  28962. this.eTop.style.overflowY = this.eBottom.style.overflowY = scroller;
  28963. this.setFakeHScrollSpacerWidths();
  28964. };
  28965. GridPanel.prototype.updateRowCount = function () {
  28966. var headerCount = this.headerNavigationService.getHeaderRowCount();
  28967. var rowCount = this.paginationProxy.getRowCount();
  28968. var total = (headerCount + rowCount).toString();
  28969. this.getGui().setAttribute('aria-rowcount', total);
  28970. };
  28971. GridPanel.prototype.updateColumnCount = function () {
  28972. var columns = this.columnController.getAllDisplayedColumns();
  28973. this.getGui().setAttribute('aria-colcount', columns.length.toString());
  28974. };
  28975. GridPanel.prototype.ensureColumnVisible = function (key) {
  28976. var column = this.columnController.getGridColumn(key);
  28977. if (!column) {
  28978. return;
  28979. }
  28980. if (column.isPinned()) {
  28981. console.warn('calling ensureIndexVisible on a ' + column.getPinned() + ' pinned column doesn\'t make sense for column ' + column.getColId());
  28982. return;
  28983. }
  28984. if (!this.columnController.isColumnDisplayed(column)) {
  28985. console.warn('column is not currently visible');
  28986. return;
  28987. }
  28988. var colLeftPixel = column.getLeft();
  28989. var colRightPixel = colLeftPixel + column.getActualWidth();
  28990. var viewportWidth = this.eCenterViewport.clientWidth;
  28991. var scrollPosition = this.getCenterViewportScrollLeft();
  28992. var bodyWidth = this.columnController.getBodyContainerWidth();
  28993. var viewportLeftPixel;
  28994. var viewportRightPixel;
  28995. // the logic of working out left and right viewport px is both here and in the ColumnController,
  28996. // need to refactor it out to one place
  28997. if (this.enableRtl) {
  28998. viewportLeftPixel = bodyWidth - scrollPosition - viewportWidth;
  28999. viewportRightPixel = bodyWidth - scrollPosition;
  29000. }
  29001. else {
  29002. viewportLeftPixel = scrollPosition;
  29003. viewportRightPixel = viewportWidth + scrollPosition;
  29004. }
  29005. var viewportScrolledPastCol = viewportLeftPixel > colLeftPixel;
  29006. var viewportScrolledBeforeCol = viewportRightPixel < colRightPixel;
  29007. var colToSmallForViewport = viewportWidth < column.getActualWidth();
  29008. var alignColToLeft = viewportScrolledPastCol || colToSmallForViewport;
  29009. var alignColToRight = viewportScrolledBeforeCol;
  29010. var newScrollPosition = this.getCenterViewportScrollLeft();
  29011. if (alignColToLeft || alignColToRight) {
  29012. if (this.enableRtl) {
  29013. newScrollPosition = alignColToLeft ? (bodyWidth - viewportWidth - colLeftPixel) : (bodyWidth - colRightPixel);
  29014. }
  29015. else {
  29016. newScrollPosition = alignColToLeft ? colLeftPixel : (colRightPixel - viewportWidth);
  29017. }
  29018. this.setCenterViewportScrollLeft(newScrollPosition);
  29019. }
  29020. else {
  29021. // otherwise, col is already in view, so do nothing
  29022. }
  29023. // this will happen anyway, as the move will cause a 'scroll' event on the body, however
  29024. // it is possible that the ensureColumnVisible method is called from within ag-Grid and
  29025. // the caller will need to have the columns rendered to continue, which will be before
  29026. // the event has been worked on (which is the case for cell navigation).
  29027. this.onHorizontalViewportChanged();
  29028. // so when we return back to user, the cells have rendered
  29029. this.animationFrameService.flushAllFrames();
  29030. };
  29031. GridPanel.prototype.showLoadingOverlay = function () {
  29032. if (!this.gridOptionsWrapper.isSuppressLoadingOverlay()) {
  29033. this.overlayWrapper.showLoadingOverlay();
  29034. }
  29035. };
  29036. GridPanel.prototype.showNoRowsOverlay = function () {
  29037. if (!this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
  29038. this.overlayWrapper.showNoRowsOverlay();
  29039. }
  29040. };
  29041. GridPanel.prototype.hideOverlay = function () {
  29042. this.overlayWrapper.hideOverlay();
  29043. };
  29044. // method will call itself if no available width. this covers if the grid
  29045. // isn't visible, but is just about to be visible.
  29046. GridPanel.prototype.sizeColumnsToFit = function (nextTimeout) {
  29047. var _this = this;
  29048. var availableWidth = this.eBodyViewport.clientWidth;
  29049. if (availableWidth > 0) {
  29050. this.columnController.sizeColumnsToFit(availableWidth, "sizeColumnsToFit");
  29051. return;
  29052. }
  29053. if (nextTimeout === undefined) {
  29054. window.setTimeout(function () {
  29055. _this.sizeColumnsToFit(100);
  29056. }, 0);
  29057. }
  29058. else if (nextTimeout === 100) {
  29059. window.setTimeout(function () {
  29060. _this.sizeColumnsToFit(500);
  29061. }, 100);
  29062. }
  29063. else if (nextTimeout === 500) {
  29064. window.setTimeout(function () {
  29065. _this.sizeColumnsToFit(-1);
  29066. }, 500);
  29067. }
  29068. else {
  29069. console.warn('ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +
  29070. 'zero width, maybe the grid is not visible yet on the screen?');
  29071. }
  29072. };
  29073. // used by autoWidthCalculator and autoHeightCalculator
  29074. GridPanel.prototype.getCenterContainer = function () {
  29075. return this.eCenterContainer;
  29076. };
  29077. GridPanel.prototype.getDropTargetBodyContainers = function () {
  29078. return [this.eCenterViewport, this.eTopViewport, this.eBottomViewport];
  29079. };
  29080. GridPanel.prototype.getDropTargetLeftContainers = function () {
  29081. return [this.eLeftContainer, this.eLeftBottom, this.eLeftTop];
  29082. };
  29083. GridPanel.prototype.getDropTargetRightContainers = function () {
  29084. return [this.eRightContainer, this.eRightBottom, this.eRightTop];
  29085. };
  29086. GridPanel.prototype.buildRowContainerComponents = function () {
  29087. var _this = this;
  29088. this.eAllCellContainers = [
  29089. this.eLeftContainer, this.eRightContainer, this.eCenterContainer,
  29090. this.eTop, this.eBottom, this.eFullWidthContainer
  29091. ];
  29092. this.rowContainerComponents = {
  29093. body: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
  29094. eContainer: this.eCenterContainer,
  29095. eWrapper: this.eCenterColsClipper,
  29096. eViewport: this.eBodyViewport
  29097. }),
  29098. fullWidth: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
  29099. eContainer: this.eFullWidthContainer
  29100. }),
  29101. pinnedLeft: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eLeftContainer }),
  29102. pinnedRight: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eRightContainer }),
  29103. floatingTop: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eTopContainer }),
  29104. floatingTopPinnedLeft: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eLeftTop }),
  29105. floatingTopPinnedRight: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eRightTop }),
  29106. floatingTopFullWidth: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
  29107. eContainer: this.eTopFullWidthContainer,
  29108. hideWhenNoChildren: true
  29109. }),
  29110. floatingBottom: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eBottomContainer }),
  29111. floatingBottomPinnedLeft: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eLeftBottom }),
  29112. floatingBottomPinnedRight: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({ eContainer: this.eRightBottom }),
  29113. floatingBottomFullWidth: new _rendering_rowContainerComponent__WEBPACK_IMPORTED_MODULE_4__["RowContainerComponent"]({
  29114. eContainer: this.eBottomFullWidthContainer,
  29115. hideWhenNoChildren: true
  29116. }),
  29117. };
  29118. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].iterateObject(this.rowContainerComponents, function (key, container) {
  29119. if (container) {
  29120. _this.getContext().createBean(container);
  29121. }
  29122. });
  29123. };
  29124. GridPanel.prototype.setupRowAnimationCssClass = function () {
  29125. var _this = this;
  29126. var listener = function () {
  29127. // we don't want to use row animation if scaling, as rows jump strangely as you scroll,
  29128. // when scaling and doing row animation.
  29129. var animateRows = _this.gridOptionsWrapper.isAnimateRows() && !_this.heightScaler.isScaling();
  29130. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addOrRemoveCssClass(_this.eBodyViewport, 'ag-row-animation', animateRows);
  29131. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addOrRemoveCssClass(_this.eBodyViewport, 'ag-row-no-animation', !animateRows);
  29132. };
  29133. listener();
  29134. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_HEIGHT_SCALE_CHANGED, listener);
  29135. };
  29136. // when editing a pinned row, if the cell is half outside the scrollable area, the browser can
  29137. // scroll the column into view. we do not want this, the pinned sections should never scroll.
  29138. // so we listen to scrolls on these containers and reset the scroll if we find one.
  29139. GridPanel.prototype.suppressScrollOnFloatingRow = function () {
  29140. var _this = this;
  29141. var resetTopScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
  29142. var resetBottomScroll = function () { return _this.eTopViewport.scrollLeft = 0; };
  29143. this.addManagedListener(this.eTopViewport, 'scroll', resetTopScroll);
  29144. this.addManagedListener(this.eBottomViewport, 'scroll', resetBottomScroll);
  29145. };
  29146. GridPanel.prototype.getRowContainers = function () {
  29147. return this.rowContainerComponents;
  29148. };
  29149. GridPanel.prototype.getFloatingTopBottom = function () {
  29150. return [this.eTop, this.eBottom];
  29151. };
  29152. GridPanel.prototype.onDisplayedColumnsChanged = function () {
  29153. this.setPinnedContainerSize();
  29154. this.setHeaderAndFloatingHeights();
  29155. this.onHorizontalViewportChanged();
  29156. this.updateScrollVisibleService();
  29157. this.updateColumnCount();
  29158. };
  29159. GridPanel.prototype.onDisplayedColumnsWidthChanged = function () {
  29160. this.setWidthsOfContainers();
  29161. this.onHorizontalViewportChanged();
  29162. this.updateScrollVisibleService();
  29163. if (this.enableRtl) {
  29164. // because RTL is all backwards, a change in the width of the row
  29165. // can cause a change in the scroll position, without a scroll event,
  29166. // because the scroll position in RTL is a function that depends on
  29167. // the width. to be convinced of this, take out this line, enable RTL,
  29168. // scroll all the way to the left and then resize a column
  29169. this.horizontallyScrollHeaderCenterAndFloatingCenter();
  29170. }
  29171. };
  29172. GridPanel.prototype.setWidthsOfContainers = function () {
  29173. this.setCenterWidth();
  29174. this.setPinnedContainerSize();
  29175. };
  29176. GridPanel.prototype.setCenterWidth = function () {
  29177. var _a = this, headerRootComp = _a.headerRootComp, columnController = _a.columnController;
  29178. var width = columnController.getBodyContainerWidth();
  29179. if (this.printLayout) {
  29180. var pinnedContainerWidths = columnController.getPinnedLeftContainerWidth()
  29181. + columnController.getPinnedRightContainerWidth();
  29182. width += pinnedContainerWidths;
  29183. }
  29184. headerRootComp.setHeaderContainerWidth(width);
  29185. var widthPx = width + "px";
  29186. this.eCenterContainer.style.width = widthPx;
  29187. this.eBottomContainer.style.width = widthPx;
  29188. this.eTopContainer.style.width = widthPx;
  29189. if (!this.printLayout) {
  29190. this.eBodyHorizontalScrollContainer.style.width = widthPx;
  29191. }
  29192. };
  29193. GridPanel.prototype.setPinnedLeftWidth = function () {
  29194. var _this = this;
  29195. var oldPinning = this.pinningLeft;
  29196. var widthOfCols = this.columnController.getPinnedLeftContainerWidth();
  29197. var newPinning = this.pinningLeft = !this.printLayout && widthOfCols > 0;
  29198. var containers = [this.eLeftContainer, this.eLeftTop, this.eLeftBottom];
  29199. if (oldPinning !== newPinning) {
  29200. this.headerRootComp.setLeftVisible(newPinning);
  29201. }
  29202. containers.forEach(function (e) { return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setDisplayed(e, _this.pinningLeft); });
  29203. if (newPinning) {
  29204. containers.forEach(function (ct) { return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedWidth(ct, widthOfCols); });
  29205. }
  29206. };
  29207. GridPanel.prototype.setPinnedRightWidth = function () {
  29208. var oldPinning = this.pinningRight;
  29209. var widthOfCols = this.columnController.getPinnedRightContainerWidth();
  29210. var newPinning = this.pinningRight = !this.printLayout && widthOfCols > 0;
  29211. var containers = [this.eRightContainer, this.eRightTop, this.eRightBottom];
  29212. if (oldPinning !== newPinning) {
  29213. this.headerRootComp.setRightVisible(newPinning);
  29214. }
  29215. containers.forEach(function (ct) { return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setDisplayed(ct, newPinning); });
  29216. if (newPinning) {
  29217. containers.forEach(function (ct) { return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedWidth(ct, widthOfCols); });
  29218. }
  29219. };
  29220. GridPanel.prototype.setPinnedContainerSize = function () {
  29221. this.setPinnedLeftWidth();
  29222. this.setPinnedRightWidth();
  29223. this.setFakeHScrollSpacerWidths();
  29224. };
  29225. GridPanel.prototype.setFakeHScrollSpacerWidths = function () {
  29226. // we pad the right based on a) if cols are pinned to the right and
  29227. // b) if v scroll is showing on the right (normal position of scroll)
  29228. var rightSpacing = this.columnController.getPinnedRightContainerWidth();
  29229. var scrollOnRight = !this.enableRtl && this.isVerticalScrollShowing();
  29230. if (scrollOnRight) {
  29231. rightSpacing += this.scrollWidth;
  29232. }
  29233. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedWidth(this.eHorizontalRightSpacer, rightSpacing);
  29234. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addOrRemoveCssClass(this.eHorizontalRightSpacer, 'ag-scroller-corner', rightSpacing <= this.scrollWidth);
  29235. // we pad the left based on a) if cols are pinned to the left and
  29236. // b) if v scroll is showing on the left (happens in LTR layout only)
  29237. var leftSpacing = this.columnController.getPinnedLeftContainerWidth();
  29238. var scrollOnLeft = this.enableRtl && this.isVerticalScrollShowing();
  29239. if (scrollOnLeft) {
  29240. leftSpacing += this.scrollWidth;
  29241. }
  29242. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setFixedWidth(this.eHorizontalLeftSpacer, leftSpacing);
  29243. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].addOrRemoveCssClass(this.eHorizontalLeftSpacer, 'ag-scroller-corner', leftSpacing <= this.scrollWidth);
  29244. };
  29245. GridPanel.prototype.checkBodyHeight = function () {
  29246. var bodyHeight = this.eBodyViewport.clientHeight;
  29247. if (this.bodyHeight !== bodyHeight) {
  29248. this.bodyHeight = bodyHeight;
  29249. var event_3 = {
  29250. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_HEIGHT_CHANGED,
  29251. api: this.gridApi,
  29252. columnApi: this.columnApi
  29253. };
  29254. this.eventService.dispatchEvent(event_3);
  29255. }
  29256. };
  29257. GridPanel.prototype.setHeaderAndFloatingHeights = function () {
  29258. var _a = this, columnController = _a.columnController, gridOptionsWrapper = _a.gridOptionsWrapper, pinnedRowModel = _a.pinnedRowModel, eTop = _a.eTop, eBottom = _a.eBottom;
  29259. var numberOfFloating = 0;
  29260. var headerRowCount = columnController.getHeaderRowCount();
  29261. var totalHeaderHeight;
  29262. var groupHeight;
  29263. var headerHeight;
  29264. if (columnController.isPivotMode()) {
  29265. groupHeight = gridOptionsWrapper.getPivotGroupHeaderHeight();
  29266. headerHeight = gridOptionsWrapper.getPivotHeaderHeight();
  29267. }
  29268. else {
  29269. var hasFloatingFilters = columnController.hasFloatingFilters();
  29270. if (hasFloatingFilters) {
  29271. headerRowCount++;
  29272. numberOfFloating = 1;
  29273. }
  29274. groupHeight = gridOptionsWrapper.getGroupHeaderHeight();
  29275. headerHeight = gridOptionsWrapper.getHeaderHeight();
  29276. }
  29277. var numberOfNonGroups = 1 + numberOfFloating;
  29278. var numberOfGroups = headerRowCount - numberOfNonGroups;
  29279. totalHeaderHeight = numberOfFloating * gridOptionsWrapper.getFloatingFiltersHeight();
  29280. totalHeaderHeight += numberOfGroups * groupHeight;
  29281. totalHeaderHeight += headerHeight;
  29282. this.headerRootComp.setHeight(totalHeaderHeight);
  29283. var floatingTopHeight = pinnedRowModel.getPinnedTopTotalHeight();
  29284. if (floatingTopHeight) {
  29285. // adding 1px for cell bottom border
  29286. floatingTopHeight += 1;
  29287. }
  29288. var floatingBottomHeight = pinnedRowModel.getPinnedBottomTotalHeight();
  29289. if (floatingBottomHeight) {
  29290. // adding 1px for cell bottom border
  29291. floatingBottomHeight += 1;
  29292. }
  29293. var floatingTopHeightString = floatingTopHeight + "px";
  29294. var floatingBottomHeightString = floatingBottomHeight + "px";
  29295. eTop.style.minHeight = floatingTopHeightString;
  29296. eTop.style.height = floatingTopHeightString;
  29297. eTop.style.display = floatingTopHeight ? 'inherit' : 'none';
  29298. eBottom.style.minHeight = floatingBottomHeightString;
  29299. eBottom.style.height = floatingBottomHeightString;
  29300. eBottom.style.display = floatingBottomHeight ? 'inherit' : 'none';
  29301. this.checkBodyHeight();
  29302. };
  29303. GridPanel.prototype.getBodyHeight = function () {
  29304. return this.bodyHeight;
  29305. };
  29306. // called by scrollHorizontally method and alignedGridsService
  29307. GridPanel.prototype.setHorizontalScrollPosition = function (hScrollPosition) {
  29308. this.eCenterViewport.scrollLeft = hScrollPosition;
  29309. // we need to manually do the event handling (rather than wait for the event)
  29310. // for the alignedGridsService, as if we don't, the aligned grid service gets
  29311. // notified async, and then it's 'consuming' flag doesn't get used right, and
  29312. // we can end up with an infinite loop
  29313. this.doHorizontalScroll(hScrollPosition);
  29314. };
  29315. GridPanel.prototype.setVerticalScrollPosition = function (vScrollPosition) {
  29316. this.eBodyViewport.scrollTop = vScrollPosition;
  29317. };
  29318. // called by the headerRootComp and moveColumnController
  29319. GridPanel.prototype.scrollHorizontally = function (pixels) {
  29320. var oldScrollPosition = this.eCenterViewport.scrollLeft;
  29321. this.setHorizontalScrollPosition(oldScrollPosition + pixels);
  29322. return this.eCenterViewport.scrollLeft - oldScrollPosition;
  29323. };
  29324. // called by rowDragFeature
  29325. GridPanel.prototype.scrollVertically = function (pixels) {
  29326. var oldScrollPosition = this.eBodyViewport.scrollTop;
  29327. this.setVerticalScrollPosition(oldScrollPosition + pixels);
  29328. return this.eBodyViewport.scrollTop - oldScrollPosition;
  29329. };
  29330. GridPanel.prototype.addScrollListener = function () {
  29331. this.addManagedListener(this.eCenterViewport, 'scroll', this.onCenterViewportScroll.bind(this));
  29332. this.addManagedListener(this.eBodyHorizontalScrollViewport, 'scroll', this.onFakeHorizontalScroll.bind(this));
  29333. this.addManagedListener(this.eBodyViewport, 'scroll', this.onVerticalScroll.bind(this));
  29334. };
  29335. GridPanel.prototype.onVerticalScroll = function () {
  29336. var scrollTop = this.eBodyViewport.scrollTop;
  29337. this.animationFrameService.setScrollTop(scrollTop);
  29338. this.scrollTop = scrollTop;
  29339. this.redrawRowsAfterScroll();
  29340. };
  29341. GridPanel.prototype.isControllingScroll = function (eDiv) {
  29342. if (!this.lastHorizontalScrollElement) {
  29343. this.lastHorizontalScrollElement = eDiv;
  29344. return true;
  29345. }
  29346. return eDiv === this.lastHorizontalScrollElement;
  29347. };
  29348. GridPanel.prototype.onFakeHorizontalScroll = function () {
  29349. if (!this.isControllingScroll(this.eBodyHorizontalScrollViewport)) {
  29350. return;
  29351. }
  29352. this.onBodyHorizontalScroll(this.eBodyHorizontalScrollViewport);
  29353. };
  29354. GridPanel.prototype.onCenterViewportScroll = function () {
  29355. if (!this.isControllingScroll(this.eCenterViewport)) {
  29356. return;
  29357. }
  29358. this.onBodyHorizontalScroll(this.eCenterViewport);
  29359. };
  29360. GridPanel.prototype.onBodyHorizontalScroll = function (eSource) {
  29361. var _a = this.eCenterViewport, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
  29362. // in chrome, fractions can be in the scroll left, eg 250.342234 - which messes up our 'scrollWentPastBounds'
  29363. // formula. so we floor it to allow the formula to work.
  29364. var scrollLeft = Math.floor(_utils__WEBPACK_IMPORTED_MODULE_12__["_"].getScrollLeft(eSource, this.enableRtl));
  29365. // touch devices allow elastic scroll - which temporally scrolls the panel outside of the viewport
  29366. // (eg user uses touch to go to the left of the grid, but drags past the left, the rows will actually
  29367. // scroll past the left until the user releases the mouse). when this happens, we want ignore the scroll,
  29368. // as otherwise it was causing the rows and header to flicker.
  29369. // sometimes when scrolling, we got values that extended the maximum scroll allowed. we used to
  29370. // ignore these scrolls. problem is the max scroll position could be skipped (eg the previous scroll event
  29371. // could be 10px before the max position, and then current scroll event could be 20px after the max position).
  29372. // if we just ignored the last event, we would be setting the scroll to 10px before the max position, when in
  29373. // actual fact the user has exceeded the max scroll and thus scroll should be set to the max.
  29374. var minScroll = 0;
  29375. var maxScroll = scrollWidth - clientWidth;
  29376. if (scrollLeft < minScroll) {
  29377. scrollLeft = minScroll;
  29378. }
  29379. else if (scrollLeft > maxScroll) {
  29380. scrollLeft = maxScroll;
  29381. }
  29382. this.doHorizontalScroll(scrollLeft);
  29383. this.resetLastHorizontalScrollElementDebounced();
  29384. };
  29385. GridPanel.prototype.resetLastHorizontalScrollElement = function () {
  29386. this.lastHorizontalScrollElement = null;
  29387. };
  29388. GridPanel.prototype.doHorizontalScroll = function (scrollLeft) {
  29389. this.scrollLeft = scrollLeft;
  29390. var event = {
  29391. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_SCROLL,
  29392. api: this.gridApi,
  29393. columnApi: this.columnApi,
  29394. direction: 'horizontal',
  29395. left: this.scrollLeft,
  29396. top: this.scrollTop
  29397. };
  29398. this.eventService.dispatchEvent(event);
  29399. this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft);
  29400. this.onHorizontalViewportChanged();
  29401. };
  29402. GridPanel.prototype.redrawRowsAfterScroll = function () {
  29403. var event = {
  29404. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_SCROLL,
  29405. direction: 'vertical',
  29406. api: this.gridApi,
  29407. columnApi: this.columnApi,
  29408. left: this.scrollLeft,
  29409. top: this.scrollTop
  29410. };
  29411. this.eventService.dispatchEvent(event);
  29412. };
  29413. // this gets called whenever a change in the viewport, so we can inform column controller it has to work
  29414. // out the virtual columns again. gets called from following locations:
  29415. // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged, API (doLayout)
  29416. GridPanel.prototype.onHorizontalViewportChanged = function () {
  29417. var scrollWidth = this.eCenterViewport.clientWidth;
  29418. var scrollPosition = this.getCenterViewportScrollLeft();
  29419. this.columnController.setVirtualViewportPosition(scrollWidth, scrollPosition);
  29420. };
  29421. GridPanel.prototype.getCenterViewportScrollLeft = function () {
  29422. // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser
  29423. return _utils__WEBPACK_IMPORTED_MODULE_12__["_"].getScrollLeft(this.eCenterViewport, this.enableRtl);
  29424. };
  29425. GridPanel.prototype.setCenterViewportScrollLeft = function (value) {
  29426. // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser
  29427. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setScrollLeft(this.eCenterViewport, value, this.enableRtl);
  29428. };
  29429. GridPanel.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function (scrollLeft) {
  29430. if (scrollLeft === undefined) {
  29431. scrollLeft = this.getCenterViewportScrollLeft();
  29432. }
  29433. var offset = this.enableRtl ? scrollLeft : -scrollLeft;
  29434. var _a = this.eCenterViewport, clientWidth = _a.clientWidth, scrollWidth = _a.scrollWidth;
  29435. var scrollWentPastBounds = Math.abs(offset) + clientWidth > scrollWidth;
  29436. if (scrollWentPastBounds ||
  29437. (this.enableRtl && offset < 0) ||
  29438. (!this.enableRtl && offset > 0)) {
  29439. return;
  29440. }
  29441. this.headerRootComp.setHorizontalScroll(offset);
  29442. this.eBottomContainer.style.transform = "translateX(" + offset + "px)";
  29443. this.eTopContainer.style.transform = "translateX(" + offset + "px)";
  29444. var partner = this.lastHorizontalScrollElement === this.eCenterViewport ? this.eBodyHorizontalScrollViewport : this.eCenterViewport;
  29445. _utils__WEBPACK_IMPORTED_MODULE_12__["_"].setScrollLeft(partner, scrollLeft, this.enableRtl);
  29446. };
  29447. // + rangeController
  29448. GridPanel.prototype.addScrollEventListener = function (listener) {
  29449. this.eBodyViewport.addEventListener('scroll', listener);
  29450. };
  29451. // + rangeController
  29452. GridPanel.prototype.removeScrollEventListener = function (listener) {
  29453. this.eBodyViewport.removeEventListener('scroll', listener);
  29454. };
  29455. __decorate([
  29456. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('alignedGridsService')
  29457. ], GridPanel.prototype, "alignedGridsService", void 0);
  29458. __decorate([
  29459. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  29460. ], GridPanel.prototype, "gridOptionsWrapper", void 0);
  29461. __decorate([
  29462. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowRenderer')
  29463. ], GridPanel.prototype, "rowRenderer", void 0);
  29464. __decorate([
  29465. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('pinnedRowModel')
  29466. ], GridPanel.prototype, "pinnedRowModel", void 0);
  29467. __decorate([
  29468. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('animationFrameService')
  29469. ], GridPanel.prototype, "animationFrameService", void 0);
  29470. __decorate([
  29471. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('navigationService')
  29472. ], GridPanel.prototype, "navigationService", void 0);
  29473. __decorate([
  29474. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('autoHeightCalculator')
  29475. ], GridPanel.prototype, "autoHeightCalculator", void 0);
  29476. __decorate([
  29477. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnAnimationService')
  29478. ], GridPanel.prototype, "columnAnimationService", void 0);
  29479. __decorate([
  29480. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('autoWidthCalculator')
  29481. ], GridPanel.prototype, "autoWidthCalculator", void 0);
  29482. __decorate([
  29483. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('paginationAutoPageSizeService')
  29484. ], GridPanel.prototype, "paginationAutoPageSizeService", void 0);
  29485. __decorate([
  29486. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('beans')
  29487. ], GridPanel.prototype, "beans", void 0);
  29488. __decorate([
  29489. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('paginationProxy')
  29490. ], GridPanel.prototype, "paginationProxy", void 0);
  29491. __decorate([
  29492. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
  29493. ], GridPanel.prototype, "columnApi", void 0);
  29494. __decorate([
  29495. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
  29496. ], GridPanel.prototype, "gridApi", void 0);
  29497. __decorate([
  29498. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragService')
  29499. ], GridPanel.prototype, "dragService", void 0);
  29500. __decorate([
  29501. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('mouseEventService')
  29502. ], GridPanel.prototype, "mouseEventService", void 0);
  29503. __decorate([
  29504. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('$scope')
  29505. ], GridPanel.prototype, "$scope", void 0);
  29506. __decorate([
  29507. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('scrollVisibleService')
  29508. ], GridPanel.prototype, "scrollVisibleService", void 0);
  29509. __decorate([
  29510. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('valueService')
  29511. ], GridPanel.prototype, "valueService", void 0);
  29512. __decorate([
  29513. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragAndDropService')
  29514. ], GridPanel.prototype, "dragAndDropService", void 0);
  29515. __decorate([
  29516. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('maxDivHeightScaler')
  29517. ], GridPanel.prototype, "heightScaler", void 0);
  29518. __decorate([
  29519. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('resizeObserverService')
  29520. ], GridPanel.prototype, "resizeObserverService", void 0);
  29521. __decorate([
  29522. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('undoRedoService')
  29523. ], GridPanel.prototype, "undoRedoService", void 0);
  29524. __decorate([
  29525. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  29526. ], GridPanel.prototype, "columnController", void 0);
  29527. __decorate([
  29528. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('headerNavigationService')
  29529. ], GridPanel.prototype, "headerNavigationService", void 0);
  29530. __decorate([
  29531. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('rangeController')
  29532. ], GridPanel.prototype, "rangeController", void 0);
  29533. __decorate([
  29534. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('contextMenuFactory')
  29535. ], GridPanel.prototype, "contextMenuFactory", void 0);
  29536. __decorate([
  29537. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('clipboardService')
  29538. ], GridPanel.prototype, "clipboardService", void 0);
  29539. __decorate([
  29540. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBodyViewport')
  29541. ], GridPanel.prototype, "eBodyViewport", void 0);
  29542. __decorate([
  29543. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eCenterContainer')
  29544. ], GridPanel.prototype, "eCenterContainer", void 0);
  29545. __decorate([
  29546. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eCenterViewport')
  29547. ], GridPanel.prototype, "eCenterViewport", void 0);
  29548. __decorate([
  29549. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eLeftContainer')
  29550. ], GridPanel.prototype, "eLeftContainer", void 0);
  29551. __decorate([
  29552. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eRightContainer')
  29553. ], GridPanel.prototype, "eRightContainer", void 0);
  29554. __decorate([
  29555. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eCenterColsClipper')
  29556. ], GridPanel.prototype, "eCenterColsClipper", void 0);
  29557. __decorate([
  29558. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eHorizontalScrollBody')
  29559. ], GridPanel.prototype, "eHorizontalScrollBody", void 0);
  29560. __decorate([
  29561. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eHorizontalLeftSpacer')
  29562. ], GridPanel.prototype, "eHorizontalLeftSpacer", void 0);
  29563. __decorate([
  29564. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eHorizontalRightSpacer')
  29565. ], GridPanel.prototype, "eHorizontalRightSpacer", void 0);
  29566. __decorate([
  29567. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBodyHorizontalScrollViewport')
  29568. ], GridPanel.prototype, "eBodyHorizontalScrollViewport", void 0);
  29569. __decorate([
  29570. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBodyHorizontalScrollContainer')
  29571. ], GridPanel.prototype, "eBodyHorizontalScrollContainer", void 0);
  29572. __decorate([
  29573. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eFullWidthContainer')
  29574. ], GridPanel.prototype, "eFullWidthContainer", void 0);
  29575. __decorate([
  29576. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTop')
  29577. ], GridPanel.prototype, "eTop", void 0);
  29578. __decorate([
  29579. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eLeftTop')
  29580. ], GridPanel.prototype, "eLeftTop", void 0);
  29581. __decorate([
  29582. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eRightTop')
  29583. ], GridPanel.prototype, "eRightTop", void 0);
  29584. __decorate([
  29585. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTopContainer')
  29586. ], GridPanel.prototype, "eTopContainer", void 0);
  29587. __decorate([
  29588. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTopViewport')
  29589. ], GridPanel.prototype, "eTopViewport", void 0);
  29590. __decorate([
  29591. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eTopFullWidthContainer')
  29592. ], GridPanel.prototype, "eTopFullWidthContainer", void 0);
  29593. __decorate([
  29594. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottom')
  29595. ], GridPanel.prototype, "eBottom", void 0);
  29596. __decorate([
  29597. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eLeftBottom')
  29598. ], GridPanel.prototype, "eLeftBottom", void 0);
  29599. __decorate([
  29600. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eRightBottom')
  29601. ], GridPanel.prototype, "eRightBottom", void 0);
  29602. __decorate([
  29603. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottomContainer')
  29604. ], GridPanel.prototype, "eBottomContainer", void 0);
  29605. __decorate([
  29606. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottomViewport')
  29607. ], GridPanel.prototype, "eBottomViewport", void 0);
  29608. __decorate([
  29609. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('eBottomFullWidthContainer')
  29610. ], GridPanel.prototype, "eBottomFullWidthContainer", void 0);
  29611. __decorate([
  29612. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('headerRoot')
  29613. ], GridPanel.prototype, "headerRootComp", void 0);
  29614. __decorate([
  29615. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_9__["RefSelector"])('overlayWrapper')
  29616. ], GridPanel.prototype, "overlayWrapper", void 0);
  29617. __decorate([
  29618. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  29619. ], GridPanel.prototype, "init", null);
  29620. return GridPanel;
  29621. }(_widgets_component__WEBPACK_IMPORTED_MODULE_8__["Component"]));
  29622. /***/ }),
  29623. /* 128 */
  29624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29625. "use strict";
  29626. __webpack_require__.r(__webpack_exports__);
  29627. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowContainerComponent", function() { return RowContainerComponent; });
  29628. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  29629. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50);
  29630. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  29631. /**
  29632. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  29633. * @version v23.2.1
  29634. * @link http://www.ag-grid.com/
  29635. * @license MIT
  29636. */
  29637. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  29638. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  29639. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  29640. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  29641. return c > 3 && r && Object.defineProperty(target, key, r), r;
  29642. };
  29643. /**
  29644. * There are many instances of this component covering each of the areas a row can be entered
  29645. * eg body, pinned left, fullWidth. The component differs from others in that it's given the
  29646. * elements, there is no template. All of the elements are part of the GridPanel.
  29647. */
  29648. var RowContainerComponent = /** @class */ (function () {
  29649. function RowContainerComponent(params) {
  29650. this.childCount = 0;
  29651. this.rowTemplatesToAdd = [];
  29652. this.afterGuiAttachedCallbacks = [];
  29653. // this is to cater for a 'strange behaviour' where when a panel is made visible, it is firing a scroll
  29654. // event which we want to ignore. see gridPanel.onAnyBodyScroll()
  29655. this.lastMadeVisibleTime = 0;
  29656. this.eContainer = params.eContainer;
  29657. this.eViewport = params.eViewport;
  29658. if (params.eWrapper) {
  29659. this.eWrapper = params.eWrapper;
  29660. }
  29661. this.hideWhenNoChildren = params.hideWhenNoChildren;
  29662. }
  29663. RowContainerComponent.prototype.setVerticalScrollPosition = function (verticalScrollPosition) {
  29664. this.scrollTop = verticalScrollPosition;
  29665. };
  29666. RowContainerComponent.prototype.postConstruct = function () {
  29667. this.checkDomOrder();
  29668. this.checkVisibility();
  29669. this.gridOptionsWrapper.addEventListener(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_1__["GridOptionsWrapper"].PROP_DOM_LAYOUT, this.checkDomOrder.bind(this));
  29670. };
  29671. RowContainerComponent.prototype.checkDomOrder = function () {
  29672. this.domOrder = this.gridOptionsWrapper.isEnsureDomOrder();
  29673. };
  29674. RowContainerComponent.prototype.getRowElement = function (compId) {
  29675. return this.eContainer.querySelector("[comp-id=\"" + compId + "\"]");
  29676. };
  29677. RowContainerComponent.prototype.setHeight = function (height) {
  29678. if (height == null) {
  29679. this.eContainer.style.height = '';
  29680. return;
  29681. }
  29682. this.eContainer.style.height = height + "px";
  29683. if (this.eWrapper) {
  29684. this.eWrapper.style.height = height + "px";
  29685. }
  29686. };
  29687. RowContainerComponent.prototype.flushRowTemplates = function () {
  29688. // if doing dom order, then rowTemplates will be empty,
  29689. // or if no rows added since last time also empty.
  29690. if (this.rowTemplatesToAdd.length !== 0) {
  29691. var htmlToAdd = this.rowTemplatesToAdd.join('');
  29692. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].appendHtml(this.eContainer, htmlToAdd);
  29693. this.rowTemplatesToAdd.length = 0;
  29694. }
  29695. // this only empty if no rows since last time, as when
  29696. // doing dom order, we still have callbacks to process
  29697. this.afterGuiAttachedCallbacks.forEach(function (func) { return func(); });
  29698. this.afterGuiAttachedCallbacks.length = 0;
  29699. this.lastPlacedElement = null;
  29700. };
  29701. RowContainerComponent.prototype.appendRowTemplate = function (rowTemplate, callback) {
  29702. if (this.domOrder) {
  29703. this.lastPlacedElement = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].insertTemplateWithDomOrder(this.eContainer, rowTemplate, this.lastPlacedElement);
  29704. }
  29705. else {
  29706. this.rowTemplatesToAdd.push(rowTemplate);
  29707. }
  29708. this.afterGuiAttachedCallbacks.push(callback);
  29709. // it is important we put items in in order, so that when we open a row group,
  29710. // the new rows are inserted after the opened group, but before the rows below.
  29711. // that way, the rows below are over the new rows (as dom renders last in dom over
  29712. // items previous in dom), otherwise the child rows would cover the row below and
  29713. // that meant the user doesn't see the rows below slide away.
  29714. this.childCount++;
  29715. this.checkVisibility();
  29716. };
  29717. RowContainerComponent.prototype.ensureDomOrder = function (eRow) {
  29718. if (this.domOrder) {
  29719. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].ensureDomOrder(this.eContainer, eRow, this.lastPlacedElement);
  29720. this.lastPlacedElement = eRow;
  29721. }
  29722. };
  29723. RowContainerComponent.prototype.removeRowElement = function (eRow) {
  29724. this.eContainer.removeChild(eRow);
  29725. this.childCount--;
  29726. this.checkVisibility();
  29727. };
  29728. RowContainerComponent.prototype.checkVisibility = function () {
  29729. if (!this.hideWhenNoChildren) {
  29730. return;
  29731. }
  29732. var eGui = this.eViewport ? this.eViewport : this.eContainer;
  29733. var visible = this.childCount > 0;
  29734. if (this.visible !== visible) {
  29735. this.visible = visible;
  29736. this.lastMadeVisibleTime = new Date().getTime();
  29737. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].setDisplayed(eGui, visible);
  29738. // if we are showing the viewport, then the scroll is always zero,
  29739. // so we need to align with the other sections (ie if this is full
  29740. // width container, and first time showing a full width row, we need to
  29741. // scroll it so full width rows are show in right place alongside the
  29742. // body rows). without this, there was an issue with 'loading rows' for
  29743. // server side row model, as loading rows are full width, and they were
  29744. // not getting displayed in the right location when rows were expanded.
  29745. if (visible && this.eViewport) {
  29746. this.eViewport.scrollTop = this.scrollTop;
  29747. }
  29748. }
  29749. };
  29750. RowContainerComponent.prototype.isMadeVisibleRecently = function () {
  29751. var now = new Date().getTime();
  29752. var millisSinceVisible = now - this.lastMadeVisibleTime;
  29753. return millisSinceVisible < 500;
  29754. };
  29755. __decorate([
  29756. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  29757. ], RowContainerComponent.prototype, "gridOptionsWrapper", void 0);
  29758. __decorate([
  29759. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  29760. ], RowContainerComponent.prototype, "postConstruct", null);
  29761. return RowContainerComponent;
  29762. }());
  29763. /***/ }),
  29764. /* 129 */
  29765. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29766. "use strict";
  29767. __webpack_require__.r(__webpack_exports__);
  29768. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowDragFeature", function() { return RowDragFeature; });
  29769. /* harmony import */ var _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(104);
  29770. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  29771. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44);
  29772. /* harmony import */ var _utils_array__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17);
  29773. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41);
  29774. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  29775. /**
  29776. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  29777. * @version v23.2.1
  29778. * @link http://www.ag-grid.com/
  29779. * @license MIT
  29780. */
  29781. var __extends = (undefined && undefined.__extends) || (function () {
  29782. var extendStatics = function (d, b) {
  29783. extendStatics = Object.setPrototypeOf ||
  29784. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  29785. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  29786. return extendStatics(d, b);
  29787. };
  29788. return function (d, b) {
  29789. extendStatics(d, b);
  29790. function __() { this.constructor = d; }
  29791. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  29792. };
  29793. })();
  29794. var __assign = (undefined && undefined.__assign) || function () {
  29795. __assign = Object.assign || function(t) {
  29796. for (var s, i = 1, n = arguments.length; i < n; i++) {
  29797. s = arguments[i];
  29798. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  29799. t[p] = s[p];
  29800. }
  29801. return t;
  29802. };
  29803. return __assign.apply(this, arguments);
  29804. };
  29805. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  29806. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  29807. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  29808. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  29809. return c > 3 && r && Object.defineProperty(target, key, r), r;
  29810. };
  29811. var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
  29812. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  29813. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  29814. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  29815. r[k] = a[j];
  29816. return r;
  29817. };
  29818. var RowDragFeature = /** @class */ (function (_super) {
  29819. __extends(RowDragFeature, _super);
  29820. function RowDragFeature(eContainer, gridPanel) {
  29821. var _this = _super.call(this) || this;
  29822. _this.isMultiRowDrag = false;
  29823. _this.isGridSorted = false;
  29824. _this.isGridFiltered = false;
  29825. _this.isRowGroupActive = false;
  29826. _this.eContainer = eContainer;
  29827. _this.gridPanel = gridPanel;
  29828. return _this;
  29829. }
  29830. RowDragFeature.prototype.postConstruct = function () {
  29831. if (this.gridOptionsWrapper.isRowModelDefault()) {
  29832. this.clientSideRowModel = this.rowModel;
  29833. }
  29834. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
  29835. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
  29836. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.onRowGroupChanged.bind(this));
  29837. this.onSortChanged();
  29838. this.onFilterChanged();
  29839. this.onRowGroupChanged();
  29840. };
  29841. RowDragFeature.prototype.onSortChanged = function () {
  29842. var sortModel = this.sortController.getSortModel();
  29843. this.isGridSorted = !_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missingOrEmpty(sortModel);
  29844. };
  29845. RowDragFeature.prototype.onFilterChanged = function () {
  29846. this.isGridFiltered = this.filterManager.isAnyFilterPresent();
  29847. };
  29848. RowDragFeature.prototype.onRowGroupChanged = function () {
  29849. var rowGroups = this.columnController.getRowGroupColumns();
  29850. this.isRowGroupActive = !_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missingOrEmpty(rowGroups);
  29851. };
  29852. RowDragFeature.prototype.getContainer = function () {
  29853. return this.eContainer;
  29854. };
  29855. RowDragFeature.prototype.isInterestedIn = function (type) {
  29856. return type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].RowDrag;
  29857. };
  29858. RowDragFeature.prototype.getIconName = function () {
  29859. var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
  29860. if (managedDrag && this.shouldPreventRowMove()) {
  29861. return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_NOT_ALLOWED;
  29862. }
  29863. return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_MOVE;
  29864. };
  29865. RowDragFeature.prototype.shouldPreventRowMove = function () {
  29866. return this.isGridSorted || this.isGridFiltered || this.isRowGroupActive;
  29867. };
  29868. RowDragFeature.prototype.getRowNodes = function (draggingEvent) {
  29869. if (!this.isFromThisGrid(draggingEvent)) {
  29870. return draggingEvent.dragItem.rowNodes;
  29871. }
  29872. var enableMultiRowDragging = this.gridOptionsWrapper.isEnableMultiRowDragging();
  29873. var selectedNodes = this.selectionController.getSelectedNodes();
  29874. var currentNode = draggingEvent.dragItem.rowNode;
  29875. if (enableMultiRowDragging && selectedNodes.indexOf(currentNode) !== -1) {
  29876. this.isMultiRowDrag = true;
  29877. return __spreadArrays(selectedNodes);
  29878. }
  29879. this.isMultiRowDrag = false;
  29880. return [currentNode];
  29881. };
  29882. RowDragFeature.prototype.onDragEnter = function (draggingEvent) {
  29883. // when entering, we fire the enter event, then in onEnterOrDragging,
  29884. // we also fire the move event. so we get both events when entering.
  29885. this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_ENTER, draggingEvent);
  29886. this.getRowNodes(draggingEvent).forEach(function (rowNode) {
  29887. rowNode.setDragging(true);
  29888. });
  29889. this.onEnterOrDragging(draggingEvent);
  29890. };
  29891. RowDragFeature.prototype.onDragging = function (draggingEvent) {
  29892. this.onEnterOrDragging(draggingEvent);
  29893. };
  29894. RowDragFeature.prototype.isFromThisGrid = function (draggingEvent) {
  29895. return this.gridPanel.getGui().contains(draggingEvent.dragSource.eElement);
  29896. };
  29897. RowDragFeature.prototype.isDropZoneWithinThisGrid = function (draggingEvent) {
  29898. var gridGui = this.gridPanel.getGui();
  29899. var dropZoneTarget = draggingEvent.dropZoneTarget;
  29900. return !gridGui.contains(dropZoneTarget);
  29901. };
  29902. RowDragFeature.prototype.onEnterOrDragging = function (draggingEvent) {
  29903. // this event is fired for enter and move
  29904. this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_MOVE, draggingEvent);
  29905. this.lastDraggingEvent = draggingEvent;
  29906. var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y;
  29907. var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
  29908. if (managedDrag) {
  29909. this.doManagedDrag(draggingEvent, pixel);
  29910. }
  29911. this.checkCenterForScrolling(pixel);
  29912. };
  29913. RowDragFeature.prototype.doManagedDrag = function (draggingEvent, pixel) {
  29914. var _this = this;
  29915. var rowNodes;
  29916. var isFromThisGrid = this.isFromThisGrid(draggingEvent);
  29917. if (isFromThisGrid) {
  29918. rowNodes = [draggingEvent.dragItem.rowNode];
  29919. if (this.isMultiRowDrag) {
  29920. rowNodes = __spreadArrays(this.selectionController.getSelectedNodes()).sort(function (a, b) { return _this.getRowIndexNumber(a) - _this.getRowIndexNumber(b); });
  29921. }
  29922. draggingEvent.dragItem.rowNodes = rowNodes;
  29923. }
  29924. else {
  29925. rowNodes = draggingEvent.dragItem.rowNodes;
  29926. }
  29927. var managedDrag = this.gridOptionsWrapper.isRowDragManaged();
  29928. if (managedDrag && this.shouldPreventRowMove()) {
  29929. return;
  29930. }
  29931. if (this.gridOptionsWrapper.isSuppressMoveWhenRowDragging() || !isFromThisGrid) {
  29932. if (!this.isDropZoneWithinThisGrid(draggingEvent)) {
  29933. this.clientSideRowModel.highlightRowAtPixel(rowNodes[0], pixel);
  29934. }
  29935. }
  29936. else {
  29937. this.moveRows(rowNodes, pixel);
  29938. }
  29939. };
  29940. RowDragFeature.prototype.getRowIndexNumber = function (rowNode) {
  29941. return parseInt(Object(_utils_array__WEBPACK_IMPORTED_MODULE_3__["last"])(rowNode.getRowIndexString().split('-')), 10);
  29942. };
  29943. RowDragFeature.prototype.moveRowAndClearHighlight = function (draggingEvent) {
  29944. var _this = this;
  29945. var lastHighlightedRowNode = this.clientSideRowModel.getLastHighlightedRowNode();
  29946. var isBelow = lastHighlightedRowNode && lastHighlightedRowNode.highlighted === 'below';
  29947. var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y;
  29948. var rowNodes = draggingEvent.dragItem.rowNodes;
  29949. var increment = isBelow ? 1 : 0;
  29950. if (this.isFromThisGrid(draggingEvent)) {
  29951. rowNodes.forEach(function (rowNode) {
  29952. if (rowNode.rowTop < pixel) {
  29953. increment -= 1;
  29954. }
  29955. });
  29956. this.moveRows(rowNodes, pixel, increment);
  29957. }
  29958. else {
  29959. var getRowNodeId_1 = this.gridOptionsWrapper.getRowNodeIdFunc();
  29960. var addIndex = this.clientSideRowModel.getRowIndexAtPixel(pixel) + 1;
  29961. if (this.clientSideRowModel.getHighlightPosition(pixel) === 'above') {
  29962. addIndex--;
  29963. }
  29964. this.clientSideRowModel.updateRowData({
  29965. add: rowNodes
  29966. .map(function (node) { return node.data; })
  29967. .filter(function (data) { return !_this.clientSideRowModel.getRowNode(getRowNodeId_1 ? getRowNodeId_1(data) : data.id); }),
  29968. addIndex: addIndex
  29969. });
  29970. }
  29971. this.clearRowHighlight();
  29972. };
  29973. RowDragFeature.prototype.clearRowHighlight = function () {
  29974. this.clientSideRowModel.highlightRowAtPixel(null);
  29975. };
  29976. RowDragFeature.prototype.moveRows = function (rowNodes, pixel, increment) {
  29977. if (increment === void 0) { increment = 0; }
  29978. var rowWasMoved = this.clientSideRowModel.ensureRowsAtPixel(rowNodes, pixel, increment);
  29979. if (rowWasMoved) {
  29980. this.focusController.clearFocusedCell();
  29981. if (this.rangeController) {
  29982. this.rangeController.removeAllCellRanges();
  29983. }
  29984. }
  29985. };
  29986. RowDragFeature.prototype.checkCenterForScrolling = function (pixel) {
  29987. // scroll if the mouse is within 50px of the grid edge
  29988. var pixelRange = this.gridPanel.getVScrollPosition();
  29989. // console.log(`pixelRange = (${pixelRange.top}, ${pixelRange.bottom})`);
  29990. this.needToMoveUp = pixel < (pixelRange.top + 50);
  29991. this.needToMoveDown = pixel > (pixelRange.bottom - 50);
  29992. // console.log(`needToMoveUp = ${this.needToMoveUp} = pixel < (pixelRange.top + 50) = ${pixel} < (${pixelRange.top} + 50)`);
  29993. // console.log(`needToMoveDown = ${this.needToMoveDown} = pixel < (pixelRange.top + 50) = ${pixel} < (${pixelRange.top} + 50)`);
  29994. if (this.needToMoveUp || this.needToMoveDown) {
  29995. this.ensureIntervalStarted();
  29996. }
  29997. else {
  29998. this.ensureIntervalCleared();
  29999. }
  30000. };
  30001. RowDragFeature.prototype.ensureIntervalStarted = function () {
  30002. if (this.movingIntervalId) {
  30003. return;
  30004. }
  30005. this.intervalCount = 0;
  30006. this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), 100);
  30007. };
  30008. RowDragFeature.prototype.ensureIntervalCleared = function () {
  30009. if (!this.moveInterval) {
  30010. return;
  30011. }
  30012. window.clearInterval(this.movingIntervalId);
  30013. this.movingIntervalId = null;
  30014. };
  30015. RowDragFeature.prototype.moveInterval = function () {
  30016. // the amounts we move get bigger at each interval, so the speed accelerates, starting a bit slow
  30017. // and getting faster. this is to give smoother user experience. we max at 100px to limit the speed.
  30018. var pixelsToMove;
  30019. this.intervalCount++;
  30020. pixelsToMove = 10 + (this.intervalCount * 5);
  30021. if (pixelsToMove > 100) {
  30022. pixelsToMove = 100;
  30023. }
  30024. var pixelsMoved;
  30025. if (this.needToMoveDown) {
  30026. pixelsMoved = this.gridPanel.scrollVertically(pixelsToMove);
  30027. }
  30028. else if (this.needToMoveUp) {
  30029. pixelsMoved = this.gridPanel.scrollVertically(-pixelsToMove);
  30030. }
  30031. if (pixelsMoved !== 0) {
  30032. this.onDragging(this.lastDraggingEvent);
  30033. }
  30034. };
  30035. RowDragFeature.prototype.addRowDropZone = function (params) {
  30036. var _this = this;
  30037. if (!params.getContainer()) {
  30038. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].doOnce(function () { return console.warn('ag-Grid: addRowDropZone - A container target needs to be provided'); }, 'add-drop-zone-empty-target');
  30039. return;
  30040. }
  30041. if (this.dragAndDropService.findExternalZone(params)) {
  30042. console.warn('ag-Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.');
  30043. return;
  30044. }
  30045. var processedParams = {
  30046. getContainer: params.getContainer
  30047. };
  30048. if (params.fromGrid) {
  30049. params.fromGrid = undefined;
  30050. processedParams = params;
  30051. }
  30052. else {
  30053. if (params.onDragEnter) {
  30054. processedParams.onDragEnter = function (e) {
  30055. params.onDragEnter(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_ENTER, e));
  30056. };
  30057. }
  30058. if (params.onDragLeave) {
  30059. processedParams.onDragLeave = function (e) {
  30060. params.onDragLeave(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_LEAVE, e));
  30061. };
  30062. }
  30063. if (params.onDragging) {
  30064. processedParams.onDragging = function (e) {
  30065. params.onDragging(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_MOVE, e));
  30066. };
  30067. }
  30068. if (params.onDragStop) {
  30069. processedParams.onDragStop = function (e) {
  30070. params.onDragStop(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_END, e));
  30071. };
  30072. }
  30073. }
  30074. this.dragAndDropService.addDropTarget(__assign({ isInterestedIn: function (type) { return type === _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragSourceType"].RowDrag; }, getIconName: function () { return _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["DragAndDropService"].ICON_MOVE; }, external: true }, processedParams));
  30075. };
  30076. RowDragFeature.prototype.getRowDropZone = function (events) {
  30077. var _this = this;
  30078. var getContainer = this.getContainer.bind(this);
  30079. var onDragEnter = this.onDragEnter.bind(this);
  30080. var onDragLeave = this.onDragLeave.bind(this);
  30081. var onDragging = this.onDragging.bind(this);
  30082. var onDragStop = this.onDragStop.bind(this);
  30083. if (!events) {
  30084. return { getContainer: getContainer, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onDragging: onDragging, onDragStop: onDragStop, fromGrid: true };
  30085. }
  30086. return {
  30087. getContainer: getContainer,
  30088. onDragEnter: events.onDragEnter
  30089. ? (function (e) {
  30090. onDragEnter(e);
  30091. events.onDragEnter(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_ENTER, e));
  30092. })
  30093. : onDragEnter,
  30094. onDragLeave: events.onDragLeave
  30095. ? (function (e) {
  30096. onDragLeave(e);
  30097. events.onDragLeave(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_LEAVE, e));
  30098. })
  30099. : onDragLeave,
  30100. onDragging: events.onDragging
  30101. ? (function (e) {
  30102. onDragging(e);
  30103. events.onDragging(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_MOVE, e));
  30104. })
  30105. : onDragging,
  30106. onDragStop: events.onDragStop
  30107. ? (function (e) {
  30108. onDragStop(e);
  30109. events.onDragStop(_this.draggingToRowDragEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_END, e));
  30110. })
  30111. : onDragStop,
  30112. fromGrid: true
  30113. };
  30114. };
  30115. RowDragFeature.prototype.draggingToRowDragEvent = function (type, draggingEvent) {
  30116. var yNormalised = this.mouseEventService.getNormalisedPosition(draggingEvent).y;
  30117. var mouseIsPastLastRow = yNormalised > this.rowModel.getCurrentPageHeight();
  30118. var overIndex = -1;
  30119. var overNode = null;
  30120. if (!mouseIsPastLastRow) {
  30121. overIndex = this.rowModel.getRowIndexAtPixel(yNormalised);
  30122. overNode = this.rowModel.getRow(overIndex);
  30123. }
  30124. var vDirectionString;
  30125. switch (draggingEvent.vDirection) {
  30126. case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["VerticalDirection"].Down:
  30127. vDirectionString = 'down';
  30128. break;
  30129. case _dragAndDrop_dragAndDropService__WEBPACK_IMPORTED_MODULE_0__["VerticalDirection"].Up:
  30130. vDirectionString = 'up';
  30131. break;
  30132. default:
  30133. vDirectionString = null;
  30134. break;
  30135. }
  30136. var event = {
  30137. type: type,
  30138. api: this.gridOptionsWrapper.getApi(),
  30139. columnApi: this.gridOptionsWrapper.getColumnApi(),
  30140. event: draggingEvent.event,
  30141. node: draggingEvent.dragItem.rowNode,
  30142. nodes: draggingEvent.dragItem.rowNodes,
  30143. overIndex: overIndex,
  30144. overNode: overNode,
  30145. y: yNormalised,
  30146. vDirection: vDirectionString
  30147. };
  30148. return event;
  30149. };
  30150. RowDragFeature.prototype.dispatchGridEvent = function (type, draggingEvent) {
  30151. var event = this.draggingToRowDragEvent(type, draggingEvent);
  30152. this.eventService.dispatchEvent(event);
  30153. };
  30154. RowDragFeature.prototype.onDragLeave = function (draggingEvent) {
  30155. this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_LEAVE, draggingEvent);
  30156. this.stopDragging(draggingEvent);
  30157. this.clearRowHighlight();
  30158. if (this.isFromThisGrid(draggingEvent)) {
  30159. this.isMultiRowDrag = false;
  30160. }
  30161. };
  30162. RowDragFeature.prototype.onDragStop = function (draggingEvent) {
  30163. this.dispatchGridEvent(_eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_ROW_DRAG_END, draggingEvent);
  30164. this.stopDragging(draggingEvent);
  30165. if (this.gridOptionsWrapper.isRowDragManaged() &&
  30166. (this.gridOptionsWrapper.isSuppressMoveWhenRowDragging() || !this.isFromThisGrid(draggingEvent)) &&
  30167. !this.isDropZoneWithinThisGrid(draggingEvent)) {
  30168. this.moveRowAndClearHighlight(draggingEvent);
  30169. }
  30170. };
  30171. RowDragFeature.prototype.stopDragging = function (draggingEvent) {
  30172. this.ensureIntervalCleared();
  30173. this.getRowNodes(draggingEvent).forEach(function (rowNode) {
  30174. rowNode.setDragging(false);
  30175. });
  30176. };
  30177. __decorate([
  30178. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('dragAndDropService')
  30179. ], RowDragFeature.prototype, "dragAndDropService", void 0);
  30180. __decorate([
  30181. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
  30182. ], RowDragFeature.prototype, "rowModel", void 0);
  30183. __decorate([
  30184. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  30185. ], RowDragFeature.prototype, "columnController", void 0);
  30186. __decorate([
  30187. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('focusController')
  30188. ], RowDragFeature.prototype, "focusController", void 0);
  30189. __decorate([
  30190. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('sortController')
  30191. ], RowDragFeature.prototype, "sortController", void 0);
  30192. __decorate([
  30193. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('filterManager')
  30194. ], RowDragFeature.prototype, "filterManager", void 0);
  30195. __decorate([
  30196. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  30197. ], RowDragFeature.prototype, "gridOptionsWrapper", void 0);
  30198. __decorate([
  30199. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('selectionController')
  30200. ], RowDragFeature.prototype, "selectionController", void 0);
  30201. __decorate([
  30202. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Optional"])('rangeController')
  30203. ], RowDragFeature.prototype, "rangeController", void 0);
  30204. __decorate([
  30205. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('mouseEventService')
  30206. ], RowDragFeature.prototype, "mouseEventService", void 0);
  30207. __decorate([
  30208. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  30209. ], RowDragFeature.prototype, "postConstruct", null);
  30210. return RowDragFeature;
  30211. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_4__["BeanStub"]));
  30212. /***/ }),
  30213. /* 130 */
  30214. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30215. "use strict";
  30216. __webpack_require__.r(__webpack_exports__);
  30217. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridApi", function() { return GridApi; });
  30218. /* harmony import */ var _gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50);
  30219. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
  30220. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  30221. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38);
  30222. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39);
  30223. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  30224. /**
  30225. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  30226. * @version v23.2.1
  30227. * @link http://www.ag-grid.com/
  30228. * @license MIT
  30229. */
  30230. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  30231. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  30232. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  30233. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  30234. return c > 3 && r && Object.defineProperty(target, key, r), r;
  30235. };
  30236. var GridApi = /** @class */ (function () {
  30237. function GridApi() {
  30238. this.detailGridInfoMap = {};
  30239. this.destroyCalled = false;
  30240. }
  30241. GridApi.prototype.registerGridComp = function (gridPanel) {
  30242. this.gridPanel = gridPanel;
  30243. };
  30244. GridApi.prototype.registerGridCore = function (gridCore) {
  30245. this.gridCore = gridCore;
  30246. };
  30247. GridApi.prototype.registerHeaderRootComp = function (headerRootComp) {
  30248. this.headerRootComp = headerRootComp;
  30249. };
  30250. GridApi.prototype.init = function () {
  30251. switch (this.rowModel.getType()) {
  30252. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE:
  30253. this.clientSideRowModel = this.rowModel;
  30254. break;
  30255. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_INFINITE:
  30256. this.infiniteRowModel = this.rowModel;
  30257. break;
  30258. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE:
  30259. this.serverSideRowModel = this.rowModel;
  30260. break;
  30261. }
  30262. };
  30263. /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */
  30264. GridApi.prototype.__getAlignedGridService = function () {
  30265. return this.alignedGridsService;
  30266. };
  30267. GridApi.prototype.addDetailGridInfo = function (id, gridInfo) {
  30268. this.detailGridInfoMap[id] = gridInfo;
  30269. };
  30270. GridApi.prototype.removeDetailGridInfo = function (id) {
  30271. this.detailGridInfoMap[id] = undefined;
  30272. };
  30273. GridApi.prototype.getDetailGridInfo = function (id) {
  30274. return this.detailGridInfoMap[id];
  30275. };
  30276. GridApi.prototype.forEachDetailGridInfo = function (callback) {
  30277. var index = 0;
  30278. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].iterateObject(this.detailGridInfoMap, function (id, gridInfo) {
  30279. // check for undefined, as old references will still be lying around
  30280. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(gridInfo)) {
  30281. callback(gridInfo, index);
  30282. index++;
  30283. }
  30284. });
  30285. };
  30286. GridApi.prototype.getDataAsCsv = function (params) {
  30287. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].CsvExportModule, 'api.getDataAsCsv')) {
  30288. return this.csvCreator.getDataAsCsv(params);
  30289. }
  30290. };
  30291. GridApi.prototype.exportDataAsCsv = function (params) {
  30292. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].CsvExportModule, 'api.exportDataAsCSv')) {
  30293. this.csvCreator.exportDataAsCsv(params);
  30294. }
  30295. };
  30296. GridApi.prototype.getDataAsExcel = function (params) {
  30297. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].ExcelExportModule, 'api.getDataAsExcel')) {
  30298. return this.excelCreator.getDataAsExcelXml(params);
  30299. }
  30300. };
  30301. GridApi.prototype.exportDataAsExcel = function (params) {
  30302. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].ExcelExportModule, 'api.exportDataAsExcel')) {
  30303. this.excelCreator.exportDataAsExcel(params);
  30304. }
  30305. };
  30306. /** @deprecated */
  30307. GridApi.prototype.setEnterpriseDatasource = function (datasource) {
  30308. console.warn("ag-grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()");
  30309. this.setServerSideDatasource(datasource);
  30310. };
  30311. GridApi.prototype.setServerSideDatasource = function (datasource) {
  30312. if (this.gridOptionsWrapper.isRowModelServerSide()) {
  30313. // should really have an IEnterpriseRowModel interface, so we are not casting to any
  30314. this.rowModel.setDatasource(datasource);
  30315. }
  30316. else {
  30317. console.warn("ag-Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '" + _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE + "'");
  30318. }
  30319. };
  30320. GridApi.prototype.setDatasource = function (datasource) {
  30321. if (this.gridOptionsWrapper.isRowModelInfinite()) {
  30322. this.rowModel.setDatasource(datasource);
  30323. }
  30324. else {
  30325. console.warn("ag-Grid: you can only use a datasource when gridOptions.rowModelType is '" + _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_INFINITE + "'");
  30326. }
  30327. };
  30328. GridApi.prototype.setViewportDatasource = function (viewportDatasource) {
  30329. if (this.gridOptionsWrapper.isRowModelViewport()) {
  30330. // this is bad coding, because it's using an interface that's exposed in the enterprise.
  30331. // really we should create an interface in the core for viewportDatasource and let
  30332. // the enterprise implement it, rather than casting to 'any' here
  30333. this.rowModel.setViewportDatasource(viewportDatasource);
  30334. }
  30335. else {
  30336. console.warn("ag-Grid: you can only use a viewport datasource when gridOptions.rowModelType is '" + _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].ROW_MODEL_TYPE_VIEWPORT + "'");
  30337. }
  30338. };
  30339. GridApi.prototype.setRowData = function (rowData) {
  30340. if (this.gridOptionsWrapper.isRowModelDefault()) {
  30341. if (this.gridOptionsWrapper.isImmutableData()) {
  30342. var res = this.immutableService.createTransactionForRowData(rowData);
  30343. if (!res) {
  30344. return;
  30345. }
  30346. var transaction = res[0], orderIdMap = res[1];
  30347. this.clientSideRowModel.updateRowData(transaction, orderIdMap);
  30348. // need to force updating of full width rows - note this wouldn't be necessary the full width cell comp listened
  30349. // to the data change event on the row node and refreshed itself.
  30350. this.rowRenderer.refreshFullWidthRows();
  30351. }
  30352. else {
  30353. this.selectionController.reset();
  30354. this.clientSideRowModel.setRowData(rowData);
  30355. }
  30356. }
  30357. else {
  30358. console.warn('cannot call setRowData unless using normal row model');
  30359. }
  30360. };
  30361. /** @deprecated */
  30362. GridApi.prototype.setFloatingTopRowData = function (rows) {
  30363. console.warn('ag-Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()');
  30364. this.setPinnedTopRowData(rows);
  30365. };
  30366. /** @deprecated */
  30367. GridApi.prototype.setFloatingBottomRowData = function (rows) {
  30368. console.warn('ag-Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()');
  30369. this.setPinnedBottomRowData(rows);
  30370. };
  30371. /** @deprecated */
  30372. GridApi.prototype.getFloatingTopRowCount = function () {
  30373. console.warn('ag-Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()');
  30374. return this.getPinnedTopRowCount();
  30375. };
  30376. /** @deprecated */
  30377. GridApi.prototype.getFloatingBottomRowCount = function () {
  30378. console.warn('ag-Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()');
  30379. return this.getPinnedBottomRowCount();
  30380. };
  30381. /** @deprecated */
  30382. GridApi.prototype.getFloatingTopRow = function (index) {
  30383. console.warn('ag-Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()');
  30384. return this.getPinnedTopRow(index);
  30385. };
  30386. /** @deprecated */
  30387. GridApi.prototype.getFloatingBottomRow = function (index) {
  30388. console.warn('ag-Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()');
  30389. return this.getPinnedBottomRow(index);
  30390. };
  30391. GridApi.prototype.setPinnedTopRowData = function (rows) {
  30392. this.pinnedRowModel.setPinnedTopRowData(rows);
  30393. };
  30394. GridApi.prototype.setPinnedBottomRowData = function (rows) {
  30395. this.pinnedRowModel.setPinnedBottomRowData(rows);
  30396. };
  30397. GridApi.prototype.getPinnedTopRowCount = function () {
  30398. return this.pinnedRowModel.getPinnedTopRowCount();
  30399. };
  30400. GridApi.prototype.getPinnedBottomRowCount = function () {
  30401. return this.pinnedRowModel.getPinnedBottomRowCount();
  30402. };
  30403. GridApi.prototype.getPinnedTopRow = function (index) {
  30404. return this.pinnedRowModel.getPinnedTopRow(index);
  30405. };
  30406. GridApi.prototype.getPinnedBottomRow = function (index) {
  30407. return this.pinnedRowModel.getPinnedBottomRow(index);
  30408. };
  30409. GridApi.prototype.setColumnDefs = function (colDefs, source) {
  30410. if (source === void 0) { source = "api"; }
  30411. this.columnController.setColumnDefs(colDefs, source);
  30412. };
  30413. GridApi.prototype.setAutoGroupColumnDef = function (colDef, source) {
  30414. if (source === void 0) { source = "api"; }
  30415. this.gridOptionsWrapper.setProperty('autoGroupColumnDef', colDef, true);
  30416. };
  30417. GridApi.prototype.expireValueCache = function () {
  30418. this.valueCache.expire();
  30419. };
  30420. GridApi.prototype.getVerticalPixelRange = function () {
  30421. return this.gridPanel.getVScrollPosition();
  30422. };
  30423. GridApi.prototype.getHorizontalPixelRange = function () {
  30424. return this.gridPanel.getHScrollPosition();
  30425. };
  30426. GridApi.prototype.setAlwaysShowVerticalScroll = function (show) {
  30427. this.gridOptionsWrapper.setProperty('alwaysShowVerticalScroll', show);
  30428. };
  30429. GridApi.prototype.refreshToolPanel = function () {
  30430. this.gridCore.refreshSideBar();
  30431. };
  30432. GridApi.prototype.refreshCells = function (params) {
  30433. if (params === void 0) { params = {}; }
  30434. if (Array.isArray(params)) {
  30435. // the old version of refreshCells() took an array of rowNodes for the first argument
  30436. console.warn('since ag-Grid v11.1, refreshCells() now takes parameters, please see the documentation.');
  30437. return;
  30438. }
  30439. this.rowRenderer.refreshCells(params);
  30440. };
  30441. GridApi.prototype.flashCells = function (params) {
  30442. if (params === void 0) { params = {}; }
  30443. this.rowRenderer.flashCells(params);
  30444. };
  30445. GridApi.prototype.redrawRows = function (params) {
  30446. if (params === void 0) { params = {}; }
  30447. if (params && params.rowNodes) {
  30448. this.rowRenderer.redrawRows(params.rowNodes);
  30449. }
  30450. else {
  30451. this.rowRenderer.redrawAfterModelUpdate();
  30452. }
  30453. };
  30454. GridApi.prototype.timeFullRedraw = function (count) {
  30455. if (count === void 0) { count = 1; }
  30456. var iterationCount = 0;
  30457. var totalProcessing = 0;
  30458. var totalReflow = 0;
  30459. var that = this;
  30460. doOneIteration();
  30461. function doOneIteration() {
  30462. var start = (new Date()).getTime();
  30463. that.rowRenderer.redrawAfterModelUpdate();
  30464. var endProcessing = (new Date()).getTime();
  30465. window.setTimeout(function () {
  30466. var endReflow = (new Date()).getTime();
  30467. var durationProcessing = endProcessing - start;
  30468. var durationReflow = endReflow - endProcessing;
  30469. // tslint:disable-next-line
  30470. console.log('duration: processing = ' + durationProcessing + 'ms, reflow = ' + durationReflow + 'ms');
  30471. iterationCount++;
  30472. totalProcessing += durationProcessing;
  30473. totalReflow += durationReflow;
  30474. if (iterationCount < count) {
  30475. // wait for 1s between tests
  30476. window.setTimeout(doOneIteration, 1000);
  30477. }
  30478. else {
  30479. finish();
  30480. }
  30481. }, 0);
  30482. }
  30483. function finish() {
  30484. // tslint:disable-next-line
  30485. console.log('tests complete. iteration count = ' + iterationCount);
  30486. // tslint:disable-next-line
  30487. console.log('average processing = ' + (totalProcessing / iterationCount) + 'ms');
  30488. // tslint:disable-next-line
  30489. console.log('average reflow = ' + (totalReflow / iterationCount) + 'ms');
  30490. }
  30491. };
  30492. /** @deprecated */
  30493. GridApi.prototype.refreshView = function () {
  30494. console.warn('ag-Grid: since v11.1, refreshView() is deprecated, please call refreshCells() or redrawRows() instead');
  30495. this.redrawRows();
  30496. };
  30497. /** @deprecated */
  30498. GridApi.prototype.refreshRows = function (rowNodes) {
  30499. console.warn('since ag-Grid v11.1, refreshRows() is deprecated, please use refreshCells({rowNodes: rows}) or redrawRows({rowNodes: rows}) instead');
  30500. this.refreshCells({ rowNodes: rowNodes });
  30501. };
  30502. /** @deprecated */
  30503. GridApi.prototype.rowDataChanged = function (rows) {
  30504. console.warn('ag-Grid: rowDataChanged is deprecated, either call refreshView() to refresh everything, or call rowNode.setRowData(newData) to set value on a particular node');
  30505. this.redrawRows();
  30506. };
  30507. /** @deprecated */
  30508. GridApi.prototype.softRefreshView = function () {
  30509. console.error('ag-Grid: since v16, softRefreshView() is no longer supported. Please check the documentation on how to refresh.');
  30510. };
  30511. /** @deprecated */
  30512. GridApi.prototype.refreshGroupRows = function () {
  30513. console.warn('ag-Grid: since v11.1, refreshGroupRows() is no longer supported, call refreshCells() instead. ' +
  30514. 'Because refreshCells() now does dirty checking, it will only refresh cells that have changed, so it should ' +
  30515. 'not be necessary to only refresh the group rows.');
  30516. this.refreshCells();
  30517. };
  30518. GridApi.prototype.setFunctionsReadOnly = function (readOnly) {
  30519. this.gridOptionsWrapper.setProperty('functionsReadOnly', readOnly);
  30520. };
  30521. GridApi.prototype.refreshHeader = function () {
  30522. this.headerRootComp.refreshHeader();
  30523. this.gridPanel.setHeaderAndFloatingHeights();
  30524. };
  30525. GridApi.prototype.isAnyFilterPresent = function () {
  30526. return this.filterManager.isAnyFilterPresent();
  30527. };
  30528. /** @deprecated */
  30529. GridApi.prototype.isAdvancedFilterPresent = function () {
  30530. console.warn('ag-Grid: isAdvancedFilterPresent() is deprecated, please use isColumnFilterPresent()');
  30531. return this.isColumnFilterPresent();
  30532. };
  30533. GridApi.prototype.isColumnFilterPresent = function () {
  30534. return this.filterManager.isAdvancedFilterPresent();
  30535. };
  30536. GridApi.prototype.isQuickFilterPresent = function () {
  30537. return this.filterManager.isQuickFilterPresent();
  30538. };
  30539. GridApi.prototype.getModel = function () {
  30540. return this.rowModel;
  30541. };
  30542. GridApi.prototype.setRowNodeExpanded = function (rowNode, expanded) {
  30543. if (rowNode) {
  30544. rowNode.setExpanded(expanded);
  30545. }
  30546. };
  30547. GridApi.prototype.onGroupExpandedOrCollapsed = function (deprecated_refreshFromIndex) {
  30548. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30549. console.warn('ag-Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model');
  30550. }
  30551. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(deprecated_refreshFromIndex)) {
  30552. console.warn('ag-Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows');
  30553. }
  30554. // we don't really want the user calling this if only one rowNode was expanded, instead they should be
  30555. // calling rowNode.setExpanded(boolean) - this way we do a 'keepRenderedRows=false' so that the whole
  30556. // grid gets refreshed again - otherwise the row with the rowNodes that were changed won't get updated,
  30557. // and thus the expand icon in the group cell won't get 'opened' or 'closed'.
  30558. this.clientSideRowModel.refreshModel({ step: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_MAP });
  30559. };
  30560. GridApi.prototype.refreshInMemoryRowModel = function (step) {
  30561. console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()");
  30562. this.refreshClientSideRowModel(step);
  30563. };
  30564. GridApi.prototype.refreshClientSideRowModel = function (step) {
  30565. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30566. console.warn('cannot call refreshClientSideRowModel unless using normal row model');
  30567. }
  30568. var paramsStep = _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_EVERYTHING;
  30569. var stepsMapped = {
  30570. group: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_EVERYTHING,
  30571. filter: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_FILTER,
  30572. map: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_MAP,
  30573. aggregate: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_AGGREGATE,
  30574. sort: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_SORT,
  30575. pivot: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_PIVOT
  30576. };
  30577. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(step)) {
  30578. paramsStep = stepsMapped[step];
  30579. }
  30580. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(paramsStep)) {
  30581. console.error("ag-Grid: invalid step " + step + ", available steps are " + Object.keys(stepsMapped).join(', '));
  30582. return;
  30583. }
  30584. var modelParams = {
  30585. step: paramsStep,
  30586. keepRenderedRows: true,
  30587. animate: true,
  30588. keepEditingRows: true
  30589. };
  30590. this.clientSideRowModel.refreshModel(modelParams);
  30591. };
  30592. GridApi.prototype.isAnimationFrameQueueEmpty = function () {
  30593. return this.animationFrameService.isQueueEmpty();
  30594. };
  30595. GridApi.prototype.getRowNode = function (id) {
  30596. return this.rowModel.getRowNode(id);
  30597. };
  30598. GridApi.prototype.getSizesForCurrentTheme = function () {
  30599. return {
  30600. rowHeight: this.gridOptionsWrapper.getRowHeightAsNumber(),
  30601. headerHeight: this.gridOptionsWrapper.getHeaderHeight()
  30602. };
  30603. };
  30604. GridApi.prototype.expandAll = function () {
  30605. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30606. console.warn('ag-Grid: cannot call expandAll unless using normal row model');
  30607. return;
  30608. }
  30609. this.clientSideRowModel.expandOrCollapseAll(true);
  30610. };
  30611. GridApi.prototype.collapseAll = function () {
  30612. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30613. console.warn('ag-Grid: cannot call collapseAll unless using normal row model');
  30614. return;
  30615. }
  30616. this.clientSideRowModel.expandOrCollapseAll(false);
  30617. };
  30618. GridApi.prototype.getToolPanelInstance = function (id) {
  30619. return this.gridCore.getToolPanelInstance(id);
  30620. };
  30621. GridApi.prototype.addVirtualRowListener = function (eventName, rowIndex, callback) {
  30622. if (typeof eventName !== 'string') {
  30623. console.warn('ag-Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener.');
  30624. }
  30625. this.addRenderedRowListener(eventName, rowIndex, callback);
  30626. };
  30627. GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
  30628. if (eventName === 'virtualRowSelected') {
  30629. console.warn("ag-Grid: event virtualRowSelected is deprecated, to register for individual row\n selection events, add a listener directly to the row node.");
  30630. }
  30631. this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback);
  30632. };
  30633. GridApi.prototype.setQuickFilter = function (newFilter) {
  30634. this.filterManager.setQuickFilter(newFilter);
  30635. };
  30636. GridApi.prototype.selectIndex = function (index, tryMulti, suppressEvents) {
  30637. console.warn('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
  30638. if (suppressEvents) {
  30639. console.warn('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  30640. }
  30641. this.selectionController.selectIndex(index, tryMulti);
  30642. };
  30643. GridApi.prototype.deselectIndex = function (index, suppressEvents) {
  30644. if (suppressEvents === void 0) { suppressEvents = false; }
  30645. console.warn('ag-Grid: do not use api for selection, call node.setSelected(value) instead');
  30646. if (suppressEvents) {
  30647. console.warn('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  30648. }
  30649. this.selectionController.deselectIndex(index);
  30650. };
  30651. GridApi.prototype.selectNode = function (node, tryMulti, suppressEvents) {
  30652. if (tryMulti === void 0) { tryMulti = false; }
  30653. if (suppressEvents === void 0) { suppressEvents = false; }
  30654. console.warn('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
  30655. if (suppressEvents) {
  30656. console.warn('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  30657. }
  30658. node.setSelectedParams({ newValue: true, clearSelection: !tryMulti });
  30659. };
  30660. GridApi.prototype.deselectNode = function (node, suppressEvents) {
  30661. if (suppressEvents === void 0) { suppressEvents = false; }
  30662. console.warn('ag-Grid: API for selection is deprecated, call node.setSelected(value) instead');
  30663. if (suppressEvents) {
  30664. console.warn('ag-Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it');
  30665. }
  30666. node.setSelectedParams({ newValue: false });
  30667. };
  30668. GridApi.prototype.selectAll = function () {
  30669. this.selectionController.selectAllRowNodes();
  30670. };
  30671. GridApi.prototype.deselectAll = function () {
  30672. this.selectionController.deselectAllRowNodes();
  30673. };
  30674. GridApi.prototype.selectAllFiltered = function () {
  30675. this.selectionController.selectAllRowNodes(true);
  30676. };
  30677. GridApi.prototype.deselectAllFiltered = function () {
  30678. this.selectionController.deselectAllRowNodes(true);
  30679. };
  30680. GridApi.prototype.recomputeAggregates = function () {
  30681. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30682. console.warn('cannot call recomputeAggregates unless using normal row model');
  30683. }
  30684. console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead");
  30685. this.clientSideRowModel.refreshModel({ step: _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].STEP_AGGREGATE });
  30686. };
  30687. GridApi.prototype.sizeColumnsToFit = function () {
  30688. this.gridPanel.sizeColumnsToFit();
  30689. };
  30690. GridApi.prototype.showLoadingOverlay = function () {
  30691. this.gridPanel.showLoadingOverlay();
  30692. };
  30693. GridApi.prototype.showNoRowsOverlay = function () {
  30694. this.gridPanel.showNoRowsOverlay();
  30695. };
  30696. GridApi.prototype.hideOverlay = function () {
  30697. this.gridPanel.hideOverlay();
  30698. };
  30699. GridApi.prototype.isNodeSelected = function (node) {
  30700. console.warn('ag-Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead');
  30701. return node.isSelected();
  30702. };
  30703. GridApi.prototype.getSelectedNodesById = function () {
  30704. console.error('ag-Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead');
  30705. return null;
  30706. };
  30707. GridApi.prototype.getSelectedNodes = function () {
  30708. return this.selectionController.getSelectedNodes();
  30709. };
  30710. GridApi.prototype.getSelectedRows = function () {
  30711. return this.selectionController.getSelectedRows();
  30712. };
  30713. GridApi.prototype.getBestCostNodeSelection = function () {
  30714. return this.selectionController.getBestCostNodeSelection();
  30715. };
  30716. GridApi.prototype.getRenderedNodes = function () {
  30717. return this.rowRenderer.getRenderedNodes();
  30718. };
  30719. GridApi.prototype.ensureColIndexVisible = function (index) {
  30720. console.warn('ag-Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.');
  30721. };
  30722. GridApi.prototype.ensureColumnVisible = function (key) {
  30723. this.gridPanel.ensureColumnVisible(key);
  30724. };
  30725. // Valid values for position are bottom, middle and top
  30726. GridApi.prototype.ensureIndexVisible = function (index, position) {
  30727. this.gridPanel.ensureIndexVisible(index, position);
  30728. };
  30729. // Valid values for position are bottom, middle and top
  30730. GridApi.prototype.ensureNodeVisible = function (comparator, position) {
  30731. this.gridCore.ensureNodeVisible(comparator, position);
  30732. };
  30733. GridApi.prototype.forEachLeafNode = function (callback) {
  30734. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30735. console.warn('cannot call forEachNode unless using normal row model');
  30736. }
  30737. this.clientSideRowModel.forEachLeafNode(callback);
  30738. };
  30739. GridApi.prototype.forEachNode = function (callback) {
  30740. this.rowModel.forEachNode(callback);
  30741. };
  30742. GridApi.prototype.forEachNodeAfterFilter = function (callback) {
  30743. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30744. console.warn('cannot call forEachNodeAfterFilter unless using normal row model');
  30745. }
  30746. this.clientSideRowModel.forEachNodeAfterFilter(callback);
  30747. };
  30748. GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) {
  30749. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.clientSideRowModel)) {
  30750. console.warn('cannot call forEachNodeAfterFilterAndSort unless using normal row model');
  30751. }
  30752. this.clientSideRowModel.forEachNodeAfterFilterAndSort(callback);
  30753. };
  30754. GridApi.prototype.getFilterApiForColDef = function (colDef) {
  30755. console.warn('ag-grid API method getFilterApiForColDef deprecated, use getFilterInstance instead');
  30756. return this.getFilterInstance(colDef);
  30757. };
  30758. GridApi.prototype.getFilterInstance = function (key, callback) {
  30759. var column = this.columnController.getPrimaryColumn(key);
  30760. if (column) {
  30761. var filterPromise = this.filterManager.getFilterComponent(column, 'NO_UI');
  30762. var currentValue = filterPromise.resolveNow(null, function (filterComp) { return filterComp; });
  30763. if (callback) {
  30764. if (currentValue) {
  30765. setTimeout(callback, 0, currentValue);
  30766. }
  30767. else {
  30768. filterPromise.then(callback);
  30769. }
  30770. }
  30771. return currentValue;
  30772. }
  30773. };
  30774. GridApi.prototype.getFilterApi = function (key) {
  30775. console.warn('ag-Grid: getFilterApi is deprecated, use getFilterInstance instead');
  30776. return this.getFilterInstance(key);
  30777. };
  30778. GridApi.prototype.destroyFilter = function (key) {
  30779. var column = this.columnController.getPrimaryColumn(key);
  30780. if (column) {
  30781. return this.filterManager.destroyFilter(column, "filterDestroyed");
  30782. }
  30783. };
  30784. GridApi.prototype.getStatusPanel = function (key) {
  30785. if (this.statusBarService) {
  30786. return this.statusBarService.getStatusPanel(key);
  30787. }
  30788. };
  30789. GridApi.prototype.getColumnDef = function (key) {
  30790. var column = this.columnController.getPrimaryColumn(key);
  30791. if (column) {
  30792. return column.getColDef();
  30793. }
  30794. return null;
  30795. };
  30796. GridApi.prototype.onFilterChanged = function () {
  30797. this.filterManager.onFilterChanged();
  30798. };
  30799. GridApi.prototype.onSortChanged = function () {
  30800. this.sortController.onSortChanged();
  30801. };
  30802. GridApi.prototype.setSortModel = function (sortModel, source) {
  30803. if (source === void 0) { source = "api"; }
  30804. this.sortController.setSortModel(sortModel, source);
  30805. };
  30806. GridApi.prototype.getSortModel = function () {
  30807. return this.sortController.getSortModel();
  30808. };
  30809. GridApi.prototype.setFilterModel = function (model) {
  30810. this.filterManager.setFilterModel(model);
  30811. };
  30812. GridApi.prototype.getFilterModel = function () {
  30813. return this.filterManager.getFilterModel();
  30814. };
  30815. GridApi.prototype.getFocusedCell = function () {
  30816. return this.focusController.getFocusedCell();
  30817. };
  30818. GridApi.prototype.clearFocusedCell = function () {
  30819. return this.focusController.clearFocusedCell();
  30820. };
  30821. GridApi.prototype.setFocusedCell = function (rowIndex, colKey, floating) {
  30822. this.focusController.setFocusedCell(rowIndex, colKey, floating, true);
  30823. };
  30824. GridApi.prototype.setSuppressRowDrag = function (value) {
  30825. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_ROW_DRAG, value);
  30826. };
  30827. GridApi.prototype.setSuppressMoveWhenRowDragging = function (value) {
  30828. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG, value);
  30829. };
  30830. GridApi.prototype.setSuppressRowClickSelection = function (value) {
  30831. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_ROW_CLICK_SELECTION, value);
  30832. };
  30833. GridApi.prototype.addRowDropZone = function (params) {
  30834. this.gridPanel.getRowDragFeature().addRowDropZone(params);
  30835. };
  30836. GridApi.prototype.removeRowDropZone = function (params) {
  30837. var activeDropTarget = this.dragAndDropService.findExternalZone(params);
  30838. if (activeDropTarget) {
  30839. this.dragAndDropService.removeDropTarget(activeDropTarget);
  30840. }
  30841. };
  30842. GridApi.prototype.getRowDropZoneParams = function (events) {
  30843. return this.gridPanel.getRowDragFeature().getRowDropZone(events);
  30844. };
  30845. GridApi.prototype.setHeaderHeight = function (headerHeight) {
  30846. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_HEADER_HEIGHT, headerHeight);
  30847. this.doLayout();
  30848. };
  30849. GridApi.prototype.setGridAutoHeight = function (gridAutoHeight) {
  30850. console.warn('api.setGridAutoHeight(boolean) is deprecated, please use api.setDomLayout() instead');
  30851. this.setDomLayout(gridAutoHeight ? 'autoHeight' : 'normal');
  30852. };
  30853. GridApi.prototype.setDomLayout = function (domLayout) {
  30854. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_DOM_LAYOUT, domLayout);
  30855. };
  30856. GridApi.prototype.setEnableCellTextSelection = function (selectable) {
  30857. this.gridPanel.setCellTextSelection(selectable);
  30858. };
  30859. GridApi.prototype.setGroupHeaderHeight = function (headerHeight) {
  30860. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_HEADER_HEIGHT, headerHeight);
  30861. this.doLayout();
  30862. };
  30863. GridApi.prototype.setFloatingFiltersHeight = function (headerHeight) {
  30864. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_FLOATING_FILTERS_HEIGHT, headerHeight);
  30865. this.doLayout();
  30866. };
  30867. GridApi.prototype.setPivotGroupHeaderHeight = function (headerHeight) {
  30868. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_GROUP_HEADER_HEIGHT, headerHeight);
  30869. this.doLayout();
  30870. };
  30871. GridApi.prototype.setPivotHeaderHeight = function (headerHeight) {
  30872. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_PIVOT_HEADER_HEIGHT, headerHeight);
  30873. this.doLayout();
  30874. };
  30875. GridApi.prototype.isSideBarVisible = function () {
  30876. return this.gridCore.isSideBarVisible();
  30877. };
  30878. GridApi.prototype.setSideBarVisible = function (show) {
  30879. this.gridCore.setSideBarVisible(show);
  30880. };
  30881. GridApi.prototype.setSideBarPosition = function (position) {
  30882. this.gridCore.setSideBarPosition(position);
  30883. };
  30884. GridApi.prototype.showToolPanel = function (show) {
  30885. console.warn("ag-grid: from v19 api.showToolPanel has been deprecated in favour of api.setSideBarVisible");
  30886. this.setSideBarVisible(show);
  30887. };
  30888. GridApi.prototype.openToolPanel = function (key) {
  30889. this.gridCore.openToolPanel(key);
  30890. };
  30891. GridApi.prototype.closeToolPanel = function () {
  30892. this.gridCore.closeToolPanel();
  30893. };
  30894. GridApi.prototype.getOpenedToolPanel = function () {
  30895. return this.gridCore.getOpenedToolPanel();
  30896. };
  30897. GridApi.prototype.getSideBar = function () {
  30898. return this.gridCore.getSideBar();
  30899. };
  30900. GridApi.prototype.setSideBar = function (def) {
  30901. return this.gridCore.setSideBar(def);
  30902. };
  30903. GridApi.prototype.setSuppressClipboardPaste = function (value) {
  30904. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_SUPPRESS_CLIPBOARD_PASTE, value);
  30905. };
  30906. GridApi.prototype.isToolPanelShowing = function () {
  30907. return this.gridCore.isToolPanelShowing();
  30908. };
  30909. GridApi.prototype.doLayout = function () {
  30910. this.gridPanel.checkViewportAndScrolls();
  30911. };
  30912. GridApi.prototype.resetRowHeights = function () {
  30913. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(this.clientSideRowModel)) {
  30914. this.clientSideRowModel.resetRowHeights();
  30915. }
  30916. };
  30917. GridApi.prototype.setGroupRemoveSingleChildren = function (value) {
  30918. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_REMOVE_SINGLE_CHILDREN, value);
  30919. };
  30920. GridApi.prototype.setGroupRemoveLowestSingleChildren = function (value) {
  30921. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, value);
  30922. };
  30923. GridApi.prototype.onRowHeightChanged = function () {
  30924. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(this.clientSideRowModel)) {
  30925. this.clientSideRowModel.onRowHeightChanged();
  30926. }
  30927. };
  30928. GridApi.prototype.getValue = function (colKey, rowNode) {
  30929. var column = this.columnController.getPrimaryColumn(colKey);
  30930. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(column)) {
  30931. column = this.columnController.getGridColumn(colKey);
  30932. }
  30933. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(column)) {
  30934. return null;
  30935. }
  30936. return this.valueService.getValue(column, rowNode);
  30937. };
  30938. GridApi.prototype.addEventListener = function (eventType, listener) {
  30939. var async = this.gridOptionsWrapper.useAsyncEvents();
  30940. this.eventService.addEventListener(eventType, listener, async);
  30941. };
  30942. GridApi.prototype.addGlobalListener = function (listener) {
  30943. var async = this.gridOptionsWrapper.useAsyncEvents();
  30944. this.eventService.addGlobalListener(listener, async);
  30945. };
  30946. GridApi.prototype.removeEventListener = function (eventType, listener) {
  30947. var async = this.gridOptionsWrapper.useAsyncEvents();
  30948. this.eventService.removeEventListener(eventType, listener, async);
  30949. };
  30950. GridApi.prototype.removeGlobalListener = function (listener) {
  30951. var async = this.gridOptionsWrapper.useAsyncEvents();
  30952. this.eventService.removeGlobalListener(listener, async);
  30953. };
  30954. GridApi.prototype.dispatchEvent = function (event) {
  30955. this.eventService.dispatchEvent(event);
  30956. };
  30957. GridApi.prototype.destroy = function () {
  30958. // this is needed as GridAPI is a bean, and GridAPI.destroy() is called as part
  30959. // of context.destroy(). so we need to stop the infinite loop.
  30960. if (this.destroyCalled) {
  30961. return;
  30962. }
  30963. this.destroyCalled = true;
  30964. // destroy the UI first (as they use the services)
  30965. this.context.destroyBean(this.gridCore);
  30966. // destroy the services
  30967. this.context.destroy();
  30968. };
  30969. GridApi.prototype.resetQuickFilter = function () {
  30970. this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; });
  30971. };
  30972. GridApi.prototype.getRangeSelections = function () {
  30973. console.warn("ag-Grid: in v20.1.x, api.getRangeSelections() is gone, please use getCellRanges() instead.\n We had to change how cell selections works a small bit to allow charting to integrate. The return type of\n getCellRanges() is a bit different, please check the ag-Grid documentation.");
  30974. return null;
  30975. };
  30976. GridApi.prototype.getCellRanges = function () {
  30977. if (this.rangeController) {
  30978. return this.rangeController.getCellRanges();
  30979. }
  30980. console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
  30981. return null;
  30982. };
  30983. GridApi.prototype.camelCaseToHumanReadable = function (camelCase) {
  30984. return _utils__WEBPACK_IMPORTED_MODULE_5__["_"].camelCaseToHumanText(camelCase);
  30985. };
  30986. GridApi.prototype.addRangeSelection = function (deprecatedNoLongerUsed) {
  30987. console.warn('ag-Grid: As of version 21.x, range selection changed slightly to allow charting integration. Please call api.addCellRange() instead of api.addRangeSelection()');
  30988. };
  30989. GridApi.prototype.addCellRange = function (params) {
  30990. if (!this.rangeController) {
  30991. console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
  30992. }
  30993. this.rangeController.addCellRange(params);
  30994. };
  30995. GridApi.prototype.clearRangeSelection = function () {
  30996. if (!this.rangeController) {
  30997. console.warn('ag-Grid: cell range selection is only available in ag-Grid Enterprise');
  30998. }
  30999. this.rangeController.removeAllCellRanges();
  31000. };
  31001. GridApi.prototype.undoCellEditing = function () {
  31002. this.undoRedoService.undo();
  31003. };
  31004. GridApi.prototype.redoCellEditing = function () {
  31005. this.undoRedoService.redo();
  31006. };
  31007. GridApi.prototype.getChartModels = function () {
  31008. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.getChartModels') &&
  31009. _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.getChartModels')) {
  31010. return this.chartService.getChartModels();
  31011. }
  31012. };
  31013. GridApi.prototype.createRangeChart = function (params) {
  31014. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.createRangeChart') &&
  31015. _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.createRangeChart')) {
  31016. return this.chartService.createRangeChart(params);
  31017. }
  31018. };
  31019. GridApi.prototype.createPivotChart = function (params) {
  31020. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].RangeSelectionModule, 'api.createPivotChart') &&
  31021. _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_4__["ModuleRegistry"].assertRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"].GridChartsModule, 'api.createPivotChart')) {
  31022. return this.chartService.createPivotChart(params);
  31023. }
  31024. };
  31025. GridApi.prototype.copySelectedRowsToClipboard = function (includeHeader, columnKeys) {
  31026. if (!this.clipboardService) {
  31027. console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
  31028. }
  31029. this.clipboardService.copySelectedRowsToClipboard(includeHeader, columnKeys);
  31030. };
  31031. GridApi.prototype.copySelectedRangeToClipboard = function (includeHeader) {
  31032. if (!this.clipboardService) {
  31033. console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
  31034. }
  31035. this.clipboardService.copySelectedRangeToClipboard(includeHeader);
  31036. };
  31037. GridApi.prototype.copySelectedRangeDown = function () {
  31038. if (!this.clipboardService) {
  31039. console.warn('ag-Grid: clipboard is only available in ag-Grid Enterprise');
  31040. }
  31041. this.clipboardService.copyRangeDown();
  31042. };
  31043. GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) {
  31044. // use grid column so works with pivot mode
  31045. var column = this.columnController.getGridColumn(colKey);
  31046. this.menuFactory.showMenuAfterButtonClick(column, buttonElement);
  31047. };
  31048. GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) {
  31049. // use grid column so works with pivot mode
  31050. var column = this.columnController.getGridColumn(colKey);
  31051. if (!column) {
  31052. column = this.columnController.getPrimaryColumn(colKey);
  31053. }
  31054. if (!column) {
  31055. console.error("ag-Grid: column '" + colKey + "' not found");
  31056. return;
  31057. }
  31058. this.menuFactory.showMenuAfterMouseEvent(column, mouseEvent);
  31059. };
  31060. GridApi.prototype.hidePopupMenu = function () {
  31061. // hide the context menu if in enterprise
  31062. if (this.contextMenuFactory) {
  31063. this.contextMenuFactory.hideActiveMenu();
  31064. }
  31065. // and hide the column menu always
  31066. this.menuFactory.hideActiveMenu();
  31067. };
  31068. GridApi.prototype.setPopupParent = function (ePopupParent) {
  31069. this.gridOptionsWrapper.setProperty(_gridOptionsWrapper__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_POPUP_PARENT, ePopupParent);
  31070. };
  31071. GridApi.prototype.tabToNextCell = function () {
  31072. return this.rowRenderer.tabToNextCell(false);
  31073. };
  31074. GridApi.prototype.tabToPreviousCell = function () {
  31075. return this.rowRenderer.tabToNextCell(true);
  31076. };
  31077. GridApi.prototype.getCellRendererInstances = function (params) {
  31078. if (params === void 0) { params = {}; }
  31079. return this.rowRenderer.getCellRendererInstances(params);
  31080. };
  31081. GridApi.prototype.getCellEditorInstances = function (params) {
  31082. if (params === void 0) { params = {}; }
  31083. return this.rowRenderer.getCellEditorInstances(params);
  31084. };
  31085. GridApi.prototype.getEditingCells = function () {
  31086. return this.rowRenderer.getEditingCells();
  31087. };
  31088. GridApi.prototype.stopEditing = function (cancel) {
  31089. if (cancel === void 0) { cancel = false; }
  31090. this.rowRenderer.stopEditing(cancel);
  31091. };
  31092. GridApi.prototype.startEditingCell = function (params) {
  31093. var column = this.columnController.getGridColumn(params.colKey);
  31094. if (!column) {
  31095. console.warn("ag-Grid: no column found for " + params.colKey);
  31096. return;
  31097. }
  31098. var cellPosition = {
  31099. rowIndex: params.rowIndex,
  31100. rowPinned: params.rowPinned,
  31101. column: column
  31102. };
  31103. var notPinned = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(params.rowPinned);
  31104. if (notPinned) {
  31105. this.gridPanel.ensureIndexVisible(params.rowIndex);
  31106. }
  31107. this.rowRenderer.startEditingCell(cellPosition, params.keyPress, params.charPress);
  31108. };
  31109. GridApi.prototype.addAggFunc = function (key, aggFunc) {
  31110. if (this.aggFuncService) {
  31111. this.aggFuncService.addAggFunc(key, aggFunc);
  31112. }
  31113. };
  31114. GridApi.prototype.addAggFuncs = function (aggFuncs) {
  31115. if (this.aggFuncService) {
  31116. this.aggFuncService.addAggFuncs(aggFuncs);
  31117. }
  31118. };
  31119. GridApi.prototype.clearAggFuncs = function () {
  31120. if (this.aggFuncService) {
  31121. this.aggFuncService.clear();
  31122. }
  31123. };
  31124. GridApi.prototype.applyTransaction = function (rowDataTransaction) {
  31125. var res = null;
  31126. if (this.clientSideRowModel) {
  31127. if (rowDataTransaction && rowDataTransaction.addIndex != null) {
  31128. var message_1 = 'ag-Grid: as of v23.1, transaction.addIndex is deprecated. If you want precision control of adding data, use immutableData instead';
  31129. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].doOnce(function () { return console.warn(message_1); }, 'transaction.addIndex deprecated');
  31130. }
  31131. res = this.clientSideRowModel.updateRowData(rowDataTransaction);
  31132. }
  31133. else if (this.infiniteRowModel) {
  31134. var message_2 = 'ag-Grid: as of v23.1, transactions for Infinite Row Model are deprecated. If you want to make updates to data in Infinite Row Models, then refresh the data.';
  31135. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].doOnce(function () { return console.warn(message_2); }, 'applyTransaction infiniteRowModel deprecated');
  31136. this.infiniteRowModel.updateRowData(rowDataTransaction);
  31137. }
  31138. else {
  31139. console.error('ag-Grid: updateRowData() only works with ClientSideRowModel and InfiniteRowModel.');
  31140. }
  31141. // refresh all the full width rows
  31142. this.rowRenderer.refreshFullWidthRows();
  31143. // do change detection for all present cells
  31144. if (!this.gridOptionsWrapper.isSuppressChangeDetection()) {
  31145. this.rowRenderer.refreshCells();
  31146. }
  31147. return res;
  31148. };
  31149. /** @deprecated */
  31150. GridApi.prototype.updateRowData = function (rowDataTransaction) {
  31151. var message = 'ag-Grid: as of v23.1, grid API updateRowData(transaction) is now called applyTransaction(transaction). updateRowData is deprecated and will be removed in a future major release.';
  31152. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].doOnce(function () { return console.warn(message); }, 'updateRowData deprecated');
  31153. return this.applyTransaction(rowDataTransaction);
  31154. };
  31155. GridApi.prototype.applyTransactionAsync = function (rowDataTransaction, callback) {
  31156. if (!this.clientSideRowModel) {
  31157. console.error('ag-Grid: api.applyTransactionAsync() only works with ClientSideRowModel.');
  31158. return;
  31159. }
  31160. this.clientSideRowModel.batchUpdateRowData(rowDataTransaction, callback);
  31161. };
  31162. /** @deprecated */
  31163. GridApi.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {
  31164. var message = 'ag-Grid: as of v23.1, grid API batchUpdateRowData(transaction, callback) is now called applyTransactionAsync(transaction, callback). batchUpdateRowData is deprecated and will be removed in a future major release.';
  31165. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].doOnce(function () { return console.warn(message); }, 'batchUpdateRowData deprecated');
  31166. this.applyTransactionAsync(rowDataTransaction, callback);
  31167. };
  31168. GridApi.prototype.insertItemsAtIndex = function (index, items, skipRefresh) {
  31169. if (skipRefresh === void 0) { skipRefresh = false; }
  31170. console.warn('ag-Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead.');
  31171. this.updateRowData({ add: items, addIndex: index, update: null, remove: null });
  31172. };
  31173. GridApi.prototype.removeItems = function (rowNodes, skipRefresh) {
  31174. if (skipRefresh === void 0) { skipRefresh = false; }
  31175. console.warn('ag-Grid: removeItems() is deprecated, use updateRowData(transaction) instead.');
  31176. var dataToRemove = rowNodes.map(function (rowNode) { return rowNode.data; });
  31177. this.updateRowData({ add: null, addIndex: null, update: null, remove: dataToRemove });
  31178. };
  31179. GridApi.prototype.addItems = function (items, skipRefresh) {
  31180. if (skipRefresh === void 0) { skipRefresh = false; }
  31181. console.warn('ag-Grid: addItems() is deprecated, use updateRowData(transaction) instead.');
  31182. this.updateRowData({ add: items, addIndex: null, update: null, remove: null });
  31183. };
  31184. GridApi.prototype.refreshVirtualPageCache = function () {
  31185. console.warn('ag-Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead');
  31186. this.refreshInfiniteCache();
  31187. };
  31188. GridApi.prototype.refreshInfinitePageCache = function () {
  31189. console.warn('ag-Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead');
  31190. this.refreshInfiniteCache();
  31191. };
  31192. GridApi.prototype.refreshInfiniteCache = function () {
  31193. if (this.infiniteRowModel) {
  31194. this.infiniteRowModel.refreshCache();
  31195. }
  31196. else {
  31197. console.warn("ag-Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'.");
  31198. }
  31199. };
  31200. GridApi.prototype.purgeVirtualPageCache = function () {
  31201. console.warn('ag-Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead');
  31202. this.purgeInfinitePageCache();
  31203. };
  31204. GridApi.prototype.purgeInfinitePageCache = function () {
  31205. console.warn('ag-Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead');
  31206. this.purgeInfiniteCache();
  31207. };
  31208. GridApi.prototype.purgeInfiniteCache = function () {
  31209. if (this.infiniteRowModel) {
  31210. this.infiniteRowModel.purgeCache();
  31211. }
  31212. else {
  31213. console.warn("ag-Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.");
  31214. }
  31215. };
  31216. /** @deprecated */
  31217. GridApi.prototype.purgeEnterpriseCache = function (route) {
  31218. console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()");
  31219. this.purgeServerSideCache(route);
  31220. };
  31221. GridApi.prototype.purgeServerSideCache = function (route) {
  31222. if (this.serverSideRowModel) {
  31223. this.serverSideRowModel.purgeCache(route);
  31224. }
  31225. else {
  31226. console.warn("ag-Grid: api.purgeServerSideCache is only available when rowModelType='enterprise'.");
  31227. }
  31228. };
  31229. GridApi.prototype.getVirtualRowCount = function () {
  31230. console.warn('ag-Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead');
  31231. return this.getInfiniteRowCount();
  31232. };
  31233. GridApi.prototype.getInfiniteRowCount = function () {
  31234. if (this.infiniteRowModel) {
  31235. return this.infiniteRowModel.getVirtualRowCount();
  31236. }
  31237. else {
  31238. console.warn("ag-Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.");
  31239. }
  31240. };
  31241. GridApi.prototype.isMaxRowFound = function () {
  31242. if (this.infiniteRowModel) {
  31243. return this.infiniteRowModel.isMaxRowFound();
  31244. }
  31245. else {
  31246. console.warn("ag-Grid: api.isMaxRowFound is only available when rowModelType='virtual'.");
  31247. }
  31248. };
  31249. GridApi.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
  31250. console.warn('ag-Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead');
  31251. this.setInfiniteRowCount(rowCount, maxRowFound);
  31252. };
  31253. GridApi.prototype.setInfiniteRowCount = function (rowCount, maxRowFound) {
  31254. if (this.infiniteRowModel) {
  31255. this.infiniteRowModel.setVirtualRowCount(rowCount, maxRowFound);
  31256. }
  31257. else {
  31258. console.warn("ag-Grid: api.setVirtualRowCount is only available when rowModelType='virtual'.");
  31259. }
  31260. };
  31261. GridApi.prototype.getVirtualPageState = function () {
  31262. console.warn('ag-Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead');
  31263. return this.getCacheBlockState();
  31264. };
  31265. GridApi.prototype.getInfinitePageState = function () {
  31266. console.warn('ag-Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead');
  31267. return this.getCacheBlockState();
  31268. };
  31269. GridApi.prototype.getCacheBlockState = function () {
  31270. if (this.infiniteRowModel) {
  31271. return this.infiniteRowModel.getBlockState();
  31272. }
  31273. else if (this.serverSideRowModel) {
  31274. return this.serverSideRowModel.getBlockState();
  31275. }
  31276. else {
  31277. console.warn("ag-Grid: api.getCacheBlockState() is only available when rowModelType='infinite' or rowModelType='serverSide'.");
  31278. }
  31279. };
  31280. GridApi.prototype.checkGridSize = function () {
  31281. this.gridPanel.setHeaderAndFloatingHeights();
  31282. };
  31283. GridApi.prototype.getFirstRenderedRow = function () {
  31284. console.warn('in ag-Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()');
  31285. return this.getFirstDisplayedRow();
  31286. };
  31287. GridApi.prototype.getFirstDisplayedRow = function () {
  31288. return this.rowRenderer.getFirstVirtualRenderedRow();
  31289. };
  31290. GridApi.prototype.getLastRenderedRow = function () {
  31291. console.warn('in ag-Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()');
  31292. return this.getLastDisplayedRow();
  31293. };
  31294. GridApi.prototype.getLastDisplayedRow = function () {
  31295. return this.rowRenderer.getLastVirtualRenderedRow();
  31296. };
  31297. GridApi.prototype.getDisplayedRowAtIndex = function (index) {
  31298. return this.rowModel.getRow(index);
  31299. };
  31300. GridApi.prototype.getDisplayedRowCount = function () {
  31301. return this.rowModel.getRowCount();
  31302. };
  31303. GridApi.prototype.paginationIsLastPageFound = function () {
  31304. return this.paginationProxy.isLastPageFound();
  31305. };
  31306. GridApi.prototype.paginationGetPageSize = function () {
  31307. return this.paginationProxy.getPageSize();
  31308. };
  31309. GridApi.prototype.paginationSetPageSize = function (size) {
  31310. this.gridOptionsWrapper.setProperty('paginationPageSize', size);
  31311. };
  31312. GridApi.prototype.paginationGetCurrentPage = function () {
  31313. return this.paginationProxy.getCurrentPage();
  31314. };
  31315. GridApi.prototype.paginationGetTotalPages = function () {
  31316. return this.paginationProxy.getTotalPages();
  31317. };
  31318. GridApi.prototype.paginationGetRowCount = function () {
  31319. return this.paginationProxy.getMasterRowCount();
  31320. };
  31321. GridApi.prototype.paginationGoToNextPage = function () {
  31322. this.paginationProxy.goToNextPage();
  31323. };
  31324. GridApi.prototype.paginationGoToPreviousPage = function () {
  31325. this.paginationProxy.goToPreviousPage();
  31326. };
  31327. GridApi.prototype.paginationGoToFirstPage = function () {
  31328. this.paginationProxy.goToFirstPage();
  31329. };
  31330. GridApi.prototype.paginationGoToLastPage = function () {
  31331. this.paginationProxy.goToLastPage();
  31332. };
  31333. GridApi.prototype.paginationGoToPage = function (page) {
  31334. this.paginationProxy.goToPage(page);
  31335. };
  31336. __decorate([
  31337. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('immutableService')
  31338. ], GridApi.prototype, "immutableService", void 0);
  31339. __decorate([
  31340. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('csvCreator')
  31341. ], GridApi.prototype, "csvCreator", void 0);
  31342. __decorate([
  31343. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('excelCreator')
  31344. ], GridApi.prototype, "excelCreator", void 0);
  31345. __decorate([
  31346. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowRenderer')
  31347. ], GridApi.prototype, "rowRenderer", void 0);
  31348. __decorate([
  31349. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('filterManager')
  31350. ], GridApi.prototype, "filterManager", void 0);
  31351. __decorate([
  31352. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnController')
  31353. ], GridApi.prototype, "columnController", void 0);
  31354. __decorate([
  31355. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
  31356. ], GridApi.prototype, "selectionController", void 0);
  31357. __decorate([
  31358. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  31359. ], GridApi.prototype, "gridOptionsWrapper", void 0);
  31360. __decorate([
  31361. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueService')
  31362. ], GridApi.prototype, "valueService", void 0);
  31363. __decorate([
  31364. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('alignedGridsService')
  31365. ], GridApi.prototype, "alignedGridsService", void 0);
  31366. __decorate([
  31367. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('eventService')
  31368. ], GridApi.prototype, "eventService", void 0);
  31369. __decorate([
  31370. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('pinnedRowModel')
  31371. ], GridApi.prototype, "pinnedRowModel", void 0);
  31372. __decorate([
  31373. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('context')
  31374. ], GridApi.prototype, "context", void 0);
  31375. __decorate([
  31376. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
  31377. ], GridApi.prototype, "rowModel", void 0);
  31378. __decorate([
  31379. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('sortController')
  31380. ], GridApi.prototype, "sortController", void 0);
  31381. __decorate([
  31382. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('paginationProxy')
  31383. ], GridApi.prototype, "paginationProxy", void 0);
  31384. __decorate([
  31385. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('focusController')
  31386. ], GridApi.prototype, "focusController", void 0);
  31387. __decorate([
  31388. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('dragAndDropService')
  31389. ], GridApi.prototype, "dragAndDropService", void 0);
  31390. __decorate([
  31391. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('rangeController')
  31392. ], GridApi.prototype, "rangeController", void 0);
  31393. __decorate([
  31394. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('clipboardService')
  31395. ], GridApi.prototype, "clipboardService", void 0);
  31396. __decorate([
  31397. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('aggFuncService')
  31398. ], GridApi.prototype, "aggFuncService", void 0);
  31399. __decorate([
  31400. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('menuFactory')
  31401. ], GridApi.prototype, "menuFactory", void 0);
  31402. __decorate([
  31403. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('contextMenuFactory')
  31404. ], GridApi.prototype, "contextMenuFactory", void 0);
  31405. __decorate([
  31406. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('cellRendererFactory')
  31407. ], GridApi.prototype, "cellRendererFactory", void 0);
  31408. __decorate([
  31409. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('valueCache')
  31410. ], GridApi.prototype, "valueCache", void 0);
  31411. __decorate([
  31412. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('animationFrameService')
  31413. ], GridApi.prototype, "animationFrameService", void 0);
  31414. __decorate([
  31415. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('statusBarService')
  31416. ], GridApi.prototype, "statusBarService", void 0);
  31417. __decorate([
  31418. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('chartService')
  31419. ], GridApi.prototype, "chartService", void 0);
  31420. __decorate([
  31421. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Optional"])('undoRedoService')
  31422. ], GridApi.prototype, "undoRedoService", void 0);
  31423. __decorate([
  31424. _context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
  31425. ], GridApi.prototype, "init", null);
  31426. GridApi = __decorate([
  31427. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('gridApi')
  31428. ], GridApi);
  31429. return GridApi;
  31430. }());
  31431. /***/ }),
  31432. /* 131 */
  31433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31434. "use strict";
  31435. __webpack_require__.r(__webpack_exports__);
  31436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionService", function() { return ExpressionService; });
  31437. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  31438. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  31439. /**
  31440. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  31441. * @version v23.2.1
  31442. * @link http://www.ag-grid.com/
  31443. * @license MIT
  31444. */
  31445. var __extends = (undefined && undefined.__extends) || (function () {
  31446. var extendStatics = function (d, b) {
  31447. extendStatics = Object.setPrototypeOf ||
  31448. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  31449. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  31450. return extendStatics(d, b);
  31451. };
  31452. return function (d, b) {
  31453. extendStatics(d, b);
  31454. function __() { this.constructor = d; }
  31455. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  31456. };
  31457. })();
  31458. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  31459. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  31460. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  31461. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  31462. return c > 3 && r && Object.defineProperty(target, key, r), r;
  31463. };
  31464. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  31465. return function (target, key) { decorator(target, key, paramIndex); }
  31466. };
  31467. var ExpressionService = /** @class */ (function (_super) {
  31468. __extends(ExpressionService, _super);
  31469. function ExpressionService() {
  31470. var _this = _super !== null && _super.apply(this, arguments) || this;
  31471. _this.expressionToFunctionCache = {};
  31472. return _this;
  31473. }
  31474. ExpressionService.prototype.setBeans = function (loggerFactory) {
  31475. this.logger = loggerFactory.create('ExpressionService');
  31476. };
  31477. ExpressionService.prototype.evaluate = function (expressionOrFunc, params) {
  31478. if (typeof expressionOrFunc === 'function') {
  31479. // valueGetter is a function, so just call it
  31480. var func = expressionOrFunc;
  31481. return func(params);
  31482. }
  31483. else if (typeof expressionOrFunc === 'string') {
  31484. // valueGetter is an expression, so execute the expression
  31485. var expression = expressionOrFunc;
  31486. return this.evaluateExpression(expression, params);
  31487. }
  31488. else {
  31489. console.error('ag-Grid: value should be either a string or a function', expressionOrFunc);
  31490. }
  31491. };
  31492. ExpressionService.prototype.evaluateExpression = function (expression, params) {
  31493. try {
  31494. var javaScriptFunction = this.createExpressionFunction(expression);
  31495. // the params don't have all these values, rather we add every possible
  31496. // value a params can have, which makes whatever is in the params available.
  31497. var result = javaScriptFunction(params.value, params.context, params.oldValue, params.newValue, params.value, params.node, params.data, params.colDef, params.rowIndex, params.api, params.columnApi, params.getValue, params.column, params.columnGroup);
  31498. return result;
  31499. }
  31500. catch (e) {
  31501. // the expression failed, which can happen, as it's the client that
  31502. // provides the expression. so print a nice message
  31503. // tslint:disable-next-line
  31504. console.log('Processing of the expression failed');
  31505. // tslint:disable-next-line
  31506. console.log('Expression = ' + expression);
  31507. // tslint:disable-next-line
  31508. console.log('Params =', params);
  31509. // tslint:disable-next-line
  31510. console.log('Exception = ' + e);
  31511. return null;
  31512. }
  31513. };
  31514. ExpressionService.prototype.createExpressionFunction = function (expression) {
  31515. // check cache first
  31516. if (this.expressionToFunctionCache[expression]) {
  31517. return this.expressionToFunctionCache[expression];
  31518. }
  31519. // if not found in cache, return the function
  31520. var functionBody = this.createFunctionBody(expression);
  31521. var theFunction = new Function('x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup', functionBody);
  31522. // store in cache
  31523. this.expressionToFunctionCache[expression] = theFunction;
  31524. return theFunction;
  31525. };
  31526. ExpressionService.prototype.createFunctionBody = function (expression) {
  31527. // if the expression has the 'return' word in it, then use as is,
  31528. // if not, then wrap it with return and ';' to make a function
  31529. if (expression.indexOf('return') >= 0) {
  31530. return expression;
  31531. }
  31532. else {
  31533. return 'return ' + expression + ';';
  31534. }
  31535. };
  31536. __decorate([
  31537. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory'))
  31538. ], ExpressionService.prototype, "setBeans", null);
  31539. ExpressionService = __decorate([
  31540. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('expressionService')
  31541. ], ExpressionService);
  31542. return ExpressionService;
  31543. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  31544. /***/ }),
  31545. /* 132 */
  31546. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31547. "use strict";
  31548. __webpack_require__.r(__webpack_exports__);
  31549. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateService", function() { return TemplateService; });
  31550. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  31551. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  31552. /**
  31553. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  31554. * @version v23.2.1
  31555. * @link http://www.ag-grid.com/
  31556. * @license MIT
  31557. */
  31558. var __extends = (undefined && undefined.__extends) || (function () {
  31559. var extendStatics = function (d, b) {
  31560. extendStatics = Object.setPrototypeOf ||
  31561. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  31562. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  31563. return extendStatics(d, b);
  31564. };
  31565. return function (d, b) {
  31566. extendStatics(d, b);
  31567. function __() { this.constructor = d; }
  31568. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  31569. };
  31570. })();
  31571. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  31572. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  31573. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  31574. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  31575. return c > 3 && r && Object.defineProperty(target, key, r), r;
  31576. };
  31577. var TemplateService = /** @class */ (function (_super) {
  31578. __extends(TemplateService, _super);
  31579. function TemplateService() {
  31580. var _this = _super !== null && _super.apply(this, arguments) || this;
  31581. _this.templateCache = {};
  31582. _this.waitingCallbacks = {};
  31583. return _this;
  31584. }
  31585. // returns the template if it is loaded, or null if it is not loaded
  31586. // but will call the callback when it is loaded
  31587. TemplateService.prototype.getTemplate = function (url, callback) {
  31588. var templateFromCache = this.templateCache[url];
  31589. if (templateFromCache) {
  31590. return templateFromCache;
  31591. }
  31592. var callbackList = this.waitingCallbacks[url];
  31593. var that = this;
  31594. if (!callbackList) {
  31595. // first time this was called, so need a new list for callbacks
  31596. callbackList = [];
  31597. this.waitingCallbacks[url] = callbackList;
  31598. // and also need to do the http request
  31599. var client = new XMLHttpRequest();
  31600. client.onload = function () {
  31601. that.handleHttpResult(this, url);
  31602. };
  31603. client.open("GET", url);
  31604. client.send();
  31605. }
  31606. // add this callback
  31607. if (callback) {
  31608. callbackList.push(callback);
  31609. }
  31610. // caller needs to wait for template to load, so return null
  31611. return null;
  31612. };
  31613. TemplateService.prototype.handleHttpResult = function (httpResult, url) {
  31614. if (httpResult.status !== 200 || httpResult.response === null) {
  31615. console.warn("Unable to get template error " + httpResult.status + " - " + url);
  31616. return;
  31617. }
  31618. // response success, so process it
  31619. // in IE9 the response is in - responseText
  31620. this.templateCache[url] = httpResult.response || httpResult.responseText;
  31621. // inform all listeners that this is now in the cache
  31622. var callbacks = this.waitingCallbacks[url];
  31623. for (var i = 0; i < callbacks.length; i++) {
  31624. var callback = callbacks[i];
  31625. // we could pass the callback the response, however we know the client of this code
  31626. // is the cell renderer, and it passes the 'cellRefresh' method in as the callback
  31627. // which doesn't take any parameters.
  31628. callback();
  31629. }
  31630. if (this.$scope) {
  31631. var that_1 = this;
  31632. window.setTimeout(function () {
  31633. that_1.$scope.$apply();
  31634. }, 0);
  31635. }
  31636. };
  31637. __decorate([
  31638. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$scope')
  31639. ], TemplateService.prototype, "$scope", void 0);
  31640. TemplateService = __decorate([
  31641. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('templateService')
  31642. ], TemplateService);
  31643. return TemplateService;
  31644. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  31645. /***/ }),
  31646. /* 133 */
  31647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31648. "use strict";
  31649. __webpack_require__.r(__webpack_exports__);
  31650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupService", function() { return PopupService; });
  31651. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
  31652. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  31653. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  31654. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  31655. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  31656. /**
  31657. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  31658. * @version v23.2.1
  31659. * @link http://www.ag-grid.com/
  31660. * @license MIT
  31661. */
  31662. var __extends = (undefined && undefined.__extends) || (function () {
  31663. var extendStatics = function (d, b) {
  31664. extendStatics = Object.setPrototypeOf ||
  31665. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  31666. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  31667. return extendStatics(d, b);
  31668. };
  31669. return function (d, b) {
  31670. extendStatics(d, b);
  31671. function __() { this.constructor = d; }
  31672. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  31673. };
  31674. })();
  31675. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  31676. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  31677. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  31678. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  31679. return c > 3 && r && Object.defineProperty(target, key, r), r;
  31680. };
  31681. var PopupService = /** @class */ (function (_super) {
  31682. __extends(PopupService, _super);
  31683. function PopupService() {
  31684. var _this = _super !== null && _super.apply(this, arguments) || this;
  31685. _this.popupList = [];
  31686. return _this;
  31687. }
  31688. PopupService.prototype.init = function () {
  31689. var _this = this;
  31690. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_KEYBOARD_FOCUS, function () {
  31691. _this.popupList.forEach(function (popup) {
  31692. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(popup.element, 'ag-keyboard-focus');
  31693. });
  31694. });
  31695. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MOUSE_FOCUS, function () {
  31696. _this.popupList.forEach(function (popup) {
  31697. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].removeCssClass(popup.element, 'ag-keyboard-focus');
  31698. });
  31699. });
  31700. };
  31701. PopupService.prototype.registerGridCore = function (gridCore) {
  31702. this.gridCore = gridCore;
  31703. };
  31704. PopupService.prototype.getPopupParent = function () {
  31705. var ePopupParent = this.gridOptionsWrapper.getPopupParent();
  31706. if (ePopupParent) {
  31707. return ePopupParent;
  31708. }
  31709. return this.gridCore.getRootGui();
  31710. };
  31711. PopupService.prototype.positionPopupForMenu = function (params) {
  31712. var sourceRect = params.eventSource.getBoundingClientRect();
  31713. var parentRect = this.getParentRect();
  31714. var y = this.keepYWithinBounds(params, sourceRect.top - parentRect.top);
  31715. var minWidth = (params.ePopup.clientWidth > 0) ? params.ePopup.clientWidth : 200;
  31716. params.ePopup.style.minWidth = minWidth + "px";
  31717. var widthOfParent = parentRect.right - parentRect.left;
  31718. var maxX = widthOfParent - minWidth;
  31719. // the x position of the popup depends on RTL or LTR. for normal cases, LTR, we put the child popup
  31720. // to the right, unless it doesn't fit and we then put it to the left. for RTL it's the other way around,
  31721. // we try place it first to the left, and then if not to the right.
  31722. var x;
  31723. if (this.gridOptionsWrapper.isEnableRtl()) {
  31724. // for RTL, try left first
  31725. x = xLeftPosition();
  31726. if (x < 0) {
  31727. x = xRightPosition();
  31728. }
  31729. if (x > maxX) {
  31730. x = 0;
  31731. }
  31732. }
  31733. else {
  31734. // for LTR, try right first
  31735. x = xRightPosition();
  31736. if (x > maxX) {
  31737. x = xLeftPosition();
  31738. }
  31739. if (x < 0) {
  31740. x = 0;
  31741. }
  31742. }
  31743. params.ePopup.style.left = x + "px";
  31744. params.ePopup.style.top = y + "px";
  31745. function xRightPosition() {
  31746. return sourceRect.right - parentRect.left - 2;
  31747. }
  31748. function xLeftPosition() {
  31749. return sourceRect.left - parentRect.left - minWidth;
  31750. }
  31751. };
  31752. PopupService.prototype.positionPopupUnderMouseEvent = function (params) {
  31753. var _a = this.calculatePointerAlign(params.mouseEvent), x = _a.x, y = _a.y;
  31754. var ePopup = params.ePopup, nudgeX = params.nudgeX, nudgeY = params.nudgeY;
  31755. this.positionPopup({
  31756. ePopup: ePopup,
  31757. x: x,
  31758. y: y,
  31759. nudgeX: nudgeX,
  31760. nudgeY: nudgeY,
  31761. keepWithinBounds: true
  31762. });
  31763. this.callPostProcessPopup(params.type, params.ePopup, null, params.mouseEvent, params.column, params.rowNode);
  31764. };
  31765. PopupService.prototype.calculatePointerAlign = function (e) {
  31766. var parentRect = this.getParentRect();
  31767. return {
  31768. x: e.clientX - parentRect.left,
  31769. y: e.clientY - parentRect.top
  31770. };
  31771. };
  31772. PopupService.prototype.positionPopupUnderComponent = function (params) {
  31773. var sourceRect = params.eventSource.getBoundingClientRect();
  31774. var alignSide = params.alignSide || 'left';
  31775. var parentRect = this.getParentRect();
  31776. var x = sourceRect.left - parentRect.left;
  31777. if (alignSide === 'right') {
  31778. x -= (params.ePopup.offsetWidth - sourceRect.width);
  31779. }
  31780. this.positionPopup({
  31781. ePopup: params.ePopup,
  31782. minWidth: params.minWidth,
  31783. minHeight: params.minHeight,
  31784. nudgeX: params.nudgeX,
  31785. nudgeY: params.nudgeY,
  31786. x: x,
  31787. y: sourceRect.top - parentRect.top + sourceRect.height,
  31788. keepWithinBounds: params.keepWithinBounds
  31789. });
  31790. this.callPostProcessPopup(params.type, params.ePopup, params.eventSource, null, params.column, params.rowNode);
  31791. };
  31792. PopupService.prototype.positionPopupOverComponent = function (params) {
  31793. var sourceRect = params.eventSource.getBoundingClientRect();
  31794. var parentRect = this.getParentRect();
  31795. this.positionPopup({
  31796. ePopup: params.ePopup,
  31797. minWidth: params.minWidth,
  31798. nudgeX: params.nudgeX,
  31799. nudgeY: params.nudgeY,
  31800. x: sourceRect.left - parentRect.left,
  31801. y: sourceRect.top - parentRect.top,
  31802. keepWithinBounds: params.keepWithinBounds
  31803. });
  31804. this.callPostProcessPopup(params.type, params.ePopup, params.eventSource, null, params.column, params.rowNode);
  31805. };
  31806. PopupService.prototype.callPostProcessPopup = function (type, ePopup, eventSource, mouseEvent, column, rowNode) {
  31807. var callback = this.gridOptionsWrapper.getPostProcessPopupFunc();
  31808. if (callback) {
  31809. var params = {
  31810. column: column,
  31811. rowNode: rowNode,
  31812. ePopup: ePopup,
  31813. type: type,
  31814. eventSource: eventSource,
  31815. mouseEvent: mouseEvent
  31816. };
  31817. callback(params);
  31818. }
  31819. };
  31820. PopupService.prototype.positionPopup = function (params) {
  31821. var x = params.x;
  31822. var y = params.y;
  31823. if (params.nudgeX) {
  31824. x += params.nudgeX;
  31825. }
  31826. if (params.nudgeY) {
  31827. y += params.nudgeY;
  31828. }
  31829. // if popup is overflowing to the bottom, move it up
  31830. if (params.keepWithinBounds) {
  31831. x = this.keepXWithinBounds(params, x);
  31832. y = this.keepYWithinBounds(params, y);
  31833. }
  31834. params.ePopup.style.left = x + "px";
  31835. params.ePopup.style.top = y + "px";
  31836. };
  31837. PopupService.prototype.getActivePopups = function () {
  31838. return this.popupList.map(function (popup) { return popup.element; });
  31839. };
  31840. PopupService.prototype.getParentRect = function () {
  31841. // subtract the popup parent borders, because popupParent.getBoundingClientRect
  31842. // returns the rect outside the borders, but the 0,0 coordinate for absolute
  31843. // positioning is inside the border, leading the popup to be off by the width
  31844. // of the border
  31845. var popupParent = this.getPopupParent();
  31846. var eDocument = this.gridOptionsWrapper.getDocument();
  31847. if (popupParent === eDocument.body) {
  31848. popupParent = eDocument.documentElement;
  31849. }
  31850. var style = getComputedStyle(popupParent);
  31851. var bounds = popupParent.getBoundingClientRect();
  31852. return {
  31853. top: bounds.top + parseFloat(style.borderTopWidth) || 0,
  31854. left: bounds.left + parseFloat(style.borderLeftWidth) || 0,
  31855. right: bounds.right + parseFloat(style.borderRightWidth) || 0,
  31856. bottom: bounds.bottom + parseFloat(style.borderBottomWidth) || 0,
  31857. };
  31858. };
  31859. PopupService.prototype.keepYWithinBounds = function (params, y) {
  31860. var eDocument = this.gridOptionsWrapper.getDocument();
  31861. var docElement = eDocument.documentElement;
  31862. var popupParent = this.getPopupParent();
  31863. var parentRect = popupParent.getBoundingClientRect();
  31864. var documentRect = eDocument.documentElement.getBoundingClientRect();
  31865. var isBody = popupParent === eDocument.body;
  31866. var minHeight = Math.min(200, parentRect.height);
  31867. var diff = 0;
  31868. if (params.minHeight && params.minHeight < minHeight) {
  31869. minHeight = params.minHeight;
  31870. }
  31871. else if (params.ePopup.offsetHeight > 0) {
  31872. minHeight = params.ePopup.clientHeight;
  31873. diff = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].getAbsoluteHeight(params.ePopup) - minHeight;
  31874. }
  31875. var heightOfParent = isBody ? (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].getAbsoluteHeight(docElement) + docElement.scrollTop) : parentRect.height;
  31876. if (isBody) {
  31877. heightOfParent -= Math.abs(documentRect.top - parentRect.top);
  31878. }
  31879. var maxY = heightOfParent - minHeight - diff;
  31880. return Math.min(Math.max(y, 0), Math.abs(maxY));
  31881. };
  31882. PopupService.prototype.keepXWithinBounds = function (params, x) {
  31883. var eDocument = this.gridOptionsWrapper.getDocument();
  31884. var docElement = eDocument.documentElement;
  31885. var popupParent = this.getPopupParent();
  31886. var parentRect = popupParent.getBoundingClientRect();
  31887. var documentRect = eDocument.documentElement.getBoundingClientRect();
  31888. var isBody = popupParent === eDocument.body;
  31889. var ePopup = params.ePopup;
  31890. var minWidth = Math.min(200, parentRect.width);
  31891. var diff = 0;
  31892. if (params.minWidth && params.minWidth < minWidth) {
  31893. minWidth = params.minWidth;
  31894. }
  31895. else if (ePopup.offsetWidth > 0) {
  31896. minWidth = ePopup.offsetWidth;
  31897. ePopup.style.minWidth = minWidth + "px";
  31898. diff = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].getAbsoluteWidth(ePopup) - minWidth;
  31899. }
  31900. var widthOfParent = isBody ? (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].getAbsoluteWidth(docElement) + docElement.scrollLeft) : parentRect.width;
  31901. if (isBody) {
  31902. widthOfParent -= Math.abs(documentRect.left - parentRect.left);
  31903. }
  31904. var maxX = widthOfParent - minWidth - diff;
  31905. return Math.min(Math.max(x, 0), Math.abs(maxX));
  31906. };
  31907. // adds an element to a div, but also listens to background checking for clicks,
  31908. // so that when the background is clicked, the child is removed again, giving
  31909. // a model look to popups.
  31910. PopupService.prototype.addAsModalPopup = function (eChild, closeOnEsc, closedCallback, click) {
  31911. return this.addPopup(true, eChild, closeOnEsc, closedCallback, click);
  31912. };
  31913. PopupService.prototype.addPopup = function (modal, eChild, closeOnEsc, closedCallback, click, alwaysOnTop) {
  31914. var _this = this;
  31915. var eDocument = this.gridOptionsWrapper.getDocument();
  31916. if (!eDocument) {
  31917. console.warn('ag-grid: could not find the document, document is empty');
  31918. return function () { };
  31919. }
  31920. var pos = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].findIndex(this.popupList, function (popup) { return popup.element === eChild; });
  31921. if (pos !== -1) {
  31922. var popup = this.popupList[pos];
  31923. return popup.hideFunc;
  31924. }
  31925. var ePopupParent = this.getPopupParent();
  31926. // for angular specifically, but shouldn't cause an issue with js or other fw's
  31927. // https://github.com/angular/angular/issues/8563
  31928. ePopupParent.appendChild(eChild);
  31929. eChild.style.top = '0px';
  31930. eChild.style.left = '0px';
  31931. // add env CSS class to child, in case user provided a popup parent, which means
  31932. // theme class may be missing
  31933. var eWrapper = document.createElement('div');
  31934. var theme = this.environment.getTheme().theme;
  31935. if (theme) {
  31936. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eWrapper, theme);
  31937. }
  31938. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eWrapper, 'ag-popup');
  31939. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eChild, this.gridOptionsWrapper.isEnableRtl() ? 'ag-rtl' : 'ag-ltr');
  31940. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eChild, 'ag-popup-child');
  31941. eWrapper.appendChild(eChild);
  31942. ePopupParent.appendChild(eWrapper);
  31943. if (alwaysOnTop) {
  31944. this.setAlwaysOnTop(eWrapper, true);
  31945. }
  31946. else {
  31947. this.bringPopupToFront(eWrapper);
  31948. }
  31949. var popupHidden = false;
  31950. var hidePopupOnKeyboardEvent = function (event) {
  31951. var key = event.which || event.keyCode;
  31952. if (!eWrapper.contains(document.activeElement)) {
  31953. return;
  31954. }
  31955. switch (key) {
  31956. case _constants__WEBPACK_IMPORTED_MODULE_0__["Constants"].KEY_ESCAPE:
  31957. hidePopup({ keyboardEvent: event });
  31958. }
  31959. };
  31960. var hidePopupOnMouseEvent = function (event) {
  31961. hidePopup({ mouseEvent: event });
  31962. };
  31963. var hidePopupOnTouchEvent = function (event) {
  31964. hidePopup({ touchEvent: event });
  31965. };
  31966. var hidePopup = function (params) {
  31967. if (params === void 0) { params = {}; }
  31968. var mouseEvent = params.mouseEvent, touchEvent = params.touchEvent, keyboardEvent = params.keyboardEvent;
  31969. if (
  31970. // we don't hide popup if the event was on the child, or any
  31971. // children of this child
  31972. _this.isEventFromCurrentPopup({ mouseEvent: mouseEvent, touchEvent: touchEvent }, eChild) ||
  31973. // if the event to close is actually the open event, then ignore it
  31974. _this.isEventSameChainAsOriginalEvent({ originalMouseEvent: click, mouseEvent: mouseEvent, touchEvent: touchEvent }) ||
  31975. // this method should only be called once. the client can have different
  31976. // paths, each one wanting to close, so this method may be called multiple times.
  31977. popupHidden) {
  31978. return;
  31979. }
  31980. popupHidden = true;
  31981. ePopupParent.removeChild(eWrapper);
  31982. eDocument.removeEventListener('keydown', hidePopupOnKeyboardEvent);
  31983. eDocument.removeEventListener('mousedown', hidePopupOnMouseEvent);
  31984. eDocument.removeEventListener('touchstart', hidePopupOnTouchEvent);
  31985. eDocument.removeEventListener('contextmenu', hidePopupOnMouseEvent);
  31986. _this.eventService.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DRAG_STARTED, hidePopupOnMouseEvent);
  31987. if (closedCallback) {
  31988. closedCallback(mouseEvent || touchEvent || keyboardEvent);
  31989. }
  31990. _this.popupList = _this.popupList.filter(function (popup) { return popup.element !== eChild; });
  31991. };
  31992. // if we add these listeners now, then the current mouse
  31993. // click will be included, which we don't want
  31994. window.setTimeout(function () {
  31995. if (closeOnEsc) {
  31996. eDocument.addEventListener('keydown', hidePopupOnKeyboardEvent);
  31997. }
  31998. if (modal) {
  31999. eDocument.addEventListener('mousedown', hidePopupOnMouseEvent);
  32000. _this.eventService.addEventListener(_events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_DRAG_STARTED, hidePopupOnMouseEvent);
  32001. eDocument.addEventListener('touchstart', hidePopupOnTouchEvent);
  32002. eDocument.addEventListener('contextmenu', hidePopupOnMouseEvent);
  32003. }
  32004. }, 0);
  32005. this.popupList.push({
  32006. element: eChild,
  32007. hideFunc: hidePopup
  32008. });
  32009. return hidePopup;
  32010. };
  32011. PopupService.prototype.isEventFromCurrentPopup = function (params, target) {
  32012. var mouseEvent = params.mouseEvent, touchEvent = params.touchEvent;
  32013. var event = mouseEvent ? mouseEvent : touchEvent;
  32014. if (!event) {
  32015. return false;
  32016. }
  32017. var indexOfThisChild = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].findIndex(this.popupList, function (popup) { return popup.element === target; });
  32018. if (indexOfThisChild === -1) {
  32019. return false;
  32020. }
  32021. for (var i = indexOfThisChild; i < this.popupList.length; i++) {
  32022. var popup = this.popupList[i];
  32023. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].isElementInEventPath(popup.element, event)) {
  32024. return true;
  32025. }
  32026. }
  32027. // if the user did not write their own Custom Element to be rendered as popup
  32028. // and this component has an additional popup element, they should have the
  32029. // `ag-custom-component-popup` class to be detected as part of the Custom Component
  32030. return this.isElementWithinCustomPopup(event.target);
  32031. };
  32032. PopupService.prototype.isElementWithinCustomPopup = function (el) {
  32033. if (!this.popupList.length) {
  32034. return false;
  32035. }
  32036. while (el && el !== document.body) {
  32037. if (el.classList.contains('ag-custom-component-popup') || el.parentElement === null) {
  32038. return true;
  32039. }
  32040. el = el.parentElement;
  32041. }
  32042. return false;
  32043. };
  32044. // in some browsers, the context menu event can be fired before the click event, which means
  32045. // the context menu event could open the popup, but then the click event closes it straight away.
  32046. PopupService.prototype.isEventSameChainAsOriginalEvent = function (params) {
  32047. var originalMouseEvent = params.originalMouseEvent, mouseEvent = params.mouseEvent, touchEvent = params.touchEvent;
  32048. // we check the coordinates of the event, to see if it's the same event. there is a 1 / 1000 chance that
  32049. // the event is a different event, however that is an edge case that is not very relevant (the user clicking
  32050. // twice on the same location isn't a normal path).
  32051. // event could be mouse event or touch event.
  32052. var mouseEventOrTouch = null;
  32053. if (mouseEvent) {
  32054. // mouse event can be used direction, it has coordinates
  32055. mouseEventOrTouch = mouseEvent;
  32056. }
  32057. else if (touchEvent) {
  32058. // touch event doesn't have coordinates, need it's touch object
  32059. mouseEventOrTouch = touchEvent.touches[0];
  32060. }
  32061. if (mouseEventOrTouch && originalMouseEvent) {
  32062. // for x, allow 4px margin, to cover iPads, where touch (which opens menu) is followed
  32063. // by browser click (when you finger up, touch is interrupted as click in browser)
  32064. var screenX_1 = mouseEvent ? mouseEvent.screenX : 0;
  32065. var screenY_1 = mouseEvent ? mouseEvent.screenY : 0;
  32066. var xMatch = Math.abs(originalMouseEvent.screenX - screenX_1) < 5;
  32067. var yMatch = Math.abs(originalMouseEvent.screenY - screenY_1) < 5;
  32068. if (xMatch && yMatch) {
  32069. return true;
  32070. }
  32071. }
  32072. return false;
  32073. };
  32074. PopupService.prototype.getWrapper = function (ePopup) {
  32075. while (!_utils__WEBPACK_IMPORTED_MODULE_4__["_"].containsClass(ePopup, 'ag-popup') && ePopup.parentElement) {
  32076. ePopup = ePopup.parentElement;
  32077. }
  32078. return _utils__WEBPACK_IMPORTED_MODULE_4__["_"].containsClass(ePopup, 'ag-popup') ? ePopup : null;
  32079. };
  32080. PopupService.prototype.setAlwaysOnTop = function (ePopup, alwaysOnTop) {
  32081. var eWrapper = this.getWrapper(ePopup);
  32082. if (!eWrapper) {
  32083. return;
  32084. }
  32085. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addOrRemoveCssClass(eWrapper, 'ag-always-on-top', !!alwaysOnTop);
  32086. if (alwaysOnTop) {
  32087. this.bringPopupToFront(eWrapper);
  32088. }
  32089. };
  32090. PopupService.prototype.bringPopupToFront = function (ePopup) {
  32091. var parent = this.getPopupParent();
  32092. var popupList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup'));
  32093. var popupLen = popupList.length;
  32094. var alwaysOnTopList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup.ag-always-on-top'));
  32095. var onTopLength = alwaysOnTopList.length;
  32096. var eWrapper = this.getWrapper(ePopup);
  32097. if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) {
  32098. return;
  32099. }
  32100. var pos = popupList.indexOf(eWrapper);
  32101. if (onTopLength) {
  32102. var isPopupAlwaysOnTop = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].containsClass(eWrapper, 'ag-always-on-top');
  32103. if (isPopupAlwaysOnTop) {
  32104. if (pos !== popupLen - 1) {
  32105. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].last(alwaysOnTopList).insertAdjacentElement('afterend', eWrapper);
  32106. }
  32107. }
  32108. else if (pos !== popupLen - onTopLength - 1) {
  32109. alwaysOnTopList[0].insertAdjacentElement('beforebegin', eWrapper);
  32110. }
  32111. }
  32112. else if (pos !== popupLen - 1) {
  32113. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].last(popupList).insertAdjacentElement('afterend', eWrapper);
  32114. }
  32115. var params = {
  32116. type: 'popupToFront',
  32117. api: this.gridOptionsWrapper.getApi(),
  32118. columnApi: this.gridOptionsWrapper.getColumnApi(),
  32119. eWrapper: eWrapper
  32120. };
  32121. this.eventService.dispatchEvent(params);
  32122. };
  32123. __decorate([
  32124. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  32125. ], PopupService.prototype, "gridOptionsWrapper", void 0);
  32126. __decorate([
  32127. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('environment')
  32128. ], PopupService.prototype, "environment", void 0);
  32129. __decorate([
  32130. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  32131. ], PopupService.prototype, "init", null);
  32132. PopupService = __decorate([
  32133. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('popupService')
  32134. ], PopupService);
  32135. return PopupService;
  32136. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  32137. /***/ }),
  32138. /* 134 */
  32139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32140. "use strict";
  32141. __webpack_require__.r(__webpack_exports__);
  32142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LoggerFactory", function() { return LoggerFactory; });
  32143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return Logger; });
  32144. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  32145. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  32146. /**
  32147. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  32148. * @version v23.2.1
  32149. * @link http://www.ag-grid.com/
  32150. * @license MIT
  32151. */
  32152. var __extends = (undefined && undefined.__extends) || (function () {
  32153. var extendStatics = function (d, b) {
  32154. extendStatics = Object.setPrototypeOf ||
  32155. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32156. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32157. return extendStatics(d, b);
  32158. };
  32159. return function (d, b) {
  32160. extendStatics(d, b);
  32161. function __() { this.constructor = d; }
  32162. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32163. };
  32164. })();
  32165. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  32166. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  32167. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  32168. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  32169. return c > 3 && r && Object.defineProperty(target, key, r), r;
  32170. };
  32171. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  32172. return function (target, key) { decorator(target, key, paramIndex); }
  32173. };
  32174. var LoggerFactory = /** @class */ (function (_super) {
  32175. __extends(LoggerFactory, _super);
  32176. function LoggerFactory() {
  32177. return _super !== null && _super.apply(this, arguments) || this;
  32178. }
  32179. LoggerFactory.prototype.setBeans = function (gridOptionsWrapper) {
  32180. this.logging = gridOptionsWrapper.isDebug();
  32181. };
  32182. LoggerFactory.prototype.create = function (name) {
  32183. return new Logger(name, this.isLogging.bind(this));
  32184. };
  32185. LoggerFactory.prototype.isLogging = function () {
  32186. return this.logging;
  32187. };
  32188. __decorate([
  32189. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('gridOptionsWrapper'))
  32190. ], LoggerFactory.prototype, "setBeans", null);
  32191. LoggerFactory = __decorate([
  32192. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('loggerFactory')
  32193. ], LoggerFactory);
  32194. return LoggerFactory;
  32195. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  32196. var Logger = /** @class */ (function () {
  32197. function Logger(name, isLoggingFunc) {
  32198. this.name = name;
  32199. this.isLoggingFunc = isLoggingFunc;
  32200. }
  32201. Logger.prototype.isLogging = function () {
  32202. return this.isLoggingFunc();
  32203. };
  32204. Logger.prototype.log = function (message) {
  32205. if (this.isLoggingFunc()) {
  32206. // tslint:disable-next-line
  32207. console.log('ag-Grid.' + this.name + ': ' + message);
  32208. }
  32209. };
  32210. return Logger;
  32211. }());
  32212. /***/ }),
  32213. /* 135 */
  32214. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32215. "use strict";
  32216. __webpack_require__.r(__webpack_exports__);
  32217. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoWidthCalculator", function() { return AutoWidthCalculator; });
  32218. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  32219. /* harmony import */ var _headerRendering_header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(111);
  32220. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  32221. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  32222. /**
  32223. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  32224. * @version v23.2.1
  32225. * @link http://www.ag-grid.com/
  32226. * @license MIT
  32227. */
  32228. var __extends = (undefined && undefined.__extends) || (function () {
  32229. var extendStatics = function (d, b) {
  32230. extendStatics = Object.setPrototypeOf ||
  32231. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32232. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32233. return extendStatics(d, b);
  32234. };
  32235. return function (d, b) {
  32236. extendStatics(d, b);
  32237. function __() { this.constructor = d; }
  32238. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32239. };
  32240. })();
  32241. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  32242. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  32243. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  32244. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  32245. return c > 3 && r && Object.defineProperty(target, key, r), r;
  32246. };
  32247. var AutoWidthCalculator = /** @class */ (function (_super) {
  32248. __extends(AutoWidthCalculator, _super);
  32249. function AutoWidthCalculator() {
  32250. return _super !== null && _super.apply(this, arguments) || this;
  32251. }
  32252. AutoWidthCalculator.prototype.registerGridComp = function (gridPanel) {
  32253. this.gridPanel = gridPanel;
  32254. };
  32255. AutoWidthCalculator.prototype.registerHeaderRootComp = function (headerRootComp) {
  32256. this.headerRootComp = headerRootComp;
  32257. };
  32258. // this is the trick: we create a dummy container and clone all the cells
  32259. // into the dummy, then check the dummy's width. then destroy the dummy
  32260. // as we don't need it any more.
  32261. // drawback: only the cells visible on the screen are considered
  32262. AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column, skipHeader) {
  32263. var eHeaderCell = this.getHeaderCellForColumn(column);
  32264. // cell isn't visible
  32265. if (!eHeaderCell) {
  32266. return -1;
  32267. }
  32268. var eDummyContainer = document.createElement('span');
  32269. // position fixed, so it isn't restricted to the boundaries of the parent
  32270. eDummyContainer.style.position = 'fixed';
  32271. // we put the dummy into the body container, so it will inherit all the
  32272. // css styles that the real cells are inheriting
  32273. var eBodyContainer = this.gridPanel.getCenterContainer();
  32274. eBodyContainer.appendChild(eDummyContainer);
  32275. // get all the cells that are currently displayed (this only brings back
  32276. // rendered cells, rows not rendered due to row visualisation will not be here)
  32277. this.putRowCellsIntoDummyContainer(column, eDummyContainer);
  32278. if (!skipHeader) {
  32279. // we only consider the lowest level cell, not the group cell. in 99% of the time, this
  32280. // will be enough. if we consider groups, then it gets too complicated for what it's worth,
  32281. // as the groups can span columns and this class only considers one column at a time.
  32282. this.cloneItemIntoDummy(eHeaderCell, eDummyContainer);
  32283. }
  32284. // at this point, all the clones are lined up vertically with natural widths. the dummy
  32285. // container will have a width wide enough just to fit the largest.
  32286. var dummyContainerWidth = eDummyContainer.offsetWidth;
  32287. // we are finished with the dummy container, so get rid of it
  32288. eBodyContainer.removeChild(eDummyContainer);
  32289. // we add padding as I found sometimes the gui still put '...' after some of the texts. so the
  32290. // user can configure the grid to add a few more pixels after the calculated width
  32291. var autoSizePadding = this.gridOptionsWrapper.getAutoSizePadding();
  32292. return dummyContainerWidth + autoSizePadding;
  32293. };
  32294. AutoWidthCalculator.prototype.getHeaderCellForColumn = function (column) {
  32295. var comp = null;
  32296. // find the rendered header cell
  32297. this.headerRootComp.forEachHeaderElement(function (headerElement) {
  32298. if (headerElement instanceof _headerRendering_header_headerWrapperComp__WEBPACK_IMPORTED_MODULE_1__["HeaderWrapperComp"]) {
  32299. var headerWrapperComp = headerElement;
  32300. if (headerWrapperComp.getColumn() === column) {
  32301. comp = headerWrapperComp;
  32302. }
  32303. }
  32304. });
  32305. return comp ? comp.getGui() : null;
  32306. };
  32307. AutoWidthCalculator.prototype.putRowCellsIntoDummyContainer = function (column, eDummyContainer) {
  32308. var _this = this;
  32309. var eCells = this.rowRenderer.getAllCellsForColumn(column);
  32310. eCells.forEach(function (eCell) { return _this.cloneItemIntoDummy(eCell, eDummyContainer); });
  32311. };
  32312. AutoWidthCalculator.prototype.cloneItemIntoDummy = function (eCell, eDummyContainer) {
  32313. // make a deep clone of the cell
  32314. var eCellClone = eCell.cloneNode(true);
  32315. // the original has a fixed width, we remove this to allow the natural width based on content
  32316. eCellClone.style.width = '';
  32317. // the original has position = absolute, we need to remove this so it's positioned normally
  32318. eCellClone.style.position = 'static';
  32319. eCellClone.style.left = '';
  32320. // we put the cell into a containing div, as otherwise the cells would just line up
  32321. // on the same line, standard flow layout, by putting them into divs, they are laid
  32322. // out one per line
  32323. var eCloneParent = document.createElement('div');
  32324. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].containsClass(eCellClone, 'ag-header-cell')) {
  32325. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(eCloneParent, 'ag-header');
  32326. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(eCloneParent, 'ag-header-row');
  32327. eCloneParent.style.position = 'static';
  32328. }
  32329. // table-row, so that each cell is on a row. i also tried display='block', but this
  32330. // didn't work in IE
  32331. eCloneParent.style.display = 'table-row';
  32332. // the twig on the branch, the branch on the tree, the tree in the hole,
  32333. // the hole in the bog, the bog in the clone, the clone in the parent,
  32334. // the parent in the dummy, and the dummy down in the vall-e-ooo, OOOOOOOOO! Oh row the rattling bog....
  32335. eCloneParent.appendChild(eCellClone);
  32336. eDummyContainer.appendChild(eCloneParent);
  32337. };
  32338. __decorate([
  32339. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  32340. ], AutoWidthCalculator.prototype, "rowRenderer", void 0);
  32341. __decorate([
  32342. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  32343. ], AutoWidthCalculator.prototype, "gridOptionsWrapper", void 0);
  32344. AutoWidthCalculator = __decorate([
  32345. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('autoWidthCalculator')
  32346. ], AutoWidthCalculator);
  32347. return AutoWidthCalculator;
  32348. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  32349. /***/ }),
  32350. /* 136 */
  32351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32352. "use strict";
  32353. __webpack_require__.r(__webpack_exports__);
  32354. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HorizontalResizeService", function() { return HorizontalResizeService; });
  32355. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  32356. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  32357. /**
  32358. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  32359. * @version v23.2.1
  32360. * @link http://www.ag-grid.com/
  32361. * @license MIT
  32362. */
  32363. var __extends = (undefined && undefined.__extends) || (function () {
  32364. var extendStatics = function (d, b) {
  32365. extendStatics = Object.setPrototypeOf ||
  32366. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32367. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32368. return extendStatics(d, b);
  32369. };
  32370. return function (d, b) {
  32371. extendStatics(d, b);
  32372. function __() { this.constructor = d; }
  32373. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32374. };
  32375. })();
  32376. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  32377. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  32378. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  32379. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  32380. return c > 3 && r && Object.defineProperty(target, key, r), r;
  32381. };
  32382. var HorizontalResizeService = /** @class */ (function (_super) {
  32383. __extends(HorizontalResizeService, _super);
  32384. function HorizontalResizeService() {
  32385. return _super !== null && _super.apply(this, arguments) || this;
  32386. }
  32387. HorizontalResizeService.prototype.addResizeBar = function (params) {
  32388. var _this = this;
  32389. var dragSource = {
  32390. dragStartPixels: params.dragStartPixels || 0,
  32391. eElement: params.eResizeBar,
  32392. onDragStart: this.onDragStart.bind(this, params),
  32393. onDragStop: this.onDragStop.bind(this, params),
  32394. onDragging: this.onDragging.bind(this, params)
  32395. };
  32396. this.dragService.addDragSource(dragSource, true);
  32397. // we pass remove func back to the caller, so call can tell us when they
  32398. // are finished, and then we remove the listener from the drag source
  32399. var finishedWithResizeFunc = function () { return _this.dragService.removeDragSource(dragSource); };
  32400. return finishedWithResizeFunc;
  32401. };
  32402. HorizontalResizeService.prototype.onDragStart = function (params, mouseEvent) {
  32403. this.dragStartX = mouseEvent.clientX;
  32404. this.setResizeIcons();
  32405. var shiftKey = mouseEvent instanceof MouseEvent ? mouseEvent.shiftKey === true : false;
  32406. params.onResizeStart(shiftKey);
  32407. };
  32408. HorizontalResizeService.prototype.setResizeIcons = function () {
  32409. this.oldBodyCursor = this.eGridDiv.style.cursor;
  32410. this.oldMsUserSelect = this.eGridDiv.style.msUserSelect;
  32411. this.oldWebkitUserSelect = this.eGridDiv.style.webkitUserSelect;
  32412. // change the body cursor, so when drag moves out of the drag bar, the cursor is still 'resize' (or 'move'
  32413. this.eGridDiv.style.cursor = 'ew-resize';
  32414. // we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move)
  32415. this.eGridDiv.style.msUserSelect = 'none';
  32416. this.eGridDiv.style.webkitUserSelect = 'none';
  32417. };
  32418. HorizontalResizeService.prototype.onDragStop = function (params, mouseEvent) {
  32419. params.onResizeEnd(this.resizeAmount);
  32420. this.resetIcons();
  32421. };
  32422. HorizontalResizeService.prototype.resetIcons = function () {
  32423. // we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move)
  32424. this.eGridDiv.style.cursor = this.oldBodyCursor;
  32425. this.eGridDiv.style.msUserSelect = this.oldMsUserSelect;
  32426. this.eGridDiv.style.webkitUserSelect = this.oldWebkitUserSelect;
  32427. };
  32428. HorizontalResizeService.prototype.onDragging = function (params, mouseEvent) {
  32429. this.resizeAmount = mouseEvent.clientX - this.dragStartX;
  32430. params.onResizing(this.resizeAmount);
  32431. };
  32432. __decorate([
  32433. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragService')
  32434. ], HorizontalResizeService.prototype, "dragService", void 0);
  32435. __decorate([
  32436. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
  32437. ], HorizontalResizeService.prototype, "eGridDiv", void 0);
  32438. HorizontalResizeService = __decorate([
  32439. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('horizontalResizeService')
  32440. ], HorizontalResizeService);
  32441. return HorizontalResizeService;
  32442. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  32443. /***/ }),
  32444. /* 137 */
  32445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32446. "use strict";
  32447. __webpack_require__.r(__webpack_exports__);
  32448. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridCore", function() { return GridCore; });
  32449. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  32450. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  32451. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  32452. /* harmony import */ var _entities_sideBar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52);
  32453. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38);
  32454. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);
  32455. /* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(117);
  32456. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7);
  32457. /**
  32458. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  32459. * @version v23.2.1
  32460. * @link http://www.ag-grid.com/
  32461. * @license MIT
  32462. */
  32463. var __extends = (undefined && undefined.__extends) || (function () {
  32464. var extendStatics = function (d, b) {
  32465. extendStatics = Object.setPrototypeOf ||
  32466. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32467. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32468. return extendStatics(d, b);
  32469. };
  32470. return function (d, b) {
  32471. extendStatics(d, b);
  32472. function __() { this.constructor = d; }
  32473. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32474. };
  32475. })();
  32476. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  32477. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  32478. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  32479. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  32480. return c > 3 && r && Object.defineProperty(target, key, r), r;
  32481. };
  32482. var GridCore = /** @class */ (function (_super) {
  32483. __extends(GridCore, _super);
  32484. function GridCore() {
  32485. return _super !== null && _super.apply(this, arguments) || this;
  32486. }
  32487. GridCore.prototype.postConstruct = function () {
  32488. var _this = this;
  32489. this.logger = this.loggerFactory.create('GridCore');
  32490. var template = this.createTemplate();
  32491. this.setTemplate(template);
  32492. // register with services that need grid core
  32493. [
  32494. this.gridApi,
  32495. this.rowRenderer,
  32496. this.popupService,
  32497. this.focusController
  32498. ].forEach(function (service) { return service.registerGridCore(_this); });
  32499. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].ClipboardModule)) {
  32500. this.clipboardService.registerGridCore(this);
  32501. }
  32502. this.gridOptionsWrapper.addLayoutElement(this.getGui());
  32503. this.eGridDiv.appendChild(this.getGui());
  32504. this.addDestroyFunc(function () {
  32505. _this.eGridDiv.removeChild(_this.getGui());
  32506. });
  32507. // if using angular, watch for quickFilter changes
  32508. if (this.$scope) {
  32509. var quickFilterUnregisterFn = this.$scope.$watch(this.quickFilterOnScope, function (newFilter) { return _this.filterManager.setQuickFilter(newFilter); });
  32510. this.addDestroyFunc(quickFilterUnregisterFn);
  32511. }
  32512. // important to set rtl before doLayout, as setting the RTL class impacts the scroll position,
  32513. // which doLayout indirectly depends on
  32514. this.addRtlSupport();
  32515. this.logger.log('ready');
  32516. this.gridOptionsWrapper.addLayoutElement(this.eRootWrapperBody);
  32517. var unsubscribeFromResize = this.resizeObserverService.observeResize(this.eGridDiv, this.onGridSizeChanged.bind(this));
  32518. this.addDestroyFunc(function () { return unsubscribeFromResize(); });
  32519. var eGui = this.getGui();
  32520. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_KEYBOARD_FOCUS, function () {
  32521. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(eGui, 'ag-keyboard-focus');
  32522. });
  32523. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MOUSE_FOCUS, function () {
  32524. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].removeCssClass(eGui, 'ag-keyboard-focus');
  32525. });
  32526. _super.prototype.postConstruct.call(this);
  32527. };
  32528. GridCore.prototype.getFocusableElement = function () {
  32529. return this.eRootWrapperBody;
  32530. };
  32531. GridCore.prototype.createTemplate = function () {
  32532. var sideBarModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].SideBarModule);
  32533. var statusBarModuleLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].StatusBarModule);
  32534. var rowGroupingLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RowGroupingModule);
  32535. var enterpriseCoreLoaded = _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].EnterpriseCoreModule);
  32536. var dropZones = rowGroupingLoaded ? '<ag-grid-header-drop-zones></ag-grid-header-drop-zones>' : '';
  32537. var sideBar = sideBarModuleLoaded ? '<ag-side-bar ref="sideBar"></ag-side-bar>' : '';
  32538. var statusBar = statusBarModuleLoaded ? '<ag-status-bar ref="statusBar"></ag-status-bar>' : '';
  32539. var watermark = enterpriseCoreLoaded ? '<ag-watermark></ag-watermark>' : '';
  32540. var template = "<div ref=\"eRootWrapper\" class=\"ag-root-wrapper\">\n " + dropZones + "\n <div class=\"ag-root-wrapper-body\" ref=\"rootWrapperBody\">\n <ag-grid-comp ref=\"gridPanel\"></ag-grid-comp>\n " + sideBar + "\n </div>\n " + statusBar + "\n <ag-pagination></ag-pagination>\n " + watermark + "\n </div>";
  32541. return template;
  32542. };
  32543. GridCore.prototype.isFocusableContainer = function () {
  32544. return true;
  32545. };
  32546. GridCore.prototype.getFocusableContainers = function () {
  32547. var focusableContainers = [
  32548. this.gridPanel.getGui()
  32549. ];
  32550. if (this.sideBarComp) {
  32551. focusableContainers.push(this.sideBarComp.getGui());
  32552. }
  32553. return focusableContainers.filter(function (el) { return _utils__WEBPACK_IMPORTED_MODULE_7__["_"].isVisible(el); });
  32554. };
  32555. GridCore.prototype.focusNextInnerContainer = function (backwards) {
  32556. var focusableContainers = this.getFocusableContainers();
  32557. var idxWithFocus = _utils__WEBPACK_IMPORTED_MODULE_7__["_"].findIndex(focusableContainers, function (container) { return container.contains(document.activeElement); });
  32558. var nextIdx = idxWithFocus + (backwards ? -1 : 1);
  32559. if (nextIdx < 0 || nextIdx >= focusableContainers.length) {
  32560. return false;
  32561. }
  32562. if (nextIdx === 0) {
  32563. return this.focusGridHeader();
  32564. }
  32565. return this.focusController.focusFirstFocusableElement(focusableContainers[nextIdx]);
  32566. };
  32567. GridCore.prototype.focusInnerElement = function (fromBottom) {
  32568. var focusableContainers = this.getFocusableContainers();
  32569. if (fromBottom && focusableContainers.length > 1) {
  32570. return this.focusController.focusFirstFocusableElement(_utils__WEBPACK_IMPORTED_MODULE_7__["_"].last(focusableContainers));
  32571. }
  32572. return this.focusGridHeader();
  32573. };
  32574. GridCore.prototype.focusGridHeader = function () {
  32575. var firstColumn = this.columnController.getAllDisplayedColumns()[0];
  32576. if (!firstColumn) {
  32577. return false;
  32578. }
  32579. if (firstColumn.getParent()) {
  32580. firstColumn = this.columnController.getColumnGroupAtLevel(firstColumn, 0);
  32581. }
  32582. this.focusController.focusHeaderPosition({
  32583. headerRowIndex: 0,
  32584. column: firstColumn
  32585. });
  32586. return true;
  32587. };
  32588. GridCore.prototype.onGridSizeChanged = function () {
  32589. var event = {
  32590. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_GRID_SIZE_CHANGED,
  32591. api: this.gridApi,
  32592. columnApi: this.columnApi,
  32593. clientWidth: this.eGridDiv.clientWidth,
  32594. clientHeight: this.eGridDiv.clientHeight
  32595. };
  32596. this.eventService.dispatchEvent(event);
  32597. };
  32598. GridCore.prototype.addRtlSupport = function () {
  32599. var cssClass = this.gridOptionsWrapper.isEnableRtl() ? 'ag-rtl' : 'ag-ltr';
  32600. _utils__WEBPACK_IMPORTED_MODULE_7__["_"].addCssClass(this.getGui(), cssClass);
  32601. };
  32602. GridCore.prototype.getRootGui = function () {
  32603. return this.getGui();
  32604. };
  32605. GridCore.prototype.isSideBarVisible = function () {
  32606. if (!this.sideBarComp) {
  32607. return false;
  32608. }
  32609. return this.sideBarComp.isDisplayed();
  32610. };
  32611. GridCore.prototype.setSideBarVisible = function (show) {
  32612. if (!this.sideBarComp) {
  32613. if (show) {
  32614. console.warn('ag-Grid: sideBar is not loaded');
  32615. }
  32616. return;
  32617. }
  32618. this.sideBarComp.setDisplayed(show);
  32619. };
  32620. GridCore.prototype.setSideBarPosition = function (position) {
  32621. if (!this.sideBarComp) {
  32622. console.warn('ag-Grid: sideBar is not loaded');
  32623. return;
  32624. }
  32625. this.sideBarComp.setSideBarPosition(position);
  32626. };
  32627. GridCore.prototype.closeToolPanel = function () {
  32628. if (!this.sideBarComp) {
  32629. console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
  32630. return;
  32631. }
  32632. this.sideBarComp.close();
  32633. };
  32634. GridCore.prototype.getSideBar = function () {
  32635. return this.gridOptions.sideBar;
  32636. };
  32637. GridCore.prototype.getToolPanelInstance = function (key) {
  32638. if (!this.sideBarComp) {
  32639. console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
  32640. return;
  32641. }
  32642. return this.sideBarComp.getToolPanelInstance(key);
  32643. };
  32644. GridCore.prototype.refreshSideBar = function () {
  32645. if (this.sideBarComp) {
  32646. this.sideBarComp.refresh();
  32647. }
  32648. };
  32649. GridCore.prototype.setSideBar = function (def) {
  32650. if (!this.sideBarComp) {
  32651. return;
  32652. }
  32653. this.eRootWrapperBody.removeChild(this.sideBarComp.getGui());
  32654. this.gridOptions.sideBar = _entities_sideBar__WEBPACK_IMPORTED_MODULE_3__["SideBarDefParser"].parse(def);
  32655. this.sideBarComp.reset();
  32656. this.eRootWrapperBody.appendChild(this.sideBarComp.getGui());
  32657. };
  32658. GridCore.prototype.getOpenedToolPanel = function () {
  32659. if (!this.sideBarComp) {
  32660. return null;
  32661. }
  32662. return this.sideBarComp.openedItem();
  32663. };
  32664. GridCore.prototype.openToolPanel = function (key) {
  32665. if (!this.sideBarComp) {
  32666. console.warn('ag-Grid: toolPanel is only available in ag-Grid Enterprise');
  32667. return;
  32668. }
  32669. this.sideBarComp.openToolPanel(key);
  32670. };
  32671. GridCore.prototype.isToolPanelShowing = function () {
  32672. return this.sideBarComp.isToolPanelShowing();
  32673. };
  32674. GridCore.prototype.destroy = function () {
  32675. this.logger.log('Grid DOM removed');
  32676. _super.prototype.destroy.call(this);
  32677. };
  32678. // Valid values for position are bottom, middle and top
  32679. GridCore.prototype.ensureNodeVisible = function (comparator, position) {
  32680. if (position === void 0) { position = null; }
  32681. if (this.doingVirtualPaging) {
  32682. throw new Error('Cannot use ensureNodeVisible when doing virtual paging, as we cannot check rows that are not in memory');
  32683. }
  32684. // look for the node index we want to display
  32685. var rowCount = this.rowModel.getRowCount();
  32686. var comparatorIsAFunction = typeof comparator === 'function';
  32687. var indexToSelect = -1;
  32688. // go through all the nodes, find the one we want to show
  32689. for (var i = 0; i < rowCount; i++) {
  32690. var node = this.rowModel.getRow(i);
  32691. if (comparatorIsAFunction) {
  32692. if (comparator(node)) {
  32693. indexToSelect = i;
  32694. break;
  32695. }
  32696. }
  32697. else {
  32698. // check object equality against node and data
  32699. if (comparator === node || comparator === node.data) {
  32700. indexToSelect = i;
  32701. break;
  32702. }
  32703. }
  32704. }
  32705. if (indexToSelect >= 0) {
  32706. this.gridPanel.ensureIndexVisible(indexToSelect, position);
  32707. }
  32708. };
  32709. __decorate([
  32710. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptions')
  32711. ], GridCore.prototype, "gridOptions", void 0);
  32712. __decorate([
  32713. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  32714. ], GridCore.prototype, "gridOptionsWrapper", void 0);
  32715. __decorate([
  32716. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  32717. ], GridCore.prototype, "rowModel", void 0);
  32718. __decorate([
  32719. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('resizeObserverService')
  32720. ], GridCore.prototype, "resizeObserverService", void 0);
  32721. __decorate([
  32722. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  32723. ], GridCore.prototype, "rowRenderer", void 0);
  32724. __decorate([
  32725. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  32726. ], GridCore.prototype, "filterManager", void 0);
  32727. __decorate([
  32728. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
  32729. ], GridCore.prototype, "eGridDiv", void 0);
  32730. __decorate([
  32731. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$scope')
  32732. ], GridCore.prototype, "$scope", void 0);
  32733. __decorate([
  32734. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('quickFilterOnScope')
  32735. ], GridCore.prototype, "quickFilterOnScope", void 0);
  32736. __decorate([
  32737. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
  32738. ], GridCore.prototype, "popupService", void 0);
  32739. __decorate([
  32740. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  32741. ], GridCore.prototype, "columnController", void 0);
  32742. __decorate([
  32743. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('loggerFactory')
  32744. ], GridCore.prototype, "loggerFactory", void 0);
  32745. __decorate([
  32746. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  32747. ], GridCore.prototype, "columnApi", void 0);
  32748. __decorate([
  32749. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  32750. ], GridCore.prototype, "gridApi", void 0);
  32751. __decorate([
  32752. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('clipboardService')
  32753. ], GridCore.prototype, "clipboardService", void 0);
  32754. __decorate([
  32755. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('gridPanel')
  32756. ], GridCore.prototype, "gridPanel", void 0);
  32757. __decorate([
  32758. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('sideBar')
  32759. ], GridCore.prototype, "sideBarComp", void 0);
  32760. __decorate([
  32761. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('rootWrapperBody')
  32762. ], GridCore.prototype, "eRootWrapperBody", void 0);
  32763. return GridCore;
  32764. }(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_6__["ManagedFocusComponent"]));
  32765. /***/ }),
  32766. /* 138 */
  32767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32768. "use strict";
  32769. __webpack_require__.r(__webpack_exports__);
  32770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StandardMenuFactory", function() { return StandardMenuFactory; });
  32771. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  32772. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  32773. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  32774. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  32775. /**
  32776. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  32777. * @version v23.2.1
  32778. * @link http://www.ag-grid.com/
  32779. * @license MIT
  32780. */
  32781. var __extends = (undefined && undefined.__extends) || (function () {
  32782. var extendStatics = function (d, b) {
  32783. extendStatics = Object.setPrototypeOf ||
  32784. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32785. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32786. return extendStatics(d, b);
  32787. };
  32788. return function (d, b) {
  32789. extendStatics(d, b);
  32790. function __() { this.constructor = d; }
  32791. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32792. };
  32793. })();
  32794. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  32795. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  32796. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  32797. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  32798. return c > 3 && r && Object.defineProperty(target, key, r), r;
  32799. };
  32800. var StandardMenuFactory = /** @class */ (function (_super) {
  32801. __extends(StandardMenuFactory, _super);
  32802. function StandardMenuFactory() {
  32803. return _super !== null && _super.apply(this, arguments) || this;
  32804. }
  32805. StandardMenuFactory.prototype.hideActiveMenu = function () {
  32806. if (this.hidePopup) {
  32807. this.hidePopup();
  32808. }
  32809. };
  32810. StandardMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent) {
  32811. var _this = this;
  32812. this.showPopup(column, function (eMenu) {
  32813. _this.popupService.positionPopupUnderMouseEvent({
  32814. column: column,
  32815. type: 'columnMenu',
  32816. mouseEvent: mouseEvent,
  32817. ePopup: eMenu
  32818. });
  32819. }, mouseEvent.target);
  32820. };
  32821. StandardMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource) {
  32822. var _this = this;
  32823. this.showPopup(column, function (eMenu) {
  32824. _this.popupService.positionPopupUnderComponent({
  32825. type: 'columnMenu',
  32826. eventSource: eventSource,
  32827. ePopup: eMenu,
  32828. keepWithinBounds: true,
  32829. column: column
  32830. });
  32831. }, eventSource);
  32832. };
  32833. StandardMenuFactory.prototype.showPopup = function (column, positionCallback, eventSource) {
  32834. var _this = this;
  32835. var filterWrapper = this.filterManager.getOrCreateFilterWrapper(column, 'COLUMN_MENU');
  32836. var eMenu = document.createElement('div');
  32837. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(eMenu, 'ag-menu');
  32838. this.tabListener = this.addManagedListener(eMenu, 'keydown', function (e) { return _this.trapFocusWithin(e, eMenu); });
  32839. filterWrapper.guiPromise.then(function (gui) { return eMenu.appendChild(gui); });
  32840. var hidePopup;
  32841. var bodyScrollListener = function (event) {
  32842. // if h scroll, popup is no longer over the column
  32843. if (event.direction === 'horizontal') {
  32844. hidePopup();
  32845. }
  32846. };
  32847. this.eventService.addEventListener('bodyScroll', bodyScrollListener);
  32848. var closedCallback = function (e) {
  32849. _this.eventService.removeEventListener('bodyScroll', bodyScrollListener);
  32850. column.setMenuVisible(false, 'contextMenu');
  32851. var isKeyboardEvent = e instanceof KeyboardEvent;
  32852. if (_this.tabListener) {
  32853. _this.tabListener = _this.tabListener();
  32854. }
  32855. if (isKeyboardEvent && eventSource && _utils__WEBPACK_IMPORTED_MODULE_3__["_"].isVisible(eventSource)) {
  32856. var focusableEl = _this.focusController.findTabbableParent(eventSource);
  32857. if (focusableEl) {
  32858. focusableEl.focus();
  32859. }
  32860. }
  32861. };
  32862. // need to show filter before positioning, as only after filter
  32863. // is visible can we find out what the width of it is
  32864. hidePopup = this.popupService.addAsModalPopup(eMenu, true, closedCallback);
  32865. positionCallback(eMenu);
  32866. filterWrapper.filterPromise.then(function (filter) {
  32867. if (filter.afterGuiAttached) {
  32868. var params = {
  32869. hidePopup: hidePopup
  32870. };
  32871. filter.afterGuiAttached(params);
  32872. }
  32873. });
  32874. this.hidePopup = hidePopup;
  32875. column.setMenuVisible(true, 'contextMenu');
  32876. };
  32877. StandardMenuFactory.prototype.trapFocusWithin = function (e, menu) {
  32878. if (e.keyCode !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_TAB) {
  32879. return;
  32880. }
  32881. if (this.focusController.findNextFocusableElement(menu, false, e.shiftKey)) {
  32882. return;
  32883. }
  32884. e.preventDefault();
  32885. if (e.shiftKey) {
  32886. this.focusController.focusLastFocusableElement(menu);
  32887. }
  32888. else {
  32889. this.focusController.focusFirstFocusableElement(menu);
  32890. }
  32891. };
  32892. StandardMenuFactory.prototype.isMenuEnabled = function (column) {
  32893. // for standard, we show menu if filter is enabled, and the menu is not suppressed
  32894. return column.isFilterAllowed();
  32895. };
  32896. __decorate([
  32897. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  32898. ], StandardMenuFactory.prototype, "filterManager", void 0);
  32899. __decorate([
  32900. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
  32901. ], StandardMenuFactory.prototype, "popupService", void 0);
  32902. __decorate([
  32903. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
  32904. ], StandardMenuFactory.prototype, "focusController", void 0);
  32905. StandardMenuFactory = __decorate([
  32906. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('menuFactory')
  32907. ], StandardMenuFactory);
  32908. return StandardMenuFactory;
  32909. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  32910. /***/ }),
  32911. /* 139 */
  32912. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  32913. "use strict";
  32914. __webpack_require__.r(__webpack_exports__);
  32915. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragService", function() { return DragService; });
  32916. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  32917. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  32918. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  32919. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  32920. /**
  32921. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  32922. * @version v23.2.1
  32923. * @link http://www.ag-grid.com/
  32924. * @license MIT
  32925. */
  32926. var __extends = (undefined && undefined.__extends) || (function () {
  32927. var extendStatics = function (d, b) {
  32928. extendStatics = Object.setPrototypeOf ||
  32929. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  32930. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  32931. return extendStatics(d, b);
  32932. };
  32933. return function (d, b) {
  32934. extendStatics(d, b);
  32935. function __() { this.constructor = d; }
  32936. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32937. };
  32938. })();
  32939. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  32940. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  32941. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  32942. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  32943. return c > 3 && r && Object.defineProperty(target, key, r), r;
  32944. };
  32945. /** Adds drag listening onto an element. In ag-Grid this is used twice, first is resizing columns,
  32946. * second is moving the columns and column groups around (ie the 'drag' part of Drag and Drop. */
  32947. var DragService = /** @class */ (function (_super) {
  32948. __extends(DragService, _super);
  32949. function DragService() {
  32950. var _this = _super !== null && _super.apply(this, arguments) || this;
  32951. _this.dragEndFunctions = [];
  32952. _this.dragSources = [];
  32953. return _this;
  32954. }
  32955. DragService.prototype.init = function () {
  32956. this.logger = this.loggerFactory.create('DragService');
  32957. };
  32958. DragService.prototype.removeAllListeners = function () {
  32959. this.dragSources.forEach(this.removeListener.bind(this));
  32960. this.dragSources.length = 0;
  32961. };
  32962. DragService.prototype.removeListener = function (dragSourceAndListener) {
  32963. var element = dragSourceAndListener.dragSource.eElement;
  32964. var mouseDownListener = dragSourceAndListener.mouseDownListener;
  32965. element.removeEventListener('mousedown', mouseDownListener);
  32966. // remove touch listener only if it exists
  32967. if (dragSourceAndListener.touchEnabled) {
  32968. var touchStartListener = dragSourceAndListener.touchStartListener;
  32969. element.removeEventListener('touchstart', touchStartListener, { passive: true });
  32970. }
  32971. };
  32972. DragService.prototype.removeDragSource = function (params) {
  32973. var dragSourceAndListener = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].find(this.dragSources, function (item) { return item.dragSource === params; });
  32974. if (!dragSourceAndListener) {
  32975. return;
  32976. }
  32977. this.removeListener(dragSourceAndListener);
  32978. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].removeFromArray(this.dragSources, dragSourceAndListener);
  32979. };
  32980. DragService.prototype.setNoSelectToBody = function (noSelect) {
  32981. var eDocument = this.gridOptionsWrapper.getDocument();
  32982. var eBody = eDocument.querySelector('body');
  32983. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(eBody)) {
  32984. // when we drag the mouse in ag-Grid, this class gets added / removed from the body, so that
  32985. // the mouse isn't selecting text when dragging.
  32986. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addOrRemoveCssClass(eBody, 'ag-unselectable', noSelect);
  32987. }
  32988. };
  32989. DragService.prototype.addDragSource = function (params, includeTouch) {
  32990. if (includeTouch === void 0) { includeTouch = false; }
  32991. var mouseListener = this.onMouseDown.bind(this, params);
  32992. params.eElement.addEventListener('mousedown', mouseListener);
  32993. var touchListener = null;
  32994. var suppressTouch = this.gridOptionsWrapper.isSuppressTouch();
  32995. if (includeTouch && !suppressTouch) {
  32996. touchListener = this.onTouchStart.bind(this, params);
  32997. params.eElement.addEventListener('touchstart', touchListener, { passive: false });
  32998. }
  32999. this.dragSources.push({
  33000. dragSource: params,
  33001. mouseDownListener: mouseListener,
  33002. touchStartListener: touchListener,
  33003. touchEnabled: includeTouch
  33004. });
  33005. };
  33006. // gets called whenever mouse down on any drag source
  33007. DragService.prototype.onTouchStart = function (params, touchEvent) {
  33008. var _this = this;
  33009. this.currentDragParams = params;
  33010. this.dragging = false;
  33011. var touch = touchEvent.touches[0];
  33012. this.touchLastTime = touch;
  33013. this.touchStart = touch;
  33014. if (touchEvent.cancelable) {
  33015. touchEvent.preventDefault();
  33016. }
  33017. var touchMoveEvent = function (e) { return _this.onTouchMove(e, params.eElement); };
  33018. var touchEndEvent = function (e) { return _this.onTouchUp(e, params.eElement); };
  33019. var target = params.eElement;
  33020. var events = [
  33021. { target: target, type: 'touchmove', listener: touchMoveEvent, options: { passive: true } },
  33022. { target: target, type: 'touchend', listener: touchEndEvent, options: { passive: true } },
  33023. { target: target, type: 'touchcancel', listener: touchEndEvent, options: { passive: true } }
  33024. ];
  33025. // temporally add these listeners, for the duration of the drag
  33026. this.addTemporaryEvents(events);
  33027. // see if we want to start dragging straight away
  33028. if (params.dragStartPixels === 0) {
  33029. this.onCommonMove(touch, this.touchStart, params.eElement);
  33030. }
  33031. };
  33032. // gets called whenever mouse down on any drag source
  33033. DragService.prototype.onMouseDown = function (params, mouseEvent) {
  33034. var _this = this;
  33035. var e = mouseEvent;
  33036. if (params.skipMouseEvent && params.skipMouseEvent(mouseEvent)) {
  33037. return;
  33038. }
  33039. // if there are two elements with parent / child relationship, and both are draggable,
  33040. // when we drag the child, we should NOT drag the parent. an example of this is row moving
  33041. // and range selection - row moving should get preference when use drags the rowDrag component.
  33042. if (e._alreadyProcessedByDragService) {
  33043. return;
  33044. }
  33045. e._alreadyProcessedByDragService = true;
  33046. // only interested in left button clicks
  33047. if (mouseEvent.button !== 0) {
  33048. return;
  33049. }
  33050. this.currentDragParams = params;
  33051. this.dragging = false;
  33052. this.mouseStartEvent = mouseEvent;
  33053. var eDocument = this.gridOptionsWrapper.getDocument();
  33054. this.setNoSelectToBody(true);
  33055. var mouseMoveEvent = function (e, el) { return _this.onMouseMove(e, params.eElement); };
  33056. var mouseUpEvent = function (e, el) { return _this.onMouseUp(e, params.eElement); };
  33057. var contextEvent = function (e) { return e.preventDefault(); };
  33058. var target = eDocument;
  33059. var events = [
  33060. { target: target, type: 'mousemove', listener: mouseMoveEvent },
  33061. { target: target, type: 'mouseup', listener: mouseUpEvent },
  33062. { target: target, type: 'contextmenu', listener: contextEvent }
  33063. ];
  33064. // temporally add these listeners, for the duration of the drag
  33065. this.addTemporaryEvents(events);
  33066. //see if we want to start dragging straight away
  33067. if (params.dragStartPixels === 0) {
  33068. this.onMouseMove(mouseEvent, params.eElement);
  33069. }
  33070. };
  33071. DragService.prototype.addTemporaryEvents = function (events) {
  33072. events.forEach(function (currentEvent) {
  33073. var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options;
  33074. target.addEventListener(type, listener, options);
  33075. });
  33076. this.dragEndFunctions.push(function () {
  33077. events.forEach(function (currentEvent) {
  33078. var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options;
  33079. target.removeEventListener(type, listener, options);
  33080. });
  33081. });
  33082. };
  33083. // returns true if the event is close to the original event by X pixels either vertically or horizontally.
  33084. // we only start dragging after X pixels so this allows us to know if we should start dragging yet.
  33085. DragService.prototype.isEventNearStartEvent = function (currentEvent, startEvent) {
  33086. // by default, we wait 4 pixels before starting the drag
  33087. var dragStartPixels = this.currentDragParams.dragStartPixels;
  33088. var requiredPixelDiff = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(dragStartPixels) ? dragStartPixels : 4;
  33089. return _utils__WEBPACK_IMPORTED_MODULE_2__["_"].areEventsNear(currentEvent, startEvent, requiredPixelDiff);
  33090. };
  33091. DragService.prototype.getFirstActiveTouch = function (touchList) {
  33092. for (var i = 0; i < touchList.length; i++) {
  33093. if (touchList[i].identifier === this.touchStart.identifier) {
  33094. return touchList[i];
  33095. }
  33096. }
  33097. return null;
  33098. };
  33099. DragService.prototype.onCommonMove = function (currentEvent, startEvent, el) {
  33100. if (!this.dragging) {
  33101. // if mouse hasn't travelled from the start position enough, do nothing
  33102. if (!this.dragging && this.isEventNearStartEvent(currentEvent, startEvent)) {
  33103. return;
  33104. }
  33105. this.dragging = true;
  33106. var event_1 = {
  33107. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DRAG_STARTED,
  33108. api: this.gridApi,
  33109. columnApi: this.columnApi,
  33110. target: el
  33111. };
  33112. this.eventService.dispatchEvent(event_1);
  33113. this.currentDragParams.onDragStart(startEvent);
  33114. }
  33115. this.currentDragParams.onDragging(currentEvent);
  33116. };
  33117. DragService.prototype.onTouchMove = function (touchEvent, el) {
  33118. var touch = this.getFirstActiveTouch(touchEvent.touches);
  33119. if (!touch) {
  33120. return;
  33121. }
  33122. // this.___statusPanel.setInfoText(Math.random() + ' onTouchMove preventDefault stopPropagation');
  33123. // if we don't preview default, then the browser will try and do it's own touch stuff,
  33124. // like do 'back button' (chrome does this) or scroll the page (eg drag column could be confused
  33125. // with scroll page in the app)
  33126. // touchEvent.preventDefault();
  33127. this.onCommonMove(touch, this.touchStart, el);
  33128. };
  33129. // only gets called after a mouse down - as this is only added after mouseDown
  33130. // and is removed when mouseUp happens
  33131. DragService.prototype.onMouseMove = function (mouseEvent, el) {
  33132. this.onCommonMove(mouseEvent, this.mouseStartEvent, el);
  33133. };
  33134. DragService.prototype.onTouchUp = function (touchEvent, el) {
  33135. var touch = this.getFirstActiveTouch(touchEvent.changedTouches);
  33136. // i haven't worked this out yet, but there is no matching touch
  33137. // when we get the touch up event. to get around this, we swap in
  33138. // the last touch. this is a hack to 'get it working' while we
  33139. // figure out what's going on, why we are not getting a touch in
  33140. // current event.
  33141. if (!touch) {
  33142. touch = this.touchLastTime;
  33143. }
  33144. // if mouse was left up before we started to move, then this is a tap.
  33145. // we check this before onUpCommon as onUpCommon resets the dragging
  33146. // let tap = !this.dragging;
  33147. // let tapTarget = this.currentDragParams.eElement;
  33148. this.onUpCommon(touch, el);
  33149. // if tap, tell user
  33150. // console.log(`${Math.random()} tap = ${tap}`);
  33151. // if (tap) {
  33152. // tapTarget.click();
  33153. // }
  33154. };
  33155. DragService.prototype.onMouseUp = function (mouseEvent, el) {
  33156. this.onUpCommon(mouseEvent, el);
  33157. };
  33158. DragService.prototype.onUpCommon = function (eventOrTouch, el) {
  33159. if (this.dragging) {
  33160. this.dragging = false;
  33161. this.currentDragParams.onDragStop(eventOrTouch);
  33162. var event_2 = {
  33163. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_DRAG_STOPPED,
  33164. api: this.gridApi,
  33165. columnApi: this.columnApi,
  33166. target: el
  33167. };
  33168. this.eventService.dispatchEvent(event_2);
  33169. }
  33170. this.setNoSelectToBody(false);
  33171. this.mouseStartEvent = null;
  33172. this.touchStart = null;
  33173. this.touchLastTime = null;
  33174. this.currentDragParams = null;
  33175. this.dragEndFunctions.forEach(function (func) { return func(); });
  33176. this.dragEndFunctions.length = 0;
  33177. };
  33178. __decorate([
  33179. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('loggerFactory')
  33180. ], DragService.prototype, "loggerFactory", void 0);
  33181. __decorate([
  33182. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  33183. ], DragService.prototype, "gridOptionsWrapper", void 0);
  33184. __decorate([
  33185. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  33186. ], DragService.prototype, "columnApi", void 0);
  33187. __decorate([
  33188. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  33189. ], DragService.prototype, "gridApi", void 0);
  33190. __decorate([
  33191. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  33192. ], DragService.prototype, "init", null);
  33193. __decorate([
  33194. _context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
  33195. ], DragService.prototype, "removeAllListeners", null);
  33196. DragService = __decorate([
  33197. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('dragService')
  33198. ], DragService);
  33199. return DragService;
  33200. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  33201. /***/ }),
  33202. /* 140 */
  33203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33204. "use strict";
  33205. __webpack_require__.r(__webpack_exports__);
  33206. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortController", function() { return SortController; });
  33207. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  33208. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  33209. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  33210. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  33211. /**
  33212. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  33213. * @version v23.2.1
  33214. * @link http://www.ag-grid.com/
  33215. * @license MIT
  33216. */
  33217. var __extends = (undefined && undefined.__extends) || (function () {
  33218. var extendStatics = function (d, b) {
  33219. extendStatics = Object.setPrototypeOf ||
  33220. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  33221. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  33222. return extendStatics(d, b);
  33223. };
  33224. return function (d, b) {
  33225. extendStatics(d, b);
  33226. function __() { this.constructor = d; }
  33227. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  33228. };
  33229. })();
  33230. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  33231. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  33232. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  33233. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  33234. return c > 3 && r && Object.defineProperty(target, key, r), r;
  33235. };
  33236. var SortController = /** @class */ (function (_super) {
  33237. __extends(SortController, _super);
  33238. function SortController() {
  33239. var _this = _super !== null && _super.apply(this, arguments) || this;
  33240. // used by the public api, for saving the sort model
  33241. _this.getSortModel = function () {
  33242. return _this.getColumnsWithSortingOrdered().map(function (column) { return ({
  33243. colId: column.getColId(),
  33244. sort: column.getSort()
  33245. }); });
  33246. };
  33247. return _this;
  33248. }
  33249. SortController_1 = SortController;
  33250. SortController.prototype.progressSort = function (column, multiSort, source) {
  33251. if (source === void 0) { source = "api"; }
  33252. var nextDirection = this.getNextSortDirection(column);
  33253. this.setSortForColumn(column, nextDirection, multiSort, source);
  33254. };
  33255. SortController.prototype.setSortForColumn = function (column, sort, multiSort, source) {
  33256. if (source === void 0) { source = "api"; }
  33257. // auto correct - if sort not legal value, then set it to 'no sort' (which is null)
  33258. if (sort !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC && sort !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC) {
  33259. sort = null;
  33260. }
  33261. // update sort on current col
  33262. column.setSort(sort, source);
  33263. // sortedAt used for knowing order of cols when multi-col sort
  33264. if (column.getSort()) {
  33265. var sortedAt = Number(new Date().valueOf());
  33266. column.setSortedAt(sortedAt);
  33267. }
  33268. else {
  33269. column.setSortedAt(null);
  33270. }
  33271. var doingMultiSort = multiSort && !this.gridOptionsWrapper.isSuppressMultiSort();
  33272. // clear sort on all columns except this one, and update the icons
  33273. if (!doingMultiSort) {
  33274. this.clearSortBarThisColumn(column, source);
  33275. }
  33276. this.dispatchSortChangedEvents();
  33277. };
  33278. // gets called by API, so if data changes, use can call this, which will end up
  33279. // working out the sort order again of the rows.
  33280. SortController.prototype.onSortChanged = function () {
  33281. this.dispatchSortChangedEvents();
  33282. };
  33283. SortController.prototype.dispatchSortChangedEvents = function () {
  33284. var event = {
  33285. type: _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_SORT_CHANGED,
  33286. api: this.gridApi,
  33287. columnApi: this.columnApi
  33288. };
  33289. this.eventService.dispatchEvent(event);
  33290. };
  33291. SortController.prototype.clearSortBarThisColumn = function (columnToSkip, source) {
  33292. this.columnController.getPrimaryAndSecondaryAndAutoColumns().forEach(function (columnToClear) {
  33293. // Do not clear if either holding shift, or if column in question was clicked
  33294. if (!(columnToClear === columnToSkip)) {
  33295. // setting to 'undefined' as null means 'none' rather than cleared, otherwise issue will arise
  33296. // if sort order is: ['desc', null , 'asc'], as it will start at null rather than 'desc'.
  33297. columnToClear.setSort(undefined, source);
  33298. }
  33299. });
  33300. };
  33301. SortController.prototype.getNextSortDirection = function (column) {
  33302. var sortingOrder;
  33303. if (column.getColDef().sortingOrder) {
  33304. sortingOrder = column.getColDef().sortingOrder;
  33305. }
  33306. else if (this.gridOptionsWrapper.getSortingOrder()) {
  33307. sortingOrder = this.gridOptionsWrapper.getSortingOrder();
  33308. }
  33309. else {
  33310. sortingOrder = SortController_1.DEFAULT_SORTING_ORDER;
  33311. }
  33312. if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) {
  33313. console.warn("ag-grid: sortingOrder must be an array with at least one element, currently it's " + sortingOrder);
  33314. return null;
  33315. }
  33316. var currentIndex = sortingOrder.indexOf(column.getSort());
  33317. var notInArray = currentIndex < 0;
  33318. var lastItemInArray = currentIndex == sortingOrder.length - 1;
  33319. var result;
  33320. if (notInArray || lastItemInArray) {
  33321. result = sortingOrder[0];
  33322. }
  33323. else {
  33324. result = sortingOrder[currentIndex + 1];
  33325. }
  33326. // verify the sort type exists, as the user could provide the sortingOrder, need to make sure it's valid
  33327. if (SortController_1.DEFAULT_SORTING_ORDER.indexOf(result) < 0) {
  33328. console.warn('ag-grid: invalid sort type ' + result);
  33329. return null;
  33330. }
  33331. return result;
  33332. };
  33333. SortController.prototype.setSortModel = function (sortModel, source) {
  33334. var _this = this;
  33335. if (source === void 0) { source = "api"; }
  33336. // first up, clear any previous sort
  33337. var sortModelProvided = sortModel && sortModel.length > 0;
  33338. var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
  33339. allColumnsIncludingAuto.forEach(function (column) {
  33340. var sortForCol = null;
  33341. var sortedAt = -1;
  33342. if (sortModelProvided && column.getColDef().sortable) {
  33343. for (var j = 0; j < sortModel.length; j++) {
  33344. var sortModelEntry = sortModel[j];
  33345. if (typeof sortModelEntry.colId === 'string'
  33346. && typeof column.getColId() === 'string'
  33347. && _this.compareColIds(sortModelEntry, column)) {
  33348. sortForCol = sortModelEntry.sort;
  33349. sortedAt = j;
  33350. }
  33351. }
  33352. }
  33353. if (sortForCol) {
  33354. column.setSort(sortForCol, source);
  33355. column.setSortedAt(sortedAt);
  33356. }
  33357. else {
  33358. column.setSort(null, source);
  33359. column.setSortedAt(null);
  33360. }
  33361. });
  33362. this.dispatchSortChangedEvents();
  33363. };
  33364. SortController.prototype.compareColIds = function (sortModelEntry, column) {
  33365. return sortModelEntry.colId === column.getColId();
  33366. };
  33367. SortController.prototype.getColumnsWithSortingOrdered = function () {
  33368. // pull out all the columns that have sorting set
  33369. var allColumnsIncludingAuto = this.columnController.getPrimaryAndSecondaryAndAutoColumns();
  33370. var columnsWithSorting = allColumnsIncludingAuto.filter(function (column) { return !!column.getSort(); });
  33371. // put the columns in order of which one got sorted first
  33372. columnsWithSorting.sort(function (a, b) { return a.sortedAt - b.sortedAt; });
  33373. return columnsWithSorting;
  33374. };
  33375. // used by row controller, when doing the sorting
  33376. SortController.prototype.getSortForRowController = function () {
  33377. return this.getColumnsWithSortingOrdered().map(function (column) {
  33378. var isAscending = column.getSort() === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC;
  33379. return {
  33380. inverter: isAscending ? 1 : -1,
  33381. column: column
  33382. };
  33383. });
  33384. };
  33385. var SortController_1;
  33386. SortController.DEFAULT_SORTING_ORDER = [_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_ASC, _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].SORT_DESC, null];
  33387. __decorate([
  33388. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  33389. ], SortController.prototype, "gridOptionsWrapper", void 0);
  33390. __decorate([
  33391. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  33392. ], SortController.prototype, "columnController", void 0);
  33393. __decorate([
  33394. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  33395. ], SortController.prototype, "columnApi", void 0);
  33396. __decorate([
  33397. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  33398. ], SortController.prototype, "gridApi", void 0);
  33399. SortController = SortController_1 = __decorate([
  33400. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('sortController')
  33401. ], SortController);
  33402. return SortController;
  33403. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  33404. /***/ }),
  33405. /* 141 */
  33406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33407. "use strict";
  33408. __webpack_require__.r(__webpack_exports__);
  33409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FocusController", function() { return FocusController; });
  33410. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  33411. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  33412. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  33413. /* harmony import */ var _rendering_cellComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(101);
  33414. /* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(117);
  33415. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  33416. /**
  33417. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  33418. * @version v23.2.1
  33419. * @link http://www.ag-grid.com/
  33420. * @license MIT
  33421. */
  33422. var __extends = (undefined && undefined.__extends) || (function () {
  33423. var extendStatics = function (d, b) {
  33424. extendStatics = Object.setPrototypeOf ||
  33425. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  33426. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  33427. return extendStatics(d, b);
  33428. };
  33429. return function (d, b) {
  33430. extendStatics(d, b);
  33431. function __() { this.constructor = d; }
  33432. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  33433. };
  33434. })();
  33435. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  33436. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  33437. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  33438. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  33439. return c > 3 && r && Object.defineProperty(target, key, r), r;
  33440. };
  33441. var FocusController = /** @class */ (function (_super) {
  33442. __extends(FocusController, _super);
  33443. function FocusController() {
  33444. var _this = _super !== null && _super.apply(this, arguments) || this;
  33445. _this.keyboardFocusActive = false;
  33446. return _this;
  33447. }
  33448. FocusController_1 = FocusController;
  33449. FocusController.prototype.init = function () {
  33450. var eDocument = this.gridOptionsWrapper.getDocument();
  33451. var clearFocusedCellListener = this.clearFocusedCell.bind(this);
  33452. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED, clearFocusedCellListener);
  33453. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED, this.onColumnEverythingChanged.bind(this));
  33454. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_GROUP_OPENED, clearFocusedCellListener);
  33455. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, clearFocusedCellListener);
  33456. this.addManagedListener(eDocument, 'keydown', this.activateKeyboardMode.bind(this));
  33457. this.addManagedListener(eDocument, 'mousedown', this.activateMouseMode.bind(this));
  33458. };
  33459. FocusController.prototype.registerGridCore = function (gridCore) {
  33460. this.gridCore = gridCore;
  33461. };
  33462. FocusController.prototype.onColumnEverythingChanged = function () {
  33463. // if the columns change, check and see if this column still exists. if it does,
  33464. // then we can keep the focused cell. if it doesn't, then we need to drop the focused
  33465. // cell.
  33466. if (this.focusedCellPosition) {
  33467. var col = this.focusedCellPosition.column;
  33468. var colFromColumnController = this.columnController.getGridColumn(col.getId());
  33469. if (col !== colFromColumnController) {
  33470. this.clearFocusedCell();
  33471. }
  33472. }
  33473. };
  33474. FocusController.prototype.isKeyboardFocus = function () {
  33475. return this.keyboardFocusActive;
  33476. };
  33477. FocusController.prototype.activateMouseMode = function () {
  33478. this.keyboardFocusActive = false;
  33479. this.eventService.dispatchEvent({ type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_MOUSE_FOCUS });
  33480. };
  33481. FocusController.prototype.activateKeyboardMode = function () {
  33482. this.keyboardFocusActive = true;
  33483. this.eventService.dispatchEvent({ type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_KEYBOARD_FOCUS });
  33484. };
  33485. // we check if the browser is focusing something, and if it is, and
  33486. // it's the cell we think is focused, then return the cell. so this
  33487. // methods returns the cell if a) we think it has focus and b) the
  33488. // browser thinks it has focus. this then returns nothing if we
  33489. // first focus a cell, then second click outside the grid, as then the
  33490. // grid cell will still be focused as far as the grid is concerned,
  33491. // however the browser focus will have moved somewhere else.
  33492. FocusController.prototype.getFocusCellToUseAfterRefresh = function () {
  33493. if (this.gridOptionsWrapper.isSuppressFocusAfterRefresh() || !this.focusedCellPosition) {
  33494. return null;
  33495. }
  33496. // we check that the browser is actually focusing on the grid, if it is not, then
  33497. // we have nothing to worry about
  33498. var browserFocusedCell = this.getGridCellForDomElement(document.activeElement);
  33499. if (!browserFocusedCell) {
  33500. return null;
  33501. }
  33502. return this.focusedCellPosition;
  33503. };
  33504. FocusController.prototype.getGridCellForDomElement = function (eBrowserCell) {
  33505. var ePointer = eBrowserCell;
  33506. while (ePointer) {
  33507. var cellComp = this.gridOptionsWrapper.getDomData(ePointer, _rendering_cellComp__WEBPACK_IMPORTED_MODULE_3__["CellComp"].DOM_DATA_KEY_CELL_COMP);
  33508. if (cellComp) {
  33509. return cellComp.getCellPosition();
  33510. }
  33511. ePointer = ePointer.parentNode;
  33512. }
  33513. return null;
  33514. };
  33515. FocusController.prototype.clearFocusedCell = function () {
  33516. this.focusedCellPosition = null;
  33517. this.onCellFocused(false);
  33518. };
  33519. FocusController.prototype.getFocusedCell = function () {
  33520. return this.focusedCellPosition;
  33521. };
  33522. FocusController.prototype.setFocusedCell = function (rowIndex, colKey, floating, forceBrowserFocus) {
  33523. if (forceBrowserFocus === void 0) { forceBrowserFocus = false; }
  33524. var column = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].makeNull(this.columnController.getGridColumn(colKey));
  33525. this.focusedCellPosition = { rowIndex: rowIndex, rowPinned: _utils__WEBPACK_IMPORTED_MODULE_5__["_"].makeNull(floating), column: column };
  33526. this.onCellFocused(forceBrowserFocus);
  33527. };
  33528. FocusController.prototype.isCellFocused = function (cellPosition) {
  33529. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.focusedCellPosition)) {
  33530. return false;
  33531. }
  33532. return this.focusedCellPosition.column === cellPosition.column && this.isRowFocused(cellPosition.rowIndex, cellPosition.rowPinned);
  33533. };
  33534. FocusController.prototype.isRowNodeFocused = function (rowNode) {
  33535. return this.isRowFocused(rowNode.rowIndex, rowNode.rowPinned);
  33536. };
  33537. FocusController.prototype.isHeaderWrapperFocused = function (headerWrapper) {
  33538. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.focusedHeaderPosition)) {
  33539. return false;
  33540. }
  33541. var column = headerWrapper.getColumn();
  33542. var headerRowIndex = headerWrapper.getParentComponent().getRowIndex();
  33543. var pinned = headerWrapper.getPinned();
  33544. var _a = this.focusedHeaderPosition, focusedColumn = _a.column, focusedHeaderRowIndex = _a.headerRowIndex;
  33545. return column === focusedColumn &&
  33546. headerRowIndex === focusedHeaderRowIndex &&
  33547. pinned == focusedColumn.getPinned();
  33548. };
  33549. FocusController.prototype.clearFocusedHeader = function () {
  33550. this.focusedHeaderPosition = null;
  33551. };
  33552. FocusController.prototype.getFocusedHeader = function () {
  33553. return this.focusedHeaderPosition;
  33554. };
  33555. FocusController.prototype.setFocusedHeader = function (headerRowIndex, column) {
  33556. this.focusedHeaderPosition = { headerRowIndex: headerRowIndex, column: column };
  33557. };
  33558. FocusController.prototype.focusHeaderPosition = function (headerPosition, direction) {
  33559. this.headerNavigationService.scrollToColumn(headerPosition.column, direction);
  33560. var childContainer = this.headerNavigationService.getHeaderContainer(headerPosition.column.getPinned());
  33561. var rowComps = childContainer.getRowComps();
  33562. var nextRowComp = rowComps[headerPosition.headerRowIndex];
  33563. var headerComps = nextRowComp.getHeaderComps();
  33564. var nextHeader = headerComps[headerPosition.column.getUniqueId()];
  33565. if (nextHeader) {
  33566. // this will automatically call the setFocusedHeader method above
  33567. nextHeader.getFocusableElement().focus();
  33568. return true;
  33569. }
  33570. return false;
  33571. };
  33572. FocusController.prototype.isAnyCellFocused = function () {
  33573. return !!this.focusedCellPosition;
  33574. };
  33575. FocusController.prototype.isRowFocused = function (rowIndex, floating) {
  33576. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].missing(this.focusedCellPosition)) {
  33577. return false;
  33578. }
  33579. var floatingOrNull = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].makeNull(floating);
  33580. return this.focusedCellPosition.rowIndex === rowIndex && this.focusedCellPosition.rowPinned === floatingOrNull;
  33581. };
  33582. FocusController.prototype.findFocusableElements = function (rootNode, exclude, onlyUnmanaged) {
  33583. var focusableString = FocusController_1.FOCUSABLE_SELECTOR;
  33584. var excludeString = FocusController_1.FOCUSABLE_EXCLUDE;
  33585. if (exclude) {
  33586. excludeString += ', ' + exclude;
  33587. }
  33588. if (onlyUnmanaged) {
  33589. excludeString += ', [tabindex="-1"]';
  33590. }
  33591. var nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString));
  33592. var excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString));
  33593. if (!excludeNodes.length) {
  33594. return nodes;
  33595. }
  33596. var diff = function (a, b) { return a.filter(function (element) { return b.indexOf(element) === -1; }); };
  33597. return diff(nodes, excludeNodes);
  33598. };
  33599. FocusController.prototype.focusFirstFocusableElement = function (rootNode, onlyUnmanaged) {
  33600. var focusable = this.findFocusableElements(rootNode, null, onlyUnmanaged)[0];
  33601. if (focusable) {
  33602. focusable.focus();
  33603. return true;
  33604. }
  33605. return false;
  33606. };
  33607. FocusController.prototype.focusLastFocusableElement = function (rootNode, onlyUnmanaged) {
  33608. var focusable = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].last(this.findFocusableElements(rootNode, null, onlyUnmanaged));
  33609. if (focusable) {
  33610. focusable.focus();
  33611. return true;
  33612. }
  33613. return false;
  33614. };
  33615. FocusController.prototype.findNextFocusableElement = function (rootNode, onlyManaged, backwards) {
  33616. var focusable = this.findFocusableElements(rootNode, onlyManaged ? ':not([tabindex="-1"])' : null);
  33617. var currentIndex;
  33618. if (onlyManaged) {
  33619. currentIndex = _utils__WEBPACK_IMPORTED_MODULE_5__["_"].findIndex(focusable, function (el) { return el.contains(document.activeElement); });
  33620. }
  33621. else {
  33622. currentIndex = focusable.indexOf(document.activeElement);
  33623. }
  33624. var nextIndex = currentIndex + (backwards ? -1 : 1);
  33625. if (nextIndex < 0 || nextIndex > focusable.length) {
  33626. return;
  33627. }
  33628. return focusable[nextIndex];
  33629. };
  33630. FocusController.prototype.isFocusUnderManagedComponent = function (rootNode) {
  33631. var managedContainers = rootNode.querySelectorAll("." + _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_4__["ManagedFocusComponent"].FOCUS_MANAGED_CLASS);
  33632. if (!managedContainers.length) {
  33633. return false;
  33634. }
  33635. for (var i = 0; i < managedContainers.length; i++) {
  33636. if (managedContainers[i].contains(document.activeElement)) {
  33637. return true;
  33638. }
  33639. }
  33640. return false;
  33641. };
  33642. FocusController.prototype.findTabbableParent = function (node, limit) {
  33643. if (limit === void 0) { limit = 5; }
  33644. var counter = 0;
  33645. while (node && _utils__WEBPACK_IMPORTED_MODULE_5__["_"].getTabIndex(node) === null && ++counter <= limit) {
  33646. node = node.parentElement;
  33647. }
  33648. if (_utils__WEBPACK_IMPORTED_MODULE_5__["_"].getTabIndex(node) === null) {
  33649. return null;
  33650. }
  33651. return node;
  33652. };
  33653. FocusController.prototype.onCellFocused = function (forceBrowserFocus) {
  33654. var event = {
  33655. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_CELL_FOCUSED,
  33656. forceBrowserFocus: forceBrowserFocus,
  33657. rowIndex: null,
  33658. column: null,
  33659. floating: null,
  33660. api: this.gridApi,
  33661. columnApi: this.columnApi,
  33662. rowPinned: null
  33663. };
  33664. if (this.focusedCellPosition) {
  33665. event.rowIndex = this.focusedCellPosition.rowIndex;
  33666. event.column = this.focusedCellPosition.column;
  33667. event.rowPinned = this.focusedCellPosition.rowPinned;
  33668. }
  33669. this.eventService.dispatchEvent(event);
  33670. };
  33671. FocusController.prototype.focusGridView = function (column) {
  33672. var firstRow = this.rowPositionUtils.getFirstRow();
  33673. if (!firstRow) {
  33674. return false;
  33675. }
  33676. var rowIndex = firstRow.rowIndex, rowPinned = firstRow.rowPinned;
  33677. var focusedHeader = this.getFocusedHeader();
  33678. if (!column) {
  33679. column = focusedHeader.column;
  33680. }
  33681. if (!_utils__WEBPACK_IMPORTED_MODULE_5__["_"].exists(rowIndex)) {
  33682. return false;
  33683. }
  33684. this.rowRenderer.ensureCellVisible({ rowIndex: rowIndex, column: column, rowPinned: rowPinned });
  33685. this.setFocusedCell(rowIndex, column, _utils__WEBPACK_IMPORTED_MODULE_5__["_"].makeNull(rowPinned), true);
  33686. if (this.rangeController) {
  33687. var cellPosition = { rowIndex: rowIndex, rowPinned: rowPinned, column: column };
  33688. this.rangeController.setRangeToCell(cellPosition);
  33689. }
  33690. return true;
  33691. };
  33692. FocusController.prototype.focusNextGridCoreContainer = function (backwards) {
  33693. if (this.gridCore.focusNextInnerContainer(backwards)) {
  33694. return true;
  33695. }
  33696. if (!backwards) {
  33697. this.gridCore.forceFocusOutOfContainer();
  33698. }
  33699. };
  33700. var FocusController_1;
  33701. FocusController.FOCUSABLE_SELECTOR = '[tabindex], input, select, button, textarea';
  33702. FocusController.FOCUSABLE_EXCLUDE = '.ag-hidden, .ag-hidden *, .ag-disabled, .ag-disabled *';
  33703. __decorate([
  33704. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  33705. ], FocusController.prototype, "gridOptionsWrapper", void 0);
  33706. __decorate([
  33707. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  33708. ], FocusController.prototype, "columnController", void 0);
  33709. __decorate([
  33710. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('headerNavigationService')
  33711. ], FocusController.prototype, "headerNavigationService", void 0);
  33712. __decorate([
  33713. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  33714. ], FocusController.prototype, "columnApi", void 0);
  33715. __decorate([
  33716. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  33717. ], FocusController.prototype, "gridApi", void 0);
  33718. __decorate([
  33719. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  33720. ], FocusController.prototype, "rowRenderer", void 0);
  33721. __decorate([
  33722. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowPositionUtils')
  33723. ], FocusController.prototype, "rowPositionUtils", void 0);
  33724. __decorate([
  33725. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('rangeController')
  33726. ], FocusController.prototype, "rangeController", void 0);
  33727. __decorate([
  33728. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  33729. ], FocusController.prototype, "init", null);
  33730. FocusController = FocusController_1 = __decorate([
  33731. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('focusController')
  33732. ], FocusController);
  33733. return FocusController;
  33734. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  33735. /***/ }),
  33736. /* 142 */
  33737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33738. "use strict";
  33739. __webpack_require__.r(__webpack_exports__);
  33740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseEventService", function() { return MouseEventService; });
  33741. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  33742. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  33743. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  33744. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  33745. /**
  33746. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  33747. * @version v23.2.1
  33748. * @link http://www.ag-grid.com/
  33749. * @license MIT
  33750. */
  33751. var __extends = (undefined && undefined.__extends) || (function () {
  33752. var extendStatics = function (d, b) {
  33753. extendStatics = Object.setPrototypeOf ||
  33754. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  33755. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  33756. return extendStatics(d, b);
  33757. };
  33758. return function (d, b) {
  33759. extendStatics(d, b);
  33760. function __() { this.constructor = d; }
  33761. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  33762. };
  33763. })();
  33764. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  33765. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  33766. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  33767. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  33768. return c > 3 && r && Object.defineProperty(target, key, r), r;
  33769. };
  33770. var MouseEventService = /** @class */ (function (_super) {
  33771. __extends(MouseEventService, _super);
  33772. function MouseEventService() {
  33773. var _this = _super !== null && _super.apply(this, arguments) || this;
  33774. _this.gridInstanceId = MouseEventService_1.gridInstanceSequence.next();
  33775. return _this;
  33776. }
  33777. MouseEventService_1 = MouseEventService;
  33778. MouseEventService.prototype.init = function () {
  33779. this.stampDomElementWithGridInstance();
  33780. };
  33781. MouseEventService.prototype.registerGridComp = function (gridPanel) {
  33782. this.gridPanel = gridPanel;
  33783. };
  33784. // we put the instance id onto the main DOM element. this is used for events, when grids are inside grids,
  33785. // so the grid can work out if the even came from this grid or a grid inside this one. see the ctrl+v logic
  33786. // for where this is used.
  33787. MouseEventService.prototype.stampDomElementWithGridInstance = function () {
  33788. this.eGridDiv[MouseEventService_1.GRID_DOM_KEY] = this.gridInstanceId;
  33789. };
  33790. MouseEventService.prototype.getRenderedCellForEvent = function (event) {
  33791. return _utils__WEBPACK_IMPORTED_MODULE_1__["_"].getCellCompForEvent(this.gridOptionsWrapper, event);
  33792. };
  33793. // walks the path of the event, and returns true if this grid is the first one that it finds. if doing
  33794. // master / detail grids, and a child grid is found, then it returns false. this stops things like copy/paste
  33795. // getting executed on many grids at the same time.
  33796. MouseEventService.prototype.isEventFromThisGrid = function (event) {
  33797. var path = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].getEventPath(event);
  33798. for (var i = 0; i < path.length; i++) {
  33799. var element = path[i];
  33800. var instanceId = element[MouseEventService_1.GRID_DOM_KEY];
  33801. if (_utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(instanceId)) {
  33802. var eventFromThisGrid = instanceId === this.gridInstanceId;
  33803. return eventFromThisGrid;
  33804. }
  33805. }
  33806. return false;
  33807. };
  33808. MouseEventService.prototype.getCellPositionForEvent = function (event) {
  33809. var cellComp = this.getRenderedCellForEvent(event);
  33810. return cellComp ? cellComp.getCellPosition() : null;
  33811. };
  33812. MouseEventService.prototype.getNormalisedPosition = function (event) {
  33813. var gridPanelHasScrolls = this.gridOptionsWrapper.getDomLayout() === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].DOM_LAYOUT_NORMAL;
  33814. var x = event.x, y = event.y;
  33815. if (gridPanelHasScrolls) {
  33816. var vRange = this.gridPanel.getVScrollPosition();
  33817. var hRange = this.gridPanel.getHScrollPosition();
  33818. return { x: x + hRange.left, y: y + vRange.top };
  33819. }
  33820. return { x: x, y: y };
  33821. };
  33822. var MouseEventService_1;
  33823. MouseEventService.gridInstanceSequence = new _utils__WEBPACK_IMPORTED_MODULE_1__["NumberSequence"]();
  33824. MouseEventService.GRID_DOM_KEY = '__ag_grid_instance';
  33825. __decorate([
  33826. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  33827. ], MouseEventService.prototype, "gridOptionsWrapper", void 0);
  33828. __decorate([
  33829. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
  33830. ], MouseEventService.prototype, "eGridDiv", void 0);
  33831. __decorate([
  33832. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  33833. ], MouseEventService.prototype, "init", null);
  33834. MouseEventService = MouseEventService_1 = __decorate([
  33835. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('mouseEventService')
  33836. ], MouseEventService);
  33837. return MouseEventService;
  33838. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  33839. /***/ }),
  33840. /* 143 */
  33841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33842. "use strict";
  33843. __webpack_require__.r(__webpack_exports__);
  33844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellNavigationService", function() { return CellNavigationService; });
  33845. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  33846. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  33847. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  33848. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  33849. /**
  33850. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  33851. * @version v23.2.1
  33852. * @link http://www.ag-grid.com/
  33853. * @license MIT
  33854. */
  33855. var __extends = (undefined && undefined.__extends) || (function () {
  33856. var extendStatics = function (d, b) {
  33857. extendStatics = Object.setPrototypeOf ||
  33858. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  33859. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  33860. return extendStatics(d, b);
  33861. };
  33862. return function (d, b) {
  33863. extendStatics(d, b);
  33864. function __() { this.constructor = d; }
  33865. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  33866. };
  33867. })();
  33868. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  33869. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  33870. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  33871. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  33872. return c > 3 && r && Object.defineProperty(target, key, r), r;
  33873. };
  33874. var CellNavigationService = /** @class */ (function (_super) {
  33875. __extends(CellNavigationService, _super);
  33876. function CellNavigationService() {
  33877. return _super !== null && _super.apply(this, arguments) || this;
  33878. }
  33879. // returns null if no cell to focus on, ie at the end of the grid
  33880. CellNavigationService.prototype.getNextCellToFocus = function (key, lastCellToFocus) {
  33881. // starting with the provided cell, we keep moving until we find a cell we can
  33882. // focus on.
  33883. var pointer = lastCellToFocus;
  33884. var finished = false;
  33885. // finished will be true when either:
  33886. // a) cell found that we can focus on
  33887. // b) run out of cells (ie the method returns null)
  33888. while (!finished) {
  33889. switch (key) {
  33890. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_UP:
  33891. pointer = this.getCellAbove(pointer);
  33892. break;
  33893. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_DOWN:
  33894. pointer = this.getCellBelow(pointer);
  33895. break;
  33896. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_RIGHT:
  33897. if (this.gridOptionsWrapper.isEnableRtl()) {
  33898. pointer = this.getCellToLeft(pointer);
  33899. }
  33900. else {
  33901. pointer = this.getCellToRight(pointer);
  33902. }
  33903. break;
  33904. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_LEFT:
  33905. if (this.gridOptionsWrapper.isEnableRtl()) {
  33906. pointer = this.getCellToRight(pointer);
  33907. }
  33908. else {
  33909. pointer = this.getCellToLeft(pointer);
  33910. }
  33911. break;
  33912. default:
  33913. pointer = null;
  33914. console.warn('ag-Grid: unknown key for navigation ' + key);
  33915. break;
  33916. }
  33917. if (pointer) {
  33918. finished = this.isCellGoodToFocusOn(pointer);
  33919. }
  33920. else {
  33921. finished = true;
  33922. }
  33923. }
  33924. return pointer;
  33925. };
  33926. CellNavigationService.prototype.isCellGoodToFocusOn = function (gridCell) {
  33927. var column = gridCell.column;
  33928. var rowNode;
  33929. switch (gridCell.rowPinned) {
  33930. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP:
  33931. rowNode = this.pinnedRowModel.getPinnedTopRow(gridCell.rowIndex);
  33932. break;
  33933. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM:
  33934. rowNode = this.pinnedRowModel.getPinnedBottomRow(gridCell.rowIndex);
  33935. break;
  33936. default:
  33937. rowNode = this.rowModel.getRow(gridCell.rowIndex);
  33938. break;
  33939. }
  33940. var suppressNavigable = column.isSuppressNavigable(rowNode);
  33941. return !suppressNavigable;
  33942. };
  33943. CellNavigationService.prototype.getCellToLeft = function (lastCell) {
  33944. if (!lastCell) {
  33945. return null;
  33946. }
  33947. var colToLeft = this.columnController.getDisplayedColBefore(lastCell.column);
  33948. if (!colToLeft) {
  33949. return null;
  33950. }
  33951. return {
  33952. rowIndex: lastCell.rowIndex,
  33953. column: colToLeft,
  33954. rowPinned: lastCell.rowPinned
  33955. };
  33956. };
  33957. CellNavigationService.prototype.getCellToRight = function (lastCell) {
  33958. if (!lastCell) {
  33959. return null;
  33960. }
  33961. var colToRight = this.columnController.getDisplayedColAfter(lastCell.column);
  33962. // if already on right, do nothing
  33963. if (!colToRight) {
  33964. return null;
  33965. }
  33966. return {
  33967. rowIndex: lastCell.rowIndex,
  33968. column: colToRight,
  33969. rowPinned: lastCell.rowPinned
  33970. };
  33971. };
  33972. CellNavigationService.prototype.getRowBelow = function (rowPosition) {
  33973. // if already on top row, do nothing
  33974. var index = rowPosition.rowIndex;
  33975. var pinned = rowPosition.rowPinned;
  33976. if (this.isLastRowInContainer(rowPosition)) {
  33977. switch (pinned) {
  33978. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM:
  33979. // never any rows after pinned bottom
  33980. return null;
  33981. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP:
  33982. // if on last row of pinned top, then next row is main body (if rows exist),
  33983. // otherwise it's the pinned bottom
  33984. if (this.rowModel.isRowsToRender()) {
  33985. return { rowIndex: 0, rowPinned: null };
  33986. }
  33987. else if (this.pinnedRowModel.isRowsToRender(_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM)) {
  33988. return { rowIndex: 0, rowPinned: _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM };
  33989. }
  33990. return null;
  33991. default:
  33992. // if in the main body, then try pinned bottom, otherwise return nothing
  33993. if (this.pinnedRowModel.isRowsToRender(_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM)) {
  33994. return { rowIndex: 0, rowPinned: _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM };
  33995. }
  33996. return null;
  33997. }
  33998. }
  33999. return { rowIndex: index + 1, rowPinned: pinned };
  34000. };
  34001. CellNavigationService.prototype.getCellBelow = function (lastCell) {
  34002. if (!lastCell) {
  34003. return null;
  34004. }
  34005. var rowBelow = this.getRowBelow(lastCell);
  34006. if (rowBelow) {
  34007. return {
  34008. rowIndex: rowBelow.rowIndex,
  34009. column: lastCell.column,
  34010. rowPinned: rowBelow.rowPinned
  34011. };
  34012. }
  34013. return null;
  34014. };
  34015. CellNavigationService.prototype.isLastRowInContainer = function (rowPosition) {
  34016. var pinned = rowPosition.rowPinned;
  34017. var index = rowPosition.rowIndex;
  34018. if (pinned === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP) {
  34019. var lastTopIndex = this.pinnedRowModel.getPinnedTopRowData().length - 1;
  34020. return lastTopIndex <= index;
  34021. }
  34022. else if (pinned === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM) {
  34023. var lastBottomIndex = this.pinnedRowModel.getPinnedBottomRowData().length - 1;
  34024. return lastBottomIndex <= index;
  34025. }
  34026. var lastBodyIndex = this.rowModel.getRowCount() - 1;
  34027. return lastBodyIndex <= index;
  34028. };
  34029. CellNavigationService.prototype.getRowAbove = function (rowPosition) {
  34030. // if already on top row, do nothing
  34031. var index = rowPosition.rowIndex;
  34032. var pinned = rowPosition.rowPinned;
  34033. // if already on top row, do nothing
  34034. if (index === 0) {
  34035. if (pinned === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP) {
  34036. return null;
  34037. }
  34038. else if (!pinned) {
  34039. if (this.pinnedRowModel.isRowsToRender(_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP)) {
  34040. return this.getLastFloatingTopRow();
  34041. }
  34042. return null;
  34043. }
  34044. else {
  34045. // last floating bottom
  34046. if (this.rowModel.isRowsToRender()) {
  34047. return this.getLastBodyCell();
  34048. }
  34049. else if (this.pinnedRowModel.isRowsToRender(_constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP)) {
  34050. return this.getLastFloatingTopRow();
  34051. }
  34052. return null;
  34053. }
  34054. }
  34055. return { rowIndex: index - 1, rowPinned: pinned };
  34056. };
  34057. CellNavigationService.prototype.getCellAbove = function (lastCell) {
  34058. if (!lastCell) {
  34059. return null;
  34060. }
  34061. var rowAbove = this.getRowAbove({ rowIndex: lastCell.rowIndex, rowPinned: lastCell.rowPinned });
  34062. if (rowAbove) {
  34063. return {
  34064. rowIndex: rowAbove.rowIndex,
  34065. column: lastCell.column,
  34066. rowPinned: rowAbove.rowPinned
  34067. };
  34068. }
  34069. return null;
  34070. };
  34071. CellNavigationService.prototype.getLastBodyCell = function () {
  34072. var lastBodyRow = this.rowModel.getRowCount() - 1;
  34073. return { rowIndex: lastBodyRow, rowPinned: null };
  34074. };
  34075. CellNavigationService.prototype.getLastFloatingTopRow = function () {
  34076. var lastFloatingRow = this.pinnedRowModel.getPinnedTopRowData().length - 1;
  34077. return { rowIndex: lastFloatingRow, rowPinned: _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP };
  34078. };
  34079. CellNavigationService.prototype.getNextTabbedCell = function (gridCell, backwards) {
  34080. if (backwards) {
  34081. return this.getNextTabbedCellBackwards(gridCell);
  34082. }
  34083. return this.getNextTabbedCellForwards(gridCell);
  34084. };
  34085. CellNavigationService.prototype.getNextTabbedCellForwards = function (gridCell) {
  34086. var displayedColumns = this.columnController.getAllDisplayedColumns();
  34087. var newRowIndex = gridCell.rowIndex;
  34088. var newFloating = gridCell.rowPinned;
  34089. // move along to the next cell
  34090. var newColumn = this.columnController.getDisplayedColAfter(gridCell.column);
  34091. // check if end of the row, and if so, go forward a row
  34092. if (!newColumn) {
  34093. newColumn = displayedColumns[0];
  34094. var rowBelow = this.getRowBelow(gridCell);
  34095. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].missing(rowBelow)) {
  34096. return null;
  34097. }
  34098. newRowIndex = rowBelow ? rowBelow.rowIndex : null;
  34099. newFloating = rowBelow ? rowBelow.rowPinned : null;
  34100. }
  34101. return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };
  34102. };
  34103. CellNavigationService.prototype.getNextTabbedCellBackwards = function (gridCell) {
  34104. var displayedColumns = this.columnController.getAllDisplayedColumns();
  34105. var newRowIndex = gridCell.rowIndex;
  34106. var newFloating = gridCell.rowPinned;
  34107. // move along to the next cell
  34108. var newColumn = this.columnController.getDisplayedColBefore(gridCell.column);
  34109. // check if end of the row, and if so, go forward a row
  34110. if (!newColumn) {
  34111. newColumn = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].last(displayedColumns);
  34112. var rowAbove = this.getRowAbove({ rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned });
  34113. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].missing(rowAbove)) {
  34114. return null;
  34115. }
  34116. newRowIndex = rowAbove ? rowAbove.rowIndex : null;
  34117. newFloating = rowAbove ? rowAbove.rowPinned : null;
  34118. }
  34119. return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating };
  34120. };
  34121. __decorate([
  34122. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  34123. ], CellNavigationService.prototype, "columnController", void 0);
  34124. __decorate([
  34125. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  34126. ], CellNavigationService.prototype, "rowModel", void 0);
  34127. __decorate([
  34128. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('pinnedRowModel')
  34129. ], CellNavigationService.prototype, "pinnedRowModel", void 0);
  34130. __decorate([
  34131. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  34132. ], CellNavigationService.prototype, "gridOptionsWrapper", void 0);
  34133. CellNavigationService = __decorate([
  34134. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('cellNavigationService')
  34135. ], CellNavigationService);
  34136. return CellNavigationService;
  34137. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  34138. /***/ }),
  34139. /* 144 */
  34140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34141. "use strict";
  34142. __webpack_require__.r(__webpack_exports__);
  34143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellRendererFactory", function() { return CellRendererFactory; });
  34144. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34145. /* harmony import */ var _cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(77);
  34146. /* harmony import */ var _cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76);
  34147. /* harmony import */ var _cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67);
  34148. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  34149. /**
  34150. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34151. * @version v23.2.1
  34152. * @link http://www.ag-grid.com/
  34153. * @license MIT
  34154. */
  34155. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34156. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34157. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34158. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34159. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34160. };
  34161. var CellRendererFactory = /** @class */ (function () {
  34162. function CellRendererFactory() {
  34163. this.cellRendererMap = {};
  34164. }
  34165. CellRendererFactory_1 = CellRendererFactory;
  34166. CellRendererFactory.prototype.init = function () {
  34167. this.cellRendererMap[CellRendererFactory_1.ANIMATE_SLIDE] = _cellRenderers_animateSlideCellRenderer__WEBPACK_IMPORTED_MODULE_1__["AnimateSlideCellRenderer"];
  34168. this.cellRendererMap[CellRendererFactory_1.ANIMATE_SHOW_CHANGE] = _cellRenderers_animateShowChangeCellRenderer__WEBPACK_IMPORTED_MODULE_2__["AnimateShowChangeCellRenderer"];
  34169. this.cellRendererMap[CellRendererFactory_1.GROUP] = _cellRenderers_groupCellRenderer__WEBPACK_IMPORTED_MODULE_3__["GroupCellRenderer"];
  34170. // this.registerRenderersFromGridOptions();
  34171. };
  34172. // private registerRenderersFromGridOptions(): void {
  34173. // let userProvidedCellRenderers = this.gridOptionsWrapper.getCellRenderers();
  34174. // _.iterateObject(userProvidedCellRenderers, (key: string, cellRenderer: {new(): ICellRenderer} | ICellRendererFunc)=> {
  34175. // this.addCellRenderer(key, cellRenderer);
  34176. // });
  34177. // }
  34178. CellRendererFactory.prototype.addCellRenderer = function (key, cellRenderer) {
  34179. this.cellRendererMap[key] = cellRenderer;
  34180. };
  34181. CellRendererFactory.prototype.getCellRenderer = function (key) {
  34182. var result = this.cellRendererMap[key];
  34183. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].missing(result)) {
  34184. console.warn('ag-Grid: unable to find cellRenderer for key ' + key);
  34185. return null;
  34186. }
  34187. return result;
  34188. };
  34189. var CellRendererFactory_1;
  34190. CellRendererFactory.ANIMATE_SLIDE = 'animateSlide';
  34191. CellRendererFactory.ANIMATE_SHOW_CHANGE = 'animateShowChange';
  34192. CellRendererFactory.GROUP = 'group';
  34193. __decorate([
  34194. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  34195. ], CellRendererFactory.prototype, "gridOptionsWrapper", void 0);
  34196. __decorate([
  34197. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
  34198. ], CellRendererFactory.prototype, "expressionService", void 0);
  34199. __decorate([
  34200. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eventService')
  34201. ], CellRendererFactory.prototype, "eventService", void 0);
  34202. __decorate([
  34203. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  34204. ], CellRendererFactory.prototype, "init", null);
  34205. CellRendererFactory = CellRendererFactory_1 = __decorate([
  34206. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('cellRendererFactory')
  34207. ], CellRendererFactory);
  34208. return CellRendererFactory;
  34209. }());
  34210. /***/ }),
  34211. /* 145 */
  34212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34213. "use strict";
  34214. __webpack_require__.r(__webpack_exports__);
  34215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueFormatterService", function() { return ValueFormatterService; });
  34216. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34217. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  34218. /**
  34219. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34220. * @version v23.2.1
  34221. * @link http://www.ag-grid.com/
  34222. * @license MIT
  34223. */
  34224. var __extends = (undefined && undefined.__extends) || (function () {
  34225. var extendStatics = function (d, b) {
  34226. extendStatics = Object.setPrototypeOf ||
  34227. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34228. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34229. return extendStatics(d, b);
  34230. };
  34231. return function (d, b) {
  34232. extendStatics(d, b);
  34233. function __() { this.constructor = d; }
  34234. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34235. };
  34236. })();
  34237. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34238. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34239. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34240. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34241. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34242. };
  34243. var ValueFormatterService = /** @class */ (function (_super) {
  34244. __extends(ValueFormatterService, _super);
  34245. function ValueFormatterService() {
  34246. return _super !== null && _super.apply(this, arguments) || this;
  34247. }
  34248. ValueFormatterService.prototype.formatValue = function (column, node, $scope, value, suppliedFormatter, useFormatterFromColumn) {
  34249. if (useFormatterFromColumn === void 0) { useFormatterFromColumn = true; }
  34250. var result = null;
  34251. var formatter;
  34252. var colDef = column.getColDef();
  34253. if (suppliedFormatter) {
  34254. // use supplied formatter if provided, e.g. set filter items can have their own value formatters
  34255. formatter = suppliedFormatter;
  34256. }
  34257. else if (useFormatterFromColumn) {
  34258. // if row is pinned, give preference to the pinned formatter
  34259. formatter = node && node.rowPinned && colDef.pinnedRowValueFormatter ?
  34260. colDef.pinnedRowValueFormatter : colDef.valueFormatter;
  34261. }
  34262. if (formatter) {
  34263. var params = {
  34264. value: value,
  34265. node: node,
  34266. data: node ? node.data : null,
  34267. colDef: colDef,
  34268. column: column,
  34269. api: this.gridOptionsWrapper.getApi(),
  34270. columnApi: this.gridOptionsWrapper.getColumnApi(),
  34271. context: this.gridOptionsWrapper.getContext()
  34272. };
  34273. // originally we put the angular 1 scope here, but we don't want the scope
  34274. // in the params interface, as other frameworks will see the interface, and
  34275. // angular 1 is not cool any more. so we hack the scope in here (we cannot
  34276. // include it above, as it's not in the interface, so would cause a compile error).
  34277. // in the future, when we stop supporting angular 1, we can take this out.
  34278. params.$scope = $scope;
  34279. result = this.expressionService.evaluate(formatter, params);
  34280. }
  34281. else if (colDef.refData) {
  34282. return colDef.refData[value] || '';
  34283. }
  34284. // if we don't do this, then arrays get displayed as 1,2,3, but we want 1, 2, 3 (i.e. with spaces)
  34285. if (result == null && Array.isArray(value)) {
  34286. result = value.join(', ');
  34287. }
  34288. return result;
  34289. };
  34290. __decorate([
  34291. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  34292. ], ValueFormatterService.prototype, "gridOptionsWrapper", void 0);
  34293. __decorate([
  34294. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
  34295. ], ValueFormatterService.prototype, "expressionService", void 0);
  34296. ValueFormatterService = __decorate([
  34297. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('valueFormatterService')
  34298. ], ValueFormatterService);
  34299. return ValueFormatterService;
  34300. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  34301. /***/ }),
  34302. /* 146 */
  34303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34304. "use strict";
  34305. __webpack_require__.r(__webpack_exports__);
  34306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgRadioButton", function() { return AgRadioButton; });
  34307. /* harmony import */ var _agCheckbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70);
  34308. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44);
  34309. /**
  34310. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34311. * @version v23.2.1
  34312. * @link http://www.ag-grid.com/
  34313. * @license MIT
  34314. */
  34315. var __extends = (undefined && undefined.__extends) || (function () {
  34316. var extendStatics = function (d, b) {
  34317. extendStatics = Object.setPrototypeOf ||
  34318. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34319. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34320. return extendStatics(d, b);
  34321. };
  34322. return function (d, b) {
  34323. extendStatics(d, b);
  34324. function __() { this.constructor = d; }
  34325. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34326. };
  34327. })();
  34328. var AgRadioButton = /** @class */ (function (_super) {
  34329. __extends(AgRadioButton, _super);
  34330. function AgRadioButton() {
  34331. var _this = _super !== null && _super.apply(this, arguments) || this;
  34332. _this.className = 'ag-radio-button';
  34333. _this.inputType = 'radio';
  34334. return _this;
  34335. }
  34336. AgRadioButton.prototype.isSelected = function () {
  34337. return this.eInput.checked;
  34338. };
  34339. AgRadioButton.prototype.toggle = function () {
  34340. var nextValue = this.getNextValue();
  34341. this.setValue(nextValue);
  34342. };
  34343. AgRadioButton.prototype.addInputListeners = function () {
  34344. _super.prototype.addInputListeners.call(this);
  34345. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CHECKBOX_CHANGED, this.onChange.bind(this));
  34346. };
  34347. /**
  34348. * This ensures that if another radio button in the same named group is selected, we deselect this radio button.
  34349. * By default the browser does this for you, but we are managing classes ourselves in order to ensure input
  34350. * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected,
  34351. * not deselected, so we need to use our own event.
  34352. */
  34353. AgRadioButton.prototype.onChange = function (event) {
  34354. if (event.selected &&
  34355. event.name &&
  34356. this.eInput.name &&
  34357. this.eInput.name === event.name &&
  34358. event.id &&
  34359. this.eInput.id !== event.id) {
  34360. this.setValue(false, true);
  34361. }
  34362. };
  34363. return AgRadioButton;
  34364. }(_agCheckbox__WEBPACK_IMPORTED_MODULE_0__["AgCheckbox"]));
  34365. /***/ }),
  34366. /* 147 */
  34367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34368. "use strict";
  34369. __webpack_require__.r(__webpack_exports__);
  34370. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VanillaFrameworkOverrides", function() { return VanillaFrameworkOverrides; });
  34371. /**
  34372. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34373. * @version v23.2.1
  34374. * @link http://www.ag-grid.com/
  34375. * @license MIT
  34376. */
  34377. /** The base frameworks, eg React & Angular 2, override this bean with implementations specific to their requirement. */
  34378. var VanillaFrameworkOverrides = /** @class */ (function () {
  34379. function VanillaFrameworkOverrides() {
  34380. }
  34381. // for Vanilla JS, we use simple timeout
  34382. VanillaFrameworkOverrides.prototype.setTimeout = function (action, timeout) {
  34383. window.setTimeout(action, timeout);
  34384. };
  34385. // for Vanilla JS, we just add the event to the element
  34386. VanillaFrameworkOverrides.prototype.addEventListenerOutsideAngular = function (element, type, listener, useCapture) {
  34387. element.addEventListener(type, listener, useCapture);
  34388. };
  34389. return VanillaFrameworkOverrides;
  34390. }());
  34391. /***/ }),
  34392. /* 148 */
  34393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34394. "use strict";
  34395. __webpack_require__.r(__webpack_exports__);
  34396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollVisibleService", function() { return ScrollVisibleService; });
  34397. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34398. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  34399. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  34400. /**
  34401. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34402. * @version v23.2.1
  34403. * @link http://www.ag-grid.com/
  34404. * @license MIT
  34405. */
  34406. var __extends = (undefined && undefined.__extends) || (function () {
  34407. var extendStatics = function (d, b) {
  34408. extendStatics = Object.setPrototypeOf ||
  34409. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34410. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34411. return extendStatics(d, b);
  34412. };
  34413. return function (d, b) {
  34414. extendStatics(d, b);
  34415. function __() { this.constructor = d; }
  34416. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34417. };
  34418. })();
  34419. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34420. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34421. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34422. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34423. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34424. };
  34425. var ScrollVisibleService = /** @class */ (function (_super) {
  34426. __extends(ScrollVisibleService, _super);
  34427. function ScrollVisibleService() {
  34428. return _super !== null && _super.apply(this, arguments) || this;
  34429. }
  34430. ScrollVisibleService.prototype.setScrollsVisible = function (params) {
  34431. var atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing ||
  34432. this.verticalScrollShowing !== params.verticalScrollShowing;
  34433. if (atLeastOneDifferent) {
  34434. this.horizontalScrollShowing = params.horizontalScrollShowing;
  34435. this.verticalScrollShowing = params.verticalScrollShowing;
  34436. var event_1 = {
  34437. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_SCROLL_VISIBILITY_CHANGED,
  34438. api: this.gridApi,
  34439. columnApi: this.columnApi
  34440. };
  34441. this.eventService.dispatchEvent(event_1);
  34442. }
  34443. };
  34444. // used by pagination service - to know page height
  34445. ScrollVisibleService.prototype.isHorizontalScrollShowing = function () {
  34446. return this.horizontalScrollShowing;
  34447. };
  34448. // used by header container
  34449. ScrollVisibleService.prototype.isVerticalScrollShowing = function () {
  34450. return this.verticalScrollShowing;
  34451. };
  34452. __decorate([
  34453. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  34454. ], ScrollVisibleService.prototype, "columnController", void 0);
  34455. __decorate([
  34456. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  34457. ], ScrollVisibleService.prototype, "columnApi", void 0);
  34458. __decorate([
  34459. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  34460. ], ScrollVisibleService.prototype, "gridApi", void 0);
  34461. __decorate([
  34462. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  34463. ], ScrollVisibleService.prototype, "gridOptionsWrapper", void 0);
  34464. ScrollVisibleService = __decorate([
  34465. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('scrollVisibleService')
  34466. ], ScrollVisibleService);
  34467. return ScrollVisibleService;
  34468. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  34469. /***/ }),
  34470. /* 149 */
  34471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34472. "use strict";
  34473. __webpack_require__.r(__webpack_exports__);
  34474. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylingService", function() { return StylingService; });
  34475. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34476. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  34477. /**
  34478. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34479. * @version v23.2.1
  34480. * @link http://www.ag-grid.com/
  34481. * @license MIT
  34482. */
  34483. var __extends = (undefined && undefined.__extends) || (function () {
  34484. var extendStatics = function (d, b) {
  34485. extendStatics = Object.setPrototypeOf ||
  34486. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34487. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34488. return extendStatics(d, b);
  34489. };
  34490. return function (d, b) {
  34491. extendStatics(d, b);
  34492. function __() { this.constructor = d; }
  34493. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34494. };
  34495. })();
  34496. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34497. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34498. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34499. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34500. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34501. };
  34502. var StylingService = /** @class */ (function (_super) {
  34503. __extends(StylingService, _super);
  34504. function StylingService() {
  34505. return _super !== null && _super.apply(this, arguments) || this;
  34506. }
  34507. StylingService.prototype.processAllCellClasses = function (colDef, params, onApplicableClass, onNotApplicableClass) {
  34508. this.processClassRules(colDef.cellClassRules, params, onApplicableClass, onNotApplicableClass);
  34509. this.processStaticCellClasses(colDef, params, onApplicableClass);
  34510. };
  34511. StylingService.prototype.processClassRules = function (classRules, params, onApplicableClass, onNotApplicableClass) {
  34512. if (typeof classRules === 'object' && classRules !== null) {
  34513. var classNames = Object.keys(classRules);
  34514. for (var i = 0; i < classNames.length; i++) {
  34515. var className = classNames[i];
  34516. var rule = classRules[className];
  34517. var resultOfRule = void 0;
  34518. if (typeof rule === 'string') {
  34519. resultOfRule = this.expressionService.evaluate(rule, params);
  34520. }
  34521. else if (typeof rule === 'function') {
  34522. resultOfRule = rule(params);
  34523. }
  34524. if (resultOfRule) {
  34525. onApplicableClass(className);
  34526. }
  34527. else if (onNotApplicableClass) {
  34528. onNotApplicableClass(className);
  34529. }
  34530. }
  34531. }
  34532. };
  34533. StylingService.prototype.processStaticCellClasses = function (colDef, params, onApplicableClass) {
  34534. var cellClass = colDef.cellClass;
  34535. if (cellClass) {
  34536. var classOrClasses = void 0;
  34537. if (typeof colDef.cellClass === 'function') {
  34538. var cellClassFunc = colDef.cellClass;
  34539. classOrClasses = cellClassFunc(params);
  34540. }
  34541. else {
  34542. classOrClasses = colDef.cellClass;
  34543. }
  34544. if (typeof classOrClasses === 'string') {
  34545. onApplicableClass(classOrClasses);
  34546. }
  34547. else if (Array.isArray(classOrClasses)) {
  34548. classOrClasses.forEach(function (cssClassItem) {
  34549. onApplicableClass(cssClassItem);
  34550. });
  34551. }
  34552. }
  34553. };
  34554. __decorate([
  34555. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
  34556. ], StylingService.prototype, "expressionService", void 0);
  34557. StylingService = __decorate([
  34558. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('stylingService')
  34559. ], StylingService);
  34560. return StylingService;
  34561. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  34562. /***/ }),
  34563. /* 150 */
  34564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34565. "use strict";
  34566. __webpack_require__.r(__webpack_exports__);
  34567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnHoverService", function() { return ColumnHoverService; });
  34568. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34569. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  34570. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  34571. /**
  34572. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34573. * @version v23.2.1
  34574. * @link http://www.ag-grid.com/
  34575. * @license MIT
  34576. */
  34577. var __extends = (undefined && undefined.__extends) || (function () {
  34578. var extendStatics = function (d, b) {
  34579. extendStatics = Object.setPrototypeOf ||
  34580. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34581. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34582. return extendStatics(d, b);
  34583. };
  34584. return function (d, b) {
  34585. extendStatics(d, b);
  34586. function __() { this.constructor = d; }
  34587. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34588. };
  34589. })();
  34590. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34591. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34592. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34593. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34594. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34595. };
  34596. var ColumnHoverService = /** @class */ (function (_super) {
  34597. __extends(ColumnHoverService, _super);
  34598. function ColumnHoverService() {
  34599. return _super !== null && _super.apply(this, arguments) || this;
  34600. }
  34601. ColumnHoverService.prototype.setMouseOver = function (columns) {
  34602. this.selectedColumns = columns;
  34603. var event = {
  34604. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_HOVER_CHANGED,
  34605. api: this.gridApi,
  34606. columnApi: this.columnApi
  34607. };
  34608. this.eventService.dispatchEvent(event);
  34609. };
  34610. ColumnHoverService.prototype.clearMouseOver = function () {
  34611. this.selectedColumns = null;
  34612. var event = {
  34613. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_HOVER_CHANGED,
  34614. api: this.gridApi,
  34615. columnApi: this.columnApi
  34616. };
  34617. this.eventService.dispatchEvent(event);
  34618. };
  34619. ColumnHoverService.prototype.isHovered = function (column) {
  34620. return this.selectedColumns && this.selectedColumns.indexOf(column) >= 0;
  34621. };
  34622. __decorate([
  34623. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  34624. ], ColumnHoverService.prototype, "columnApi", void 0);
  34625. __decorate([
  34626. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  34627. ], ColumnHoverService.prototype, "gridApi", void 0);
  34628. ColumnHoverService = __decorate([
  34629. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('columnHoverService')
  34630. ], ColumnHoverService);
  34631. return ColumnHoverService;
  34632. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  34633. /***/ }),
  34634. /* 151 */
  34635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34636. "use strict";
  34637. __webpack_require__.r(__webpack_exports__);
  34638. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColumnAnimationService", function() { return ColumnAnimationService; });
  34639. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34640. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  34641. /**
  34642. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34643. * @version v23.2.1
  34644. * @link http://www.ag-grid.com/
  34645. * @license MIT
  34646. */
  34647. var __extends = (undefined && undefined.__extends) || (function () {
  34648. var extendStatics = function (d, b) {
  34649. extendStatics = Object.setPrototypeOf ||
  34650. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34651. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34652. return extendStatics(d, b);
  34653. };
  34654. return function (d, b) {
  34655. extendStatics(d, b);
  34656. function __() { this.constructor = d; }
  34657. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34658. };
  34659. })();
  34660. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34661. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34662. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34663. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34664. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34665. };
  34666. var ColumnAnimationService = /** @class */ (function (_super) {
  34667. __extends(ColumnAnimationService, _super);
  34668. function ColumnAnimationService() {
  34669. var _this = _super !== null && _super.apply(this, arguments) || this;
  34670. _this.executeNextFuncs = [];
  34671. _this.executeLaterFuncs = [];
  34672. _this.active = false;
  34673. _this.animationThreadCount = 0;
  34674. return _this;
  34675. }
  34676. ColumnAnimationService.prototype.registerGridComp = function (gridPanel) {
  34677. this.gridPanel = gridPanel;
  34678. };
  34679. ColumnAnimationService.prototype.isActive = function () {
  34680. return this.active;
  34681. };
  34682. ColumnAnimationService.prototype.start = function () {
  34683. if (this.active) {
  34684. return;
  34685. }
  34686. if (this.gridOptionsWrapper.isSuppressColumnMoveAnimation()) {
  34687. return;
  34688. }
  34689. // if doing RTL, we don't animate open / close as due to how the pixels are inverted,
  34690. // the animation moves all the row the the right rather than to the left (ie it's the static
  34691. // columns that actually get their coordinates updated)
  34692. if (this.gridOptionsWrapper.isEnableRtl()) {
  34693. return;
  34694. }
  34695. this.ensureAnimationCssClassPresent();
  34696. this.active = true;
  34697. };
  34698. ColumnAnimationService.prototype.finish = function () {
  34699. if (!this.active) {
  34700. return;
  34701. }
  34702. this.flush();
  34703. this.active = false;
  34704. };
  34705. ColumnAnimationService.prototype.executeNextVMTurn = function (func) {
  34706. if (this.active) {
  34707. this.executeNextFuncs.push(func);
  34708. }
  34709. else {
  34710. func();
  34711. }
  34712. };
  34713. ColumnAnimationService.prototype.executeLaterVMTurn = function (func) {
  34714. if (this.active) {
  34715. this.executeLaterFuncs.push(func);
  34716. }
  34717. else {
  34718. func();
  34719. }
  34720. };
  34721. ColumnAnimationService.prototype.ensureAnimationCssClassPresent = function () {
  34722. var _this = this;
  34723. // up the count, so we can tell if someone else has updated the count
  34724. // by the time the 'wait' func executes
  34725. this.animationThreadCount++;
  34726. var animationThreadCountCopy = this.animationThreadCount;
  34727. this.gridPanel.setColumnMovingCss(true);
  34728. this.executeLaterFuncs.push(function () {
  34729. // only remove the class if this thread was the last one to update it
  34730. if (_this.animationThreadCount === animationThreadCountCopy) {
  34731. _this.gridPanel.setColumnMovingCss(false);
  34732. }
  34733. });
  34734. };
  34735. ColumnAnimationService.prototype.flush = function () {
  34736. var nowFuncs = this.executeNextFuncs;
  34737. this.executeNextFuncs = [];
  34738. var waitFuncs = this.executeLaterFuncs;
  34739. this.executeLaterFuncs = [];
  34740. if (nowFuncs.length === 0 && waitFuncs.length === 0) {
  34741. return;
  34742. }
  34743. window.setTimeout(function () { return nowFuncs.forEach(function (func) { return func(); }); }, 0);
  34744. window.setTimeout(function () { return waitFuncs.forEach(function (func) { return func(); }); }, 300);
  34745. };
  34746. __decorate([
  34747. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  34748. ], ColumnAnimationService.prototype, "gridOptionsWrapper", void 0);
  34749. ColumnAnimationService = __decorate([
  34750. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('columnAnimationService')
  34751. ], ColumnAnimationService);
  34752. return ColumnAnimationService;
  34753. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  34754. /***/ }),
  34755. /* 152 */
  34756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34757. "use strict";
  34758. __webpack_require__.r(__webpack_exports__);
  34759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoGroupColService", function() { return AutoGroupColService; });
  34760. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  34761. /* harmony import */ var _entities_column__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
  34762. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  34763. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  34764. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  34765. /**
  34766. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34767. * @version v23.2.1
  34768. * @link http://www.ag-grid.com/
  34769. * @license MIT
  34770. */
  34771. var __extends = (undefined && undefined.__extends) || (function () {
  34772. var extendStatics = function (d, b) {
  34773. extendStatics = Object.setPrototypeOf ||
  34774. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34775. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34776. return extendStatics(d, b);
  34777. };
  34778. return function (d, b) {
  34779. extendStatics(d, b);
  34780. function __() { this.constructor = d; }
  34781. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34782. };
  34783. })();
  34784. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34785. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34786. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34787. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34788. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34789. };
  34790. var AutoGroupColService = /** @class */ (function (_super) {
  34791. __extends(AutoGroupColService, _super);
  34792. function AutoGroupColService() {
  34793. return _super !== null && _super.apply(this, arguments) || this;
  34794. }
  34795. AutoGroupColService_1 = AutoGroupColService;
  34796. AutoGroupColService.prototype.createAutoGroupColumns = function (rowGroupColumns) {
  34797. var _this = this;
  34798. var groupAutoColumns = [];
  34799. var doingTreeData = this.gridOptionsWrapper.isTreeData();
  34800. var doingMultiAutoColumn = this.gridOptionsWrapper.isGroupMultiAutoColumn();
  34801. if (doingTreeData && doingMultiAutoColumn) {
  34802. console.warn('ag-Grid: you cannot mix groupMultiAutoColumn with treeData, only one column can be used to display groups when doing tree data');
  34803. doingMultiAutoColumn = false;
  34804. }
  34805. // if doing groupMultiAutoColumn, then we call the method multiple times, once
  34806. // for each column we are grouping by
  34807. if (doingMultiAutoColumn) {
  34808. rowGroupColumns.forEach(function (rowGroupCol, index) {
  34809. groupAutoColumns.push(_this.createOneAutoGroupColumn(rowGroupCol, index));
  34810. });
  34811. }
  34812. else {
  34813. groupAutoColumns.push(this.createOneAutoGroupColumn());
  34814. }
  34815. return groupAutoColumns;
  34816. };
  34817. // rowGroupCol and index are missing if groupMultiAutoColumn=false
  34818. AutoGroupColService.prototype.createOneAutoGroupColumn = function (rowGroupCol, index) {
  34819. // if one provided by user, use it, otherwise create one
  34820. var defaultAutoColDef = this.generateDefaultColDef(rowGroupCol);
  34821. // if doing multi, set the field
  34822. var colId;
  34823. if (rowGroupCol) {
  34824. colId = _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].GROUP_AUTO_COLUMN_ID + "-" + rowGroupCol.getId();
  34825. }
  34826. else {
  34827. colId = AutoGroupColService_1.GROUP_AUTO_COLUMN_BUNDLE_ID;
  34828. }
  34829. var userAutoColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();
  34830. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].mergeDeep(defaultAutoColDef, userAutoColDef);
  34831. defaultAutoColDef = this.columnFactory.mergeColDefs(defaultAutoColDef);
  34832. defaultAutoColDef.colId = colId;
  34833. // For tree data the filter is always allowed
  34834. if (!this.gridOptionsWrapper.isTreeData()) {
  34835. // we would only allow filter if the user has provided field or value getter. otherwise the filter
  34836. // would not be able to work.
  34837. var noFieldOrValueGetter = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].missing(defaultAutoColDef.field) && _utils__WEBPACK_IMPORTED_MODULE_4__["_"].missing(defaultAutoColDef.valueGetter) && _utils__WEBPACK_IMPORTED_MODULE_4__["_"].missing(defaultAutoColDef.filterValueGetter);
  34838. if (noFieldOrValueGetter) {
  34839. defaultAutoColDef.filter = false;
  34840. }
  34841. }
  34842. // if showing many cols, we don't want to show more than one with a checkbox for selection
  34843. if (index && index > 0) {
  34844. defaultAutoColDef.headerCheckboxSelection = false;
  34845. }
  34846. var newCol = new _entities_column__WEBPACK_IMPORTED_MODULE_1__["Column"](defaultAutoColDef, null, colId, true);
  34847. this.context.createBean(newCol);
  34848. return newCol;
  34849. };
  34850. AutoGroupColService.prototype.generateDefaultColDef = function (rowGroupCol) {
  34851. var userAutoColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();
  34852. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  34853. var defaultAutoColDef = {
  34854. headerName: localeTextFunc('group', 'Group')
  34855. };
  34856. var userHasProvidedGroupCellRenderer = userAutoColDef && (userAutoColDef.cellRenderer || userAutoColDef.cellRendererFramework);
  34857. // only add the default group cell renderer if user hasn't provided one
  34858. if (!userHasProvidedGroupCellRenderer) {
  34859. defaultAutoColDef.cellRenderer = 'agGroupCellRenderer';
  34860. }
  34861. // we never allow moving the group column
  34862. // defaultAutoColDef.suppressMovable = true;
  34863. if (rowGroupCol) {
  34864. var rowGroupColDef = rowGroupCol.getColDef();
  34865. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].assign(defaultAutoColDef, {
  34866. // cellRendererParams.groupKey: colDefToCopy.field;
  34867. headerName: this.columnController.getDisplayNameForColumn(rowGroupCol, 'header'),
  34868. headerValueGetter: rowGroupColDef.headerValueGetter
  34869. });
  34870. if (rowGroupColDef.cellRenderer) {
  34871. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].assign(defaultAutoColDef, {
  34872. cellRendererParams: {
  34873. innerRenderer: rowGroupColDef.cellRenderer,
  34874. innerRendererParams: rowGroupColDef.cellRendererParams
  34875. }
  34876. });
  34877. }
  34878. defaultAutoColDef.showRowGroup = rowGroupCol.getColId();
  34879. }
  34880. else {
  34881. defaultAutoColDef.showRowGroup = true;
  34882. }
  34883. return defaultAutoColDef;
  34884. };
  34885. var AutoGroupColService_1;
  34886. AutoGroupColService.GROUP_AUTO_COLUMN_BUNDLE_ID = _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].GROUP_AUTO_COLUMN_ID;
  34887. __decorate([
  34888. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  34889. ], AutoGroupColService.prototype, "gridOptionsWrapper", void 0);
  34890. __decorate([
  34891. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  34892. ], AutoGroupColService.prototype, "columnController", void 0);
  34893. __decorate([
  34894. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnFactory')
  34895. ], AutoGroupColService.prototype, "columnFactory", void 0);
  34896. AutoGroupColService = AutoGroupColService_1 = __decorate([
  34897. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('autoGroupColService')
  34898. ], AutoGroupColService);
  34899. return AutoGroupColService;
  34900. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  34901. /***/ }),
  34902. /* 153 */
  34903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34904. "use strict";
  34905. __webpack_require__.r(__webpack_exports__);
  34906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationProxy", function() { return PaginationProxy; });
  34907. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  34908. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  34909. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  34910. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  34911. /**
  34912. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  34913. * @version v23.2.1
  34914. * @link http://www.ag-grid.com/
  34915. * @license MIT
  34916. */
  34917. var __extends = (undefined && undefined.__extends) || (function () {
  34918. var extendStatics = function (d, b) {
  34919. extendStatics = Object.setPrototypeOf ||
  34920. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  34921. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  34922. return extendStatics(d, b);
  34923. };
  34924. return function (d, b) {
  34925. extendStatics(d, b);
  34926. function __() { this.constructor = d; }
  34927. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34928. };
  34929. })();
  34930. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  34931. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  34932. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  34933. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  34934. return c > 3 && r && Object.defineProperty(target, key, r), r;
  34935. };
  34936. var PaginationProxy = /** @class */ (function (_super) {
  34937. __extends(PaginationProxy, _super);
  34938. function PaginationProxy() {
  34939. var _this = _super !== null && _super.apply(this, arguments) || this;
  34940. _this.currentPage = 0;
  34941. _this.topDisplayedRowIndex = 0;
  34942. _this.bottomDisplayedRowIndex = 0;
  34943. _this.pixelOffset = 0;
  34944. _this.masterRowCount = 0;
  34945. return _this;
  34946. }
  34947. PaginationProxy.prototype.postConstruct = function () {
  34948. this.active = this.gridOptionsWrapper.isPagination();
  34949. this.paginateChildRows = this.gridOptionsWrapper.isPaginateChildRows();
  34950. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));
  34951. this.addManagedListener(this.gridOptionsWrapper, 'paginationPageSize', this.onModelUpdated.bind(this));
  34952. this.onModelUpdated();
  34953. };
  34954. PaginationProxy.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {
  34955. var res = this.rowModel.ensureRowHeightsValid(startPixel, endPixel, this.getPageFirstRow(), this.getPageLastRow());
  34956. if (res) {
  34957. this.calculatePages();
  34958. }
  34959. return res;
  34960. };
  34961. PaginationProxy.prototype.onModelUpdated = function (modelUpdatedEvent) {
  34962. this.calculatePages();
  34963. var paginationChangedEvent = {
  34964. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_PAGINATION_CHANGED,
  34965. animate: modelUpdatedEvent ? modelUpdatedEvent.animate : false,
  34966. newData: modelUpdatedEvent ? modelUpdatedEvent.newData : false,
  34967. newPage: modelUpdatedEvent ? modelUpdatedEvent.newPage : false,
  34968. keepRenderedRows: modelUpdatedEvent ? modelUpdatedEvent.keepRenderedRows : false,
  34969. api: this.gridApi,
  34970. columnApi: this.columnApi
  34971. };
  34972. this.eventService.dispatchEvent(paginationChangedEvent);
  34973. };
  34974. PaginationProxy.prototype.goToPage = function (page) {
  34975. if (!this.active) {
  34976. return;
  34977. }
  34978. if (this.currentPage === page) {
  34979. return;
  34980. }
  34981. this.currentPage = page;
  34982. var event = {
  34983. type: _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_MODEL_UPDATED,
  34984. animate: false,
  34985. keepRenderedRows: false,
  34986. newData: false,
  34987. newPage: true,
  34988. api: this.gridApi,
  34989. columnApi: this.columnApi
  34990. };
  34991. this.onModelUpdated(event);
  34992. };
  34993. PaginationProxy.prototype.getPixelOffset = function () {
  34994. return this.pixelOffset;
  34995. };
  34996. PaginationProxy.prototype.getRow = function (index) {
  34997. return this.rowModel.getRow(index);
  34998. };
  34999. PaginationProxy.prototype.getRowNode = function (id) {
  35000. return this.rowModel.getRowNode(id);
  35001. };
  35002. PaginationProxy.prototype.getRowIndexAtPixel = function (pixel) {
  35003. return this.rowModel.getRowIndexAtPixel(pixel);
  35004. };
  35005. PaginationProxy.prototype.getCurrentPageHeight = function () {
  35006. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].missing(this.topRowBounds) || _utils__WEBPACK_IMPORTED_MODULE_3__["_"].missing(this.bottomRowBounds)) {
  35007. return 0;
  35008. }
  35009. return Math.max(this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight - this.topRowBounds.rowTop, 0);
  35010. };
  35011. PaginationProxy.prototype.isRowPresent = function (rowNode) {
  35012. if (!this.rowModel.isRowPresent(rowNode)) {
  35013. return false;
  35014. }
  35015. var nodeIsInPage = rowNode.rowIndex >= this.topDisplayedRowIndex && rowNode.rowIndex <= this.bottomDisplayedRowIndex;
  35016. return nodeIsInPage;
  35017. };
  35018. PaginationProxy.prototype.isEmpty = function () {
  35019. return this.rowModel.isEmpty();
  35020. };
  35021. PaginationProxy.prototype.isRowsToRender = function () {
  35022. return this.rowModel.isRowsToRender();
  35023. };
  35024. PaginationProxy.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
  35025. return this.rowModel.getNodesInRangeForSelection(firstInRange, lastInRange);
  35026. };
  35027. PaginationProxy.prototype.forEachNode = function (callback) {
  35028. return this.rowModel.forEachNode(callback);
  35029. };
  35030. PaginationProxy.prototype.getType = function () {
  35031. return this.rowModel.getType();
  35032. };
  35033. PaginationProxy.prototype.getRowBounds = function (index) {
  35034. var res = this.rowModel.getRowBounds(index);
  35035. res.rowIndex = index;
  35036. return res;
  35037. };
  35038. PaginationProxy.prototype.getPageFirstRow = function () {
  35039. return this.topRowBounds ? this.topRowBounds.rowIndex : -1;
  35040. };
  35041. PaginationProxy.prototype.getPageLastRow = function () {
  35042. return this.bottomRowBounds ? this.bottomRowBounds.rowIndex : -1;
  35043. };
  35044. PaginationProxy.prototype.getRowCount = function () {
  35045. return this.rowModel.getRowCount();
  35046. };
  35047. PaginationProxy.prototype.goToPageWithIndex = function (index) {
  35048. if (!this.active) {
  35049. return;
  35050. }
  35051. var pageNumber = Math.floor(index / this.pageSize);
  35052. this.goToPage(pageNumber);
  35053. };
  35054. PaginationProxy.prototype.isLastPageFound = function () {
  35055. return this.rowModel.isLastRowFound();
  35056. };
  35057. PaginationProxy.prototype.getCurrentPage = function () {
  35058. return this.currentPage;
  35059. };
  35060. PaginationProxy.prototype.goToNextPage = function () {
  35061. this.goToPage(this.currentPage + 1);
  35062. };
  35063. PaginationProxy.prototype.goToPreviousPage = function () {
  35064. this.goToPage(this.currentPage - 1);
  35065. };
  35066. PaginationProxy.prototype.goToFirstPage = function () {
  35067. this.goToPage(0);
  35068. };
  35069. PaginationProxy.prototype.goToLastPage = function () {
  35070. var rowCount = this.rowModel.getRowCount();
  35071. var lastPage = Math.floor(rowCount / this.pageSize);
  35072. this.goToPage(lastPage);
  35073. };
  35074. PaginationProxy.prototype.getPageSize = function () {
  35075. return this.pageSize;
  35076. };
  35077. PaginationProxy.prototype.getTotalPages = function () {
  35078. return this.totalPages;
  35079. };
  35080. PaginationProxy.prototype.setPageSize = function () {
  35081. // show put this into super class
  35082. this.pageSize = this.gridOptionsWrapper.getPaginationPageSize();
  35083. if (!(this.pageSize >= 1)) {
  35084. this.pageSize = 100;
  35085. }
  35086. };
  35087. PaginationProxy.prototype.calculatePages = function () {
  35088. if (this.active) {
  35089. this.setPageSize();
  35090. if (this.paginateChildRows) {
  35091. this.calculatePagesAllRows();
  35092. }
  35093. else {
  35094. this.calculatePagesMasterRowsOnly();
  35095. }
  35096. }
  35097. else {
  35098. this.calculatedPagesNotActive();
  35099. }
  35100. this.topRowBounds = this.rowModel.getRowBounds(this.topDisplayedRowIndex);
  35101. if (this.topRowBounds) {
  35102. this.topRowBounds.rowIndex = this.topDisplayedRowIndex;
  35103. }
  35104. this.bottomRowBounds = this.rowModel.getRowBounds(this.bottomDisplayedRowIndex);
  35105. if (this.bottomRowBounds) {
  35106. this.bottomRowBounds.rowIndex = this.bottomDisplayedRowIndex;
  35107. }
  35108. this.pixelOffset = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(this.topRowBounds) ? this.topRowBounds.rowTop : 0;
  35109. };
  35110. PaginationProxy.prototype.setZeroRows = function () {
  35111. this.topDisplayedRowIndex = 0;
  35112. this.bottomDisplayedRowIndex = -1;
  35113. this.currentPage = 0;
  35114. this.totalPages = 0;
  35115. };
  35116. PaginationProxy.prototype.calculatePagesMasterRowsOnly = function () {
  35117. // const csrm = <ClientSideRowModel> this.rowModel;
  35118. // const rootNode = csrm.getRootNode();
  35119. // const masterRows = rootNode.childrenAfterSort;
  35120. this.masterRowCount = this.rowModel.getTopLevelRowCount();
  35121. if (this.masterRowCount === 0) {
  35122. this.setZeroRows();
  35123. return;
  35124. }
  35125. var masterLastRowIndex = this.masterRowCount - 1;
  35126. this.totalPages = Math.floor((masterLastRowIndex) / this.pageSize) + 1;
  35127. if (this.currentPage >= this.totalPages) {
  35128. this.currentPage = this.totalPages - 1;
  35129. }
  35130. if (!_utils__WEBPACK_IMPORTED_MODULE_3__["_"].isNumeric(this.currentPage) || this.currentPage < 0) {
  35131. this.currentPage = 0;
  35132. }
  35133. var masterPageStartIndex = this.pageSize * this.currentPage;
  35134. var masterPageEndIndex = (this.pageSize * (this.currentPage + 1)) - 1;
  35135. if (masterPageEndIndex > masterLastRowIndex) {
  35136. masterPageEndIndex = masterLastRowIndex;
  35137. }
  35138. this.topDisplayedRowIndex = this.rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex);
  35139. // masterRows[masterPageStartIndex].rowIndex;
  35140. if (masterPageEndIndex === masterLastRowIndex) {
  35141. // if showing the last master row, then we want to show the very last row of the model
  35142. this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;
  35143. }
  35144. else {
  35145. var firstIndexNotToShow = this.rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1);
  35146. //masterRows[masterPageEndIndex + 1].rowIndex;
  35147. // this gets the index of the last child - eg current row is open, we want to display all children,
  35148. // the index of the last child is one less than the index of the next parent row.
  35149. this.bottomDisplayedRowIndex = firstIndexNotToShow - 1;
  35150. }
  35151. };
  35152. PaginationProxy.prototype.getMasterRowCount = function () {
  35153. return this.masterRowCount;
  35154. };
  35155. PaginationProxy.prototype.calculatePagesAllRows = function () {
  35156. this.masterRowCount = this.rowModel.getRowCount();
  35157. if (this.masterRowCount === 0) {
  35158. this.setZeroRows();
  35159. return;
  35160. }
  35161. var maxRowIndex = this.masterRowCount - 1;
  35162. this.totalPages = Math.floor((maxRowIndex) / this.pageSize) + 1;
  35163. if (this.currentPage >= this.totalPages) {
  35164. this.currentPage = this.totalPages - 1;
  35165. }
  35166. if (!_utils__WEBPACK_IMPORTED_MODULE_3__["_"].isNumeric(this.currentPage) || this.currentPage < 0) {
  35167. this.currentPage = 0;
  35168. }
  35169. this.topDisplayedRowIndex = this.pageSize * this.currentPage;
  35170. this.bottomDisplayedRowIndex = (this.pageSize * (this.currentPage + 1)) - 1;
  35171. if (this.bottomDisplayedRowIndex > maxRowIndex) {
  35172. this.bottomDisplayedRowIndex = maxRowIndex;
  35173. }
  35174. };
  35175. PaginationProxy.prototype.calculatedPagesNotActive = function () {
  35176. this.pageSize = this.rowModel.getRowCount();
  35177. this.totalPages = 1;
  35178. this.currentPage = 0;
  35179. this.topDisplayedRowIndex = 0;
  35180. this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1;
  35181. };
  35182. __decorate([
  35183. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('rowModel')
  35184. ], PaginationProxy.prototype, "rowModel", void 0);
  35185. __decorate([
  35186. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  35187. ], PaginationProxy.prototype, "gridOptionsWrapper", void 0);
  35188. __decorate([
  35189. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('selectionController')
  35190. ], PaginationProxy.prototype, "selectionController", void 0);
  35191. __decorate([
  35192. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('columnApi')
  35193. ], PaginationProxy.prototype, "columnApi", void 0);
  35194. __decorate([
  35195. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridApi')
  35196. ], PaginationProxy.prototype, "gridApi", void 0);
  35197. __decorate([
  35198. _context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
  35199. ], PaginationProxy.prototype, "postConstruct", null);
  35200. PaginationProxy = __decorate([
  35201. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('paginationProxy')
  35202. ], PaginationProxy);
  35203. return PaginationProxy;
  35204. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  35205. /***/ }),
  35206. /* 154 */
  35207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35208. "use strict";
  35209. __webpack_require__.r(__webpack_exports__);
  35210. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationAutoPageSizeService", function() { return PaginationAutoPageSizeService; });
  35211. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  35212. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43);
  35213. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  35214. /**
  35215. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35216. * @version v23.2.1
  35217. * @link http://www.ag-grid.com/
  35218. * @license MIT
  35219. */
  35220. var __extends = (undefined && undefined.__extends) || (function () {
  35221. var extendStatics = function (d, b) {
  35222. extendStatics = Object.setPrototypeOf ||
  35223. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35224. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35225. return extendStatics(d, b);
  35226. };
  35227. return function (d, b) {
  35228. extendStatics(d, b);
  35229. function __() { this.constructor = d; }
  35230. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35231. };
  35232. })();
  35233. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35234. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35235. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35236. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35237. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35238. };
  35239. var PaginationAutoPageSizeService = /** @class */ (function (_super) {
  35240. __extends(PaginationAutoPageSizeService, _super);
  35241. function PaginationAutoPageSizeService() {
  35242. return _super !== null && _super.apply(this, arguments) || this;
  35243. }
  35244. PaginationAutoPageSizeService.prototype.registerGridComp = function (gridPanel) {
  35245. this.gridPanel = gridPanel;
  35246. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_BODY_HEIGHT_CHANGED, this.onBodyHeightChanged.bind(this));
  35247. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this));
  35248. this.checkPageSize();
  35249. };
  35250. PaginationAutoPageSizeService.prototype.notActive = function () {
  35251. return !this.gridOptionsWrapper.isPaginationAutoPageSize();
  35252. };
  35253. PaginationAutoPageSizeService.prototype.onScrollVisibilityChanged = function () {
  35254. this.checkPageSize();
  35255. };
  35256. PaginationAutoPageSizeService.prototype.onBodyHeightChanged = function () {
  35257. this.checkPageSize();
  35258. };
  35259. PaginationAutoPageSizeService.prototype.checkPageSize = function () {
  35260. if (this.notActive()) {
  35261. return;
  35262. }
  35263. var rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
  35264. var bodyHeight = this.gridPanel.getBodyHeight();
  35265. if (bodyHeight > 0) {
  35266. var newPageSize = Math.floor(bodyHeight / rowHeight);
  35267. this.gridOptionsWrapper.setProperty('paginationPageSize', newPageSize);
  35268. }
  35269. };
  35270. __decorate([
  35271. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  35272. ], PaginationAutoPageSizeService.prototype, "gridOptionsWrapper", void 0);
  35273. PaginationAutoPageSizeService = __decorate([
  35274. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Bean"])('paginationAutoPageSizeService')
  35275. ], PaginationAutoPageSizeService);
  35276. return PaginationAutoPageSizeService;
  35277. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  35278. /***/ }),
  35279. /* 155 */
  35280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35281. "use strict";
  35282. __webpack_require__.r(__webpack_exports__);
  35283. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValueCache", function() { return ValueCache; });
  35284. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  35285. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  35286. /**
  35287. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35288. * @version v23.2.1
  35289. * @link http://www.ag-grid.com/
  35290. * @license MIT
  35291. */
  35292. var __extends = (undefined && undefined.__extends) || (function () {
  35293. var extendStatics = function (d, b) {
  35294. extendStatics = Object.setPrototypeOf ||
  35295. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35296. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35297. return extendStatics(d, b);
  35298. };
  35299. return function (d, b) {
  35300. extendStatics(d, b);
  35301. function __() { this.constructor = d; }
  35302. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35303. };
  35304. })();
  35305. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35306. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35307. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35308. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35309. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35310. };
  35311. var ValueCache = /** @class */ (function (_super) {
  35312. __extends(ValueCache, _super);
  35313. function ValueCache() {
  35314. var _this = _super !== null && _super.apply(this, arguments) || this;
  35315. _this.cacheVersion = 0;
  35316. return _this;
  35317. }
  35318. ValueCache.prototype.init = function () {
  35319. this.active = this.gridOptionsWrapper.isValueCache();
  35320. this.neverExpires = this.gridOptionsWrapper.isValueCacheNeverExpires();
  35321. };
  35322. ValueCache.prototype.onDataChanged = function () {
  35323. if (this.neverExpires) {
  35324. return;
  35325. }
  35326. this.expire();
  35327. };
  35328. ValueCache.prototype.expire = function () {
  35329. this.cacheVersion++;
  35330. };
  35331. ValueCache.prototype.setValue = function (rowNode, colId, value) {
  35332. if (this.active) {
  35333. if (rowNode.__cacheVersion !== this.cacheVersion) {
  35334. rowNode.__cacheVersion = this.cacheVersion;
  35335. rowNode.__cacheData = {};
  35336. }
  35337. rowNode.__cacheData[colId] = value;
  35338. }
  35339. };
  35340. ValueCache.prototype.getValue = function (rowNode, colId) {
  35341. if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) {
  35342. return undefined;
  35343. }
  35344. return rowNode.__cacheData[colId];
  35345. };
  35346. __decorate([
  35347. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  35348. ], ValueCache.prototype, "gridOptionsWrapper", void 0);
  35349. __decorate([
  35350. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  35351. ], ValueCache.prototype, "init", null);
  35352. ValueCache = __decorate([
  35353. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('valueCache')
  35354. ], ValueCache);
  35355. return ValueCache;
  35356. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  35357. /***/ }),
  35358. /* 156 */
  35359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35360. "use strict";
  35361. __webpack_require__.r(__webpack_exports__);
  35362. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChangeDetectionService", function() { return ChangeDetectionService; });
  35363. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  35364. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  35365. /* harmony import */ var _utils_changedPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(97);
  35366. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  35367. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43);
  35368. /**
  35369. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35370. * @version v23.2.1
  35371. * @link http://www.ag-grid.com/
  35372. * @license MIT
  35373. */
  35374. var __extends = (undefined && undefined.__extends) || (function () {
  35375. var extendStatics = function (d, b) {
  35376. extendStatics = Object.setPrototypeOf ||
  35377. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35378. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35379. return extendStatics(d, b);
  35380. };
  35381. return function (d, b) {
  35382. extendStatics(d, b);
  35383. function __() { this.constructor = d; }
  35384. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35385. };
  35386. })();
  35387. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35388. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35389. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35390. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35391. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35392. };
  35393. var ChangeDetectionService = /** @class */ (function (_super) {
  35394. __extends(ChangeDetectionService, _super);
  35395. function ChangeDetectionService() {
  35396. return _super !== null && _super.apply(this, arguments) || this;
  35397. }
  35398. ChangeDetectionService.prototype.init = function () {
  35399. if (this.rowModel.getType() === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
  35400. this.clientSideRowModel = this.rowModel;
  35401. }
  35402. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_4__["Events"].EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged.bind(this));
  35403. };
  35404. ChangeDetectionService.prototype.onCellValueChanged = function (event) {
  35405. // Clipboard service manages its own change detection, so no need to do it here.
  35406. // The clipboard manages its own as otherwise this would happen once for every cell
  35407. // that got updated as part of a paste operation, so e.g. if 100 cells in a paste operation,
  35408. // this doChangeDetection would get called 100 times (once for each cell), instead clipboard
  35409. // service executes the logic we have here once (in essence batching up all cell changes
  35410. // into one change detection).
  35411. if (event.source === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].SOURCE_PASTE) {
  35412. return;
  35413. }
  35414. this.doChangeDetection(event.node, event.column);
  35415. };
  35416. ChangeDetectionService.prototype.doChangeDetection = function (rowNode, column) {
  35417. if (this.gridOptionsWrapper.isSuppressChangeDetection()) {
  35418. return;
  35419. }
  35420. // step 1 of change detection is to update the aggregated values
  35421. if (this.clientSideRowModel && !rowNode.isRowPinned()) {
  35422. var onlyChangedColumns = this.gridOptionsWrapper.isAggregateOnlyChangedColumns();
  35423. var changedPath = new _utils_changedPath__WEBPACK_IMPORTED_MODULE_2__["ChangedPath"](onlyChangedColumns, this.clientSideRowModel.getRootNode());
  35424. changedPath.addParentNode(rowNode.parent, [column]);
  35425. this.clientSideRowModel.doAggregate(changedPath);
  35426. }
  35427. // step 2 of change detection is to refresh the cells
  35428. this.rowRenderer.refreshCells();
  35429. };
  35430. __decorate([
  35431. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  35432. ], ChangeDetectionService.prototype, "gridOptionsWrapper", void 0);
  35433. __decorate([
  35434. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
  35435. ], ChangeDetectionService.prototype, "rowModel", void 0);
  35436. __decorate([
  35437. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowRenderer')
  35438. ], ChangeDetectionService.prototype, "rowRenderer", void 0);
  35439. __decorate([
  35440. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  35441. ], ChangeDetectionService.prototype, "init", null);
  35442. ChangeDetectionService = __decorate([
  35443. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('changeDetectionService')
  35444. ], ChangeDetectionService);
  35445. return ChangeDetectionService;
  35446. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  35447. /***/ }),
  35448. /* 157 */
  35449. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35450. "use strict";
  35451. __webpack_require__.r(__webpack_exports__);
  35452. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AlignedGridsService", function() { return AlignedGridsService; });
  35453. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
  35454. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  35455. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  35456. /**
  35457. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35458. * @version v23.2.1
  35459. * @link http://www.ag-grid.com/
  35460. * @license MIT
  35461. */
  35462. var __extends = (undefined && undefined.__extends) || (function () {
  35463. var extendStatics = function (d, b) {
  35464. extendStatics = Object.setPrototypeOf ||
  35465. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35466. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35467. return extendStatics(d, b);
  35468. };
  35469. return function (d, b) {
  35470. extendStatics(d, b);
  35471. function __() { this.constructor = d; }
  35472. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35473. };
  35474. })();
  35475. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35476. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35477. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35478. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35479. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35480. };
  35481. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  35482. return function (target, key) { decorator(target, key, paramIndex); }
  35483. };
  35484. var AlignedGridsService = /** @class */ (function (_super) {
  35485. __extends(AlignedGridsService, _super);
  35486. function AlignedGridsService() {
  35487. var _this = _super !== null && _super.apply(this, arguments) || this;
  35488. // flag to mark if we are consuming. to avoid cyclic events (ie other grid firing back to master
  35489. // while processing a master event) we mark this if consuming an event, and if we are, then
  35490. // we don't fire back any events.
  35491. _this.consuming = false;
  35492. return _this;
  35493. }
  35494. AlignedGridsService.prototype.setBeans = function (loggerFactory) {
  35495. this.logger = loggerFactory.create('AlignedGridsService');
  35496. };
  35497. AlignedGridsService.prototype.registerGridComp = function (gridPanel) {
  35498. this.gridPanel = gridPanel;
  35499. };
  35500. AlignedGridsService.prototype.init = function () {
  35501. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_MOVED, this.fireColumnEvent.bind(this));
  35502. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VISIBLE, this.fireColumnEvent.bind(this));
  35503. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PINNED, this.fireColumnEvent.bind(this));
  35504. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_GROUP_OPENED, this.fireColumnEvent.bind(this));
  35505. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_RESIZED, this.fireColumnEvent.bind(this));
  35506. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_BODY_SCROLL, this.fireScrollEvent.bind(this));
  35507. };
  35508. // common logic across all the fire methods
  35509. AlignedGridsService.prototype.fireEvent = function (callback) {
  35510. // if we are already consuming, then we are acting on an event from a master,
  35511. // so we don't cause a cyclic firing of events
  35512. if (this.consuming) {
  35513. return;
  35514. }
  35515. // iterate through the aligned grids, and pass each aligned grid service to the callback
  35516. var otherGrids = this.gridOptionsWrapper.getAlignedGrids();
  35517. if (otherGrids) {
  35518. otherGrids.forEach(function (otherGridOptions) {
  35519. if (otherGridOptions.api) {
  35520. var alignedGridService = otherGridOptions.api.__getAlignedGridService();
  35521. callback(alignedGridService);
  35522. }
  35523. });
  35524. }
  35525. };
  35526. // common logic across all consume methods. very little common logic, however extracting
  35527. // guarantees consistency across the methods.
  35528. AlignedGridsService.prototype.onEvent = function (callback) {
  35529. this.consuming = true;
  35530. callback();
  35531. this.consuming = false;
  35532. };
  35533. AlignedGridsService.prototype.fireColumnEvent = function (event) {
  35534. this.fireEvent(function (alignedGridsService) {
  35535. alignedGridsService.onColumnEvent(event);
  35536. });
  35537. };
  35538. AlignedGridsService.prototype.fireScrollEvent = function (event) {
  35539. if (event.direction !== 'horizontal') {
  35540. return;
  35541. }
  35542. this.fireEvent(function (alignedGridsService) {
  35543. alignedGridsService.onScrollEvent(event);
  35544. });
  35545. };
  35546. AlignedGridsService.prototype.onScrollEvent = function (event) {
  35547. var _this = this;
  35548. this.onEvent(function () {
  35549. _this.gridPanel.setHorizontalScrollPosition(event.left);
  35550. });
  35551. };
  35552. AlignedGridsService.prototype.getMasterColumns = function (event) {
  35553. var result = [];
  35554. if (event.columns) {
  35555. event.columns.forEach(function (column) {
  35556. result.push(column);
  35557. });
  35558. }
  35559. else if (event.column) {
  35560. result.push(event.column);
  35561. }
  35562. return result;
  35563. };
  35564. AlignedGridsService.prototype.getColumnIds = function (event) {
  35565. var result = [];
  35566. if (event.columns) {
  35567. event.columns.forEach(function (column) {
  35568. result.push(column.getColId());
  35569. });
  35570. }
  35571. else if (event.column) {
  35572. result.push(event.column.getColId());
  35573. }
  35574. return result;
  35575. };
  35576. AlignedGridsService.prototype.onColumnEvent = function (event) {
  35577. var _this = this;
  35578. this.onEvent(function () {
  35579. switch (event.type) {
  35580. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_MOVED:
  35581. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VISIBLE:
  35582. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PINNED:
  35583. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_RESIZED:
  35584. var colEvent = event;
  35585. _this.processColumnEvent(colEvent);
  35586. break;
  35587. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_GROUP_OPENED:
  35588. var groupOpenedEvent = event;
  35589. _this.processGroupOpenedEvent(groupOpenedEvent);
  35590. break;
  35591. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PIVOT_CHANGED:
  35592. // we cannot support pivoting with aligned grids as the columns will be out of sync as the
  35593. // grids will have columns created based on the row data of the grid.
  35594. console.warn('ag-Grid: pivoting is not supported with aligned grids. ' +
  35595. 'You can only use one of these features at a time in a grid.');
  35596. break;
  35597. }
  35598. });
  35599. };
  35600. AlignedGridsService.prototype.processGroupOpenedEvent = function (groupOpenedEvent) {
  35601. // likewise for column group
  35602. var masterColumnGroup = groupOpenedEvent.columnGroup;
  35603. var otherColumnGroup;
  35604. if (masterColumnGroup) {
  35605. var groupId = masterColumnGroup.getGroupId();
  35606. otherColumnGroup = this.columnController.getOriginalColumnGroup(groupId);
  35607. }
  35608. if (masterColumnGroup && !otherColumnGroup) {
  35609. return;
  35610. }
  35611. this.logger.log('onColumnEvent-> processing ' + groupOpenedEvent + ' expanded = ' + masterColumnGroup.isExpanded());
  35612. this.columnController.setColumnGroupOpened(otherColumnGroup, masterColumnGroup.isExpanded(), "alignedGridChanged");
  35613. };
  35614. AlignedGridsService.prototype.processColumnEvent = function (colEvent) {
  35615. var _this = this;
  35616. // the column in the event is from the master grid. need to
  35617. // look up the equivalent from this (other) grid
  35618. var masterColumn = colEvent.column;
  35619. var otherColumn;
  35620. if (masterColumn) {
  35621. otherColumn = this.columnController.getPrimaryColumn(masterColumn.getColId());
  35622. }
  35623. // if event was with respect to a master column, that is not present in this
  35624. // grid, then we ignore the event
  35625. if (masterColumn && !otherColumn) {
  35626. return;
  35627. }
  35628. // in time, all the methods below should use the column ids, it's a more generic way
  35629. // of handling columns, and also allows for single or multi column events
  35630. var columnIds = this.getColumnIds(colEvent);
  35631. var masterColumns = this.getMasterColumns(colEvent);
  35632. switch (colEvent.type) {
  35633. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_MOVED:
  35634. var movedEvent = colEvent;
  35635. this.logger.log("onColumnEvent-> processing " + colEvent.type + " toIndex = " + movedEvent.toIndex);
  35636. this.columnController.moveColumns(columnIds, movedEvent.toIndex, "alignedGridChanged");
  35637. break;
  35638. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VISIBLE:
  35639. var visibleEvent = colEvent;
  35640. this.logger.log("onColumnEvent-> processing " + colEvent.type + " visible = " + visibleEvent.visible);
  35641. this.columnController.setColumnsVisible(columnIds, visibleEvent.visible, "alignedGridChanged");
  35642. break;
  35643. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PINNED:
  35644. var pinnedEvent = colEvent;
  35645. this.logger.log("onColumnEvent-> processing " + colEvent.type + " pinned = " + pinnedEvent.pinned);
  35646. this.columnController.setColumnsPinned(columnIds, pinnedEvent.pinned, "alignedGridChanged");
  35647. break;
  35648. case _events__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_RESIZED:
  35649. var resizedEvent_1 = colEvent;
  35650. masterColumns.forEach(function (column) {
  35651. _this.logger.log("onColumnEvent-> processing " + colEvent.type + " actualWidth = " + column.getActualWidth());
  35652. var columnWidths = [{ key: column.getColId(), newWidth: column.getActualWidth() }];
  35653. _this.columnController.setColumnWidths(columnWidths, false, resizedEvent_1.finished, "alignedGridChanged");
  35654. });
  35655. break;
  35656. }
  35657. var isVerticalScrollShowing = this.gridPanel.isVerticalScrollShowing();
  35658. var alignedGrids = this.gridOptionsWrapper.getAlignedGrids();
  35659. alignedGrids.forEach(function (grid) {
  35660. grid.api.setAlwaysShowVerticalScroll(isVerticalScrollShowing);
  35661. });
  35662. };
  35663. __decorate([
  35664. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  35665. ], AlignedGridsService.prototype, "gridOptionsWrapper", void 0);
  35666. __decorate([
  35667. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  35668. ], AlignedGridsService.prototype, "columnController", void 0);
  35669. __decorate([
  35670. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Qualifier"])('loggerFactory'))
  35671. ], AlignedGridsService.prototype, "setBeans", null);
  35672. __decorate([
  35673. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  35674. ], AlignedGridsService.prototype, "init", null);
  35675. AlignedGridsService = __decorate([
  35676. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('alignedGridsService')
  35677. ], AlignedGridsService);
  35678. return AlignedGridsService;
  35679. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  35680. /***/ }),
  35681. /* 158 */
  35682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35683. "use strict";
  35684. __webpack_require__.r(__webpack_exports__);
  35685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgComponentUtils", function() { return AgComponentUtils; });
  35686. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  35687. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  35688. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  35689. /**
  35690. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35691. * @version v23.2.1
  35692. * @link http://www.ag-grid.com/
  35693. * @license MIT
  35694. */
  35695. var __extends = (undefined && undefined.__extends) || (function () {
  35696. var extendStatics = function (d, b) {
  35697. extendStatics = Object.setPrototypeOf ||
  35698. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35699. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35700. return extendStatics(d, b);
  35701. };
  35702. return function (d, b) {
  35703. extendStatics(d, b);
  35704. function __() { this.constructor = d; }
  35705. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35706. };
  35707. })();
  35708. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35709. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35710. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35711. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35712. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35713. };
  35714. var AgComponentUtils = /** @class */ (function (_super) {
  35715. __extends(AgComponentUtils, _super);
  35716. function AgComponentUtils() {
  35717. return _super !== null && _super.apply(this, arguments) || this;
  35718. }
  35719. AgComponentUtils.prototype.adaptFunction = function (propertyName, hardcodedJsFunction, componentFromFramework, source) {
  35720. if (hardcodedJsFunction == null) {
  35721. return {
  35722. component: null,
  35723. componentFromFramework: componentFromFramework,
  35724. source: source,
  35725. paramsFromSelector: null
  35726. };
  35727. }
  35728. var metadata = this.componentMetadataProvider.retrieve(propertyName);
  35729. if (metadata && metadata.functionAdapter) {
  35730. return {
  35731. componentFromFramework: componentFromFramework,
  35732. component: metadata.functionAdapter(hardcodedJsFunction),
  35733. source: source,
  35734. paramsFromSelector: null
  35735. };
  35736. }
  35737. return null;
  35738. };
  35739. AgComponentUtils.prototype.adaptCellRendererFunction = function (callback) {
  35740. var Adapter = /** @class */ (function () {
  35741. function Adapter() {
  35742. }
  35743. Adapter.prototype.refresh = function (params) {
  35744. return false;
  35745. };
  35746. Adapter.prototype.getGui = function () {
  35747. var callbackResult = callback(this.params);
  35748. var type = typeof callbackResult;
  35749. if (type === 'string' || type === 'number' || type === 'boolean') {
  35750. return _utils__WEBPACK_IMPORTED_MODULE_2__["_"].loadTemplate('<span>' + callbackResult + '</span>');
  35751. }
  35752. else {
  35753. return callbackResult;
  35754. }
  35755. };
  35756. Adapter.prototype.init = function (params) {
  35757. this.params = params;
  35758. };
  35759. return Adapter;
  35760. }());
  35761. return Adapter;
  35762. };
  35763. AgComponentUtils.prototype.doesImplementIComponent = function (candidate) {
  35764. if (!candidate) {
  35765. return false;
  35766. }
  35767. return candidate.prototype && 'getGui' in candidate.prototype;
  35768. };
  35769. __decorate([
  35770. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("componentMetadataProvider")
  35771. ], AgComponentUtils.prototype, "componentMetadataProvider", void 0);
  35772. AgComponentUtils = __decorate([
  35773. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])("agComponentUtils")
  35774. ], AgComponentUtils);
  35775. return AgComponentUtils;
  35776. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  35777. /***/ }),
  35778. /* 159 */
  35779. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35780. "use strict";
  35781. __webpack_require__.r(__webpack_exports__);
  35782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ComponentMetadataProvider", function() { return ComponentMetadataProvider; });
  35783. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  35784. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  35785. /**
  35786. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35787. * @version v23.2.1
  35788. * @link http://www.ag-grid.com/
  35789. * @license MIT
  35790. */
  35791. var __extends = (undefined && undefined.__extends) || (function () {
  35792. var extendStatics = function (d, b) {
  35793. extendStatics = Object.setPrototypeOf ||
  35794. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  35795. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  35796. return extendStatics(d, b);
  35797. };
  35798. return function (d, b) {
  35799. extendStatics(d, b);
  35800. function __() { this.constructor = d; }
  35801. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  35802. };
  35803. })();
  35804. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35805. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35806. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35807. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35808. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35809. };
  35810. var ComponentMetadataProvider = /** @class */ (function (_super) {
  35811. __extends(ComponentMetadataProvider, _super);
  35812. function ComponentMetadataProvider() {
  35813. return _super !== null && _super.apply(this, arguments) || this;
  35814. }
  35815. ComponentMetadataProvider.prototype.postConstruct = function () {
  35816. this.componentMetaData = {
  35817. dateComponent: {
  35818. mandatoryMethodList: ['getDate', 'setDate'],
  35819. optionalMethodList: ['afterGuiAttached', 'setInputPlaceholder']
  35820. },
  35821. detailCellRenderer: {
  35822. mandatoryMethodList: [],
  35823. optionalMethodList: ['refresh']
  35824. },
  35825. headerComponent: {
  35826. mandatoryMethodList: [],
  35827. optionalMethodList: []
  35828. },
  35829. headerGroupComponent: {
  35830. mandatoryMethodList: [],
  35831. optionalMethodList: []
  35832. },
  35833. loadingCellRenderer: {
  35834. mandatoryMethodList: [],
  35835. optionalMethodList: []
  35836. },
  35837. loadingOverlayComponent: {
  35838. mandatoryMethodList: [],
  35839. optionalMethodList: []
  35840. },
  35841. noRowsOverlayComponent: {
  35842. mandatoryMethodList: [],
  35843. optionalMethodList: []
  35844. },
  35845. floatingFilterComponent: {
  35846. mandatoryMethodList: ['onParentModelChanged'],
  35847. optionalMethodList: ['afterGuiAttached']
  35848. },
  35849. floatingFilterWrapperComponent: {
  35850. mandatoryMethodList: [],
  35851. optionalMethodList: []
  35852. },
  35853. cellRenderer: {
  35854. mandatoryMethodList: [],
  35855. optionalMethodList: ['refresh', 'afterGuiAttached'],
  35856. functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
  35857. },
  35858. cellEditor: {
  35859. mandatoryMethodList: ['getValue'],
  35860. optionalMethodList: ['isPopup', 'isCancelBeforeStart', 'isCancelAfterEnd', 'getPopupPosition', 'focusIn', 'focusOut', 'afterGuiAttached']
  35861. },
  35862. innerRenderer: {
  35863. mandatoryMethodList: [],
  35864. optionalMethodList: ['afterGuiAttached'],
  35865. functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
  35866. },
  35867. fullWidthCellRenderer: {
  35868. mandatoryMethodList: [],
  35869. optionalMethodList: ['refresh', 'afterGuiAttached'],
  35870. functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
  35871. },
  35872. pinnedRowCellRenderer: {
  35873. mandatoryMethodList: [],
  35874. optionalMethodList: ['refresh', 'afterGuiAttached'],
  35875. functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
  35876. },
  35877. groupRowInnerRenderer: {
  35878. mandatoryMethodList: [],
  35879. optionalMethodList: ['afterGuiAttached'],
  35880. functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
  35881. },
  35882. groupRowRenderer: {
  35883. mandatoryMethodList: [],
  35884. optionalMethodList: ['afterGuiAttached'],
  35885. functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)
  35886. },
  35887. filter: {
  35888. mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],
  35889. optionalMethodList: ['afterGuiAttached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged']
  35890. },
  35891. filterComponent: {
  35892. mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'],
  35893. optionalMethodList: ['afterGuiAttached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged']
  35894. },
  35895. statusPanel: {
  35896. mandatoryMethodList: [],
  35897. optionalMethodList: ['afterGuiAttached'],
  35898. },
  35899. toolPanel: {
  35900. mandatoryMethodList: [],
  35901. optionalMethodList: ['refresh', 'afterGuiAttached']
  35902. },
  35903. tooltipComponent: {
  35904. mandatoryMethodList: [],
  35905. optionalMethodList: []
  35906. }
  35907. };
  35908. };
  35909. ComponentMetadataProvider.prototype.retrieve = function (name) {
  35910. return this.componentMetaData[name];
  35911. };
  35912. __decorate([
  35913. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("agComponentUtils")
  35914. ], ComponentMetadataProvider.prototype, "agComponentUtils", void 0);
  35915. __decorate([
  35916. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  35917. ], ComponentMetadataProvider.prototype, "postConstruct", null);
  35918. ComponentMetadataProvider = __decorate([
  35919. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])("componentMetadataProvider")
  35920. ], ComponentMetadataProvider);
  35921. return ComponentMetadataProvider;
  35922. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  35923. /***/ }),
  35924. /* 160 */
  35925. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35926. "use strict";
  35927. __webpack_require__.r(__webpack_exports__);
  35928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Beans", function() { return Beans; });
  35929. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  35930. /**
  35931. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  35932. * @version v23.2.1
  35933. * @link http://www.ag-grid.com/
  35934. * @license MIT
  35935. */
  35936. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  35937. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  35938. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  35939. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  35940. return c > 3 && r && Object.defineProperty(target, key, r), r;
  35941. };
  35942. /** Using the IoC has a slight performance consideration, which is no problem most of the
  35943. * time, unless we are trashing objects - which is the case when scrolling and rowComp
  35944. * and cellComp. So for performance reasons, RowComp and CellComp do not get autowired
  35945. * with the IoC. Instead they get passed this object which is all the beans the RowComp
  35946. * and CellComp need. Not autowiring all the cells gives performance improvement. */
  35947. var Beans = /** @class */ (function () {
  35948. function Beans() {
  35949. }
  35950. Beans.prototype.registerGridComp = function (gridPanel) {
  35951. this.gridPanel = gridPanel;
  35952. };
  35953. Beans.prototype.postConstruct = function () {
  35954. this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail();
  35955. };
  35956. __decorate([
  35957. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('paginationProxy')
  35958. ], Beans.prototype, "paginationProxy", void 0);
  35959. __decorate([
  35960. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('context')
  35961. ], Beans.prototype, "context", void 0);
  35962. __decorate([
  35963. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  35964. ], Beans.prototype, "columnApi", void 0);
  35965. __decorate([
  35966. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  35967. ], Beans.prototype, "gridApi", void 0);
  35968. __decorate([
  35969. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  35970. ], Beans.prototype, "gridOptionsWrapper", void 0);
  35971. __decorate([
  35972. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('expressionService')
  35973. ], Beans.prototype, "expressionService", void 0);
  35974. __decorate([
  35975. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  35976. ], Beans.prototype, "rowRenderer", void 0);
  35977. __decorate([
  35978. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$compile')
  35979. ], Beans.prototype, "$compile", void 0);
  35980. __decorate([
  35981. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('templateService')
  35982. ], Beans.prototype, "templateService", void 0);
  35983. __decorate([
  35984. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueService')
  35985. ], Beans.prototype, "valueService", void 0);
  35986. __decorate([
  35987. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eventService')
  35988. ], Beans.prototype, "eventService", void 0);
  35989. __decorate([
  35990. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  35991. ], Beans.prototype, "columnController", void 0);
  35992. __decorate([
  35993. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('headerNavigationService')
  35994. ], Beans.prototype, "headerNavigationService", void 0);
  35995. __decorate([
  35996. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnAnimationService')
  35997. ], Beans.prototype, "columnAnimationService", void 0);
  35998. __decorate([
  35999. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('rangeController')
  36000. ], Beans.prototype, "rangeController", void 0);
  36001. __decorate([
  36002. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
  36003. ], Beans.prototype, "focusController", void 0);
  36004. __decorate([
  36005. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('contextMenuFactory')
  36006. ], Beans.prototype, "contextMenuFactory", void 0);
  36007. __decorate([
  36008. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('cellRendererFactory')
  36009. ], Beans.prototype, "cellRendererFactory", void 0);
  36010. __decorate([
  36011. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('popupService')
  36012. ], Beans.prototype, "popupService", void 0);
  36013. __decorate([
  36014. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueFormatterService')
  36015. ], Beans.prototype, "valueFormatterService", void 0);
  36016. __decorate([
  36017. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('stylingService')
  36018. ], Beans.prototype, "stylingService", void 0);
  36019. __decorate([
  36020. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnHoverService')
  36021. ], Beans.prototype, "columnHoverService", void 0);
  36022. __decorate([
  36023. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
  36024. ], Beans.prototype, "userComponentFactory", void 0);
  36025. __decorate([
  36026. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('animationFrameService')
  36027. ], Beans.prototype, "taskQueue", void 0);
  36028. __decorate([
  36029. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragAndDropService')
  36030. ], Beans.prototype, "dragAndDropService", void 0);
  36031. __decorate([
  36032. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
  36033. ], Beans.prototype, "sortController", void 0);
  36034. __decorate([
  36035. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  36036. ], Beans.prototype, "filterManager", void 0);
  36037. __decorate([
  36038. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('maxDivHeightScaler')
  36039. ], Beans.prototype, "maxDivHeightScaler", void 0);
  36040. __decorate([
  36041. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('frameworkOverrides')
  36042. ], Beans.prototype, "frameworkOverrides", void 0);
  36043. __decorate([
  36044. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('detailRowCompCache')
  36045. ], Beans.prototype, "detailRowCompCache", void 0);
  36046. __decorate([
  36047. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('cellPositionUtils')
  36048. ], Beans.prototype, "cellPositionUtils", void 0);
  36049. __decorate([
  36050. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowPositionUtils')
  36051. ], Beans.prototype, "rowPositionUtils", void 0);
  36052. __decorate([
  36053. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectionController')
  36054. ], Beans.prototype, "selectionController", void 0);
  36055. __decorate([
  36056. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('selectionHandleFactory')
  36057. ], Beans.prototype, "selectionHandleFactory", void 0);
  36058. __decorate([
  36059. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  36060. ], Beans.prototype, "postConstruct", null);
  36061. Beans = __decorate([
  36062. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('beans')
  36063. ], Beans);
  36064. return Beans;
  36065. }());
  36066. /***/ }),
  36067. /* 161 */
  36068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36069. "use strict";
  36070. __webpack_require__.r(__webpack_exports__);
  36071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return Environment; });
  36072. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  36073. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  36074. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  36075. /**
  36076. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  36077. * @version v23.2.1
  36078. * @link http://www.ag-grid.com/
  36079. * @license MIT
  36080. */
  36081. var __extends = (undefined && undefined.__extends) || (function () {
  36082. var extendStatics = function (d, b) {
  36083. extendStatics = Object.setPrototypeOf ||
  36084. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36085. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36086. return extendStatics(d, b);
  36087. };
  36088. return function (d, b) {
  36089. extendStatics(d, b);
  36090. function __() { this.constructor = d; }
  36091. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36092. };
  36093. })();
  36094. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  36095. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  36096. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  36097. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  36098. return c > 3 && r && Object.defineProperty(target, key, r), r;
  36099. };
  36100. var MAT_GRID_SIZE = 8;
  36101. var BASE_GRID_SIZE = 4;
  36102. var BALHAM_GRID_SIZE = 4;
  36103. var ALPINE_GRID_SIZE = 6;
  36104. var HARD_CODED_SIZES = {
  36105. // this item is required for custom themes
  36106. 'ag-theme-custom': {
  36107. headerHeight: 25,
  36108. headerCellMinWidth: 24,
  36109. listItemHeight: BASE_GRID_SIZE * 5,
  36110. rowHeight: 25,
  36111. chartMenuPanelWidth: 220
  36112. },
  36113. 'ag-theme-material': {
  36114. headerHeight: MAT_GRID_SIZE * 7,
  36115. headerCellMinWidth: 48,
  36116. listItemHeight: MAT_GRID_SIZE * 5,
  36117. rowHeight: MAT_GRID_SIZE * 6,
  36118. chartMenuPanelWidth: 240
  36119. },
  36120. 'ag-theme-balham': {
  36121. headerHeight: BALHAM_GRID_SIZE * 8,
  36122. headerCellMinWidth: 24,
  36123. listItemHeight: BALHAM_GRID_SIZE * 7,
  36124. rowHeight: BALHAM_GRID_SIZE * 7,
  36125. chartMenuPanelWidth: 220
  36126. },
  36127. 'ag-theme-alpine': {
  36128. headerHeight: ALPINE_GRID_SIZE * 8,
  36129. headerCellMinWidth: 36,
  36130. listItemHeight: ALPINE_GRID_SIZE * 5,
  36131. rowHeight: ALPINE_GRID_SIZE * 7,
  36132. chartMenuPanelWidth: 240
  36133. }
  36134. };
  36135. /**
  36136. * this object contains a list of Sass variables and an array
  36137. * of CSS styles required to get the correct value.
  36138. * eg. $virtual-item-height requires a structure, so we can get its height.
  36139. * <div class="ag-theme-balham">
  36140. * <div class="ag-virtual-list-container">
  36141. * <div class="ag-virtual-list-item"></div>
  36142. * </div>
  36143. * </div>
  36144. */
  36145. var SASS_PROPERTY_BUILDER = {
  36146. headerHeight: ['ag-header-row'],
  36147. headerCellMinWidth: ['ag-header-cell'],
  36148. listItemHeight: ['ag-virtual-list-item'],
  36149. rowHeight: ['ag-row'],
  36150. chartMenuPanelWidth: ['ag-chart-docked-container']
  36151. };
  36152. var CALCULATED_SIZES = {};
  36153. var Environment = /** @class */ (function (_super) {
  36154. __extends(Environment, _super);
  36155. function Environment() {
  36156. return _super !== null && _super.apply(this, arguments) || this;
  36157. }
  36158. Environment.prototype.getSassVariable = function (theme, key) {
  36159. var useTheme = 'ag-theme-' + (theme.match('material') ? 'material' : theme.match('balham') ? 'balham' : theme.match('alpine') ? 'alpine' : 'custom');
  36160. var defaultValue = HARD_CODED_SIZES[useTheme][key];
  36161. var calculatedValue = 0;
  36162. if (!CALCULATED_SIZES[theme]) {
  36163. CALCULATED_SIZES[theme] = {};
  36164. }
  36165. if (CALCULATED_SIZES[theme][key]) {
  36166. return CALCULATED_SIZES[theme][key];
  36167. }
  36168. if (SASS_PROPERTY_BUILDER[key]) {
  36169. var classList = SASS_PROPERTY_BUILDER[key];
  36170. var div = document.createElement('div');
  36171. div.style.position = 'absolute';
  36172. var el = classList.reduce(function (el, currentClass, idx) {
  36173. if (idx === 0) {
  36174. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(el, theme);
  36175. }
  36176. var div = document.createElement('div');
  36177. div.style.position = 'static';
  36178. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(div, currentClass);
  36179. el.appendChild(div);
  36180. return div;
  36181. }, div);
  36182. if (document.body) {
  36183. document.body.appendChild(div);
  36184. var sizeName = key.toLowerCase().indexOf('height') !== -1 ? 'height' : 'width';
  36185. calculatedValue = parseInt(window.getComputedStyle(el)[sizeName], 10);
  36186. document.body.removeChild(div);
  36187. }
  36188. }
  36189. CALCULATED_SIZES[theme][key] = calculatedValue || defaultValue;
  36190. return CALCULATED_SIZES[theme][key];
  36191. };
  36192. Environment.prototype.isThemeDark = function () {
  36193. var theme = this.getTheme().theme;
  36194. return !!theme && theme.indexOf('dark') >= 0;
  36195. };
  36196. Environment.prototype.chartMenuPanelWidth = function () {
  36197. var theme = this.getTheme().themeFamily;
  36198. return this.getSassVariable(theme, 'chartMenuPanelWidth');
  36199. };
  36200. Environment.prototype.getTheme = function () {
  36201. var reg = /\bag-(material|(?:theme-([\w\-]*)))\b/;
  36202. var el = this.eGridDiv;
  36203. var themeMatch;
  36204. while (el) {
  36205. themeMatch = reg.exec(el.className);
  36206. if (!themeMatch) {
  36207. el = el.parentElement;
  36208. }
  36209. else {
  36210. break;
  36211. }
  36212. }
  36213. if (!themeMatch) {
  36214. return {};
  36215. }
  36216. var theme = themeMatch[0];
  36217. var usingOldTheme = themeMatch[2] === undefined;
  36218. if (usingOldTheme) {
  36219. var newTheme_1 = theme.replace('ag-', 'ag-theme-');
  36220. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].doOnce(function () { return console.warn("ag-Grid: As of v19 old theme are no longer provided. Please replace " + theme + " with " + newTheme_1 + "."); }, 'using-old-theme');
  36221. }
  36222. return { theme: theme, el: el, themeFamily: theme.replace(/-dark$/, '') };
  36223. };
  36224. __decorate([
  36225. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('eGridDiv')
  36226. ], Environment.prototype, "eGridDiv", void 0);
  36227. Environment = __decorate([
  36228. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('environment')
  36229. ], Environment);
  36230. return Environment;
  36231. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  36232. /***/ }),
  36233. /* 162 */
  36234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36235. "use strict";
  36236. __webpack_require__.r(__webpack_exports__);
  36237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameService", function() { return AnimationFrameService; });
  36238. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  36239. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44);
  36240. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  36241. /**
  36242. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  36243. * @version v23.2.1
  36244. * @link http://www.ag-grid.com/
  36245. * @license MIT
  36246. */
  36247. var __extends = (undefined && undefined.__extends) || (function () {
  36248. var extendStatics = function (d, b) {
  36249. extendStatics = Object.setPrototypeOf ||
  36250. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36251. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36252. return extendStatics(d, b);
  36253. };
  36254. return function (d, b) {
  36255. extendStatics(d, b);
  36256. function __() { this.constructor = d; }
  36257. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36258. };
  36259. })();
  36260. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  36261. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  36262. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  36263. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  36264. return c > 3 && r && Object.defineProperty(target, key, r), r;
  36265. };
  36266. var AnimationFrameService = /** @class */ (function (_super) {
  36267. __extends(AnimationFrameService, _super);
  36268. function AnimationFrameService() {
  36269. var _this = _super !== null && _super.apply(this, arguments) || this;
  36270. // p1 and p2 are create tasks are to do with row and cell creation.
  36271. // for them we want to execute according to row order, so we use
  36272. // TaskItem so we know what index the item is for.
  36273. _this.createTasksP1 = { list: [], sorted: false }; // eg drawing back-ground of rows
  36274. _this.createTasksP2 = { list: [], sorted: false }; // eg cell renderers, adding hover functionality
  36275. // destroy tasks are to do with row removal. they are done after row creation as the user will need to see new
  36276. // rows first (as blank is scrolled into view), when we remove the old rows (no longer in view) is not as
  36277. // important.
  36278. _this.destroyTasks = [];
  36279. _this.ticking = false;
  36280. // we need to know direction of scroll, to build up rows in the direction of
  36281. // the scroll. eg if user scrolls down, we extend the rows by building down.
  36282. _this.scrollGoingDown = true;
  36283. _this.lastScrollTop = 0;
  36284. _this.taskCount = 0;
  36285. _this.cancelledTasks = new Set();
  36286. return _this;
  36287. }
  36288. AnimationFrameService.prototype.setScrollTop = function (scrollTop) {
  36289. this.scrollGoingDown = scrollTop > this.lastScrollTop;
  36290. this.lastScrollTop = scrollTop;
  36291. };
  36292. AnimationFrameService.prototype.init = function () {
  36293. this.useAnimationFrame = !this.gridOptionsWrapper.isSuppressAnimationFrame();
  36294. };
  36295. // this method is for our ag-Grid sanity only - if animation frames are turned off,
  36296. // then no place in the code should be looking to add any work to be done in animation
  36297. // frames. this stops bugs - where some code is asking for a frame to be executed
  36298. // when it should not.
  36299. AnimationFrameService.prototype.verifyAnimationFrameOn = function (methodName) {
  36300. if (this.useAnimationFrame === false) {
  36301. console.warn("ag-Grid: AnimationFrameService." + methodName + " called but animation frames are off");
  36302. }
  36303. };
  36304. AnimationFrameService.prototype.createTask = function (task, index, list) {
  36305. this.verifyAnimationFrameOn(list);
  36306. var taskItem = { task: task, index: index, createOrder: ++this.taskCount };
  36307. this.addTaskToList(this[list], taskItem);
  36308. this.schedule();
  36309. };
  36310. AnimationFrameService.prototype.cancelTask = function (task) {
  36311. this.cancelledTasks.add(task);
  36312. };
  36313. AnimationFrameService.prototype.addTaskToList = function (taskList, task) {
  36314. taskList.list.push(task);
  36315. taskList.sorted = false;
  36316. };
  36317. AnimationFrameService.prototype.sortTaskList = function (taskList) {
  36318. if (taskList.sorted) {
  36319. return;
  36320. }
  36321. var sortDirection = this.scrollGoingDown ? 1 : -1;
  36322. // sort first by row index (taking into account scroll direction), then by
  36323. // order of task creation (always ascending, so cells will render left-to-right)
  36324. taskList.list.sort(function (a, b) { return a.index !== b.index ? sortDirection * (b.index - a.index) : b.createOrder - a.createOrder; });
  36325. taskList.sorted = true;
  36326. };
  36327. AnimationFrameService.prototype.addDestroyTask = function (task) {
  36328. this.verifyAnimationFrameOn('createTasksP3');
  36329. this.destroyTasks.push(task);
  36330. this.schedule();
  36331. };
  36332. AnimationFrameService.prototype.executeFrame = function (millis) {
  36333. this.verifyAnimationFrameOn('executeFrame');
  36334. var p1TaskList = this.createTasksP1;
  36335. var p1Tasks = p1TaskList.list;
  36336. var p2TaskList = this.createTasksP2;
  36337. var p2Tasks = p2TaskList.list;
  36338. var destroyTasks = this.destroyTasks;
  36339. var frameStart = new Date().getTime();
  36340. var duration = (new Date().getTime()) - frameStart;
  36341. // 16ms is 60 fps
  36342. var noMaxMillis = millis <= 0;
  36343. while (noMaxMillis || duration < millis) {
  36344. var task = void 0;
  36345. if (p1Tasks.length) {
  36346. this.sortTaskList(p1TaskList);
  36347. task = p1Tasks.pop().task;
  36348. }
  36349. else if (p2Tasks.length) {
  36350. this.sortTaskList(p2TaskList);
  36351. task = p2Tasks.pop().task;
  36352. }
  36353. else if (destroyTasks.length) {
  36354. task = destroyTasks.pop();
  36355. }
  36356. else {
  36357. this.cancelledTasks.clear();
  36358. break;
  36359. }
  36360. if (!this.cancelledTasks.has(task)) {
  36361. task();
  36362. }
  36363. duration = (new Date().getTime()) - frameStart;
  36364. }
  36365. if (p1Tasks.length || p2Tasks.length || destroyTasks.length) {
  36366. this.requestFrame();
  36367. }
  36368. else {
  36369. this.stopTicking();
  36370. }
  36371. };
  36372. AnimationFrameService.prototype.stopTicking = function () {
  36373. this.ticking = false;
  36374. var event = {
  36375. type: _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ANIMATION_QUEUE_EMPTY,
  36376. columnApi: this.gridOptionsWrapper.getColumnApi(),
  36377. api: this.gridOptionsWrapper.getApi()
  36378. };
  36379. this.eventService.dispatchEvent(event);
  36380. };
  36381. AnimationFrameService.prototype.flushAllFrames = function () {
  36382. if (!this.useAnimationFrame) {
  36383. return;
  36384. }
  36385. this.executeFrame(-1);
  36386. };
  36387. AnimationFrameService.prototype.schedule = function () {
  36388. if (!this.useAnimationFrame) {
  36389. return;
  36390. }
  36391. if (!this.ticking) {
  36392. this.ticking = true;
  36393. this.requestFrame();
  36394. }
  36395. };
  36396. AnimationFrameService.prototype.requestFrame = function () {
  36397. // check for the existence of requestAnimationFrame, and if
  36398. // it's missing, then we polyfill it with setTimeout()
  36399. var callback = this.executeFrame.bind(this, 60);
  36400. if (window.requestAnimationFrame) {
  36401. window.requestAnimationFrame(callback);
  36402. }
  36403. else if (window.webkitRequestAnimationFrame) {
  36404. window.webkitRequestAnimationFrame(callback);
  36405. }
  36406. else {
  36407. window.setTimeout(callback, 0);
  36408. }
  36409. };
  36410. AnimationFrameService.prototype.isQueueEmpty = function () {
  36411. return !this.ticking;
  36412. };
  36413. __decorate([
  36414. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  36415. ], AnimationFrameService.prototype, "gridOptionsWrapper", void 0);
  36416. __decorate([
  36417. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  36418. ], AnimationFrameService.prototype, "init", null);
  36419. AnimationFrameService = __decorate([
  36420. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('animationFrameService')
  36421. ], AnimationFrameService);
  36422. return AnimationFrameService;
  36423. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  36424. /***/ }),
  36425. /* 163 */
  36426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36427. "use strict";
  36428. __webpack_require__.r(__webpack_exports__);
  36429. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavigationService", function() { return NavigationService; });
  36430. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  36431. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
  36432. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  36433. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  36434. /**
  36435. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  36436. * @version v23.2.1
  36437. * @link http://www.ag-grid.com/
  36438. * @license MIT
  36439. */
  36440. var __extends = (undefined && undefined.__extends) || (function () {
  36441. var extendStatics = function (d, b) {
  36442. extendStatics = Object.setPrototypeOf ||
  36443. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36444. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36445. return extendStatics(d, b);
  36446. };
  36447. return function (d, b) {
  36448. extendStatics(d, b);
  36449. function __() { this.constructor = d; }
  36450. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36451. };
  36452. })();
  36453. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  36454. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  36455. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  36456. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  36457. return c > 3 && r && Object.defineProperty(target, key, r), r;
  36458. };
  36459. var NavigationService = /** @class */ (function (_super) {
  36460. __extends(NavigationService, _super);
  36461. function NavigationService() {
  36462. var _this = _super !== null && _super.apply(this, arguments) || this;
  36463. _this.timeLastPageEventProcessed = 0;
  36464. return _this;
  36465. }
  36466. NavigationService.prototype.init = function () {
  36467. this.scrollWidth = this.gridOptionsWrapper.getScrollbarWidth();
  36468. };
  36469. NavigationService.prototype.registerGridComp = function (gridPanel) {
  36470. this.gridPanel = gridPanel;
  36471. };
  36472. NavigationService.prototype.handlePageScrollingKey = function (event) {
  36473. var key = event.which || event.keyCode;
  36474. var alt = event.altKey;
  36475. var ctrl = event.ctrlKey;
  36476. var currentCell = this.mouseEventService.getCellPositionForEvent(event);
  36477. if (!currentCell) {
  36478. return false;
  36479. }
  36480. var processed = false;
  36481. switch (key) {
  36482. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_PAGE_HOME:
  36483. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_PAGE_END:
  36484. // handle home and end when ctrl & alt are NOT pressed
  36485. if (!ctrl && !alt) {
  36486. this.onHomeOrEndKey(key);
  36487. processed = true;
  36488. }
  36489. break;
  36490. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_LEFT:
  36491. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_RIGHT:
  36492. // handle left and right when ctrl is pressed only
  36493. if (ctrl && !alt) {
  36494. this.onCtrlLeftOrRight(key, currentCell);
  36495. processed = true;
  36496. }
  36497. break;
  36498. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_UP:
  36499. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_DOWN:
  36500. // handle up and down when ctrl is pressed only
  36501. if (ctrl && !alt) {
  36502. this.onCtrlUpOrDown(key, currentCell);
  36503. processed = true;
  36504. }
  36505. break;
  36506. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_PAGE_DOWN:
  36507. // handle page up and page down when ctrl & alt are NOT pressed
  36508. if (!ctrl && !alt) {
  36509. this.onPageDown(currentCell);
  36510. processed = true;
  36511. }
  36512. break;
  36513. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_PAGE_UP:
  36514. // handle page up and page down when ctrl & alt are NOT pressed
  36515. if (!ctrl && !alt) {
  36516. this.onPageUp(currentCell);
  36517. processed = true;
  36518. }
  36519. break;
  36520. }
  36521. if (processed) {
  36522. event.preventDefault();
  36523. }
  36524. return processed;
  36525. };
  36526. // the page up/down keys caused a problem, in that if the user
  36527. // held the page up/down key down, lots of events got generated,
  36528. // which clogged up the event queue (as they take time to process)
  36529. // which in turn froze the grid. Logic below makes sure we wait 100ms
  36530. // between processing the page up/down events, so when user has finger
  36531. // held down on key, we ignore page up/down events until 100ms has passed,
  36532. // which effectively empties the queue of page up/down events.
  36533. NavigationService.prototype.isTimeSinceLastPageEventToRecent = function () {
  36534. var now = new Date().getTime();
  36535. var diff = now - this.timeLastPageEventProcessed;
  36536. return (diff < 100);
  36537. };
  36538. NavigationService.prototype.setTimeLastPageEventProcessed = function () {
  36539. this.timeLastPageEventProcessed = new Date().getTime();
  36540. };
  36541. NavigationService.prototype.onPageDown = function (gridCell) {
  36542. if (this.isTimeSinceLastPageEventToRecent()) {
  36543. return;
  36544. }
  36545. var scrollPosition = this.gridPanel.getVScrollPosition();
  36546. var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
  36547. if (this.gridPanel.isHorizontalScrollShowing()) {
  36548. pixelsInOnePage -= this.scrollWidth;
  36549. }
  36550. var pagingPixelOffset = this.paginationProxy.getPixelOffset();
  36551. var currentPageBottomPixel = scrollPosition.top + pixelsInOnePage;
  36552. var currentPageBottomRow = this.paginationProxy.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset);
  36553. var scrollIndex = currentPageBottomRow;
  36554. var currentCellPixel = this.paginationProxy.getRow(gridCell.rowIndex).rowTop;
  36555. var nextCellPixel = currentCellPixel + pixelsInOnePage - pagingPixelOffset;
  36556. var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
  36557. var pageLastRow = this.paginationProxy.getPageLastRow();
  36558. if (focusIndex > pageLastRow) {
  36559. focusIndex = pageLastRow;
  36560. }
  36561. if (scrollIndex > pageLastRow) {
  36562. scrollIndex = pageLastRow;
  36563. }
  36564. this.navigateTo(scrollIndex, 'top', null, focusIndex, gridCell.column);
  36565. this.setTimeLastPageEventProcessed();
  36566. };
  36567. NavigationService.prototype.onPageUp = function (gridCell) {
  36568. if (this.isTimeSinceLastPageEventToRecent()) {
  36569. return;
  36570. }
  36571. var scrollPosition = this.gridPanel.getVScrollPosition();
  36572. var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top;
  36573. if (this.gridPanel.isHorizontalScrollShowing()) {
  36574. pixelsInOnePage -= this.scrollWidth;
  36575. }
  36576. var pagingPixelOffset = this.paginationProxy.getPixelOffset();
  36577. var currentPageTopPixel = scrollPosition.top;
  36578. var currentPageTopRow = this.paginationProxy.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset);
  36579. var scrollIndex = currentPageTopRow;
  36580. var currentRowNode = this.paginationProxy.getRow(gridCell.rowIndex);
  36581. var nextCellPixel = currentRowNode.rowTop + currentRowNode.rowHeight - pixelsInOnePage - pagingPixelOffset;
  36582. var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset);
  36583. var firstRow = this.paginationProxy.getPageFirstRow();
  36584. if (focusIndex < firstRow) {
  36585. focusIndex = firstRow;
  36586. }
  36587. if (scrollIndex < firstRow) {
  36588. scrollIndex = firstRow;
  36589. }
  36590. this.navigateTo(scrollIndex, 'bottom', null, focusIndex, gridCell.column);
  36591. this.setTimeLastPageEventProcessed();
  36592. };
  36593. // common logic to navigate. takes parameters:
  36594. // scrollIndex - what row to vertically scroll to
  36595. // scrollType - what position to put scroll index ie top/bottom
  36596. // scrollColumn - what column to horizontally scroll to
  36597. // focusIndex / focusColumn - for page up / down, we want to scroll to one row/column, but focus another
  36598. NavigationService.prototype.navigateTo = function (scrollIndex, scrollType, scrollColumn, focusIndex, focusColumn) {
  36599. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(scrollColumn)) {
  36600. this.gridPanel.ensureColumnVisible(scrollColumn);
  36601. }
  36602. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(scrollIndex)) {
  36603. this.gridPanel.ensureIndexVisible(scrollIndex, scrollType);
  36604. }
  36605. // make sure the cell is rendered, needed if we are to focus
  36606. this.animationFrameService.flushAllFrames();
  36607. // if we don't do this, the range will be left on the last cell, which will leave the last focused cell
  36608. // highlighted.
  36609. this.focusController.setFocusedCell(focusIndex, focusColumn, null, true);
  36610. if (this.rangeController) {
  36611. var cellPosition = { rowIndex: focusIndex, rowPinned: null, column: focusColumn };
  36612. this.rangeController.setRangeToCell(cellPosition);
  36613. }
  36614. };
  36615. // ctrl + up/down will bring focus to same column, first/last row. no horizontal scrolling.
  36616. NavigationService.prototype.onCtrlUpOrDown = function (key, gridCell) {
  36617. var upKey = key === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_UP;
  36618. var rowIndexToScrollTo = upKey ? 0 : this.paginationProxy.getPageLastRow();
  36619. this.navigateTo(rowIndexToScrollTo, null, gridCell.column, rowIndexToScrollTo, gridCell.column);
  36620. };
  36621. // ctrl + left/right will bring focus to same row, first/last cell. no vertical scrolling.
  36622. NavigationService.prototype.onCtrlLeftOrRight = function (key, gridCell) {
  36623. var leftKey = key === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_LEFT;
  36624. var allColumns = this.columnController.getAllDisplayedColumns();
  36625. var columnToSelect = leftKey ? allColumns[0] : _utils__WEBPACK_IMPORTED_MODULE_3__["_"].last(allColumns);
  36626. this.navigateTo(gridCell.rowIndex, null, columnToSelect, gridCell.rowIndex, columnToSelect);
  36627. };
  36628. // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring
  36629. // same cell into view (which means either scroll all the way up, or all the way down).
  36630. NavigationService.prototype.onHomeOrEndKey = function (key) {
  36631. var homeKey = key === _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].KEY_PAGE_HOME;
  36632. var allColumns = this.columnController.getAllDisplayedColumns();
  36633. var columnToSelect = homeKey ? allColumns[0] : _utils__WEBPACK_IMPORTED_MODULE_3__["_"].last(allColumns);
  36634. var rowIndexToScrollTo = homeKey ? 0 : this.paginationProxy.getPageLastRow();
  36635. this.navigateTo(rowIndexToScrollTo, null, columnToSelect, rowIndexToScrollTo, columnToSelect);
  36636. };
  36637. __decorate([
  36638. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('mouseEventService')
  36639. ], NavigationService.prototype, "mouseEventService", void 0);
  36640. __decorate([
  36641. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('paginationProxy')
  36642. ], NavigationService.prototype, "paginationProxy", void 0);
  36643. __decorate([
  36644. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
  36645. ], NavigationService.prototype, "focusController", void 0);
  36646. __decorate([
  36647. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('animationFrameService')
  36648. ], NavigationService.prototype, "animationFrameService", void 0);
  36649. __decorate([
  36650. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Optional"])('rangeController')
  36651. ], NavigationService.prototype, "rangeController", void 0);
  36652. __decorate([
  36653. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  36654. ], NavigationService.prototype, "columnController", void 0);
  36655. __decorate([
  36656. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  36657. ], NavigationService.prototype, "gridOptionsWrapper", void 0);
  36658. __decorate([
  36659. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  36660. ], NavigationService.prototype, "init", null);
  36661. NavigationService = __decorate([
  36662. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('navigationService')
  36663. ], NavigationService);
  36664. return NavigationService;
  36665. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  36666. /***/ }),
  36667. /* 164 */
  36668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36669. "use strict";
  36670. __webpack_require__.r(__webpack_exports__);
  36671. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxDivHeightScaler", function() { return MaxDivHeightScaler; });
  36672. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  36673. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  36674. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44);
  36675. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  36676. /**
  36677. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  36678. * @version v23.2.1
  36679. * @link http://www.ag-grid.com/
  36680. * @license MIT
  36681. */
  36682. var __extends = (undefined && undefined.__extends) || (function () {
  36683. var extendStatics = function (d, b) {
  36684. extendStatics = Object.setPrototypeOf ||
  36685. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36686. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36687. return extendStatics(d, b);
  36688. };
  36689. return function (d, b) {
  36690. extendStatics(d, b);
  36691. function __() { this.constructor = d; }
  36692. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36693. };
  36694. })();
  36695. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  36696. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  36697. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  36698. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  36699. return c > 3 && r && Object.defineProperty(target, key, r), r;
  36700. };
  36701. /**
  36702. * This class solves the 'max height' problem, where the user might want to show more data than
  36703. * the max div height actually allows.
  36704. */
  36705. var MaxDivHeightScaler = /** @class */ (function (_super) {
  36706. __extends(MaxDivHeightScaler, _super);
  36707. function MaxDivHeightScaler() {
  36708. var _this = _super !== null && _super.apply(this, arguments) || this;
  36709. // the scrollY position
  36710. _this.scrollY = 0;
  36711. // how tall the body is
  36712. _this.uiBodyHeight = 0;
  36713. return _this;
  36714. }
  36715. MaxDivHeightScaler.prototype.postConstruct = function () {
  36716. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_BODY_HEIGHT_CHANGED, this.updateOffset.bind(this));
  36717. this.scrollBarWidth = this.gridOptionsWrapper.getScrollbarWidth();
  36718. this.maxDivHeight = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].getMaxDivHeight();
  36719. };
  36720. MaxDivHeightScaler.prototype.registerGridComp = function (gridPanel) {
  36721. this.gridPanel = gridPanel;
  36722. };
  36723. MaxDivHeightScaler.prototype.isScaling = function () {
  36724. return this.scaling;
  36725. };
  36726. MaxDivHeightScaler.prototype.getOffset = function () {
  36727. return this.offset;
  36728. };
  36729. MaxDivHeightScaler.prototype.updateOffset = function () {
  36730. if (!this.scaling) {
  36731. return;
  36732. }
  36733. var newScrollY = this.gridPanel.getVScrollPosition().top;
  36734. var newBodyHeight = this.getUiBodyHeight();
  36735. var atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight;
  36736. if (atLeastOneChanged) {
  36737. this.scrollY = newScrollY;
  36738. this.uiBodyHeight = newBodyHeight;
  36739. this.calculateOffset();
  36740. }
  36741. };
  36742. MaxDivHeightScaler.prototype.calculateOffset = function () {
  36743. this.uiContainerHeight = this.maxDivHeight;
  36744. this.pixelsToShave = this.modelHeight - this.uiContainerHeight;
  36745. this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight;
  36746. var scrollPercent = this.scrollY / this.maxScrollY;
  36747. this.setOffset(scrollPercent * this.pixelsToShave);
  36748. };
  36749. MaxDivHeightScaler.prototype.clearOffset = function () {
  36750. this.uiContainerHeight = this.modelHeight;
  36751. this.pixelsToShave = 0;
  36752. this.setOffset(0);
  36753. };
  36754. MaxDivHeightScaler.prototype.setOffset = function (newOffset) {
  36755. // because we are talking pixels, no point in confusing things with half numbers
  36756. var newOffsetFloor = typeof newOffset === 'number' ? Math.floor(newOffset) : null;
  36757. if (this.offset === newOffsetFloor) {
  36758. return;
  36759. }
  36760. this.offset = newOffsetFloor;
  36761. this.eventService.dispatchEvent({ type: _eventKeys__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_HEIGHT_SCALE_CHANGED });
  36762. };
  36763. MaxDivHeightScaler.prototype.setModelHeight = function (modelHeight) {
  36764. this.modelHeight = modelHeight;
  36765. this.scaling = this.maxDivHeight > 0 && modelHeight > this.maxDivHeight;
  36766. if (this.scaling) {
  36767. this.calculateOffset();
  36768. }
  36769. else {
  36770. this.clearOffset();
  36771. }
  36772. };
  36773. MaxDivHeightScaler.prototype.getUiContainerHeight = function () {
  36774. return this.uiContainerHeight;
  36775. };
  36776. MaxDivHeightScaler.prototype.getRealPixelPosition = function (modelPixel) {
  36777. return modelPixel - this.offset;
  36778. };
  36779. MaxDivHeightScaler.prototype.getUiBodyHeight = function () {
  36780. var pos = this.gridPanel.getVScrollPosition();
  36781. return pos.bottom - pos.top;
  36782. };
  36783. MaxDivHeightScaler.prototype.getScrollPositionForPixel = function (rowTop) {
  36784. if (this.pixelsToShave <= 0) {
  36785. return rowTop;
  36786. }
  36787. var modelMaxScroll = this.modelHeight - this.getUiBodyHeight();
  36788. var scrollPercent = rowTop / modelMaxScroll;
  36789. var scrollPixel = this.maxScrollY * scrollPercent;
  36790. return scrollPixel;
  36791. };
  36792. __decorate([
  36793. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  36794. ], MaxDivHeightScaler.prototype, "gridOptionsWrapper", void 0);
  36795. __decorate([
  36796. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  36797. ], MaxDivHeightScaler.prototype, "postConstruct", null);
  36798. MaxDivHeightScaler = __decorate([
  36799. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('maxDivHeightScaler')
  36800. ], MaxDivHeightScaler);
  36801. return MaxDivHeightScaler;
  36802. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  36803. /***/ }),
  36804. /* 165 */
  36805. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36806. "use strict";
  36807. __webpack_require__.r(__webpack_exports__);
  36808. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectableService", function() { return SelectableService; });
  36809. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  36810. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  36811. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  36812. /**
  36813. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  36814. * @version v23.2.1
  36815. * @link http://www.ag-grid.com/
  36816. * @license MIT
  36817. */
  36818. var __extends = (undefined && undefined.__extends) || (function () {
  36819. var extendStatics = function (d, b) {
  36820. extendStatics = Object.setPrototypeOf ||
  36821. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36822. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36823. return extendStatics(d, b);
  36824. };
  36825. return function (d, b) {
  36826. extendStatics(d, b);
  36827. function __() { this.constructor = d; }
  36828. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36829. };
  36830. })();
  36831. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  36832. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  36833. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  36834. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  36835. return c > 3 && r && Object.defineProperty(target, key, r), r;
  36836. };
  36837. var SelectableService = /** @class */ (function (_super) {
  36838. __extends(SelectableService, _super);
  36839. function SelectableService() {
  36840. return _super !== null && _super.apply(this, arguments) || this;
  36841. }
  36842. SelectableService.prototype.init = function () {
  36843. this.groupSelectsChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
  36844. this.isRowSelectableFunc = this.gridOptionsWrapper.getIsRowSelectableFunc();
  36845. };
  36846. SelectableService.prototype.updateSelectableAfterGrouping = function (rowNode) {
  36847. if (this.isRowSelectableFunc) {
  36848. var nextChildrenFunc = function (rowNode) { return rowNode.childrenAfterGroup; };
  36849. this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc);
  36850. }
  36851. };
  36852. SelectableService.prototype.updateSelectableAfterFiltering = function (rowNode) {
  36853. if (this.isRowSelectableFunc) {
  36854. var nextChildrenFunc = function (rowNode) { return rowNode.childrenAfterFilter; };
  36855. this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc);
  36856. }
  36857. };
  36858. SelectableService.prototype.recurseDown = function (children, nextChildrenFunc) {
  36859. var _this = this;
  36860. children.forEach(function (child) {
  36861. if (!child.group) {
  36862. return;
  36863. } // only interested in groups
  36864. if (child.hasChildren()) {
  36865. _this.recurseDown(nextChildrenFunc(child), nextChildrenFunc);
  36866. }
  36867. var rowSelectable;
  36868. if (_this.groupSelectsChildren) {
  36869. // have this group selectable if at least one direct child is selectable
  36870. var firstSelectable = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].find(nextChildrenFunc(child), 'selectable', true);
  36871. rowSelectable = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(firstSelectable);
  36872. }
  36873. else {
  36874. // directly retrieve selectable value from user callback
  36875. rowSelectable = _this.isRowSelectableFunc ? _this.isRowSelectableFunc(child) : false;
  36876. }
  36877. child.setRowSelectable(rowSelectable);
  36878. });
  36879. };
  36880. __decorate([
  36881. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  36882. ], SelectableService.prototype, "gridOptionsWrapper", void 0);
  36883. __decorate([
  36884. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  36885. ], SelectableService.prototype, "init", null);
  36886. SelectableService = __decorate([
  36887. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('selectableService')
  36888. ], SelectableService);
  36889. return SelectableService;
  36890. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  36891. /***/ }),
  36892. /* 166 */
  36893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36894. "use strict";
  36895. __webpack_require__.r(__webpack_exports__);
  36896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AutoHeightCalculator", function() { return AutoHeightCalculator; });
  36897. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  36898. /* harmony import */ var _cellComp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(101);
  36899. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  36900. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  36901. /**
  36902. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  36903. * @version v23.2.1
  36904. * @link http://www.ag-grid.com/
  36905. * @license MIT
  36906. */
  36907. var __extends = (undefined && undefined.__extends) || (function () {
  36908. var extendStatics = function (d, b) {
  36909. extendStatics = Object.setPrototypeOf ||
  36910. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  36911. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  36912. return extendStatics(d, b);
  36913. };
  36914. return function (d, b) {
  36915. extendStatics(d, b);
  36916. function __() { this.constructor = d; }
  36917. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  36918. };
  36919. })();
  36920. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  36921. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  36922. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  36923. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  36924. return c > 3 && r && Object.defineProperty(target, key, r), r;
  36925. };
  36926. var AutoHeightCalculator = /** @class */ (function (_super) {
  36927. __extends(AutoHeightCalculator, _super);
  36928. function AutoHeightCalculator() {
  36929. return _super !== null && _super.apply(this, arguments) || this;
  36930. }
  36931. AutoHeightCalculator.prototype.registerGridComp = function (gridPanel) {
  36932. this.gridPanel = gridPanel;
  36933. };
  36934. AutoHeightCalculator.prototype.getPreferredHeightForRow = function (rowNode) {
  36935. var _this = this;
  36936. if (!this.eDummyContainer) {
  36937. this.eDummyContainer = document.createElement('div');
  36938. // so any styles on row also get applied in dummy, otherwise
  36939. // the content in dummy may differ to the real
  36940. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].addCssClass(this.eDummyContainer, 'ag-row ag-row-no-focus');
  36941. }
  36942. // we put the dummy into the body container, so it will inherit all the
  36943. // css styles that the real cells are inheriting
  36944. var eBodyContainer = this.gridPanel.getCenterContainer();
  36945. eBodyContainer.appendChild(this.eDummyContainer);
  36946. var cellComps = [];
  36947. var autoRowHeightCols = this.columnController.getAllAutoRowHeightCols();
  36948. var visibleAutoRowHeightCols = autoRowHeightCols.filter(function (col) { return col.isVisible(); });
  36949. visibleAutoRowHeightCols.forEach(function (col) {
  36950. var cellComp = new _cellComp__WEBPACK_IMPORTED_MODULE_1__["CellComp"](_this.$scope, _this.beans, col, rowNode, null, true, false);
  36951. cellComp.setParentRow(_this.eDummyContainer);
  36952. cellComps.push(cellComp);
  36953. });
  36954. var template = cellComps.map(function (cellComp) { return cellComp.getCreateTemplate(); }).join(' ');
  36955. this.eDummyContainer.innerHTML = template;
  36956. // this gets any cellComps that are using components to put the components in
  36957. cellComps.forEach(function (cellComp) { return cellComp.afterAttached(); });
  36958. // we should be able to just take the height of the row at this point, however
  36959. // the row isn't expanding to cover the cell heights, i don't know why, i couldn't
  36960. // figure it out so instead looking at the individual cells instead
  36961. var maxCellHeight = 0;
  36962. for (var i = 0; i < this.eDummyContainer.children.length; i++) {
  36963. var child = this.eDummyContainer.children[i];
  36964. if (child.offsetHeight > maxCellHeight) {
  36965. maxCellHeight = child.offsetHeight;
  36966. }
  36967. }
  36968. // we are finished with the dummy container, so get rid of it
  36969. eBodyContainer.removeChild(this.eDummyContainer);
  36970. cellComps.forEach(function (cellComp) {
  36971. // dunno why we need to detach first, doing it here to be consistent with code in RowComp
  36972. cellComp.detach();
  36973. cellComp.destroy();
  36974. });
  36975. // in case anything left over from last time
  36976. _utils__WEBPACK_IMPORTED_MODULE_2__["_"].clearElement(this.eDummyContainer);
  36977. return maxCellHeight;
  36978. };
  36979. __decorate([
  36980. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('beans')
  36981. ], AutoHeightCalculator.prototype, "beans", void 0);
  36982. __decorate([
  36983. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("$scope")
  36984. ], AutoHeightCalculator.prototype, "$scope", void 0);
  36985. __decorate([
  36986. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])("columnController")
  36987. ], AutoHeightCalculator.prototype, "columnController", void 0);
  36988. AutoHeightCalculator = __decorate([
  36989. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('autoHeightCalculator')
  36990. ], AutoHeightCalculator);
  36991. return AutoHeightCalculator;
  36992. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  36993. /***/ }),
  36994. /* 167 */
  36995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36996. "use strict";
  36997. __webpack_require__.r(__webpack_exports__);
  36998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationComp", function() { return PaginationComp; });
  36999. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  37000. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  37001. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  37002. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
  37003. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25);
  37004. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7);
  37005. /**
  37006. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  37007. * @version v23.2.1
  37008. * @link http://www.ag-grid.com/
  37009. * @license MIT
  37010. */
  37011. var __extends = (undefined && undefined.__extends) || (function () {
  37012. var extendStatics = function (d, b) {
  37013. extendStatics = Object.setPrototypeOf ||
  37014. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  37015. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  37016. return extendStatics(d, b);
  37017. };
  37018. return function (d, b) {
  37019. extendStatics(d, b);
  37020. function __() { this.constructor = d; }
  37021. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  37022. };
  37023. })();
  37024. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  37025. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  37026. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  37027. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  37028. return c > 3 && r && Object.defineProperty(target, key, r), r;
  37029. };
  37030. var PaginationComp = /** @class */ (function (_super) {
  37031. __extends(PaginationComp, _super);
  37032. function PaginationComp() {
  37033. var _this = _super.call(this) || this;
  37034. _this.previousAndFirstButtonsDisabled = false;
  37035. _this.nextButtonDisabled = false;
  37036. _this.lastButtonDisabled = false;
  37037. return _this;
  37038. }
  37039. PaginationComp.prototype.postConstruct = function () {
  37040. var isRtl = this.gridOptionsWrapper.isEnableRtl();
  37041. this.setTemplate(this.getTemplate());
  37042. this.btFirst.insertAdjacentElement('afterbegin', _utils__WEBPACK_IMPORTED_MODULE_5__["_"].createIconNoSpan(isRtl ? 'last' : 'first', this.gridOptionsWrapper));
  37043. this.btPrevious.insertAdjacentElement('afterbegin', _utils__WEBPACK_IMPORTED_MODULE_5__["_"].createIconNoSpan(isRtl ? 'next' : 'previous', this.gridOptionsWrapper));
  37044. this.btNext.insertAdjacentElement('afterbegin', _utils__WEBPACK_IMPORTED_MODULE_5__["_"].createIconNoSpan(isRtl ? 'previous' : 'next', this.gridOptionsWrapper));
  37045. this.btLast.insertAdjacentElement('afterbegin', _utils__WEBPACK_IMPORTED_MODULE_5__["_"].createIconNoSpan(isRtl ? 'first' : 'last', this.gridOptionsWrapper));
  37046. if (this.rowModel.getType() === _constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].ROW_MODEL_TYPE_SERVER_SIDE) {
  37047. this.serverSideRowModel = this.rowModel;
  37048. }
  37049. var isPaging = this.gridOptionsWrapper.isPagination();
  37050. var paginationPanelEnabled = isPaging && !this.gridOptionsWrapper.isSuppressPaginationPanel();
  37051. if (!paginationPanelEnabled) {
  37052. this.setDisplayed(false);
  37053. return;
  37054. }
  37055. this.addManagedListener(this.eventService, _events__WEBPACK_IMPORTED_MODULE_3__["Events"].EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this));
  37056. this.addManagedListener(this.btFirst, 'click', this.onBtFirst.bind(this));
  37057. this.addManagedListener(this.btLast, 'click', this.onBtLast.bind(this));
  37058. this.addManagedListener(this.btNext, 'click', this.onBtNext.bind(this));
  37059. this.addManagedListener(this.btPrevious, 'click', this.onBtPrevious.bind(this));
  37060. this.onPaginationChanged();
  37061. };
  37062. PaginationComp.prototype.onPaginationChanged = function () {
  37063. this.enableOrDisableButtons();
  37064. this.updateRowLabels();
  37065. this.setCurrentPageLabel();
  37066. this.setTotalLabels();
  37067. };
  37068. PaginationComp.prototype.onBtFirst = function () {
  37069. if (!this.previousAndFirstButtonsDisabled) {
  37070. this.paginationProxy.goToFirstPage();
  37071. }
  37072. };
  37073. PaginationComp.prototype.setCurrentPageLabel = function () {
  37074. var pagesExist = this.paginationProxy.getTotalPages() > 0;
  37075. var currentPage = this.paginationProxy.getCurrentPage();
  37076. var toDisplay = pagesExist ? currentPage + 1 : 0;
  37077. this.lbCurrent.innerHTML = this.formatNumber(toDisplay);
  37078. };
  37079. PaginationComp.prototype.formatNumber = function (value) {
  37080. var userFunc = this.gridOptionsWrapper.getPaginationNumberFormatterFunc();
  37081. if (userFunc) {
  37082. return userFunc({ value: value });
  37083. }
  37084. else {
  37085. return _utils__WEBPACK_IMPORTED_MODULE_5__["_"].formatNumberCommas(value);
  37086. }
  37087. };
  37088. PaginationComp.prototype.getTemplate = function () {
  37089. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  37090. var strPage = localeTextFunc('page', 'Page');
  37091. var strTo = localeTextFunc('to', 'to');
  37092. var strOf = localeTextFunc('of', 'of');
  37093. var strFirst = localeTextFunc('first', 'First');
  37094. var strPrevious = localeTextFunc('previous', 'Previous');
  37095. var strNext = localeTextFunc('next', 'Next');
  37096. var strLast = localeTextFunc('last', 'Last');
  37097. return "<div class=\"ag-paging-panel ag-unselectable\">\n <span ref=\"eSummaryPanel\" class=\"ag-paging-row-summary-panel\">\n <span ref=\"lbFirstRowOnPage\" class=\"ag-paging-row-summary-panel-number\"></span>\n " + strTo + "\n <span ref=\"lbLastRowOnPage\" class=\"ag-paging-row-summary-panel-number\"></span>\n " + strOf + "\n <span ref=\"lbRecordCount\" class=\"ag-paging-row-summary-panel-number\"></span>\n </span>\n <span class=\"ag-paging-page-summary-panel\">\n <div ref=\"btFirst\" class=\"ag-paging-button-wrapper\">\n <button type=\"button\" class=\"ag-paging-button\">" + strFirst + "</button>\n </div>\n <div ref=\"btPrevious\" class=\"ag-paging-button-wrapper\">\n <button type=\"button\" class=\"ag-paging-button\">" + strPrevious + "</button>\n </div>\n <span class=\"ag-paging-description\">\n " + strPage + "\n <span ref=\"lbCurrent\" class=\"ag-paging-number\"></span>\n " + strOf + "\n <span ref=\"lbTotal\" class=\"ag-paging-number\"></span>\n </span>\n <span ref=\"lbTotal\" class=\"ag-paging-number\"></span>\n <div ref=\"btNext\" class=\"ag-paging-button-wrapper\">\n <button type=\"button\" class=\"ag-paging-button\">" + strNext + "</button>\n </div>\n <div ref=\"btLast\" class=\"ag-paging-button-wrapper\">\n <button type=\"button\" class=\"ag-paging-button\">" + strLast + "</button>\n </div>\n </span>\n </div>";
  37098. };
  37099. PaginationComp.prototype.onBtNext = function () {
  37100. if (!this.nextButtonDisabled) {
  37101. this.paginationProxy.goToNextPage();
  37102. }
  37103. };
  37104. PaginationComp.prototype.onBtPrevious = function () {
  37105. if (!this.previousAndFirstButtonsDisabled) {
  37106. this.paginationProxy.goToPreviousPage();
  37107. }
  37108. };
  37109. PaginationComp.prototype.onBtLast = function () {
  37110. if (!this.lastButtonDisabled) {
  37111. this.paginationProxy.goToLastPage();
  37112. }
  37113. };
  37114. PaginationComp.prototype.enableOrDisableButtons = function () {
  37115. var currentPage = this.paginationProxy.getCurrentPage();
  37116. var maxRowFound = this.paginationProxy.isLastPageFound();
  37117. var totalPages = this.paginationProxy.getTotalPages();
  37118. this.previousAndFirstButtonsDisabled = currentPage === 0;
  37119. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].addOrRemoveCssClass(this.btPrevious, 'ag-disabled', this.previousAndFirstButtonsDisabled);
  37120. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].addOrRemoveCssClass(this.btFirst, 'ag-disabled', this.previousAndFirstButtonsDisabled);
  37121. var zeroPagesToDisplay = this.isZeroPagesToDisplay();
  37122. var onLastPage = maxRowFound && currentPage === (totalPages - 1);
  37123. this.nextButtonDisabled = onLastPage || zeroPagesToDisplay;
  37124. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].addOrRemoveCssClass(this.btNext, 'ag-disabled', this.nextButtonDisabled);
  37125. this.lastButtonDisabled = !maxRowFound || zeroPagesToDisplay || currentPage === (totalPages - 1);
  37126. _utils__WEBPACK_IMPORTED_MODULE_5__["_"].addOrRemoveCssClass(this.btLast, 'ag-disabled', this.lastButtonDisabled);
  37127. };
  37128. PaginationComp.prototype.updateRowLabels = function () {
  37129. var currentPage = this.paginationProxy.getCurrentPage();
  37130. var pageSize = this.paginationProxy.getPageSize();
  37131. var maxRowFound = this.paginationProxy.isLastPageFound();
  37132. var rowCount = this.paginationProxy.isLastPageFound() ?
  37133. this.paginationProxy.getMasterRowCount() : null;
  37134. var startRow;
  37135. var endRow;
  37136. if (this.isZeroPagesToDisplay()) {
  37137. startRow = 0;
  37138. endRow = 0;
  37139. }
  37140. else {
  37141. startRow = (pageSize * currentPage) + 1;
  37142. endRow = startRow + pageSize - 1;
  37143. if (maxRowFound && endRow > rowCount) {
  37144. endRow = rowCount;
  37145. }
  37146. }
  37147. this.lbFirstRowOnPage.innerHTML = this.formatNumber(startRow);
  37148. if (this.serverSideRowModel && this.serverSideRowModel.isLoading()) {
  37149. this.lbLastRowOnPage.innerHTML = '?';
  37150. }
  37151. else {
  37152. this.lbLastRowOnPage.innerHTML = this.formatNumber(endRow);
  37153. }
  37154. };
  37155. PaginationComp.prototype.isZeroPagesToDisplay = function () {
  37156. var maxRowFound = this.paginationProxy.isLastPageFound();
  37157. var totalPages = this.paginationProxy.getTotalPages();
  37158. return maxRowFound && totalPages === 0;
  37159. };
  37160. PaginationComp.prototype.setTotalLabels = function () {
  37161. var lastPageFound = this.paginationProxy.isLastPageFound();
  37162. var totalPages = this.paginationProxy.getTotalPages();
  37163. var rowCount = this.paginationProxy.isLastPageFound() ?
  37164. this.paginationProxy.getMasterRowCount() : null;
  37165. if (lastPageFound) {
  37166. this.lbTotal.innerHTML = this.formatNumber(totalPages);
  37167. this.lbRecordCount.innerHTML = this.formatNumber(rowCount);
  37168. }
  37169. else {
  37170. var moreText = this.gridOptionsWrapper.getLocaleTextFunc()('more', 'more');
  37171. this.lbTotal.innerHTML = moreText;
  37172. this.lbRecordCount.innerHTML = moreText;
  37173. }
  37174. };
  37175. __decorate([
  37176. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  37177. ], PaginationComp.prototype, "gridOptionsWrapper", void 0);
  37178. __decorate([
  37179. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('paginationProxy')
  37180. ], PaginationComp.prototype, "paginationProxy", void 0);
  37181. __decorate([
  37182. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowRenderer')
  37183. ], PaginationComp.prototype, "rowRenderer", void 0);
  37184. __decorate([
  37185. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('rowModel')
  37186. ], PaginationComp.prototype, "rowModel", void 0);
  37187. __decorate([
  37188. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('btFirst')
  37189. ], PaginationComp.prototype, "btFirst", void 0);
  37190. __decorate([
  37191. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('btPrevious')
  37192. ], PaginationComp.prototype, "btPrevious", void 0);
  37193. __decorate([
  37194. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('btNext')
  37195. ], PaginationComp.prototype, "btNext", void 0);
  37196. __decorate([
  37197. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('btLast')
  37198. ], PaginationComp.prototype, "btLast", void 0);
  37199. __decorate([
  37200. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('lbRecordCount')
  37201. ], PaginationComp.prototype, "lbRecordCount", void 0);
  37202. __decorate([
  37203. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('lbFirstRowOnPage')
  37204. ], PaginationComp.prototype, "lbFirstRowOnPage", void 0);
  37205. __decorate([
  37206. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('lbLastRowOnPage')
  37207. ], PaginationComp.prototype, "lbLastRowOnPage", void 0);
  37208. __decorate([
  37209. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eSummaryPanel')
  37210. ], PaginationComp.prototype, "eSummaryPanel", void 0);
  37211. __decorate([
  37212. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('lbCurrent')
  37213. ], PaginationComp.prototype, "lbCurrent", void 0);
  37214. __decorate([
  37215. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('lbTotal')
  37216. ], PaginationComp.prototype, "lbTotal", void 0);
  37217. __decorate([
  37218. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  37219. ], PaginationComp.prototype, "postConstruct", null);
  37220. return PaginationComp;
  37221. }(_widgets_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  37222. /***/ }),
  37223. /* 168 */
  37224. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37225. "use strict";
  37226. __webpack_require__.r(__webpack_exports__);
  37227. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResizeObserverService", function() { return ResizeObserverService; });
  37228. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  37229. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  37230. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  37231. /**
  37232. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  37233. * @version v23.2.1
  37234. * @link http://www.ag-grid.com/
  37235. * @license MIT
  37236. */
  37237. var __extends = (undefined && undefined.__extends) || (function () {
  37238. var extendStatics = function (d, b) {
  37239. extendStatics = Object.setPrototypeOf ||
  37240. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  37241. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  37242. return extendStatics(d, b);
  37243. };
  37244. return function (d, b) {
  37245. extendStatics(d, b);
  37246. function __() { this.constructor = d; }
  37247. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  37248. };
  37249. })();
  37250. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  37251. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  37252. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  37253. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  37254. return c > 3 && r && Object.defineProperty(target, key, r), r;
  37255. };
  37256. var ResizeObserverService = /** @class */ (function (_super) {
  37257. __extends(ResizeObserverService, _super);
  37258. function ResizeObserverService() {
  37259. return _super !== null && _super.apply(this, arguments) || this;
  37260. }
  37261. ResizeObserverService.prototype.observeResize = function (element, callback, debounceDelay) {
  37262. if (debounceDelay === void 0) { debounceDelay = 50; }
  37263. // put in variable, so available to usePolyfill() function below
  37264. var frameworkFactory = this.getFrameworkOverrides();
  37265. // this gets fired too often and might cause some relayout issues
  37266. // so we add a debounce to the callback here to avoid the flashing effect.
  37267. var debouncedCallback = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].debounce(callback, debounceDelay);
  37268. var useBrowserResizeObserver = function () {
  37269. var resizeObserver = new window.ResizeObserver(debouncedCallback);
  37270. resizeObserver.observe(element);
  37271. return function () { return resizeObserver.disconnect(); };
  37272. };
  37273. var usePolyfill = function () {
  37274. // initialise to the current width and height, so first call will have no changes
  37275. var widthLastTime = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].offsetWidth(element);
  37276. var heightLastTime = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].offsetHeight(element);
  37277. // when finished, this gets turned to false.
  37278. var running = true;
  37279. var periodicallyCheckWidthAndHeight = function () {
  37280. if (running) {
  37281. var newWidth = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].offsetWidth(element);
  37282. var newHeight = _utils__WEBPACK_IMPORTED_MODULE_2__["_"].offsetHeight(element);
  37283. var changed = newWidth !== widthLastTime || newHeight !== heightLastTime;
  37284. if (changed) {
  37285. widthLastTime = newWidth;
  37286. heightLastTime = newHeight;
  37287. callback();
  37288. }
  37289. frameworkFactory.setTimeout(periodicallyCheckWidthAndHeight, debounceDelay);
  37290. }
  37291. };
  37292. periodicallyCheckWidthAndHeight();
  37293. // the callback function we return sets running to false
  37294. return function () { return running = false; };
  37295. };
  37296. var suppressResize = this.gridOptionsWrapper.isSuppressBrowserResizeObserver();
  37297. var resizeObserverExists = !!window.ResizeObserver;
  37298. if (resizeObserverExists && !suppressResize) {
  37299. return useBrowserResizeObserver();
  37300. }
  37301. else {
  37302. return usePolyfill();
  37303. }
  37304. };
  37305. __decorate([
  37306. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  37307. ], ResizeObserverService.prototype, "gridOptionsWrapper", void 0);
  37308. ResizeObserverService = __decorate([
  37309. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('resizeObserverService')
  37310. ], ResizeObserverService);
  37311. return ResizeObserverService;
  37312. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  37313. /***/ }),
  37314. /* 169 */
  37315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37316. "use strict";
  37317. __webpack_require__.r(__webpack_exports__);
  37318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWrapperComponent", function() { return OverlayWrapperComponent; });
  37319. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  37320. /* harmony import */ var _widgets_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  37321. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  37322. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  37323. /**
  37324. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  37325. * @version v23.2.1
  37326. * @link http://www.ag-grid.com/
  37327. * @license MIT
  37328. */
  37329. var __extends = (undefined && undefined.__extends) || (function () {
  37330. var extendStatics = function (d, b) {
  37331. extendStatics = Object.setPrototypeOf ||
  37332. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  37333. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  37334. return extendStatics(d, b);
  37335. };
  37336. return function (d, b) {
  37337. extendStatics(d, b);
  37338. function __() { this.constructor = d; }
  37339. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  37340. };
  37341. })();
  37342. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  37343. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  37344. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  37345. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  37346. return c > 3 && r && Object.defineProperty(target, key, r), r;
  37347. };
  37348. var LoadingType;
  37349. (function (LoadingType) {
  37350. LoadingType[LoadingType["Loading"] = 0] = "Loading";
  37351. LoadingType[LoadingType["NoRows"] = 1] = "NoRows";
  37352. })(LoadingType || (LoadingType = {}));
  37353. var OverlayWrapperComponent = /** @class */ (function (_super) {
  37354. __extends(OverlayWrapperComponent, _super);
  37355. function OverlayWrapperComponent() {
  37356. var _this = _super.call(this, OverlayWrapperComponent.TEMPLATE) || this;
  37357. _this.inProgress = false;
  37358. _this.destroyRequested = false;
  37359. return _this;
  37360. }
  37361. OverlayWrapperComponent.prototype.postConstruct = function () {
  37362. this.gridOptionsWrapper.addLayoutElement(this.eOverlayWrapper);
  37363. this.setDisplayed(false);
  37364. };
  37365. OverlayWrapperComponent.prototype.setWrapperTypeClass = function (loadingType) {
  37366. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.eOverlayWrapper, 'ag-overlay-loading-wrapper', loadingType === LoadingType.Loading);
  37367. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.eOverlayWrapper, 'ag-overlay-no-rows-wrapper', loadingType === LoadingType.NoRows);
  37368. };
  37369. OverlayWrapperComponent.prototype.showLoadingOverlay = function () {
  37370. var workItem = this.userComponentFactory.newLoadingOverlayComponent({
  37371. api: this.gridOptionsWrapper.getApi()
  37372. });
  37373. this.showOverlay(workItem, LoadingType.Loading);
  37374. };
  37375. OverlayWrapperComponent.prototype.showNoRowsOverlay = function () {
  37376. var workItem = this.userComponentFactory.newNoRowsOverlayComponent({
  37377. api: this.gridOptionsWrapper.getApi()
  37378. });
  37379. this.showOverlay(workItem, LoadingType.NoRows);
  37380. };
  37381. OverlayWrapperComponent.prototype.showOverlay = function (workItem, type) {
  37382. var _this = this;
  37383. if (this.inProgress) {
  37384. return;
  37385. }
  37386. this.setWrapperTypeClass(type);
  37387. this.destroyActiveOverlay();
  37388. this.inProgress = true;
  37389. workItem.then(function (comp) {
  37390. _this.inProgress = false;
  37391. _this.eOverlayWrapper.appendChild(comp.getGui());
  37392. _this.activeOverlay = comp;
  37393. if (_this.destroyRequested) {
  37394. _this.destroyRequested = false;
  37395. _this.destroyActiveOverlay();
  37396. }
  37397. });
  37398. this.setDisplayed(true);
  37399. };
  37400. OverlayWrapperComponent.prototype.destroyActiveOverlay = function () {
  37401. if (this.inProgress) {
  37402. this.destroyRequested = true;
  37403. return;
  37404. }
  37405. if (!this.activeOverlay) {
  37406. return;
  37407. }
  37408. this.activeOverlay = this.getContext().destroyBean(this.activeOverlay);
  37409. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].clearElement(this.eOverlayWrapper);
  37410. };
  37411. OverlayWrapperComponent.prototype.hideOverlay = function () {
  37412. this.destroyActiveOverlay();
  37413. this.setDisplayed(false);
  37414. };
  37415. OverlayWrapperComponent.prototype.destroy = function () {
  37416. this.destroyActiveOverlay();
  37417. _super.prototype.destroy.call(this);
  37418. };
  37419. // wrapping in outer div, and wrapper, is needed to center the loading icon
  37420. // The idea for centering came from here: http://www.vanseodesign.com/css/vertical-centering/
  37421. OverlayWrapperComponent.TEMPLATE = "\n <div class=\"ag-overlay\" aria-hidden=\"true\">\n <div class=\"ag-overlay-panel\">\n <div class=\"ag-overlay-wrapper\" ref=\"eOverlayWrapper\"></div>\n </div>\n </div>";
  37422. __decorate([
  37423. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  37424. ], OverlayWrapperComponent.prototype, "gridOptionsWrapper", void 0);
  37425. __decorate([
  37426. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('userComponentFactory')
  37427. ], OverlayWrapperComponent.prototype, "userComponentFactory", void 0);
  37428. __decorate([
  37429. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('eOverlayWrapper')
  37430. ], OverlayWrapperComponent.prototype, "eOverlayWrapper", void 0);
  37431. __decorate([
  37432. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  37433. ], OverlayWrapperComponent.prototype, "postConstruct", null);
  37434. return OverlayWrapperComponent;
  37435. }(_widgets_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  37436. /***/ }),
  37437. /* 170 */
  37438. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37439. "use strict";
  37440. __webpack_require__.r(__webpack_exports__);
  37441. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgGroupComponent", function() { return AgGroupComponent; });
  37442. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  37443. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  37444. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  37445. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  37446. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  37447. /**
  37448. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  37449. * @version v23.2.1
  37450. * @link http://www.ag-grid.com/
  37451. * @license MIT
  37452. */
  37453. var __extends = (undefined && undefined.__extends) || (function () {
  37454. var extendStatics = function (d, b) {
  37455. extendStatics = Object.setPrototypeOf ||
  37456. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  37457. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  37458. return extendStatics(d, b);
  37459. };
  37460. return function (d, b) {
  37461. extendStatics(d, b);
  37462. function __() { this.constructor = d; }
  37463. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  37464. };
  37465. })();
  37466. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  37467. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  37468. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  37469. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  37470. return c > 3 && r && Object.defineProperty(target, key, r), r;
  37471. };
  37472. var defaultItemAlign = 'center';
  37473. var defaultDirection = 'vertical';
  37474. var AgGroupComponent = /** @class */ (function (_super) {
  37475. __extends(AgGroupComponent, _super);
  37476. function AgGroupComponent(params) {
  37477. if (params === void 0) { params = {}; }
  37478. var _this = _super.call(this, AgGroupComponent.getTemplate(params)) || this;
  37479. _this.suppressEnabledCheckbox = true;
  37480. _this.suppressOpenCloseIcons = false;
  37481. var title = params.title, enabled = params.enabled, items = params.items, suppressEnabledCheckbox = params.suppressEnabledCheckbox, suppressOpenCloseIcons = params.suppressOpenCloseIcons;
  37482. _this.title = title;
  37483. _this.cssIdentifier = params.cssIdentifier || 'default';
  37484. _this.enabled = enabled != null ? enabled : true;
  37485. _this.items = items || [];
  37486. _this.alignItems = params.alignItems || 'center';
  37487. if (suppressEnabledCheckbox != null) {
  37488. _this.suppressEnabledCheckbox = suppressEnabledCheckbox;
  37489. }
  37490. if (suppressOpenCloseIcons != null) {
  37491. _this.suppressOpenCloseIcons = suppressOpenCloseIcons;
  37492. }
  37493. return _this;
  37494. }
  37495. AgGroupComponent.getTemplate = function (params) {
  37496. var cssIdentifier = params.cssIdentifier || 'default';
  37497. var direction = params.direction || 'vertical';
  37498. return /* html */ "<div class=\"ag-group ag-" + cssIdentifier + "-group\">\n <div class=\"ag-group-title-bar ag-" + cssIdentifier + "-group-title-bar ag-unselectable\" ref=\"eTitleBar\">\n <span class=\"ag-group-title-bar-icon ag-" + cssIdentifier + "-group-title-bar-icon\" ref=\"eGroupOpenedIcon\"></span>\n <span class=\"ag-group-title-bar-icon ag-" + cssIdentifier + "-group-title-bar-icon\" ref=\"eGroupClosedIcon\"></span>\n <span ref=\"eTitle\" class=\"ag-group-title ag-" + cssIdentifier + "-group-title\"></span>\n </div>\n <div ref=\"eToolbar\" class=\"ag-group-toolbar ag-" + cssIdentifier + "-group-toolbar\">\n <ag-checkbox ref=\"cbGroupEnabled\"></ag-checkbox>\n </div>\n <div ref=\"eContainer\" class=\"ag-group-container ag-group-container-" + direction + " ag-" + cssIdentifier + "-group-container\"></div>\n </div>";
  37499. };
  37500. AgGroupComponent.prototype.postConstruct = function () {
  37501. if (this.items.length) {
  37502. var initialItems = this.items;
  37503. this.items = [];
  37504. this.addItems(initialItems);
  37505. }
  37506. var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
  37507. this.cbGroupEnabled.setLabel(localeTextFunc('enabled', 'Enabled'));
  37508. if (this.title) {
  37509. this.setTitle(this.title);
  37510. }
  37511. if (this.enabled) {
  37512. this.setEnabled(this.enabled);
  37513. }
  37514. this.setAlignItems(this.alignItems);
  37515. this.hideEnabledCheckbox(this.suppressEnabledCheckbox);
  37516. this.hideOpenCloseIcons(this.suppressOpenCloseIcons);
  37517. this.setupExpandContract();
  37518. this.refreshChildDisplay();
  37519. };
  37520. AgGroupComponent.prototype.setupExpandContract = function () {
  37521. var _this = this;
  37522. this.eGroupClosedIcon.appendChild(_utils__WEBPACK_IMPORTED_MODULE_4__["_"].createIcon('columnSelectClosed', this.gridOptionsWrapper, null));
  37523. this.eGroupOpenedIcon.appendChild(_utils__WEBPACK_IMPORTED_MODULE_4__["_"].createIcon('columnSelectOpen', this.gridOptionsWrapper, null));
  37524. this.addManagedListener(this.eTitleBar, 'click', function () { return _this.toggleGroupExpand(); });
  37525. this.addManagedListener(this.eTitleBar, 'keydown', function (e) {
  37526. if (e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_ENTER) {
  37527. _this.toggleGroupExpand();
  37528. }
  37529. });
  37530. };
  37531. AgGroupComponent.prototype.refreshChildDisplay = function () {
  37532. var showIcon = !this.suppressOpenCloseIcons;
  37533. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setDisplayed(this.eGroupClosedIcon, showIcon && !this.expanded);
  37534. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setDisplayed(this.eGroupOpenedIcon, showIcon && this.expanded);
  37535. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setDisplayed(this.eToolbar, this.expanded && !this.suppressEnabledCheckbox);
  37536. };
  37537. AgGroupComponent.prototype.isExpanded = function () {
  37538. return this.expanded;
  37539. };
  37540. AgGroupComponent.prototype.setAlignItems = function (alignment) {
  37541. var eGui = this.getGui();
  37542. if (this.alignItems !== alignment) {
  37543. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].removeCssClass(eGui, "ag-group-item-alignment-" + this.alignItems);
  37544. }
  37545. this.alignItems = alignment;
  37546. var newCls = "ag-group-item-alignment-" + this.alignItems;
  37547. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eGui, newCls);
  37548. return this;
  37549. };
  37550. AgGroupComponent.prototype.toggleGroupExpand = function (expanded) {
  37551. if (this.suppressOpenCloseIcons) {
  37552. this.expanded = true;
  37553. this.refreshChildDisplay();
  37554. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setDisplayed(this.eContainer, true);
  37555. return this;
  37556. }
  37557. expanded = expanded != null ? expanded : !this.expanded;
  37558. if (this.expanded === expanded) {
  37559. return this;
  37560. }
  37561. this.expanded = expanded;
  37562. this.refreshChildDisplay();
  37563. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setDisplayed(this.eContainer, expanded);
  37564. if (this.expanded) {
  37565. this.dispatchEvent({ type: AgGroupComponent.EVENT_EXPANDED });
  37566. }
  37567. else {
  37568. this.dispatchEvent({ type: AgGroupComponent.EVENT_COLLAPSED });
  37569. }
  37570. return this;
  37571. };
  37572. AgGroupComponent.prototype.addItems = function (items) {
  37573. var _this = this;
  37574. items.forEach(function (item) { return _this.addItem(item); });
  37575. };
  37576. AgGroupComponent.prototype.addItem = function (item) {
  37577. var container = this.eContainer;
  37578. var el = item instanceof _component__WEBPACK_IMPORTED_MODULE_0__["Component"] ? item.getGui() : item;
  37579. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(el, 'ag-group-item');
  37580. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(el, "ag-" + this.cssIdentifier + "-group-item");
  37581. container.appendChild(el);
  37582. this.items.push(el);
  37583. };
  37584. AgGroupComponent.prototype.hideItem = function (hide, index) {
  37585. var itemToHide = this.items[index];
  37586. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addOrRemoveCssClass(itemToHide, 'ag-hidden', hide);
  37587. };
  37588. AgGroupComponent.prototype.setTitle = function (title) {
  37589. this.eTitle.innerText = title;
  37590. return this;
  37591. };
  37592. AgGroupComponent.prototype.addCssClassToTitleBar = function (cssClass) {
  37593. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(this.eTitleBar, cssClass);
  37594. };
  37595. AgGroupComponent.prototype.setEnabled = function (enabled, skipToggle) {
  37596. this.enabled = enabled;
  37597. this.refreshDisabledStyles();
  37598. this.toggleGroupExpand(enabled);
  37599. if (!skipToggle) {
  37600. this.cbGroupEnabled.setValue(enabled);
  37601. }
  37602. return this;
  37603. };
  37604. AgGroupComponent.prototype.isEnabled = function () {
  37605. return this.enabled;
  37606. };
  37607. AgGroupComponent.prototype.onEnableChange = function (callbackFn) {
  37608. var _this = this;
  37609. this.cbGroupEnabled.onValueChange(function (newSelection) {
  37610. _this.setEnabled(newSelection, true);
  37611. callbackFn(newSelection);
  37612. });
  37613. return this;
  37614. };
  37615. AgGroupComponent.prototype.hideEnabledCheckbox = function (hide) {
  37616. this.suppressEnabledCheckbox = hide;
  37617. this.refreshChildDisplay();
  37618. this.refreshDisabledStyles();
  37619. return this;
  37620. };
  37621. AgGroupComponent.prototype.hideOpenCloseIcons = function (hide) {
  37622. this.suppressOpenCloseIcons = hide;
  37623. if (hide) {
  37624. this.toggleGroupExpand(true);
  37625. }
  37626. return this;
  37627. };
  37628. AgGroupComponent.prototype.refreshDisabledStyles = function () {
  37629. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addOrRemoveCssClass(this.getGui(), 'ag-disabled', !this.enabled);
  37630. if (this.suppressEnabledCheckbox && !this.enabled) {
  37631. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(this.eTitleBar, 'ag-disabled-group-title-bar');
  37632. this.eTitleBar.removeAttribute('tabindex');
  37633. }
  37634. else {
  37635. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].removeCssClass(this.eTitleBar, 'ag-disabled-group-title-bar');
  37636. this.eTitleBar.setAttribute('tabindex', '0');
  37637. }
  37638. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addOrRemoveCssClass(this.eContainer, 'ag-disabled-group-container', !this.enabled);
  37639. };
  37640. AgGroupComponent.EVENT_EXPANDED = 'expanded';
  37641. AgGroupComponent.EVENT_COLLAPSED = 'collapsed';
  37642. __decorate([
  37643. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])('gridOptionsWrapper')
  37644. ], AgGroupComponent.prototype, "gridOptionsWrapper", void 0);
  37645. __decorate([
  37646. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eTitleBar')
  37647. ], AgGroupComponent.prototype, "eTitleBar", void 0);
  37648. __decorate([
  37649. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eGroupOpenedIcon')
  37650. ], AgGroupComponent.prototype, "eGroupOpenedIcon", void 0);
  37651. __decorate([
  37652. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eGroupClosedIcon')
  37653. ], AgGroupComponent.prototype, "eGroupClosedIcon", void 0);
  37654. __decorate([
  37655. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eToolbar')
  37656. ], AgGroupComponent.prototype, "eToolbar", void 0);
  37657. __decorate([
  37658. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('cbGroupEnabled')
  37659. ], AgGroupComponent.prototype, "cbGroupEnabled", void 0);
  37660. __decorate([
  37661. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eTitle')
  37662. ], AgGroupComponent.prototype, "eTitle", void 0);
  37663. __decorate([
  37664. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eContainer')
  37665. ], AgGroupComponent.prototype, "eContainer", void 0);
  37666. __decorate([
  37667. _context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
  37668. ], AgGroupComponent.prototype, "postConstruct", null);
  37669. return AgGroupComponent;
  37670. }(_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  37671. /***/ }),
  37672. /* 171 */
  37673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37674. "use strict";
  37675. __webpack_require__.r(__webpack_exports__);
  37676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgDialog", function() { return AgDialog; });
  37677. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  37678. /* harmony import */ var _agPanel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172);
  37679. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
  37680. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  37681. /**
  37682. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  37683. * @version v23.2.1
  37684. * @link http://www.ag-grid.com/
  37685. * @license MIT
  37686. */
  37687. var __extends = (undefined && undefined.__extends) || (function () {
  37688. var extendStatics = function (d, b) {
  37689. extendStatics = Object.setPrototypeOf ||
  37690. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  37691. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  37692. return extendStatics(d, b);
  37693. };
  37694. return function (d, b) {
  37695. extendStatics(d, b);
  37696. function __() { this.constructor = d; }
  37697. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  37698. };
  37699. })();
  37700. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  37701. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  37702. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  37703. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  37704. return c > 3 && r && Object.defineProperty(target, key, r), r;
  37705. };
  37706. var AgDialog = /** @class */ (function (_super) {
  37707. __extends(AgDialog, _super);
  37708. function AgDialog(config) {
  37709. var _this = _super.call(this, config) || this;
  37710. _this.RESIZE_TEMPLATE = "<div class=\"ag-resizer-wrapper\">\n <div ref=\"eTopLeftResizer\" class=\"ag-resizer ag-resizer-topLeft\"></div>\n <div ref=\"eTopResizer\" class=\"ag-resizer ag-resizer-top\"></div>\n <div ref=\"eTopRightResizer\" class=\"ag-resizer ag-resizer-topRight\"></div>\n <div ref=\"eRightResizer\" class=\"ag-resizer ag-resizer-right\"></div>\n <div ref=\"eBottomRightResizer\" class=\"ag-resizer ag-resizer-bottomRight\"></div>\n <div ref=\"eBottomResizer\" class=\"ag-resizer ag-resizer-bottom\"></div>\n <div ref=\"eBottomLeftResizer\" class=\"ag-resizer ag-resizer-bottomLeft\"></div>\n <div ref=\"eLeftResizer\" class=\"ag-resizer ag-resizer-left\"></div>\n </div>";
  37711. _this.MAXIMIZE_BTN_TEMPLATE = "<div class=\"ag-dialog-button\"></span>";
  37712. _this.resizable = {};
  37713. _this.movable = false;
  37714. _this.isMoving = false;
  37715. _this.isMaximizable = false;
  37716. _this.isMaximized = false;
  37717. _this.maximizeListeners = [];
  37718. _this.resizeListenerDestroy = null;
  37719. _this.isResizing = false;
  37720. _this.lastPosition = {
  37721. x: 0,
  37722. y: 0,
  37723. width: 0,
  37724. height: 0
  37725. };
  37726. return _this;
  37727. }
  37728. AgDialog.prototype.postConstruct = function () {
  37729. var _this = this;
  37730. var eGui = this.getGui();
  37731. var _a = this.config, movable = _a.movable, resizable = _a.resizable, maximizable = _a.maximizable;
  37732. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(eGui, 'ag-dialog');
  37733. this.moveElement = this.eTitleBar;
  37734. _super.prototype.postConstruct.call(this);
  37735. this.addManagedListener(eGui, 'focusin', function (e) {
  37736. if (eGui.contains(e.relatedTarget)) {
  37737. return;
  37738. }
  37739. _this.popupService.bringPopupToFront(eGui);
  37740. });
  37741. if (movable) {
  37742. this.setMovable(movable);
  37743. }
  37744. if (maximizable) {
  37745. this.setMaximizable(maximizable);
  37746. }
  37747. this.addResizers();
  37748. if (resizable) {
  37749. this.setResizable(resizable);
  37750. }
  37751. };
  37752. AgDialog.prototype.renderComponent = function () {
  37753. var eGui = this.getGui();
  37754. var _a = this.config, alwaysOnTop = _a.alwaysOnTop, modal = _a.modal;
  37755. this.close = this.popupService.addPopup(modal, eGui, true, this.destroy.bind(this), undefined, alwaysOnTop);
  37756. eGui.focus();
  37757. };
  37758. AgDialog.prototype.addResizers = function () {
  37759. var eGui = this.getGui();
  37760. if (!eGui) {
  37761. return;
  37762. }
  37763. var parser = new DOMParser();
  37764. var resizers = parser.parseFromString(this.RESIZE_TEMPLATE, 'text/html').body;
  37765. eGui.appendChild(resizers.firstChild);
  37766. this.createMap();
  37767. };
  37768. AgDialog.prototype.createMap = function () {
  37769. var eGui = this.getGui();
  37770. this.resizerMap = {
  37771. topLeft: { element: eGui.querySelector('[ref=eTopLeftResizer]') },
  37772. top: { element: eGui.querySelector('[ref=eTopResizer]') },
  37773. topRight: { element: eGui.querySelector('[ref=eTopRightResizer]') },
  37774. right: { element: eGui.querySelector('[ref=eRightResizer]') },
  37775. bottomRight: { element: eGui.querySelector('[ref=eBottomRightResizer]') },
  37776. bottom: { element: eGui.querySelector('[ref=eBottomResizer]') },
  37777. bottomLeft: { element: eGui.querySelector('[ref=eBottomLeftResizer]') },
  37778. left: { element: eGui.querySelector('[ref=eLeftResizer]') }
  37779. };
  37780. };
  37781. AgDialog.prototype.getResizerElement = function (side) {
  37782. return this.resizerMap[side].element;
  37783. };
  37784. AgDialog.prototype.onResizeStart = function (e) {
  37785. this.isResizing = true;
  37786. this.updateDragStartPosition(e.clientX, e.clientY);
  37787. };
  37788. AgDialog.prototype.onResize = function (e, side) {
  37789. if (!this.isResizing) {
  37790. return;
  37791. }
  37792. var isLeft = !!side.match(/left/i);
  37793. var isRight = !!side.match(/right/i);
  37794. var isTop = !!side.match(/top/i);
  37795. var isBottom = !!side.match(/bottom/i);
  37796. var isHorizontal = isLeft || isRight;
  37797. var isVertical = isTop || isBottom;
  37798. var _a = this.calculateMouseMovement({ e: e, isLeft: isLeft, isTop: isTop }), movementX = _a.movementX, movementY = _a.movementY;
  37799. var offsetLeft = 0;
  37800. var offsetTop = 0;
  37801. if (isHorizontal && movementX) {
  37802. var direction = isLeft ? -1 : 1;
  37803. var oldWidth = this.getWidth();
  37804. var newWidth = oldWidth + (movementX * direction);
  37805. var skipWidth = false;
  37806. if (isLeft) {
  37807. offsetLeft = oldWidth - newWidth;
  37808. if (this.position.x + offsetLeft <= 0 || newWidth <= this.minWidth) {
  37809. skipWidth = true;
  37810. offsetLeft = 0;
  37811. }
  37812. }
  37813. if (!skipWidth) {
  37814. this.setWidth(newWidth);
  37815. }
  37816. }
  37817. if (isVertical && movementY) {
  37818. var direction = isTop ? -1 : 1;
  37819. var oldHeight = this.getHeight();
  37820. var newHeight = oldHeight + (movementY * direction);
  37821. var skipHeight = false;
  37822. if (isTop) {
  37823. offsetTop = oldHeight - newHeight;
  37824. if (this.position.y + offsetTop <= 0 || newHeight <= this.minHeight) {
  37825. skipHeight = true;
  37826. offsetTop = 0;
  37827. }
  37828. }
  37829. if (!skipHeight) {
  37830. this.setHeight(newHeight);
  37831. }
  37832. }
  37833. this.updateDragStartPosition(e.clientX, e.clientY);
  37834. if (offsetLeft || offsetTop) {
  37835. this.offsetElement(this.position.x + offsetLeft, this.position.y + offsetTop);
  37836. }
  37837. };
  37838. AgDialog.prototype.onResizeEnd = function () {
  37839. this.isResizing = false;
  37840. var params = {
  37841. type: 'resize',
  37842. api: this.gridOptionsWrapper.getApi(),
  37843. columnApi: this.gridOptionsWrapper.getColumnApi()
  37844. };
  37845. this.dispatchEvent(params);
  37846. };
  37847. AgDialog.prototype.onMoveStart = function (e) {
  37848. this.isMoving = true;
  37849. this.updateDragStartPosition(e.clientX, e.clientY);
  37850. };
  37851. AgDialog.prototype.onMove = function (e) {
  37852. if (!this.isMoving) {
  37853. return;
  37854. }
  37855. var _a = this.position, x = _a.x, y = _a.y;
  37856. var _b = this.calculateMouseMovement({
  37857. e: e,
  37858. isTop: true,
  37859. anywhereWithin: true,
  37860. topBuffer: this.getHeight() - this.getBodyHeight()
  37861. }), movementX = _b.movementX, movementY = _b.movementY;
  37862. this.offsetElement(x + movementX, y + movementY);
  37863. this.updateDragStartPosition(e.clientX, e.clientY);
  37864. };
  37865. AgDialog.prototype.onMoveEnd = function () {
  37866. this.isMoving = false;
  37867. };
  37868. AgDialog.prototype.toggleMaximize = function () {
  37869. if (this.isMaximized) {
  37870. var _a = this.lastPosition, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
  37871. this.setWidth(width);
  37872. this.setHeight(height);
  37873. this.offsetElement(x, y);
  37874. }
  37875. else {
  37876. this.lastPosition.width = this.getWidth();
  37877. this.lastPosition.height = this.getHeight();
  37878. this.lastPosition.x = this.position.x;
  37879. this.lastPosition.y = this.position.y;
  37880. this.offsetElement(0, 0);
  37881. this.setHeight('100%');
  37882. this.setWidth('100%');
  37883. }
  37884. this.isMaximized = !this.isMaximized;
  37885. this.refreshMaximizeIcon();
  37886. };
  37887. AgDialog.prototype.refreshMaximizeIcon = function () {
  37888. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.maximizeIcon, 'ag-hidden', this.isMaximized);
  37889. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addOrRemoveCssClass(this.minimizeIcon, 'ag-hidden', !this.isMaximized);
  37890. };
  37891. AgDialog.prototype.clearMaximizebleListeners = function () {
  37892. if (this.maximizeListeners.length) {
  37893. this.maximizeListeners.forEach(function (destroyListener) { return destroyListener(); });
  37894. this.maximizeListeners.length = 0;
  37895. }
  37896. if (this.resizeListenerDestroy) {
  37897. this.resizeListenerDestroy();
  37898. this.resizeListenerDestroy = null;
  37899. }
  37900. };
  37901. AgDialog.prototype.destroy = function () {
  37902. this.setResizable(false);
  37903. this.setMovable(false);
  37904. this.maximizeButtonComp = this.destroyBean(this.maximizeButtonComp);
  37905. this.clearMaximizebleListeners();
  37906. _super.prototype.destroy.call(this);
  37907. };
  37908. AgDialog.prototype.setResizable = function (resizable) {
  37909. var _this = this;
  37910. if (typeof resizable === 'boolean') {
  37911. resizable = {
  37912. topLeft: resizable,
  37913. top: resizable,
  37914. topRight: resizable,
  37915. right: resizable,
  37916. bottomRight: resizable,
  37917. bottom: resizable,
  37918. bottomLeft: resizable,
  37919. left: resizable
  37920. };
  37921. }
  37922. Object.keys(resizable).forEach(function (side) {
  37923. var r = resizable;
  37924. var s = side;
  37925. var val = !!r[s];
  37926. var el = _this.getResizerElement(s);
  37927. var params = _this.resizerMap[s].dragSource || {
  37928. eElement: el,
  37929. onDragStart: _this.onResizeStart.bind(_this),
  37930. onDragging: function (e) { return _this.onResize(e, s); },
  37931. onDragStop: _this.onResizeEnd.bind(_this),
  37932. };
  37933. if (!!_this.resizable[s] !== val || (!_this.isAlive() && !val)) {
  37934. if (val) {
  37935. _this.dragService.addDragSource(params);
  37936. el.style.pointerEvents = 'all';
  37937. }
  37938. else {
  37939. _this.dragService.removeDragSource(params);
  37940. el.style.pointerEvents = 'none';
  37941. }
  37942. _this.resizerMap[s].dragSource = val ? params : undefined;
  37943. }
  37944. });
  37945. };
  37946. AgDialog.prototype.setMovable = function (movable) {
  37947. if (movable === this.movable) {
  37948. return;
  37949. }
  37950. this.movable = movable;
  37951. var params = this.moveElementDragListener || {
  37952. eElement: this.moveElement,
  37953. onDragStart: this.onMoveStart.bind(this),
  37954. onDragging: this.onMove.bind(this),
  37955. onDragStop: this.onMoveEnd.bind(this)
  37956. };
  37957. if (movable) {
  37958. this.dragService.addDragSource(params);
  37959. this.moveElementDragListener = params;
  37960. }
  37961. else {
  37962. this.dragService.removeDragSource(params);
  37963. this.moveElementDragListener = undefined;
  37964. }
  37965. };
  37966. AgDialog.prototype.setMaximizable = function (maximizable) {
  37967. var _this = this;
  37968. if (maximizable === false) {
  37969. this.clearMaximizebleListeners();
  37970. if (this.maximizeButtonComp) {
  37971. this.destroyBean(this.maximizeButtonComp);
  37972. this.maximizeButtonComp = this.maximizeIcon = this.minimizeIcon = undefined;
  37973. }
  37974. return;
  37975. }
  37976. var eTitleBar = this.eTitleBar;
  37977. if (!eTitleBar || maximizable === this.isMaximizable) {
  37978. return;
  37979. }
  37980. var maximizeButtonComp = this.maximizeButtonComp = new _component__WEBPACK_IMPORTED_MODULE_2__["Component"](this.MAXIMIZE_BTN_TEMPLATE);
  37981. this.getContext().createBean(maximizeButtonComp);
  37982. var eGui = maximizeButtonComp.getGui();
  37983. eGui.appendChild(this.maximizeIcon = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].createIconNoSpan('maximize', this.gridOptionsWrapper));
  37984. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(this.maximizeIcon, 'ag-panel-title-bar-button-icon');
  37985. eGui.appendChild(this.minimizeIcon = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].createIconNoSpan('minimize', this.gridOptionsWrapper));
  37986. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(this.minimizeIcon, 'ag-panel-title-bar-button-icon');
  37987. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(this.minimizeIcon, 'ag-hidden');
  37988. maximizeButtonComp.addManagedListener(eGui, 'click', this.toggleMaximize.bind(this));
  37989. this.addTitleBarButton(maximizeButtonComp, 0);
  37990. this.maximizeListeners.push(this.addManagedListener(eTitleBar, 'dblclick', this.toggleMaximize.bind(this)));
  37991. this.resizeListenerDestroy = this.addManagedListener(this, 'resize', function () {
  37992. _this.isMaximized = false;
  37993. _this.refreshMaximizeIcon();
  37994. });
  37995. };
  37996. __decorate([
  37997. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('dragService')
  37998. ], AgDialog.prototype, "dragService", void 0);
  37999. return AgDialog;
  38000. }(_agPanel__WEBPACK_IMPORTED_MODULE_1__["AgPanel"]));
  38001. /***/ }),
  38002. /* 172 */
  38003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38004. "use strict";
  38005. __webpack_require__.r(__webpack_exports__);
  38006. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgPanel", function() { return AgPanel; });
  38007. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  38008. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  38009. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
  38010. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  38011. /**
  38012. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38013. * @version v23.2.1
  38014. * @link http://www.ag-grid.com/
  38015. * @license MIT
  38016. */
  38017. var __extends = (undefined && undefined.__extends) || (function () {
  38018. var extendStatics = function (d, b) {
  38019. extendStatics = Object.setPrototypeOf ||
  38020. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38021. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38022. return extendStatics(d, b);
  38023. };
  38024. return function (d, b) {
  38025. extendStatics(d, b);
  38026. function __() { this.constructor = d; }
  38027. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38028. };
  38029. })();
  38030. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  38031. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  38032. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  38033. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  38034. return c > 3 && r && Object.defineProperty(target, key, r), r;
  38035. };
  38036. var AgPanel = /** @class */ (function (_super) {
  38037. __extends(AgPanel, _super);
  38038. function AgPanel(config) {
  38039. var _this = _super.call(this, AgPanel.getTemplate(config)) || this;
  38040. _this.closable = true;
  38041. _this.positioned = false;
  38042. _this.dragStartPosition = {
  38043. x: 0,
  38044. y: 0
  38045. };
  38046. _this.position = {
  38047. x: 0,
  38048. y: 0
  38049. };
  38050. _this.size = {
  38051. width: undefined,
  38052. height: undefined
  38053. };
  38054. _this.config = config;
  38055. return _this;
  38056. }
  38057. AgPanel.getTemplate = function (config) {
  38058. var cssIdentifier = (config && config.cssIdentifier) || 'default';
  38059. return /* html */ "<div class=\"ag-panel ag-" + cssIdentifier + "-panel\" tabindex=\"-1\">\n <div ref=\"eTitleBar\" class=\"ag-panel-title-bar ag-" + cssIdentifier + "-panel-title-bar ag-unselectable\">\n <span ref=\"eTitle\" class=\"ag-panel-title-bar-title ag-" + cssIdentifier + "-panel-title-bar-title\"></span>\n <div ref=\"eTitleBarButtons\" class=\"ag-panel-title-bar-buttons ag-" + cssIdentifier + "-panel-title-bar-buttons\"></div>\n </div>\n <div ref=\"eContentWrapper\" class=\"ag-panel-content-wrapper ag-" + cssIdentifier + "-panel-content-wrapper\"></div>\n </div>";
  38060. };
  38061. AgPanel.prototype.postConstruct = function () {
  38062. var _this = this;
  38063. var _a = this.config, component = _a.component, closable = _a.closable, hideTitleBar = _a.hideTitleBar, title = _a.title, minWidth = _a.minWidth, width = _a.width, minHeight = _a.minHeight, height = _a.height, centered = _a.centered, x = _a.x, y = _a.y;
  38064. var eGui = this.getGui();
  38065. if (component) {
  38066. this.setBodyComponent(component);
  38067. }
  38068. if (!hideTitleBar) {
  38069. if (title) {
  38070. this.setTitle(title);
  38071. }
  38072. this.setClosable(closable != null ? closable : this.closable);
  38073. }
  38074. else {
  38075. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(this.eTitleBar, 'ag-hidden');
  38076. }
  38077. this.addManagedListener(this.eTitleBar, 'mousedown', function (e) {
  38078. if (eGui.contains(e.relatedTarget) ||
  38079. eGui.contains(document.activeElement) ||
  38080. _this.eTitleBarButtons.contains(e.target)) {
  38081. e.preventDefault();
  38082. return;
  38083. }
  38084. var focusEl = _this.eContentWrapper.querySelector('button, [href], input, select, textarea, [tabindex]');
  38085. if (focusEl) {
  38086. focusEl.focus();
  38087. }
  38088. });
  38089. if (this.positioned) {
  38090. return;
  38091. }
  38092. this.minHeight = minHeight != null ? minHeight : 250;
  38093. this.minWidth = minWidth != null ? minWidth : 250;
  38094. this.popupParent = this.popupService.getPopupParent();
  38095. if (width) {
  38096. this.setWidth(width);
  38097. }
  38098. if (height) {
  38099. this.setHeight(height);
  38100. }
  38101. if (this.renderComponent) {
  38102. this.renderComponent();
  38103. }
  38104. if (!width || !height) {
  38105. this.refreshSize();
  38106. }
  38107. if (centered) {
  38108. this.center();
  38109. }
  38110. else if (x || y) {
  38111. this.offsetElement(x, y);
  38112. }
  38113. this.positioned = true;
  38114. this.eContentWrapper.style.height = '0';
  38115. };
  38116. AgPanel.prototype.renderComponent = function () {
  38117. var _this = this;
  38118. var eGui = this.getGui();
  38119. eGui.focus();
  38120. this.close = function () {
  38121. eGui.parentElement.removeChild(eGui);
  38122. _this.destroy();
  38123. };
  38124. };
  38125. AgPanel.prototype.updateDragStartPosition = function (x, y) {
  38126. this.dragStartPosition = { x: x, y: y };
  38127. };
  38128. AgPanel.prototype.calculateMouseMovement = function (params) {
  38129. var parentRect = this.popupParent.getBoundingClientRect();
  38130. var e = params.e, isLeft = params.isLeft, isTop = params.isTop, anywhereWithin = params.anywhereWithin, topBuffer = params.topBuffer;
  38131. var movementX = e.clientX - this.dragStartPosition.x;
  38132. var movementY = e.clientY - this.dragStartPosition.y;
  38133. var width = this.getWidth();
  38134. var height = this.getHeight();
  38135. // skip if cursor is outside of popupParent horizontally
  38136. var skipX = (parentRect.left >= e.clientX && this.position.x <= 0 ||
  38137. parentRect.right <= e.clientX && parentRect.right <= this.position.x + parentRect.left + width);
  38138. if (!skipX) {
  38139. if (isLeft) {
  38140. skipX = (
  38141. // skip if we are moving to the left and the cursor
  38142. // is positioned to the right of the left side anchor
  38143. (movementX < 0 && e.clientX > this.position.x + parentRect.left) ||
  38144. // skip if we are moving to the right and the cursor
  38145. // is positioned to the left of the dialog
  38146. (movementX > 0 && e.clientX < this.position.x + parentRect.left));
  38147. }
  38148. else {
  38149. if (anywhereWithin) {
  38150. // if anywhereWithin is true, we allow to move
  38151. // as long as the cursor is within the dialog
  38152. skipX = ((movementX < 0 && e.clientX > this.position.x + parentRect.left + width) ||
  38153. (movementX > 0 && e.clientX < this.position.x + parentRect.left));
  38154. }
  38155. else {
  38156. skipX = (
  38157. // if the movement is bound to the right side of the dialog
  38158. // we skip if we are moving to the left and the cursor
  38159. // is to the right of the dialog
  38160. (movementX < 0 && e.clientX > this.position.x + parentRect.left + width) ||
  38161. // or skip if we are moving to the right and the cursor
  38162. // is to the left of the right side anchor
  38163. (movementX > 0 && e.clientX < this.position.x + parentRect.left + width));
  38164. }
  38165. }
  38166. }
  38167. movementX = skipX ? 0 : movementX;
  38168. var skipY = (
  38169. // skip if cursor is outside of popupParent vertically
  38170. parentRect.top >= e.clientY && this.position.y <= 0 ||
  38171. parentRect.bottom <= e.clientY && parentRect.bottom <= this.position.y + parentRect.top + height ||
  38172. isTop && (
  38173. // skip if we are moving to towards top and the cursor is
  38174. // below the top anchor + topBuffer
  38175. // note: topBuffer is used when moving the dialog using the title bar
  38176. (movementY < 0 && e.clientY > this.position.y + parentRect.top + (topBuffer || 0)) ||
  38177. // skip if we are moving to the bottom and the cursor is
  38178. // above the top anchor
  38179. (movementY > 0 && e.clientY < this.position.y + parentRect.top)) ||
  38180. // we are anchored to the bottom of the dialog
  38181. !isTop && (
  38182. // skip if we are moving towards the top and the cursor
  38183. // is below the bottom anchor
  38184. (movementY < 0 && e.clientY > this.position.y + parentRect.top + height) ||
  38185. // skip if we are moving towards the bottom and the cursor
  38186. // is above the bottom anchor
  38187. (movementY > 0 && e.clientY < this.position.y + parentRect.top + height)));
  38188. movementY = skipY ? 0 : movementY;
  38189. return { movementX: movementX, movementY: movementY };
  38190. };
  38191. AgPanel.prototype.refreshSize = function () {
  38192. var _a = this.size, width = _a.width, height = _a.height;
  38193. if (!width) {
  38194. this.setWidth(this.getGui().offsetWidth);
  38195. }
  38196. if (!height) {
  38197. this.setHeight(this.getGui().offsetHeight);
  38198. }
  38199. };
  38200. AgPanel.prototype.offsetElement = function (x, y) {
  38201. if (x === void 0) { x = 0; }
  38202. if (y === void 0) { y = 0; }
  38203. var ePopup = this.getGui();
  38204. this.popupService.positionPopup({
  38205. ePopup: ePopup,
  38206. x: x,
  38207. y: y,
  38208. minWidth: this.minWidth,
  38209. minHeight: this.minHeight,
  38210. keepWithinBounds: true
  38211. });
  38212. this.position.x = parseInt(ePopup.style.left, 10);
  38213. this.position.y = parseInt(ePopup.style.top, 10);
  38214. };
  38215. AgPanel.prototype.getHeight = function () {
  38216. return this.size.height;
  38217. };
  38218. AgPanel.prototype.setHeight = function (height) {
  38219. var eGui = this.getGui();
  38220. var isPercent = false;
  38221. if (typeof height === 'string' && height.indexOf('%') !== -1) {
  38222. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].setFixedHeight(eGui, height);
  38223. height = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].getAbsoluteHeight(eGui);
  38224. isPercent = true;
  38225. }
  38226. else {
  38227. height = Math.max(this.minHeight, height);
  38228. var offsetParent = eGui.offsetParent;
  38229. if (offsetParent && offsetParent.clientHeight && (height + this.position.y > offsetParent.clientHeight)) {
  38230. height = offsetParent.clientHeight - this.position.y;
  38231. }
  38232. }
  38233. if (this.size.height === height) {
  38234. return;
  38235. }
  38236. this.size.height = height;
  38237. if (!isPercent) {
  38238. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].setFixedHeight(eGui, height);
  38239. }
  38240. else {
  38241. eGui.style.maxHeight = 'unset';
  38242. eGui.style.minHeight = 'unset';
  38243. }
  38244. };
  38245. AgPanel.prototype.getWidth = function () {
  38246. return this.size.width;
  38247. };
  38248. AgPanel.prototype.setWidth = function (width) {
  38249. var eGui = this.getGui();
  38250. var isPercent = false;
  38251. if (typeof width === 'string' && width.indexOf('%') !== -1) {
  38252. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].setFixedWidth(eGui, width);
  38253. width = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].getAbsoluteWidth(eGui);
  38254. isPercent = true;
  38255. }
  38256. else {
  38257. width = Math.max(this.minWidth, width);
  38258. var offsetParent = eGui.offsetParent;
  38259. if (offsetParent && offsetParent.clientWidth && (width + this.position.x > offsetParent.clientWidth)) {
  38260. width = offsetParent.clientWidth - this.position.x;
  38261. }
  38262. }
  38263. if (this.size.width === width) {
  38264. return;
  38265. }
  38266. this.size.width = width;
  38267. if (!isPercent) {
  38268. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].setFixedWidth(eGui, width);
  38269. }
  38270. else {
  38271. eGui.style.maxWidth = 'unset';
  38272. eGui.style.minWidth = 'unset';
  38273. }
  38274. };
  38275. AgPanel.prototype.center = function () {
  38276. var eGui = this.getGui();
  38277. var x = (eGui.offsetParent.clientWidth / 2) - (this.getWidth() / 2);
  38278. var y = (eGui.offsetParent.clientHeight / 2) - (this.getHeight() / 2);
  38279. this.offsetElement(x, y);
  38280. };
  38281. AgPanel.prototype.setClosable = function (closable) {
  38282. if (closable !== this.closable) {
  38283. this.closable = closable;
  38284. }
  38285. if (closable) {
  38286. var closeButtonComp = this.closeButtonComp = new _component__WEBPACK_IMPORTED_MODULE_2__["Component"](AgPanel.CLOSE_BTN_TEMPLATE);
  38287. this.getContext().createBean(closeButtonComp);
  38288. var eGui = closeButtonComp.getGui();
  38289. eGui.appendChild(_utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(_utils__WEBPACK_IMPORTED_MODULE_3__["_"].createIconNoSpan('close', this.gridOptionsWrapper), 'ag-panel-title-bar-button-icon'));
  38290. this.addTitleBarButton(closeButtonComp);
  38291. closeButtonComp.addManagedListener(eGui, 'click', this.onBtClose.bind(this));
  38292. }
  38293. else if (this.closeButtonComp) {
  38294. var eGui = this.closeButtonComp.getGui();
  38295. eGui.parentElement.removeChild(eGui);
  38296. this.closeButtonComp = this.destroyBean(this.closeButtonComp);
  38297. }
  38298. };
  38299. AgPanel.prototype.setBodyComponent = function (bodyComponent) {
  38300. bodyComponent.setParentComponent(this);
  38301. this.eContentWrapper.appendChild(bodyComponent.getGui());
  38302. };
  38303. AgPanel.prototype.addTitleBarButton = function (button, position) {
  38304. var eTitleBarButtons = this.eTitleBarButtons;
  38305. var buttons = eTitleBarButtons.children;
  38306. var len = buttons.length;
  38307. if (position == null) {
  38308. position = len;
  38309. }
  38310. position = Math.max(0, Math.min(position, len));
  38311. var eGui = button.getGui();
  38312. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].addCssClass(eGui, 'ag-panel-title-bar-button');
  38313. if (position === 0) {
  38314. eTitleBarButtons.insertAdjacentElement('afterbegin', eGui);
  38315. }
  38316. else if (position === len) {
  38317. eTitleBarButtons.insertAdjacentElement('beforeend', eGui);
  38318. }
  38319. else {
  38320. buttons[position - 1].insertAdjacentElement('afterend', eGui);
  38321. }
  38322. button.setParentComponent(this);
  38323. };
  38324. AgPanel.prototype.getBodyHeight = function () {
  38325. return _utils__WEBPACK_IMPORTED_MODULE_3__["_"].getInnerHeight(this.eContentWrapper);
  38326. };
  38327. AgPanel.prototype.getBodyWidth = function () {
  38328. return _utils__WEBPACK_IMPORTED_MODULE_3__["_"].getInnerWidth(this.eContentWrapper);
  38329. };
  38330. AgPanel.prototype.setTitle = function (title) {
  38331. this.eTitle.innerText = title;
  38332. };
  38333. // called when user hits the 'x' in the top right
  38334. AgPanel.prototype.onBtClose = function () {
  38335. this.close();
  38336. };
  38337. AgPanel.prototype.destroy = function () {
  38338. if (this.closeButtonComp) {
  38339. this.closeButtonComp = this.destroyBean(this.closeButtonComp);
  38340. }
  38341. var eGui = this.getGui();
  38342. if (eGui && eGui.offsetParent) {
  38343. this.close();
  38344. }
  38345. _super.prototype.destroy.call(this);
  38346. };
  38347. AgPanel.CLOSE_BTN_TEMPLATE = "<div class=\"ag-button\"></div>";
  38348. __decorate([
  38349. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('popupService')
  38350. ], AgPanel.prototype, "popupService", void 0);
  38351. __decorate([
  38352. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  38353. ], AgPanel.prototype, "gridOptionsWrapper", void 0);
  38354. __decorate([
  38355. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eContentWrapper')
  38356. ], AgPanel.prototype, "eContentWrapper", void 0);
  38357. __decorate([
  38358. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eTitleBar')
  38359. ], AgPanel.prototype, "eTitleBar", void 0);
  38360. __decorate([
  38361. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eTitleBarButtons')
  38362. ], AgPanel.prototype, "eTitleBarButtons", void 0);
  38363. __decorate([
  38364. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eTitle')
  38365. ], AgPanel.prototype, "eTitle", void 0);
  38366. __decorate([
  38367. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  38368. ], AgPanel.prototype, "postConstruct", null);
  38369. return AgPanel;
  38370. }(_component__WEBPACK_IMPORTED_MODULE_2__["Component"]));
  38371. /***/ }),
  38372. /* 173 */
  38373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38374. "use strict";
  38375. __webpack_require__.r(__webpack_exports__);
  38376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgInputTextField", function() { return AgInputTextField; });
  38377. /* harmony import */ var _agAbstractInputField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71);
  38378. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  38379. /**
  38380. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38381. * @version v23.2.1
  38382. * @link http://www.ag-grid.com/
  38383. * @license MIT
  38384. */
  38385. var __extends = (undefined && undefined.__extends) || (function () {
  38386. var extendStatics = function (d, b) {
  38387. extendStatics = Object.setPrototypeOf ||
  38388. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38389. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38390. return extendStatics(d, b);
  38391. };
  38392. return function (d, b) {
  38393. extendStatics(d, b);
  38394. function __() { this.constructor = d; }
  38395. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38396. };
  38397. })();
  38398. var AgInputTextField = /** @class */ (function (_super) {
  38399. __extends(AgInputTextField, _super);
  38400. function AgInputTextField(config) {
  38401. var _this = _super.call(this) || this;
  38402. _this.className = 'ag-text-field';
  38403. _this.displayTag = 'input';
  38404. _this.inputType = 'text';
  38405. _this.setTemplate(_this.TEMPLATE.replace(/%displayField%/g, _this.displayTag));
  38406. if (config) {
  38407. _this.config = config;
  38408. }
  38409. return _this;
  38410. }
  38411. AgInputTextField.prototype.setValue = function (value, silent) {
  38412. var ret = _super.prototype.setValue.call(this, value, silent);
  38413. if (this.eInput.value !== value) {
  38414. this.eInput.value = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(value) ? value : '';
  38415. }
  38416. return ret;
  38417. };
  38418. return AgInputTextField;
  38419. }(_agAbstractInputField__WEBPACK_IMPORTED_MODULE_0__["AgAbstractInputField"]));
  38420. /***/ }),
  38421. /* 174 */
  38422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38423. "use strict";
  38424. __webpack_require__.r(__webpack_exports__);
  38425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgInputTextArea", function() { return AgInputTextArea; });
  38426. /* harmony import */ var _agAbstractInputField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71);
  38427. /**
  38428. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38429. * @version v23.2.1
  38430. * @link http://www.ag-grid.com/
  38431. * @license MIT
  38432. */
  38433. var __extends = (undefined && undefined.__extends) || (function () {
  38434. var extendStatics = function (d, b) {
  38435. extendStatics = Object.setPrototypeOf ||
  38436. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38437. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38438. return extendStatics(d, b);
  38439. };
  38440. return function (d, b) {
  38441. extendStatics(d, b);
  38442. function __() { this.constructor = d; }
  38443. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38444. };
  38445. })();
  38446. var AgInputTextArea = /** @class */ (function (_super) {
  38447. __extends(AgInputTextArea, _super);
  38448. function AgInputTextArea(config) {
  38449. var _this = _super.call(this) || this;
  38450. _this.className = 'ag-text-area';
  38451. _this.displayTag = 'textarea';
  38452. _this.inputType = '';
  38453. _this.setTemplate(_this.TEMPLATE.replace(/%displayField%/g, _this.displayTag));
  38454. if (config) {
  38455. _this.config = config;
  38456. }
  38457. return _this;
  38458. }
  38459. AgInputTextArea.prototype.setValue = function (value, silent) {
  38460. var ret = _super.prototype.setValue.call(this, value, silent);
  38461. this.eInput.value = value;
  38462. return ret;
  38463. };
  38464. AgInputTextArea.prototype.setCols = function (cols) {
  38465. this.eInput.cols = cols;
  38466. return this;
  38467. };
  38468. AgInputTextArea.prototype.setRows = function (rows) {
  38469. this.eInput.rows = rows;
  38470. return this;
  38471. };
  38472. return AgInputTextArea;
  38473. }(_agAbstractInputField__WEBPACK_IMPORTED_MODULE_0__["AgAbstractInputField"]));
  38474. /***/ }),
  38475. /* 175 */
  38476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38477. "use strict";
  38478. __webpack_require__.r(__webpack_exports__);
  38479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgSlider", function() { return AgSlider; });
  38480. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57);
  38481. /* harmony import */ var _agAbstractLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73);
  38482. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72);
  38483. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  38484. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  38485. /**
  38486. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38487. * @version v23.2.1
  38488. * @link http://www.ag-grid.com/
  38489. * @license MIT
  38490. */
  38491. var __extends = (undefined && undefined.__extends) || (function () {
  38492. var extendStatics = function (d, b) {
  38493. extendStatics = Object.setPrototypeOf ||
  38494. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38495. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38496. return extendStatics(d, b);
  38497. };
  38498. return function (d, b) {
  38499. extendStatics(d, b);
  38500. function __() { this.constructor = d; }
  38501. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38502. };
  38503. })();
  38504. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  38505. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  38506. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  38507. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  38508. return c > 3 && r && Object.defineProperty(target, key, r), r;
  38509. };
  38510. var AgSlider = /** @class */ (function (_super) {
  38511. __extends(AgSlider, _super);
  38512. function AgSlider() {
  38513. var _this = _super.call(this, AgSlider.TEMPLATE) || this;
  38514. _this.labelAlignment = 'top';
  38515. return _this;
  38516. }
  38517. AgSlider.prototype.init = function () {
  38518. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(this.eSlider.getGui(), 'ag-slider-field');
  38519. };
  38520. AgSlider.prototype.onValueChange = function (callbackFn) {
  38521. var _this = this;
  38522. var eventChanged = _agAbstractField__WEBPACK_IMPORTED_MODULE_2__["AgAbstractField"].EVENT_CHANGED;
  38523. this.addManagedListener(this.eText, eventChanged, function () {
  38524. var textValue = parseFloat(_this.eText.getValue());
  38525. _this.eSlider.setValue(textValue.toString(), true);
  38526. callbackFn(textValue || 0);
  38527. });
  38528. this.addManagedListener(this.eSlider, eventChanged, function () {
  38529. var sliderValue = _this.eSlider.getValue();
  38530. _this.eText.setValue(sliderValue, true);
  38531. callbackFn(parseFloat(sliderValue));
  38532. });
  38533. return this;
  38534. };
  38535. AgSlider.prototype.setSliderWidth = function (width) {
  38536. this.eSlider.setWidth(width);
  38537. return this;
  38538. };
  38539. AgSlider.prototype.setTextFieldWidth = function (width) {
  38540. this.eText.setWidth(width);
  38541. return this;
  38542. };
  38543. AgSlider.prototype.setMinValue = function (minValue) {
  38544. this.eSlider.setMinValue(minValue);
  38545. this.eText.setMin(minValue);
  38546. return this;
  38547. };
  38548. AgSlider.prototype.setMaxValue = function (maxValue) {
  38549. this.eSlider.setMaxValue(maxValue);
  38550. this.eText.setMax(maxValue);
  38551. return this;
  38552. };
  38553. AgSlider.prototype.getValue = function () {
  38554. return this.eText.getValue();
  38555. };
  38556. AgSlider.prototype.setValue = function (value) {
  38557. if (this.getValue() === value) {
  38558. return this;
  38559. }
  38560. this.eText.setValue(value, true);
  38561. this.eSlider.setValue(value, true);
  38562. this.dispatchEvent({ type: _agAbstractField__WEBPACK_IMPORTED_MODULE_2__["AgAbstractField"].EVENT_CHANGED });
  38563. return this;
  38564. };
  38565. AgSlider.prototype.setStep = function (step) {
  38566. this.eSlider.setStep(step);
  38567. this.eText.setStep(step);
  38568. return this;
  38569. };
  38570. AgSlider.TEMPLATE = "<div class=\"ag-slider\">\n <label ref=\"eLabel\"></label>\n <div class=\"ag-wrapper ag-slider-wrapper\">\n <ag-input-range ref=\"eSlider\"></ag-input-range>\n <ag-input-number-field ref=\"eText\"></ag-input-number-field>\n </div>\n </div>";
  38571. __decorate([
  38572. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eLabel')
  38573. ], AgSlider.prototype, "eLabel", void 0);
  38574. __decorate([
  38575. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eSlider')
  38576. ], AgSlider.prototype, "eSlider", void 0);
  38577. __decorate([
  38578. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_0__["RefSelector"])('eText')
  38579. ], AgSlider.prototype, "eText", void 0);
  38580. __decorate([
  38581. _context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
  38582. ], AgSlider.prototype, "init", null);
  38583. return AgSlider;
  38584. }(_agAbstractLabel__WEBPACK_IMPORTED_MODULE_1__["AgAbstractLabel"]));
  38585. /***/ }),
  38586. /* 176 */
  38587. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38588. "use strict";
  38589. __webpack_require__.r(__webpack_exports__);
  38590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgColorPicker", function() { return AgColorPicker; });
  38591. /* harmony import */ var _agColorPanel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(177);
  38592. /* harmony import */ var _agDialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171);
  38593. /* harmony import */ var _agPickerField__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(178);
  38594. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72);
  38595. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  38596. /**
  38597. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38598. * @version v23.2.1
  38599. * @link http://www.ag-grid.com/
  38600. * @license MIT
  38601. */
  38602. var __extends = (undefined && undefined.__extends) || (function () {
  38603. var extendStatics = function (d, b) {
  38604. extendStatics = Object.setPrototypeOf ||
  38605. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38606. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38607. return extendStatics(d, b);
  38608. };
  38609. return function (d, b) {
  38610. extendStatics(d, b);
  38611. function __() { this.constructor = d; }
  38612. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38613. };
  38614. })();
  38615. var AgColorPicker = /** @class */ (function (_super) {
  38616. __extends(AgColorPicker, _super);
  38617. function AgColorPicker(config) {
  38618. var _this = _super.call(this) || this;
  38619. _this.displayTag = 'div';
  38620. _this.className = 'ag-color-picker';
  38621. _this.pickerIcon = 'colorPicker';
  38622. _this.setTemplate(_this.TEMPLATE.replace(/%displayField%/g, _this.displayTag));
  38623. if (config && config.color) {
  38624. _this.value = config.color;
  38625. }
  38626. return _this;
  38627. }
  38628. AgColorPicker.prototype.postConstruct = function () {
  38629. _super.prototype.postConstruct.call(this);
  38630. if (this.value) {
  38631. this.setValue(this.value);
  38632. }
  38633. };
  38634. AgColorPicker.prototype.showPicker = function () {
  38635. var _this = this;
  38636. var eGuiRect = this.getGui().getBoundingClientRect();
  38637. var colorDialog = new _agDialog__WEBPACK_IMPORTED_MODULE_1__["AgDialog"]({
  38638. closable: false,
  38639. modal: true,
  38640. hideTitleBar: true,
  38641. minWidth: 190,
  38642. width: 190,
  38643. height: 250,
  38644. x: eGuiRect.right - 190,
  38645. y: eGuiRect.top - 250
  38646. });
  38647. this.createBean(colorDialog);
  38648. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(colorDialog.getGui(), 'ag-color-dialog');
  38649. var colorPanel = new _agColorPanel__WEBPACK_IMPORTED_MODULE_0__["AgColorPanel"]({
  38650. picker: this
  38651. });
  38652. this.createBean(colorPanel);
  38653. colorPanel.addDestroyFunc(function () {
  38654. if (colorDialog.isAlive()) {
  38655. _this.destroyBean(colorDialog);
  38656. }
  38657. });
  38658. colorDialog.setParentComponent(this);
  38659. colorDialog.setBodyComponent(colorPanel);
  38660. colorPanel.setValue(this.getValue());
  38661. colorDialog.addDestroyFunc(function () {
  38662. var wasDestroying = _this.isDestroyingPicker;
  38663. // here we check if the picker was already being
  38664. // destroyed to avoid a stackoverflow
  38665. if (!wasDestroying) {
  38666. _this.isDestroyingPicker = true;
  38667. if (colorPanel.isAlive()) {
  38668. _this.destroyBean(colorPanel);
  38669. }
  38670. }
  38671. else {
  38672. _this.isDestroyingPicker = false;
  38673. }
  38674. if (_this.isAlive()) {
  38675. _this.getFocusableElement().focus();
  38676. }
  38677. });
  38678. return colorDialog;
  38679. };
  38680. AgColorPicker.prototype.setValue = function (color) {
  38681. if (this.value === color) {
  38682. return this;
  38683. }
  38684. this.value = color;
  38685. this.eDisplayField.style.backgroundColor = color;
  38686. this.dispatchEvent({ type: _agAbstractField__WEBPACK_IMPORTED_MODULE_3__["AgAbstractField"].EVENT_CHANGED });
  38687. return this;
  38688. };
  38689. AgColorPicker.prototype.getValue = function () {
  38690. return this.value;
  38691. };
  38692. return AgColorPicker;
  38693. }(_agPickerField__WEBPACK_IMPORTED_MODULE_2__["AgPickerField"]));
  38694. /***/ }),
  38695. /* 177 */
  38696. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38697. "use strict";
  38698. __webpack_require__.r(__webpack_exports__);
  38699. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgColorPanel", function() { return AgColorPanel; });
  38700. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56);
  38701. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  38702. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57);
  38703. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  38704. /**
  38705. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38706. * @version v23.2.1
  38707. * @link http://www.ag-grid.com/
  38708. * @license MIT
  38709. */
  38710. var __extends = (undefined && undefined.__extends) || (function () {
  38711. var extendStatics = function (d, b) {
  38712. extendStatics = Object.setPrototypeOf ||
  38713. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38714. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38715. return extendStatics(d, b);
  38716. };
  38717. return function (d, b) {
  38718. extendStatics(d, b);
  38719. function __() { this.constructor = d; }
  38720. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38721. };
  38722. })();
  38723. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  38724. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  38725. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  38726. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  38727. return c > 3 && r && Object.defineProperty(target, key, r), r;
  38728. };
  38729. var AgColorPanel = /** @class */ (function (_super) {
  38730. __extends(AgColorPanel, _super);
  38731. function AgColorPanel(config) {
  38732. var _this = _super.call(this, AgColorPanel.TEMPLATE) || this;
  38733. _this.H = 1; // in the [0, 1] range
  38734. _this.S = 1; // in the [0, 1] range
  38735. _this.B = 1; // in the [0, 1] range
  38736. _this.A = 1; // in the [0, 1] range
  38737. _this.isSpectrumDragging = false;
  38738. _this.isSpectrumHueDragging = false;
  38739. _this.isSpectrumAlphaDragging = false;
  38740. _this.colorChanged = false;
  38741. _this.picker = config.picker;
  38742. return _this;
  38743. }
  38744. AgColorPanel.prototype.postConstruct = function () {
  38745. var eGui = this.getGui();
  38746. this.initRecentColors();
  38747. this.addManagedListener(this.spectrumVal, 'mousedown', this.onSpectrumDraggerDown.bind(this));
  38748. this.addManagedListener(eGui, 'mousemove', this.onSpectrumDraggerMove.bind(this));
  38749. this.addManagedListener(this.spectrumHue, 'mousedown', this.onSpectrumHueDown.bind(this));
  38750. this.addManagedListener(eGui, 'mousemove', this.onSpectrumHueMove.bind(this));
  38751. this.addManagedListener(this.spectrumAlpha, 'mousedown', this.onSpectrumAlphaDown.bind(this));
  38752. this.addManagedListener(eGui, 'mousemove', this.onSpectrumAlphaMove.bind(this));
  38753. // Listening to `mouseup` on the document on purpose. The user might release the mouse button
  38754. // outside the UI control. When the mouse returns back to the control's area, the dragging
  38755. // of the thumb is not expected and seen as a bug.
  38756. this.addManagedListener(document, 'mouseup', this.onMouseUp.bind(this));
  38757. this.addManagedListener(this.recentColors, 'click', this.onRecentColorClick.bind(this));
  38758. };
  38759. AgColorPanel.prototype.refreshSpectrumRect = function () {
  38760. return this.spectrumValRect = this.spectrumVal.getBoundingClientRect();
  38761. };
  38762. AgColorPanel.prototype.refreshHueRect = function () {
  38763. return this.spectrumHueRect = this.spectrumHue.getBoundingClientRect();
  38764. };
  38765. AgColorPanel.prototype.refreshAlphaRect = function () {
  38766. return this.spectrumAlphaRect = this.spectrumAlpha.getBoundingClientRect();
  38767. };
  38768. AgColorPanel.prototype.onSpectrumDraggerDown = function (e) {
  38769. this.refreshSpectrumRect();
  38770. this.isSpectrumDragging = true;
  38771. this.moveDragger(e);
  38772. };
  38773. AgColorPanel.prototype.onSpectrumDraggerMove = function (e) {
  38774. if (this.isSpectrumDragging) {
  38775. this.moveDragger(e);
  38776. }
  38777. };
  38778. AgColorPanel.prototype.onSpectrumHueDown = function (e) {
  38779. this.refreshHueRect();
  38780. this.isSpectrumHueDragging = true;
  38781. this.moveHueSlider(e);
  38782. };
  38783. AgColorPanel.prototype.onSpectrumHueMove = function (e) {
  38784. if (this.isSpectrumHueDragging) {
  38785. this.moveHueSlider(e);
  38786. }
  38787. };
  38788. AgColorPanel.prototype.onSpectrumAlphaDown = function (e) {
  38789. this.refreshAlphaRect();
  38790. this.isSpectrumAlphaDragging = true;
  38791. this.moveAlphaSlider(e);
  38792. };
  38793. AgColorPanel.prototype.onSpectrumAlphaMove = function (e) {
  38794. if (this.isSpectrumAlphaDragging) {
  38795. this.moveAlphaSlider(e);
  38796. }
  38797. };
  38798. AgColorPanel.prototype.onMouseUp = function () {
  38799. this.isSpectrumDragging = false;
  38800. this.isSpectrumHueDragging = false;
  38801. this.isSpectrumAlphaDragging = false;
  38802. };
  38803. AgColorPanel.prototype.moveDragger = function (e) {
  38804. var valRect = this.spectrumValRect;
  38805. if (valRect) {
  38806. var x = e.clientX - valRect.left;
  38807. var y = e.clientY - valRect.top;
  38808. x = Math.max(x, 0);
  38809. x = Math.min(x, valRect.width);
  38810. y = Math.max(y, 0);
  38811. y = Math.min(y, valRect.height);
  38812. this.setSpectrumValue(x / valRect.width, 1 - y / valRect.height);
  38813. }
  38814. };
  38815. AgColorPanel.prototype.moveHueSlider = function (e) {
  38816. var hueRect = this.spectrumHueRect;
  38817. if (hueRect) {
  38818. var slider = this.spectrumHueSlider;
  38819. var sliderRect = slider.getBoundingClientRect();
  38820. var x = e.clientX - hueRect.left;
  38821. x = Math.max(x, 0);
  38822. x = Math.min(x, hueRect.width);
  38823. this.H = 1 - x / hueRect.width;
  38824. slider.style.left = (x + sliderRect.width / 2) + 'px';
  38825. this.update();
  38826. }
  38827. };
  38828. AgColorPanel.prototype.moveAlphaSlider = function (e) {
  38829. var alphaRect = this.spectrumAlphaRect;
  38830. if (alphaRect) {
  38831. var slider = this.spectrumAlphaSlider;
  38832. var sliderRect = slider.getBoundingClientRect();
  38833. var x = e.clientX - alphaRect.left;
  38834. x = Math.max(x, 0);
  38835. x = Math.min(x, alphaRect.width);
  38836. this.A = x / alphaRect.width;
  38837. slider.style.left = (x + sliderRect.width / 2) + 'px';
  38838. this.update();
  38839. }
  38840. };
  38841. AgColorPanel.prototype.update = function () {
  38842. var color = _utils__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHSB(this.H * 360, this.S, this.B, this.A);
  38843. var spectrumColor = _utils__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHSB(this.H * 360, 1, 1);
  38844. var rgbaColor = color.toRgbaString();
  38845. // the recent color list needs to know color has actually changed
  38846. var colorPicker = this.picker;
  38847. var existingColor = _utils__WEBPACK_IMPORTED_MODULE_1__["Color"].fromString(colorPicker.getValue());
  38848. if (existingColor.toRgbaString() !== rgbaColor) {
  38849. this.colorChanged = true;
  38850. }
  38851. colorPicker.setValue(rgbaColor);
  38852. this.spectrumColor.style.backgroundColor = spectrumColor.toRgbaString();
  38853. this.spectrumDragger.style.backgroundColor = rgbaColor;
  38854. };
  38855. /**
  38856. * @param saturation In the [0, 1] interval.
  38857. * @param brightness In the [0, 1] interval.
  38858. */
  38859. AgColorPanel.prototype.setSpectrumValue = function (saturation, brightness) {
  38860. var valRect = this.spectrumValRect || this.refreshSpectrumRect();
  38861. if (valRect) {
  38862. var dragger = this.spectrumDragger;
  38863. var draggerRect = dragger.getBoundingClientRect();
  38864. saturation = Math.max(0, saturation);
  38865. saturation = Math.min(1, saturation);
  38866. brightness = Math.max(0, brightness);
  38867. brightness = Math.min(1, brightness);
  38868. this.S = saturation;
  38869. this.B = brightness;
  38870. dragger.style.left = (saturation * valRect.width - draggerRect.width / 2) + 'px';
  38871. dragger.style.top = ((1 - brightness) * valRect.height - draggerRect.height / 2) + 'px';
  38872. this.update();
  38873. }
  38874. };
  38875. AgColorPanel.prototype.initRecentColors = function () {
  38876. var recentColors = AgColorPanel.recentColors;
  38877. var innerHtml = recentColors.map(function (color, index) {
  38878. return "<div class=\"ag-recent-color\" id=" + index + " style=\"background-color: " + color + "; width: 15px; height: 15px;\" recent-color=\"" + color + "\"></div>";
  38879. });
  38880. this.recentColors.innerHTML = innerHtml.join('');
  38881. };
  38882. AgColorPanel.prototype.setValue = function (val) {
  38883. var color = _utils__WEBPACK_IMPORTED_MODULE_1__["Color"].fromString(val);
  38884. var _a = color.toHSB(), h = _a[0], s = _a[1], b = _a[2];
  38885. this.H = (isNaN(h) ? 0 : h) / 360;
  38886. this.A = color.a;
  38887. var spectrumHueRect = this.spectrumHueRect || this.refreshHueRect();
  38888. var spectrumAlphaRect = this.spectrumAlphaRect || this.refreshAlphaRect();
  38889. this.spectrumHueSlider.style.left = ((this.H - 1) * -spectrumHueRect.width) + "px";
  38890. this.spectrumAlphaSlider.style.left = (this.A * spectrumAlphaRect.width) + "px";
  38891. this.setSpectrumValue(s, b);
  38892. };
  38893. AgColorPanel.prototype.onRecentColorClick = function (e) {
  38894. var target = e.target;
  38895. if (!_utils__WEBPACK_IMPORTED_MODULE_1__["_"].exists(target.id)) {
  38896. return;
  38897. }
  38898. var id = parseInt(target.id, 10);
  38899. this.setValue(AgColorPanel.recentColors[id]);
  38900. this.destroy();
  38901. };
  38902. AgColorPanel.prototype.addRecentColor = function () {
  38903. var color = _utils__WEBPACK_IMPORTED_MODULE_1__["Color"].fromHSB(this.H * 360, this.S, this.B, this.A);
  38904. var rgbaColor = color.toRgbaString();
  38905. var recentColors = AgColorPanel.recentColors;
  38906. if (!this.colorChanged || recentColors[0] === rgbaColor) {
  38907. return;
  38908. }
  38909. // remove duplicate color
  38910. recentColors = recentColors.filter(function (color) { return color != rgbaColor; });
  38911. // add color to head
  38912. recentColors = [rgbaColor].concat(recentColors);
  38913. // ensure we don't exceed max number of recent colors
  38914. if (recentColors.length > AgColorPanel.maxRecentColors) {
  38915. recentColors = recentColors.slice(0, AgColorPanel.maxRecentColors);
  38916. }
  38917. AgColorPanel.recentColors = recentColors;
  38918. };
  38919. AgColorPanel.prototype.destroy = function () {
  38920. this.addRecentColor();
  38921. _super.prototype.destroy.call(this);
  38922. };
  38923. AgColorPanel.maxRecentColors = 8;
  38924. AgColorPanel.recentColors = [];
  38925. AgColorPanel.TEMPLATE = "<div class=\"ag-color-panel\">\n <div ref=\"spectrumColor\" class=\"ag-spectrum-color\">\n <div class=\"ag-spectrum-sat ag-spectrum-fill\">\n <div ref=\"spectrumVal\" class=\"ag-spectrum-val ag-spectrum-fill\">\n <div ref=\"spectrumDragger\" class=\"ag-spectrum-dragger\"></div>\n </div>\n </div>\n </div>\n <div class=\"ag-spectrum-tools\">\n <div ref=\"spectrumHue\" class=\"ag-spectrum-hue ag-spectrum-tool\">\n <div class=\"ag-spectrum-hue-background\"></div>\n <div ref=\"spectrumHueSlider\" class=\"ag-spectrum-slider\"></div>\n </div>\n <div ref=\"spectrumAlpha\" class=\"ag-spectrum-alpha ag-spectrum-tool\">\n <div class=\"ag-spectrum-alpha-background\"></div>\n <div ref=\"spectrumAlphaSlider\" class=\"ag-spectrum-slider\"></div>\n </div>\n <div ref=\"recentColors\" class=\"ag-recent-colors\"></div>\n </div>\n </div>";
  38926. __decorate([
  38927. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumColor')
  38928. ], AgColorPanel.prototype, "spectrumColor", void 0);
  38929. __decorate([
  38930. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumVal')
  38931. ], AgColorPanel.prototype, "spectrumVal", void 0);
  38932. __decorate([
  38933. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumDragger')
  38934. ], AgColorPanel.prototype, "spectrumDragger", void 0);
  38935. __decorate([
  38936. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumHue')
  38937. ], AgColorPanel.prototype, "spectrumHue", void 0);
  38938. __decorate([
  38939. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumHueSlider')
  38940. ], AgColorPanel.prototype, "spectrumHueSlider", void 0);
  38941. __decorate([
  38942. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumAlpha')
  38943. ], AgColorPanel.prototype, "spectrumAlpha", void 0);
  38944. __decorate([
  38945. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('spectrumAlphaSlider')
  38946. ], AgColorPanel.prototype, "spectrumAlphaSlider", void 0);
  38947. __decorate([
  38948. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_2__["RefSelector"])('recentColors')
  38949. ], AgColorPanel.prototype, "recentColors", void 0);
  38950. __decorate([
  38951. _context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
  38952. ], AgColorPanel.prototype, "postConstruct", null);
  38953. return AgColorPanel;
  38954. }(_component__WEBPACK_IMPORTED_MODULE_0__["Component"]));
  38955. /***/ }),
  38956. /* 178 */
  38957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38958. "use strict";
  38959. __webpack_require__.r(__webpack_exports__);
  38960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgPickerField", function() { return AgPickerField; });
  38961. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72);
  38962. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  38963. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  38964. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
  38965. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  38966. /**
  38967. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  38968. * @version v23.2.1
  38969. * @link http://www.ag-grid.com/
  38970. * @license MIT
  38971. */
  38972. var __extends = (undefined && undefined.__extends) || (function () {
  38973. var extendStatics = function (d, b) {
  38974. extendStatics = Object.setPrototypeOf ||
  38975. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  38976. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  38977. return extendStatics(d, b);
  38978. };
  38979. return function (d, b) {
  38980. extendStatics(d, b);
  38981. function __() { this.constructor = d; }
  38982. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  38983. };
  38984. })();
  38985. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  38986. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  38987. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  38988. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  38989. return c > 3 && r && Object.defineProperty(target, key, r), r;
  38990. };
  38991. var AgPickerField = /** @class */ (function (_super) {
  38992. __extends(AgPickerField, _super);
  38993. function AgPickerField() {
  38994. var _this = _super !== null && _super.apply(this, arguments) || this;
  38995. _this.TEMPLATE = "<div class=\"ag-picker-field\" role=\"presentation\">\n <label ref=\"eLabel\"></label>\n <div ref=\"eWrapper\" class=\"ag-wrapper ag-picker-field-wrapper\" tabIndex=\"-1\">\n <%displayField% ref=\"eDisplayField\" class=\"ag-picker-field-display\"></%displayField%>\n <div ref=\"eIcon\" class=\"ag-picker-field-icon\"></div>\n </div>\n </div>";
  38996. _this.isDestroyingPicker = false;
  38997. _this.skipClick = false;
  38998. return _this;
  38999. }
  39000. AgPickerField.prototype.postConstruct = function () {
  39001. var _this = this;
  39002. _super.prototype.postConstruct.call(this);
  39003. var clickHandler = function () {
  39004. if (_this.skipClick) {
  39005. _this.skipClick = false;
  39006. return;
  39007. }
  39008. if (_this.isDisabled()) {
  39009. return;
  39010. }
  39011. _this.pickerComponent = _this.showPicker();
  39012. };
  39013. var eGui = this.getGui();
  39014. this.addManagedListener(eGui, 'mousedown', function (e) {
  39015. if (!_this.skipClick &&
  39016. _this.pickerComponent &&
  39017. _this.pickerComponent.isAlive() &&
  39018. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].isVisible(_this.pickerComponent.getGui()) &&
  39019. eGui.contains(e.target)) {
  39020. _this.skipClick = true;
  39021. }
  39022. });
  39023. this.addManagedListener(eGui, 'keydown', function (e) {
  39024. switch (e.keyCode) {
  39025. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_UP:
  39026. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_DOWN:
  39027. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_ENTER:
  39028. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_SPACE:
  39029. clickHandler();
  39030. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_ESCAPE:
  39031. e.preventDefault();
  39032. break;
  39033. }
  39034. });
  39035. this.addManagedListener(this.eWrapper, 'click', clickHandler);
  39036. this.addManagedListener(this.eLabel, 'click', clickHandler);
  39037. if (this.pickerIcon) {
  39038. this.eIcon.appendChild(_utils__WEBPACK_IMPORTED_MODULE_4__["_"].createIconNoSpan(this.pickerIcon, this.gridOptionsWrapper, null));
  39039. }
  39040. };
  39041. AgPickerField.prototype.setInputWidth = function (width) {
  39042. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setElementWidth(this.eWrapper, width);
  39043. return this;
  39044. };
  39045. AgPickerField.prototype.getFocusableElement = function () {
  39046. return this.eWrapper;
  39047. };
  39048. __decorate([
  39049. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  39050. ], AgPickerField.prototype, "gridOptionsWrapper", void 0);
  39051. __decorate([
  39052. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eLabel')
  39053. ], AgPickerField.prototype, "eLabel", void 0);
  39054. __decorate([
  39055. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eWrapper')
  39056. ], AgPickerField.prototype, "eWrapper", void 0);
  39057. __decorate([
  39058. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eDisplayField')
  39059. ], AgPickerField.prototype, "eDisplayField", void 0);
  39060. __decorate([
  39061. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_3__["RefSelector"])('eIcon')
  39062. ], AgPickerField.prototype, "eIcon", void 0);
  39063. return AgPickerField;
  39064. }(_agAbstractField__WEBPACK_IMPORTED_MODULE_0__["AgAbstractField"]));
  39065. /***/ }),
  39066. /* 179 */
  39067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39068. "use strict";
  39069. __webpack_require__.r(__webpack_exports__);
  39070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgInputNumberField", function() { return AgInputNumberField; });
  39071. /* harmony import */ var _agInputTextField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(173);
  39072. /**
  39073. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39074. * @version v23.2.1
  39075. * @link http://www.ag-grid.com/
  39076. * @license MIT
  39077. */
  39078. var __extends = (undefined && undefined.__extends) || (function () {
  39079. var extendStatics = function (d, b) {
  39080. extendStatics = Object.setPrototypeOf ||
  39081. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39082. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39083. return extendStatics(d, b);
  39084. };
  39085. return function (d, b) {
  39086. extendStatics(d, b);
  39087. function __() { this.constructor = d; }
  39088. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39089. };
  39090. })();
  39091. var AgInputNumberField = /** @class */ (function (_super) {
  39092. __extends(AgInputNumberField, _super);
  39093. function AgInputNumberField() {
  39094. var _this = _super !== null && _super.apply(this, arguments) || this;
  39095. _this.className = 'ag-number-field';
  39096. _this.inputType = 'number';
  39097. return _this;
  39098. }
  39099. AgInputNumberField.prototype.postConstruct = function () {
  39100. var _this = this;
  39101. _super.prototype.postConstruct.call(this);
  39102. this.addManagedListener(this.eInput, 'blur', function () {
  39103. var floatedValue = parseFloat(_this.eInput.value);
  39104. var value = isNaN(floatedValue) ? '' : _this.normalizeValue(floatedValue.toString());
  39105. if (_this.value !== value) {
  39106. _this.setValue(value);
  39107. }
  39108. });
  39109. };
  39110. AgInputNumberField.prototype.normalizeValue = function (value) {
  39111. if (value === '') {
  39112. return '';
  39113. }
  39114. if (this.precision) {
  39115. value = this.adjustPrecision(value);
  39116. }
  39117. var val = parseFloat(value);
  39118. if (this.min != null && val < this.min) {
  39119. value = this.min.toString();
  39120. }
  39121. else if (this.max != null && val > this.max) {
  39122. value = this.max.toString();
  39123. }
  39124. return value;
  39125. };
  39126. AgInputNumberField.prototype.adjustPrecision = function (value) {
  39127. if (this.precision) {
  39128. var floatString = parseFloat(value).toFixed(this.precision);
  39129. value = parseFloat(floatString).toString();
  39130. }
  39131. return value;
  39132. };
  39133. AgInputNumberField.prototype.setMin = function (min) {
  39134. if (this.min === min) {
  39135. return this;
  39136. }
  39137. this.min = min;
  39138. if (this.min != null) {
  39139. this.eInput.setAttribute('min', min.toString());
  39140. }
  39141. else {
  39142. this.eInput.removeAttribute('min');
  39143. }
  39144. return this;
  39145. };
  39146. AgInputNumberField.prototype.setMax = function (max) {
  39147. if (this.max === max) {
  39148. return this;
  39149. }
  39150. this.max = max;
  39151. if (this.max != null) {
  39152. this.eInput.setAttribute('max', max.toString());
  39153. }
  39154. else {
  39155. this.eInput.removeAttribute('max');
  39156. }
  39157. return this;
  39158. };
  39159. AgInputNumberField.prototype.setPrecision = function (precision) {
  39160. this.precision = precision;
  39161. return this;
  39162. };
  39163. AgInputNumberField.prototype.setStep = function (step) {
  39164. if (this.step === step) {
  39165. return this;
  39166. }
  39167. this.step = step;
  39168. if (step != null) {
  39169. this.eInput.setAttribute('step', step.toString());
  39170. }
  39171. else {
  39172. this.eInput.removeAttribute('step');
  39173. }
  39174. return this;
  39175. };
  39176. AgInputNumberField.prototype.setValue = function (value, silent) {
  39177. value = this.adjustPrecision(value);
  39178. var normalizedValue = this.normalizeValue(value);
  39179. if (value != normalizedValue) {
  39180. return this;
  39181. }
  39182. return _super.prototype.setValue.call(this, value, silent);
  39183. };
  39184. return AgInputNumberField;
  39185. }(_agInputTextField__WEBPACK_IMPORTED_MODULE_0__["AgInputTextField"]));
  39186. /***/ }),
  39187. /* 180 */
  39188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39189. "use strict";
  39190. __webpack_require__.r(__webpack_exports__);
  39191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgInputRange", function() { return AgInputRange; });
  39192. /* harmony import */ var _agAbstractInputField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71);
  39193. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  39194. /**
  39195. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39196. * @version v23.2.1
  39197. * @link http://www.ag-grid.com/
  39198. * @license MIT
  39199. */
  39200. var __extends = (undefined && undefined.__extends) || (function () {
  39201. var extendStatics = function (d, b) {
  39202. extendStatics = Object.setPrototypeOf ||
  39203. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39204. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39205. return extendStatics(d, b);
  39206. };
  39207. return function (d, b) {
  39208. extendStatics(d, b);
  39209. function __() { this.constructor = d; }
  39210. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39211. };
  39212. })();
  39213. var AgInputRange = /** @class */ (function (_super) {
  39214. __extends(AgInputRange, _super);
  39215. function AgInputRange(config) {
  39216. var _this = _super.call(this) || this;
  39217. _this.className = 'ag-range-field';
  39218. _this.displayTag = 'input';
  39219. _this.inputType = 'range';
  39220. _this.setTemplate(_this.TEMPLATE.replace(/%displayField%/g, _this.displayTag));
  39221. if (config) {
  39222. _this.config = config;
  39223. }
  39224. return _this;
  39225. }
  39226. AgInputRange.prototype.postConstruct = function () {
  39227. _super.prototype.postConstruct.call(this);
  39228. var _a = this.config, min = _a.min, max = _a.max, step = _a.step;
  39229. if (min != null) {
  39230. this.setMinValue(min);
  39231. }
  39232. if (max != null) {
  39233. this.setMaxValue(max);
  39234. }
  39235. this.setStep(step || 1);
  39236. };
  39237. AgInputRange.prototype.addInputListeners = function () {
  39238. var _this = this;
  39239. var isIE = _utils__WEBPACK_IMPORTED_MODULE_1__["_"].isBrowserIE();
  39240. var eventName = isIE ? 'change' : 'input';
  39241. this.addManagedListener(this.eInput, eventName, function (e) {
  39242. var value = e.target.value;
  39243. _this.setValue(value);
  39244. });
  39245. };
  39246. AgInputRange.prototype.setMinValue = function (value) {
  39247. this.min = value;
  39248. this.eInput.setAttribute('min', value.toString());
  39249. return this;
  39250. };
  39251. AgInputRange.prototype.setMaxValue = function (value) {
  39252. this.max = value;
  39253. this.eInput.setAttribute('max', value.toString());
  39254. return this;
  39255. };
  39256. AgInputRange.prototype.setStep = function (value) {
  39257. this.step = value;
  39258. this.eInput.setAttribute('step', value.toString());
  39259. return this;
  39260. };
  39261. AgInputRange.prototype.setValue = function (value, silent) {
  39262. if (this.min != null) {
  39263. value = Math.max(parseFloat(value), this.min).toString();
  39264. }
  39265. if (this.max != null) {
  39266. value = Math.min(parseFloat(value), this.max).toString();
  39267. }
  39268. var ret = _super.prototype.setValue.call(this, value, silent);
  39269. this.eInput.value = value;
  39270. return ret;
  39271. };
  39272. return AgInputRange;
  39273. }(_agAbstractInputField__WEBPACK_IMPORTED_MODULE_0__["AgAbstractInputField"]));
  39274. /***/ }),
  39275. /* 181 */
  39276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39277. "use strict";
  39278. __webpack_require__.r(__webpack_exports__);
  39279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgSelect", function() { return AgSelect; });
  39280. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72);
  39281. /* harmony import */ var _agPickerField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178);
  39282. /* harmony import */ var _agList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182);
  39283. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  39284. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  39285. /**
  39286. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39287. * @version v23.2.1
  39288. * @link http://www.ag-grid.com/
  39289. * @license MIT
  39290. */
  39291. var __extends = (undefined && undefined.__extends) || (function () {
  39292. var extendStatics = function (d, b) {
  39293. extendStatics = Object.setPrototypeOf ||
  39294. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39295. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39296. return extendStatics(d, b);
  39297. };
  39298. return function (d, b) {
  39299. extendStatics(d, b);
  39300. function __() { this.constructor = d; }
  39301. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39302. };
  39303. })();
  39304. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  39305. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  39306. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  39307. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  39308. return c > 3 && r && Object.defineProperty(target, key, r), r;
  39309. };
  39310. var AgSelect = /** @class */ (function (_super) {
  39311. __extends(AgSelect, _super);
  39312. function AgSelect(config) {
  39313. var _this = _super.call(this) || this;
  39314. _this.displayTag = 'div';
  39315. _this.className = 'ag-select';
  39316. _this.pickerIcon = 'smallDown';
  39317. _this.setTemplate(_this.TEMPLATE.replace(/%displayField%/g, _this.displayTag));
  39318. return _this;
  39319. }
  39320. AgSelect.prototype.init = function () {
  39321. var _this = this;
  39322. this.listComponent = new _agList__WEBPACK_IMPORTED_MODULE_2__["AgList"]('select');
  39323. this.getContext().createBean(this.listComponent);
  39324. this.listComponent.setParentComponent(this);
  39325. this.eWrapper.tabIndex = 0;
  39326. this.listComponent.addManagedListener(this.listComponent, _agList__WEBPACK_IMPORTED_MODULE_2__["AgList"].EVENT_ITEM_SELECTED, function () { if (_this.hideList) {
  39327. _this.hideList();
  39328. } });
  39329. this.listComponent.addManagedListener(this.listComponent, _agAbstractField__WEBPACK_IMPORTED_MODULE_0__["AgAbstractField"].EVENT_CHANGED, function () {
  39330. _this.setValue(_this.listComponent.getValue(), false, true);
  39331. if (_this.hideList) {
  39332. _this.hideList();
  39333. }
  39334. });
  39335. };
  39336. AgSelect.prototype.showPicker = function () {
  39337. var _this = this;
  39338. var listGui = this.listComponent.getGui();
  39339. var mouseWheelFunc = this.addManagedListener(document.body, 'wheel', function (e) {
  39340. if (!listGui.contains(e.target) && _this.hideList) {
  39341. _this.hideList();
  39342. }
  39343. });
  39344. var focusOutFunc = this.addManagedListener(listGui, 'focusout', function (e) {
  39345. if (!listGui.contains(e.relatedTarget) && _this.hideList) {
  39346. _this.hideList();
  39347. }
  39348. });
  39349. this.hideList = this.popupService.addPopup(true, listGui, true, function () {
  39350. _this.hideList = null;
  39351. focusOutFunc();
  39352. mouseWheelFunc();
  39353. if (_this.isAlive()) {
  39354. _this.getFocusableElement().focus();
  39355. }
  39356. });
  39357. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setElementWidth(listGui, _utils__WEBPACK_IMPORTED_MODULE_4__["_"].getAbsoluteWidth(this.eWrapper));
  39358. listGui.style.maxHeight = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].getInnerHeight(this.popupService.getPopupParent()) + 'px';
  39359. listGui.style.position = 'absolute';
  39360. this.popupService.positionPopupUnderComponent({
  39361. type: 'ag-list',
  39362. eventSource: this.eWrapper,
  39363. ePopup: listGui,
  39364. keepWithinBounds: true
  39365. });
  39366. this.listComponent.refreshHighlighted();
  39367. return this.listComponent;
  39368. };
  39369. AgSelect.prototype.addOptions = function (options) {
  39370. var _this = this;
  39371. options.forEach(function (option) { return _this.addOption(option); });
  39372. return this;
  39373. };
  39374. AgSelect.prototype.addOption = function (option) {
  39375. this.listComponent.addOption(option);
  39376. return this;
  39377. };
  39378. AgSelect.prototype.setValue = function (value, silent, fromPicker) {
  39379. if (this.value === value) {
  39380. return;
  39381. }
  39382. if (!fromPicker) {
  39383. this.listComponent.setValue(value, true);
  39384. }
  39385. var newValue = this.listComponent.getValue();
  39386. if (newValue === this.getValue()) {
  39387. return;
  39388. }
  39389. this.eDisplayField.innerHTML = this.listComponent.getDisplayValue();
  39390. return _super.prototype.setValue.call(this, value, silent);
  39391. };
  39392. AgSelect.prototype.destroy = function () {
  39393. if (this.hideList) {
  39394. this.hideList();
  39395. }
  39396. this.getContext().destroyBean(this.listComponent);
  39397. _super.prototype.destroy.call(this);
  39398. };
  39399. __decorate([
  39400. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('popupService')
  39401. ], AgSelect.prototype, "popupService", void 0);
  39402. __decorate([
  39403. _context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
  39404. ], AgSelect.prototype, "init", null);
  39405. return AgSelect;
  39406. }(_agPickerField__WEBPACK_IMPORTED_MODULE_1__["AgPickerField"]));
  39407. /***/ }),
  39408. /* 182 */
  39409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39410. "use strict";
  39411. __webpack_require__.r(__webpack_exports__);
  39412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgList", function() { return AgList; });
  39413. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72);
  39414. /* harmony import */ var _component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
  39415. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  39416. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  39417. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  39418. /**
  39419. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39420. * @version v23.2.1
  39421. * @link http://www.ag-grid.com/
  39422. * @license MIT
  39423. */
  39424. var __extends = (undefined && undefined.__extends) || (function () {
  39425. var extendStatics = function (d, b) {
  39426. extendStatics = Object.setPrototypeOf ||
  39427. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39428. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39429. return extendStatics(d, b);
  39430. };
  39431. return function (d, b) {
  39432. extendStatics(d, b);
  39433. function __() { this.constructor = d; }
  39434. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39435. };
  39436. })();
  39437. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  39438. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  39439. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  39440. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  39441. return c > 3 && r && Object.defineProperty(target, key, r), r;
  39442. };
  39443. var AgList = /** @class */ (function (_super) {
  39444. __extends(AgList, _super);
  39445. function AgList(cssIdentifier) {
  39446. if (cssIdentifier === void 0) { cssIdentifier = 'default'; }
  39447. var _this = _super.call(this, AgList.getTemplate(cssIdentifier)) || this;
  39448. _this.cssIdentifier = cssIdentifier;
  39449. _this.options = [];
  39450. _this.itemEls = [];
  39451. return _this;
  39452. }
  39453. AgList.prototype.init = function () {
  39454. this.addManagedListener(this.getGui(), 'keydown', this.handleKeyDown.bind(this));
  39455. };
  39456. AgList.getTemplate = function (cssIdentifier) {
  39457. return "<div class=\"ag-list ag-" + cssIdentifier + "-list\"></div>";
  39458. };
  39459. AgList.prototype.handleKeyDown = function (e) {
  39460. var key = e.keyCode;
  39461. switch (key) {
  39462. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_ENTER:
  39463. if (!this.highlightedEl) {
  39464. this.setValue(this.getValue());
  39465. }
  39466. else {
  39467. var pos = this.itemEls.indexOf(this.highlightedEl);
  39468. this.setValueByIndex(pos);
  39469. }
  39470. break;
  39471. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_DOWN:
  39472. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_UP:
  39473. var isDown = key === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_DOWN;
  39474. var itemToHighlight = void 0;
  39475. e.preventDefault();
  39476. if (!this.highlightedEl) {
  39477. itemToHighlight = this.itemEls[isDown ? 0 : this.itemEls.length - 1];
  39478. }
  39479. else {
  39480. var currentIdx = this.itemEls.indexOf(this.highlightedEl);
  39481. var nextPos = currentIdx + (isDown ? 1 : -1);
  39482. nextPos = Math.min(Math.max(nextPos, 0), this.itemEls.length - 1);
  39483. itemToHighlight = this.itemEls[nextPos];
  39484. }
  39485. this.highlightItem(itemToHighlight);
  39486. break;
  39487. }
  39488. };
  39489. AgList.prototype.addOptions = function (listOptions) {
  39490. var _this = this;
  39491. listOptions.forEach(function (listOption) { return _this.addOption(listOption); });
  39492. return this;
  39493. };
  39494. AgList.prototype.addOption = function (listOption) {
  39495. var value = listOption.value, text = listOption.text;
  39496. var sanitisedText = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].escape(text === undefined ? value : text);
  39497. this.options.push({ value: value, text: sanitisedText });
  39498. this.renderOption(sanitisedText);
  39499. return this;
  39500. };
  39501. AgList.prototype.renderOption = function (innerText) {
  39502. var _this = this;
  39503. var itemEl = document.createElement('div');
  39504. var itemContentEl = document.createElement('span');
  39505. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(itemEl, 'ag-list-item');
  39506. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(itemEl, "ag-" + this.cssIdentifier + "-list-item");
  39507. itemEl.tabIndex = -1;
  39508. itemContentEl.innerHTML = innerText;
  39509. this.itemEls.push(itemEl);
  39510. this.addManagedListener(itemEl, 'mouseover', function (e) { return _this.highlightItem(itemEl); });
  39511. this.addManagedListener(itemEl, 'mouseleave', function () { return _this.clearHighlighted(); });
  39512. this.addManagedListener(itemEl, 'click', function () {
  39513. var idx = _this.itemEls.indexOf(itemEl);
  39514. _this.setValueByIndex(idx);
  39515. });
  39516. itemEl.appendChild(itemContentEl);
  39517. this.getGui().appendChild(itemEl);
  39518. };
  39519. AgList.prototype.setValue = function (value, silent) {
  39520. if (this.value === value) {
  39521. this.fireItemSelected();
  39522. return this;
  39523. }
  39524. if (value == null) {
  39525. this.reset();
  39526. return this;
  39527. }
  39528. var idx = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].findIndex(this.options, function (option) { return option.value === value; });
  39529. if (idx !== -1) {
  39530. var option = this.options[idx];
  39531. this.value = option.value;
  39532. this.displayValue = option.text != null ? option.text : option.value;
  39533. this.highlightItem(this.itemEls[idx]);
  39534. if (!silent) {
  39535. this.fireChangeEvent();
  39536. }
  39537. }
  39538. return this;
  39539. };
  39540. AgList.prototype.setValueByIndex = function (idx) {
  39541. return this.setValue(this.options[idx].value);
  39542. };
  39543. AgList.prototype.getValue = function () {
  39544. return this.value;
  39545. };
  39546. AgList.prototype.getDisplayValue = function () {
  39547. return this.displayValue;
  39548. };
  39549. AgList.prototype.refreshHighlighted = function () {
  39550. var _this = this;
  39551. this.clearHighlighted();
  39552. var idx = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].findIndex(this.options, function (option) { return option.value === _this.value; });
  39553. if (idx !== -1) {
  39554. this.highlightItem(this.itemEls[idx]);
  39555. }
  39556. };
  39557. AgList.prototype.reset = function () {
  39558. this.value = null;
  39559. this.displayValue = null;
  39560. this.clearHighlighted();
  39561. this.fireChangeEvent();
  39562. };
  39563. AgList.prototype.highlightItem = function (el) {
  39564. if (!el.offsetParent) {
  39565. return;
  39566. }
  39567. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].radioCssClass(el, 'ag-active-item');
  39568. this.highlightedEl = el;
  39569. this.highlightedEl.focus();
  39570. };
  39571. AgList.prototype.clearHighlighted = function () {
  39572. if (!this.highlightedEl || !this.highlightedEl.offsetParent) {
  39573. return;
  39574. }
  39575. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].removeCssClass(this.highlightedEl, 'ag-active-item');
  39576. this.highlightedEl = null;
  39577. };
  39578. AgList.prototype.fireChangeEvent = function () {
  39579. this.dispatchEvent({ type: _agAbstractField__WEBPACK_IMPORTED_MODULE_0__["AgAbstractField"].EVENT_CHANGED });
  39580. this.fireItemSelected();
  39581. };
  39582. AgList.prototype.fireItemSelected = function () {
  39583. this.dispatchEvent({ type: AgList.EVENT_ITEM_SELECTED });
  39584. };
  39585. AgList.EVENT_ITEM_SELECTED = 'selectedItem';
  39586. __decorate([
  39587. _context_context__WEBPACK_IMPORTED_MODULE_2__["PostConstruct"]
  39588. ], AgList.prototype, "init", null);
  39589. return AgList;
  39590. }(_component__WEBPACK_IMPORTED_MODULE_1__["Component"]));
  39591. /***/ }),
  39592. /* 183 */
  39593. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39594. "use strict";
  39595. __webpack_require__.r(__webpack_exports__);
  39596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgAngleSelect", function() { return AgAngleSelect; });
  39597. /* harmony import */ var _agAbstractLabel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73);
  39598. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  39599. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  39600. /* harmony import */ var _agAbstractField__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72);
  39601. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  39602. /**
  39603. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39604. * @version v23.2.1
  39605. * @link http://www.ag-grid.com/
  39606. * @license MIT
  39607. */
  39608. var __extends = (undefined && undefined.__extends) || (function () {
  39609. var extendStatics = function (d, b) {
  39610. extendStatics = Object.setPrototypeOf ||
  39611. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39612. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39613. return extendStatics(d, b);
  39614. };
  39615. return function (d, b) {
  39616. extendStatics(d, b);
  39617. function __() { this.constructor = d; }
  39618. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39619. };
  39620. })();
  39621. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  39622. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  39623. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  39624. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  39625. return c > 3 && r && Object.defineProperty(target, key, r), r;
  39626. };
  39627. var AgAngleSelect = /** @class */ (function (_super) {
  39628. __extends(AgAngleSelect, _super);
  39629. function AgAngleSelect() {
  39630. var _this = _super.call(this, AgAngleSelect.TEMPLATE) || this;
  39631. _this.radius = 0;
  39632. _this.offsetX = 0;
  39633. _this.offsetY = 0;
  39634. return _this;
  39635. }
  39636. AgAngleSelect.prototype.postConstruct = function () {
  39637. var _this = this;
  39638. _super.prototype.postConstruct.call(this);
  39639. this.dragListener = {
  39640. eElement: this.eParentCircle,
  39641. dragStartPixels: 0,
  39642. onDragStart: function (e) {
  39643. _this.parentCircleRect = _this.eParentCircle.getBoundingClientRect();
  39644. },
  39645. onDragging: function (e) { return _this.calculateAngleDrag(e); },
  39646. onDragStop: function () { }
  39647. };
  39648. this.dragService.addDragSource(this.dragListener);
  39649. this.eAngleValue
  39650. .setLabel('')
  39651. .setLabelWidth(5)
  39652. .setInputWidth(45)
  39653. .setMin(0)
  39654. .setMax(360)
  39655. .setValue("" + this.degrees)
  39656. .onValueChange(function (value) {
  39657. if (value == null || value === '') {
  39658. value = '0';
  39659. }
  39660. value = _this.eAngleValue.normalizeValue(value);
  39661. var floatValue = parseFloat(value);
  39662. if (floatValue > 180) {
  39663. floatValue = floatValue - 360;
  39664. }
  39665. _this.setValue(floatValue);
  39666. });
  39667. this.updateNumberInput();
  39668. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(this.getValue())) {
  39669. this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString());
  39670. }
  39671. this.addManagedListener(this, _agAbstractField__WEBPACK_IMPORTED_MODULE_3__["AgAbstractField"].EVENT_CHANGED, function () {
  39672. if (_this.eAngleValue.getInputElement().contains(document.activeElement)) {
  39673. return;
  39674. }
  39675. _this.updateNumberInput();
  39676. });
  39677. };
  39678. AgAngleSelect.prototype.updateNumberInput = function () {
  39679. var normalizedValue = this.normalizeNegativeValue(this.getValue());
  39680. this.eAngleValue.setValue(normalizedValue.toString());
  39681. };
  39682. AgAngleSelect.prototype.positionChildCircle = function (radians) {
  39683. var rect = this.parentCircleRect || { width: 24, height: 24 };
  39684. var eChildCircle = this.eChildCircle;
  39685. var centerX = rect.width / 2;
  39686. var centerY = rect.height / 2;
  39687. eChildCircle.style.left = centerX + Math.cos(radians) * 8 + "px";
  39688. eChildCircle.style.top = centerY + Math.sin(radians) * 8 + "px";
  39689. };
  39690. AgAngleSelect.prototype.calculatePolar = function () {
  39691. var x = this.offsetX;
  39692. var y = this.offsetY;
  39693. var radians = Math.atan2(y, x);
  39694. this.degrees = this.toDegrees(radians);
  39695. this.radius = Math.sqrt((x * x) + (y * y));
  39696. this.positionChildCircle(radians);
  39697. };
  39698. AgAngleSelect.prototype.calculateCartesian = function () {
  39699. var radians = this.toRadians(this.getValue());
  39700. var radius = this.getRadius();
  39701. this
  39702. .setOffsetX(Math.cos(radians) * radius)
  39703. .setOffsetY(Math.sin(radians) * radius);
  39704. };
  39705. AgAngleSelect.prototype.setOffsetX = function (offset) {
  39706. if (this.offsetX !== offset) {
  39707. this.offsetX = offset;
  39708. this.calculatePolar();
  39709. }
  39710. return this;
  39711. };
  39712. AgAngleSelect.prototype.setOffsetY = function (offset) {
  39713. if (this.offsetY !== offset) {
  39714. this.offsetY = offset;
  39715. this.calculatePolar();
  39716. }
  39717. return this;
  39718. };
  39719. AgAngleSelect.prototype.calculateAngleDrag = function (e) {
  39720. var rect = this.parentCircleRect;
  39721. var centerX = rect.width / 2;
  39722. var centerY = rect.height / 2;
  39723. var x = e.clientX - rect.left;
  39724. var y = e.clientY - rect.top;
  39725. var dx = x - centerX;
  39726. var dy = y - centerY;
  39727. var radians = Math.atan2(dy, dx);
  39728. this.setValue(radians, true);
  39729. };
  39730. AgAngleSelect.prototype.toDegrees = function (radians) {
  39731. return radians / Math.PI * 180;
  39732. };
  39733. AgAngleSelect.prototype.toRadians = function (degrees) {
  39734. return degrees / 180 * Math.PI;
  39735. };
  39736. AgAngleSelect.prototype.normalizeNegativeValue = function (degrees) {
  39737. return degrees < 0 ? 360 + degrees : degrees;
  39738. };
  39739. AgAngleSelect.prototype.normalizeAngle180 = function (radians) {
  39740. radians %= Math.PI * 2;
  39741. if (radians < -Math.PI) {
  39742. radians += Math.PI * 2;
  39743. }
  39744. else if (radians >= Math.PI) {
  39745. radians -= Math.PI * 2;
  39746. }
  39747. return radians;
  39748. };
  39749. AgAngleSelect.prototype.getRadius = function () {
  39750. return this.radius;
  39751. };
  39752. AgAngleSelect.prototype.setRadius = function (r) {
  39753. if (this.radius === r) {
  39754. return this;
  39755. }
  39756. this.radius = r;
  39757. this.calculateCartesian();
  39758. return this;
  39759. };
  39760. AgAngleSelect.prototype.onValueChange = function (callbackFn) {
  39761. var _this = this;
  39762. this.addManagedListener(this, _agAbstractField__WEBPACK_IMPORTED_MODULE_3__["AgAbstractField"].EVENT_CHANGED, function () {
  39763. callbackFn(_this.degrees);
  39764. });
  39765. return this;
  39766. };
  39767. AgAngleSelect.prototype.getValue = function (radians) {
  39768. return radians ? this.toRadians(this.degrees) : this.degrees;
  39769. };
  39770. AgAngleSelect.prototype.setValue = function (degrees, radians) {
  39771. var radiansValue;
  39772. if (!radians) {
  39773. radiansValue = this.normalizeAngle180(this.toRadians(degrees));
  39774. }
  39775. else {
  39776. radiansValue = degrees;
  39777. }
  39778. degrees = this.toDegrees(radiansValue);
  39779. if (this.degrees !== degrees) {
  39780. this.degrees = Math.floor(degrees);
  39781. this.calculateCartesian();
  39782. this.positionChildCircle(radiansValue);
  39783. this.dispatchEvent({ type: _agAbstractField__WEBPACK_IMPORTED_MODULE_3__["AgAbstractField"].EVENT_CHANGED });
  39784. }
  39785. return this;
  39786. };
  39787. AgAngleSelect.prototype.setWidth = function (width) {
  39788. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].setFixedWidth(this.getGui(), width);
  39789. return this;
  39790. };
  39791. AgAngleSelect.prototype.destroy = function () {
  39792. this.dragService.removeDragSource(this.dragListener);
  39793. _super.prototype.destroy.call(this);
  39794. };
  39795. AgAngleSelect.TEMPLATE = "<div class=\"ag-angle-select\">\n <label ref=\"eLabel\"></label>\n <div class=\"ag-wrapper ag-angle-select-wrapper\">\n <div ref=\"eAngleSelectField\" class=\"ag-angle-select-field\">\n <div ref=\"eParentCircle\" class=\"ag-angle-select-parent-circle\">\n <div ref=\"eChildCircle\" class=\"ag-angle-select-child-circle\"></div>\n </div>\n </div>\n <ag-input-number-field ref=\"eAngleValue\"></ag-input-number-field>\n </div>\n </div>";
  39796. __decorate([
  39797. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eLabel')
  39798. ], AgAngleSelect.prototype, "eLabel", void 0);
  39799. __decorate([
  39800. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eParentCircle')
  39801. ], AgAngleSelect.prototype, "eParentCircle", void 0);
  39802. __decorate([
  39803. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eChildCircle')
  39804. ], AgAngleSelect.prototype, "eChildCircle", void 0);
  39805. __decorate([
  39806. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eAngleValue')
  39807. ], AgAngleSelect.prototype, "eAngleValue", void 0);
  39808. __decorate([
  39809. Object(_context_context__WEBPACK_IMPORTED_MODULE_2__["Autowired"])("dragService")
  39810. ], AgAngleSelect.prototype, "dragService", void 0);
  39811. return AgAngleSelect;
  39812. }(_agAbstractLabel__WEBPACK_IMPORTED_MODULE_0__["AgAbstractLabel"]));
  39813. /***/ }),
  39814. /* 184 */
  39815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39816. "use strict";
  39817. __webpack_require__.r(__webpack_exports__);
  39818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgToggleButton", function() { return AgToggleButton; });
  39819. /* harmony import */ var _agRadioButton__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(146);
  39820. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
  39821. /**
  39822. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39823. * @version v23.2.1
  39824. * @link http://www.ag-grid.com/
  39825. * @license MIT
  39826. */
  39827. var __extends = (undefined && undefined.__extends) || (function () {
  39828. var extendStatics = function (d, b) {
  39829. extendStatics = Object.setPrototypeOf ||
  39830. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39831. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39832. return extendStatics(d, b);
  39833. };
  39834. return function (d, b) {
  39835. extendStatics(d, b);
  39836. function __() { this.constructor = d; }
  39837. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39838. };
  39839. })();
  39840. var AgToggleButton = /** @class */ (function (_super) {
  39841. __extends(AgToggleButton, _super);
  39842. function AgToggleButton() {
  39843. var _this = _super !== null && _super.apply(this, arguments) || this;
  39844. _this.className = 'ag-toggle-button';
  39845. _this.inputType = 'checkbox';
  39846. return _this;
  39847. }
  39848. AgToggleButton.prototype.setValue = function (value, silent) {
  39849. _super.prototype.setValue.call(this, value, silent);
  39850. _utils__WEBPACK_IMPORTED_MODULE_1__["_"].addOrRemoveCssClass(this.getGui(), 'ag-selected', this.getValue());
  39851. return this;
  39852. };
  39853. return AgToggleButton;
  39854. }(_agRadioButton__WEBPACK_IMPORTED_MODULE_0__["AgRadioButton"]));
  39855. /***/ }),
  39856. /* 185 */
  39857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39858. "use strict";
  39859. __webpack_require__.r(__webpack_exports__);
  39860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DetailRowCompCache", function() { return DetailRowCompCache; });
  39861. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  39862. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
  39863. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  39864. /**
  39865. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  39866. * @version v23.2.1
  39867. * @link http://www.ag-grid.com/
  39868. * @license MIT
  39869. */
  39870. var __extends = (undefined && undefined.__extends) || (function () {
  39871. var extendStatics = function (d, b) {
  39872. extendStatics = Object.setPrototypeOf ||
  39873. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  39874. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  39875. return extendStatics(d, b);
  39876. };
  39877. return function (d, b) {
  39878. extendStatics(d, b);
  39879. function __() { this.constructor = d; }
  39880. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  39881. };
  39882. })();
  39883. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  39884. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  39885. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  39886. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  39887. return c > 3 && r && Object.defineProperty(target, key, r), r;
  39888. };
  39889. /**
  39890. * For Master Detail, it is required to keep components between expanding & collapsing parents.
  39891. * For example a user expands row A (and shows a detail grid for this row), then when row A
  39892. * is closed, we want to keep the detail grid, so next time row A is expanded the detail grid
  39893. * is showed with it's context intact, eg if user sorted in the detail grid, that sort should
  39894. * still be applied after the detail grid is shown for the second time.
  39895. */
  39896. var DetailRowCompCache = /** @class */ (function (_super) {
  39897. __extends(DetailRowCompCache, _super);
  39898. function DetailRowCompCache() {
  39899. var _this = _super !== null && _super.apply(this, arguments) || this;
  39900. _this.cacheItems = [];
  39901. return _this;
  39902. }
  39903. DetailRowCompCache.prototype.postConstruct = function () {
  39904. this.active = this.gridOptionsWrapper.isKeepDetailRows();
  39905. this.maxCacheSize = this.gridOptionsWrapper.getKeepDetailRowsCount();
  39906. };
  39907. DetailRowCompCache.prototype.addOrDestroy = function (rowNode, pinned, comp) {
  39908. // only accept detail rows
  39909. var doNotUseCache = !this.active || !rowNode.detail;
  39910. if (doNotUseCache) {
  39911. this.destroyFullWidthRow(comp);
  39912. return;
  39913. }
  39914. var item = this.getCacheItem(rowNode, true);
  39915. // put the comp in the right location of the item.
  39916. // we also destroy any previous comp - this should never happen
  39917. // as the logic outside of this class shouldn't be adding same item to the
  39918. // cache twice, however we cater for it in case in future releases code
  39919. // outside of this class is changed and this could happen.
  39920. switch (pinned) {
  39921. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_LEFT:
  39922. this.destroyFullWidthRow(item.left);
  39923. item.left = comp;
  39924. break;
  39925. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_RIGHT:
  39926. this.destroyFullWidthRow(item.right);
  39927. item.right = comp;
  39928. break;
  39929. default:
  39930. this.destroyFullWidthRow(item.center);
  39931. item.center = comp;
  39932. break;
  39933. }
  39934. this.cacheItems.sort(function (a, b) {
  39935. return b.lastAccessedTime - a.lastAccessedTime;
  39936. });
  39937. this.purgeCache(this.maxCacheSize);
  39938. };
  39939. DetailRowCompCache.prototype.getCacheItem = function (rowNode, autoCreate) {
  39940. if (autoCreate === void 0) { autoCreate = false; }
  39941. var res;
  39942. for (var i = 0; i < this.cacheItems.length; i++) {
  39943. var item = this.cacheItems[i];
  39944. if (item.rowNode === rowNode) {
  39945. res = item;
  39946. break;
  39947. }
  39948. }
  39949. if (!res && autoCreate) {
  39950. res = {
  39951. rowNode: rowNode
  39952. };
  39953. this.cacheItems.push(res);
  39954. }
  39955. if (res) {
  39956. this.stampCacheItem(res);
  39957. }
  39958. return res;
  39959. };
  39960. DetailRowCompCache.prototype.stampCacheItem = function (item) {
  39961. item.lastAccessedTime = new Date().getTime();
  39962. };
  39963. DetailRowCompCache.prototype.destroyFullWidthRow = function (comp) {
  39964. this.getContext().destroyBean(comp);
  39965. };
  39966. DetailRowCompCache.prototype.purgeCache = function (startIndex) {
  39967. // delete all rows past the index of interest
  39968. for (var i = startIndex; i < this.cacheItems.length; i++) {
  39969. var item = this.cacheItems[i];
  39970. this.destroyFullWidthRow(item.center);
  39971. this.destroyFullWidthRow(item.left);
  39972. this.destroyFullWidthRow(item.right);
  39973. }
  39974. // change the length of the array so it no longer contains the deleted items
  39975. if (this.cacheItems.length > startIndex) {
  39976. this.cacheItems.length = startIndex;
  39977. }
  39978. };
  39979. DetailRowCompCache.prototype.get = function (rowNode, pinned) {
  39980. if (!rowNode.detail) {
  39981. return undefined;
  39982. }
  39983. var item = this.getCacheItem(rowNode);
  39984. var res;
  39985. if (item) {
  39986. switch (pinned) {
  39987. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_LEFT:
  39988. if (item.left) {
  39989. res = item.left;
  39990. item.left = undefined;
  39991. }
  39992. break;
  39993. case _constants__WEBPACK_IMPORTED_MODULE_1__["Constants"].PINNED_RIGHT:
  39994. if (item.right) {
  39995. res = item.right;
  39996. item.right = undefined;
  39997. }
  39998. break;
  39999. default:
  40000. if (item.center) {
  40001. res = item.center;
  40002. item.center = undefined;
  40003. }
  40004. break;
  40005. }
  40006. }
  40007. return res;
  40008. };
  40009. DetailRowCompCache.prototype.destroy = function () {
  40010. _super.prototype.destroy.call(this);
  40011. this.purgeCache(0);
  40012. };
  40013. __decorate([
  40014. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  40015. ], DetailRowCompCache.prototype, "gridOptionsWrapper", void 0);
  40016. __decorate([
  40017. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  40018. ], DetailRowCompCache.prototype, "postConstruct", null);
  40019. __decorate([
  40020. _context_context__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
  40021. ], DetailRowCompCache.prototype, "destroy", null);
  40022. DetailRowCompCache = __decorate([
  40023. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('detailRowCompCache')
  40024. ], DetailRowCompCache);
  40025. return DetailRowCompCache;
  40026. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  40027. /***/ }),
  40028. /* 186 */
  40029. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40030. "use strict";
  40031. __webpack_require__.r(__webpack_exports__);
  40032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowPositionUtils", function() { return RowPositionUtils; });
  40033. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  40034. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  40035. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  40036. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  40037. /**
  40038. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40039. * @version v23.2.1
  40040. * @link http://www.ag-grid.com/
  40041. * @license MIT
  40042. */
  40043. var __extends = (undefined && undefined.__extends) || (function () {
  40044. var extendStatics = function (d, b) {
  40045. extendStatics = Object.setPrototypeOf ||
  40046. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40047. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40048. return extendStatics(d, b);
  40049. };
  40050. return function (d, b) {
  40051. extendStatics(d, b);
  40052. function __() { this.constructor = d; }
  40053. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40054. };
  40055. })();
  40056. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  40057. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  40058. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  40059. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  40060. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40061. };
  40062. var RowPositionUtils = /** @class */ (function (_super) {
  40063. __extends(RowPositionUtils, _super);
  40064. function RowPositionUtils() {
  40065. return _super !== null && _super.apply(this, arguments) || this;
  40066. }
  40067. RowPositionUtils.prototype.getFirstRow = function () {
  40068. var rowIndex = 0;
  40069. var rowPinned;
  40070. if (this.pinnedRowModel.getPinnedTopRowCount()) {
  40071. rowPinned = _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP;
  40072. }
  40073. else if (this.rowModel.getRowCount()) {
  40074. rowPinned = null;
  40075. }
  40076. else if (this.pinnedRowModel.getPinnedBottomRowCount()) {
  40077. rowPinned = _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM;
  40078. }
  40079. return rowPinned === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned };
  40080. };
  40081. RowPositionUtils.prototype.getRowNode = function (gridRow) {
  40082. switch (gridRow.rowPinned) {
  40083. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP:
  40084. return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];
  40085. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM:
  40086. return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];
  40087. default:
  40088. return this.rowModel.getRow(gridRow.rowIndex);
  40089. }
  40090. };
  40091. RowPositionUtils.prototype.sameRow = function (rowA, rowB) {
  40092. // if both missing
  40093. if (!rowA && !rowB) {
  40094. return true;
  40095. }
  40096. // if only one missing
  40097. if ((rowA && !rowB) || (!rowA && rowB)) {
  40098. return false;
  40099. }
  40100. // otherwise compare (use == to compare rowPinned because it can be null or undefined)
  40101. return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned;
  40102. };
  40103. // tests if this row selection is before the other row selection
  40104. RowPositionUtils.prototype.before = function (rowA, rowB) {
  40105. switch (rowA.rowPinned) {
  40106. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP:
  40107. // we we are floating top, and other isn't, then we are always before
  40108. if (rowB.rowPinned !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP) {
  40109. return true;
  40110. }
  40111. break;
  40112. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM:
  40113. // if we are floating bottom, and the other isn't, then we are never before
  40114. if (rowB.rowPinned !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_BOTTOM) {
  40115. return false;
  40116. }
  40117. break;
  40118. default:
  40119. // if we are not floating, but the other one is floating...
  40120. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(rowB.rowPinned)) {
  40121. return rowB.rowPinned !== _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].PINNED_TOP;
  40122. }
  40123. break;
  40124. }
  40125. return rowA.rowIndex < rowB.rowIndex;
  40126. };
  40127. __decorate([
  40128. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  40129. ], RowPositionUtils.prototype, "rowModel", void 0);
  40130. __decorate([
  40131. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  40132. ], RowPositionUtils.prototype, "rowRenderer", void 0);
  40133. __decorate([
  40134. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('pinnedRowModel')
  40135. ], RowPositionUtils.prototype, "pinnedRowModel", void 0);
  40136. RowPositionUtils = __decorate([
  40137. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('rowPositionUtils')
  40138. ], RowPositionUtils);
  40139. return RowPositionUtils;
  40140. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  40141. /***/ }),
  40142. /* 187 */
  40143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40144. "use strict";
  40145. __webpack_require__.r(__webpack_exports__);
  40146. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CellPositionUtils", function() { return CellPositionUtils; });
  40147. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  40148. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  40149. /**
  40150. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40151. * @version v23.2.1
  40152. * @link http://www.ag-grid.com/
  40153. * @license MIT
  40154. */
  40155. var __extends = (undefined && undefined.__extends) || (function () {
  40156. var extendStatics = function (d, b) {
  40157. extendStatics = Object.setPrototypeOf ||
  40158. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40159. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40160. return extendStatics(d, b);
  40161. };
  40162. return function (d, b) {
  40163. extendStatics(d, b);
  40164. function __() { this.constructor = d; }
  40165. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40166. };
  40167. })();
  40168. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  40169. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  40170. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  40171. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  40172. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40173. };
  40174. var CellPositionUtils = /** @class */ (function (_super) {
  40175. __extends(CellPositionUtils, _super);
  40176. function CellPositionUtils() {
  40177. return _super !== null && _super.apply(this, arguments) || this;
  40178. }
  40179. CellPositionUtils.prototype.createId = function (cellPosition) {
  40180. var rowIndex = cellPosition.rowIndex, rowPinned = cellPosition.rowPinned, column = cellPosition.column;
  40181. return this.createIdFromValues(rowIndex, column, rowPinned);
  40182. };
  40183. CellPositionUtils.prototype.createIdFromValues = function (rowIndex, column, rowPinned) {
  40184. return rowIndex + "." + (rowPinned == null ? 'null' : rowPinned) + "." + column.getId();
  40185. };
  40186. CellPositionUtils.prototype.equals = function (cellA, cellB) {
  40187. var colsMatch = cellA.column === cellB.column;
  40188. var floatingMatch = cellA.rowPinned === cellB.rowPinned;
  40189. var indexMatch = cellA.rowIndex === cellB.rowIndex;
  40190. return colsMatch && floatingMatch && indexMatch;
  40191. };
  40192. CellPositionUtils = __decorate([
  40193. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('cellPositionUtils')
  40194. ], CellPositionUtils);
  40195. return CellPositionUtils;
  40196. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  40197. /***/ }),
  40198. /* 188 */
  40199. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40200. "use strict";
  40201. __webpack_require__.r(__webpack_exports__);
  40202. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PinnedRowModel", function() { return PinnedRowModel; });
  40203. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68);
  40204. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  40205. /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
  40206. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  40207. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  40208. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41);
  40209. /**
  40210. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40211. * @version v23.2.1
  40212. * @link http://www.ag-grid.com/
  40213. * @license MIT
  40214. */
  40215. var __extends = (undefined && undefined.__extends) || (function () {
  40216. var extendStatics = function (d, b) {
  40217. extendStatics = Object.setPrototypeOf ||
  40218. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40219. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40220. return extendStatics(d, b);
  40221. };
  40222. return function (d, b) {
  40223. extendStatics(d, b);
  40224. function __() { this.constructor = d; }
  40225. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40226. };
  40227. })();
  40228. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  40229. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  40230. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  40231. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  40232. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40233. };
  40234. var PinnedRowModel = /** @class */ (function (_super) {
  40235. __extends(PinnedRowModel, _super);
  40236. function PinnedRowModel() {
  40237. return _super !== null && _super.apply(this, arguments) || this;
  40238. }
  40239. PinnedRowModel.prototype.init = function () {
  40240. this.setPinnedTopRowData(this.gridOptionsWrapper.getPinnedTopRowData());
  40241. this.setPinnedBottomRowData(this.gridOptionsWrapper.getPinnedBottomRowData());
  40242. };
  40243. PinnedRowModel.prototype.isEmpty = function (floating) {
  40244. var rows = floating === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP ? this.pinnedTopRows : this.pinnedBottomRows;
  40245. return _utils__WEBPACK_IMPORTED_MODULE_4__["_"].missingOrEmpty(rows);
  40246. };
  40247. PinnedRowModel.prototype.isRowsToRender = function (floating) {
  40248. return !this.isEmpty(floating);
  40249. };
  40250. PinnedRowModel.prototype.getRowAtPixel = function (pixel, floating) {
  40251. var rows = floating === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP ? this.pinnedTopRows : this.pinnedBottomRows;
  40252. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].missingOrEmpty(rows)) {
  40253. return 0; // this should never happen, just in case, 0 is graceful failure
  40254. }
  40255. for (var i = 0; i < rows.length; i++) {
  40256. var rowNode = rows[i];
  40257. var rowTopPixel = rowNode.rowTop + rowNode.rowHeight - 1;
  40258. // only need to range check against the top pixel, as we are going through the list
  40259. // in order, first row to hit the pixel wins
  40260. if (rowTopPixel >= pixel) {
  40261. return i;
  40262. }
  40263. }
  40264. return rows.length - 1;
  40265. };
  40266. PinnedRowModel.prototype.setPinnedTopRowData = function (rowData) {
  40267. this.pinnedTopRows = this.createNodesFromData(rowData, true);
  40268. var event = {
  40269. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PINNED_ROW_DATA_CHANGED,
  40270. api: this.gridApi,
  40271. columnApi: this.columnApi
  40272. };
  40273. this.eventService.dispatchEvent(event);
  40274. };
  40275. PinnedRowModel.prototype.setPinnedBottomRowData = function (rowData) {
  40276. this.pinnedBottomRows = this.createNodesFromData(rowData, false);
  40277. var event = {
  40278. type: _events__WEBPACK_IMPORTED_MODULE_2__["Events"].EVENT_PINNED_ROW_DATA_CHANGED,
  40279. api: this.gridApi,
  40280. columnApi: this.columnApi
  40281. };
  40282. this.eventService.dispatchEvent(event);
  40283. };
  40284. PinnedRowModel.prototype.createNodesFromData = function (allData, isTop) {
  40285. var _this = this;
  40286. var rowNodes = [];
  40287. if (allData) {
  40288. var nextRowTop_1 = 0;
  40289. allData.forEach(function (dataItem, index) {
  40290. var rowNode = new _entities_rowNode__WEBPACK_IMPORTED_MODULE_0__["RowNode"]();
  40291. _this.context.createBean(rowNode);
  40292. rowNode.data = dataItem;
  40293. var idPrefix = isTop ? _entities_rowNode__WEBPACK_IMPORTED_MODULE_0__["RowNode"].ID_PREFIX_TOP_PINNED : _entities_rowNode__WEBPACK_IMPORTED_MODULE_0__["RowNode"].ID_PREFIX_BOTTOM_PINNED;
  40294. rowNode.id = idPrefix + index;
  40295. rowNode.rowPinned = isTop ? _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP : _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM;
  40296. rowNode.setRowTop(nextRowTop_1);
  40297. rowNode.setRowHeight(_this.gridOptionsWrapper.getRowHeightForNode(rowNode).height);
  40298. rowNode.setRowIndex(index);
  40299. nextRowTop_1 += rowNode.rowHeight;
  40300. rowNodes.push(rowNode);
  40301. });
  40302. }
  40303. return rowNodes;
  40304. };
  40305. PinnedRowModel.prototype.getPinnedTopRowData = function () {
  40306. return this.pinnedTopRows;
  40307. };
  40308. PinnedRowModel.prototype.getPinnedBottomRowData = function () {
  40309. return this.pinnedBottomRows;
  40310. };
  40311. PinnedRowModel.prototype.getPinnedTopTotalHeight = function () {
  40312. return this.getTotalHeight(this.pinnedTopRows);
  40313. };
  40314. PinnedRowModel.prototype.getPinnedTopRowCount = function () {
  40315. return this.pinnedTopRows ? this.pinnedTopRows.length : 0;
  40316. };
  40317. PinnedRowModel.prototype.getPinnedBottomRowCount = function () {
  40318. return this.pinnedBottomRows ? this.pinnedBottomRows.length : 0;
  40319. };
  40320. PinnedRowModel.prototype.getPinnedTopRow = function (index) {
  40321. return this.pinnedTopRows[index];
  40322. };
  40323. PinnedRowModel.prototype.getPinnedBottomRow = function (index) {
  40324. return this.pinnedBottomRows[index];
  40325. };
  40326. PinnedRowModel.prototype.forEachPinnedTopRow = function (callback) {
  40327. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].missingOrEmpty(this.pinnedTopRows)) {
  40328. return;
  40329. }
  40330. this.pinnedTopRows.forEach(callback);
  40331. };
  40332. PinnedRowModel.prototype.forEachPinnedBottomRow = function (callback) {
  40333. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].missingOrEmpty(this.pinnedBottomRows)) {
  40334. return;
  40335. }
  40336. this.pinnedBottomRows.forEach(callback);
  40337. };
  40338. PinnedRowModel.prototype.getPinnedBottomTotalHeight = function () {
  40339. return this.getTotalHeight(this.pinnedBottomRows);
  40340. };
  40341. PinnedRowModel.prototype.getTotalHeight = function (rowNodes) {
  40342. if (!rowNodes || rowNodes.length === 0) {
  40343. return 0;
  40344. }
  40345. else {
  40346. var lastNode = _utils__WEBPACK_IMPORTED_MODULE_4__["_"].last(rowNodes);
  40347. return lastNode.rowTop + lastNode.rowHeight;
  40348. }
  40349. };
  40350. __decorate([
  40351. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridOptionsWrapper')
  40352. ], PinnedRowModel.prototype, "gridOptionsWrapper", void 0);
  40353. __decorate([
  40354. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnApi')
  40355. ], PinnedRowModel.prototype, "columnApi", void 0);
  40356. __decorate([
  40357. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('gridApi')
  40358. ], PinnedRowModel.prototype, "gridApi", void 0);
  40359. __decorate([
  40360. _context_context__WEBPACK_IMPORTED_MODULE_1__["PostConstruct"]
  40361. ], PinnedRowModel.prototype, "init", null);
  40362. PinnedRowModel = __decorate([
  40363. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('pinnedRowModel')
  40364. ], PinnedRowModel);
  40365. return PinnedRowModel;
  40366. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_5__["BeanStub"]));
  40367. /***/ }),
  40368. /* 189 */
  40369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40370. "use strict";
  40371. __webpack_require__.r(__webpack_exports__);
  40372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UndoRedoService", function() { return UndoRedoService; });
  40373. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  40374. /* harmony import */ var _eventKeys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44);
  40375. /* harmony import */ var _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(190);
  40376. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  40377. /* harmony import */ var _modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(38);
  40378. /* harmony import */ var _modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(39);
  40379. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(41);
  40380. /**
  40381. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40382. * @version v23.2.1
  40383. * @link http://www.ag-grid.com/
  40384. * @license MIT
  40385. */
  40386. var __extends = (undefined && undefined.__extends) || (function () {
  40387. var extendStatics = function (d, b) {
  40388. extendStatics = Object.setPrototypeOf ||
  40389. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40390. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40391. return extendStatics(d, b);
  40392. };
  40393. return function (d, b) {
  40394. extendStatics(d, b);
  40395. function __() { this.constructor = d; }
  40396. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40397. };
  40398. })();
  40399. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  40400. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  40401. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  40402. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  40403. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40404. };
  40405. var UndoRedoService = /** @class */ (function (_super) {
  40406. __extends(UndoRedoService, _super);
  40407. function UndoRedoService() {
  40408. var _this = _super !== null && _super.apply(this, arguments) || this;
  40409. _this.cellValueChanges = [];
  40410. _this.isCellEditing = false;
  40411. _this.isRowEditing = false;
  40412. _this.isPasting = false;
  40413. _this.isFilling = false;
  40414. _this.onCellValueChanged = function (event) {
  40415. var shouldCaptureAction = _this.isCellEditing || _this.isRowEditing || _this.isPasting || _this.isFilling;
  40416. if (!shouldCaptureAction) {
  40417. return;
  40418. }
  40419. var rowPinned = event.rowPinned, rowIndex = event.rowIndex, column = event.column, oldValue = event.oldValue, value = event.value;
  40420. var cellValueChange = {
  40421. rowPinned: rowPinned,
  40422. rowIndex: rowIndex,
  40423. columnId: column.getColId(),
  40424. oldValue: oldValue,
  40425. newValue: value
  40426. };
  40427. _this.cellValueChanges.push(cellValueChange);
  40428. };
  40429. _this.clearStacks = function () {
  40430. _this.undoStack.clear();
  40431. _this.redoStack.clear();
  40432. };
  40433. return _this;
  40434. }
  40435. UndoRedoService.prototype.init = function () {
  40436. if (!this.gridOptionsWrapper.isUndoRedoCellEditing()) {
  40437. return;
  40438. }
  40439. var undoRedoLimit = this.gridOptionsWrapper.getUndoRedoCellEditingLimit();
  40440. if (undoRedoLimit <= 0) {
  40441. return;
  40442. }
  40443. this.undoStack = new _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["UndoRedoStack"](undoRedoLimit);
  40444. this.redoStack = new _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["UndoRedoStack"](undoRedoLimit);
  40445. this.addRowEditingListeners();
  40446. this.addCellEditingListeners();
  40447. this.addPasteListeners();
  40448. this.addFillListeners();
  40449. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged);
  40450. // undo / redo is restricted to actual editing so we clear the stacks when other operations are
  40451. // performed that change the order of the row / cols.
  40452. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_MODEL_UPDATED, this.clearStacks);
  40453. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED, this.clearStacks);
  40454. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED, this.clearStacks);
  40455. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_GROUP_OPENED, this.clearStacks);
  40456. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, this.clearStacks);
  40457. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_MOVED, this.clearStacks);
  40458. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_PINNED, this.clearStacks);
  40459. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_COLUMN_VISIBLE, this.clearStacks);
  40460. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_DRAG_END, this.clearStacks);
  40461. };
  40462. UndoRedoService.prototype.undo = function () {
  40463. if (!this.undoStack) {
  40464. return;
  40465. }
  40466. var undoAction = this.undoStack.pop();
  40467. if (!undoAction || !undoAction.cellValueChanges) {
  40468. return;
  40469. }
  40470. this.processAction(undoAction, function (cellValueChange) { return cellValueChange.oldValue; });
  40471. if (undoAction instanceof _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["FillUndoRedoAction"]) {
  40472. this.processRangeAndCellFocus(undoAction.cellValueChanges, undoAction.initialRange);
  40473. }
  40474. else {
  40475. this.processRangeAndCellFocus(undoAction.cellValueChanges);
  40476. }
  40477. this.redoStack.push(undoAction);
  40478. };
  40479. UndoRedoService.prototype.redo = function () {
  40480. if (!this.redoStack) {
  40481. return;
  40482. }
  40483. var redoAction = this.redoStack.pop();
  40484. if (!redoAction || !redoAction.cellValueChanges) {
  40485. return;
  40486. }
  40487. this.processAction(redoAction, function (cellValueChange) { return cellValueChange.newValue; });
  40488. if (redoAction instanceof _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["FillUndoRedoAction"]) {
  40489. this.processRangeAndCellFocus(redoAction.cellValueChanges, redoAction.finalRange);
  40490. }
  40491. else {
  40492. this.processRangeAndCellFocus(redoAction.cellValueChanges);
  40493. }
  40494. this.undoStack.push(redoAction);
  40495. };
  40496. UndoRedoService.prototype.processAction = function (action, valueExtractor) {
  40497. var _this = this;
  40498. action.cellValueChanges.forEach(function (cellValueChange) {
  40499. var rowIndex = cellValueChange.rowIndex, rowPinned = cellValueChange.rowPinned, columnId = cellValueChange.columnId;
  40500. var rowPosition = { rowIndex: rowIndex, rowPinned: rowPinned };
  40501. var currentRow = _this.getRowNode(rowPosition);
  40502. // checks if the row has been filtered out
  40503. if (currentRow.rowTop == null) {
  40504. return;
  40505. }
  40506. currentRow.setDataValue(columnId, valueExtractor(cellValueChange));
  40507. });
  40508. };
  40509. UndoRedoService.prototype.processRangeAndCellFocus = function (cellValueChanges, range) {
  40510. if (range) {
  40511. var startRow = range.startRow;
  40512. var endRow = range.endRow;
  40513. var lastFocusedCell_1 = {
  40514. rowPinned: startRow.rowPinned,
  40515. rowIndex: startRow.rowIndex,
  40516. columnId: range.startColumn.getColId()
  40517. };
  40518. this.setLastFocusedCell(lastFocusedCell_1);
  40519. var cellRangeParams = {
  40520. rowStartIndex: startRow.rowIndex,
  40521. rowStartPinned: startRow.rowPinned,
  40522. rowEndIndex: endRow.rowIndex,
  40523. rowEndPinned: endRow.rowPinned,
  40524. columnStart: range.startColumn,
  40525. columns: range.columns
  40526. };
  40527. this.gridApi.addCellRange(cellRangeParams);
  40528. return;
  40529. }
  40530. var cellValueChange = cellValueChanges[0];
  40531. var rowIndex = cellValueChange.rowIndex, rowPinned = cellValueChange.rowPinned;
  40532. var rowPosition = { rowIndex: rowIndex, rowPinned: rowPinned };
  40533. var row = this.getRowNode(rowPosition);
  40534. var lastFocusedCell = {
  40535. rowPinned: cellValueChange.rowPinned,
  40536. rowIndex: row.rowIndex,
  40537. columnId: cellValueChange.columnId
  40538. };
  40539. this.setLastFocusedCell(lastFocusedCell);
  40540. };
  40541. UndoRedoService.prototype.setLastFocusedCell = function (lastFocusedCell) {
  40542. var rowIndex = lastFocusedCell.rowIndex, columnId = lastFocusedCell.columnId, rowPinned = lastFocusedCell.rowPinned;
  40543. this.gridApi.ensureIndexVisible(rowIndex);
  40544. this.gridApi.ensureColumnVisible(columnId);
  40545. if (_modules_moduleRegistry__WEBPACK_IMPORTED_MODULE_5__["ModuleRegistry"].isRegistered(_modules_moduleNames__WEBPACK_IMPORTED_MODULE_4__["ModuleNames"].RangeSelectionModule)) {
  40546. this.gridApi.clearRangeSelection();
  40547. }
  40548. this.focusController.setFocusedCell(rowIndex, columnId, rowPinned, true);
  40549. };
  40550. UndoRedoService.prototype.addRowEditingListeners = function () {
  40551. var _this = this;
  40552. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_EDITING_STARTED, function () {
  40553. _this.isRowEditing = true;
  40554. });
  40555. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_ROW_EDITING_STOPPED, function () {
  40556. var action = new _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["UndoRedoAction"](_this.cellValueChanges);
  40557. _this.pushActionsToUndoStack(action);
  40558. _this.isRowEditing = false;
  40559. });
  40560. };
  40561. UndoRedoService.prototype.addCellEditingListeners = function () {
  40562. var _this = this;
  40563. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_EDITING_STARTED, function () {
  40564. _this.isCellEditing = true;
  40565. });
  40566. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_CELL_EDITING_STOPPED, function () {
  40567. _this.isCellEditing = false;
  40568. var shouldPushAction = !_this.isRowEditing && !_this.isPasting && !_this.isFilling;
  40569. if (shouldPushAction) {
  40570. var action = new _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["UndoRedoAction"](_this.cellValueChanges);
  40571. _this.pushActionsToUndoStack(action);
  40572. }
  40573. });
  40574. };
  40575. UndoRedoService.prototype.addPasteListeners = function () {
  40576. var _this = this;
  40577. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_PASTE_START, function () {
  40578. _this.isPasting = true;
  40579. });
  40580. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_PASTE_END, function () {
  40581. var action = new _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["UndoRedoAction"](_this.cellValueChanges);
  40582. _this.pushActionsToUndoStack(action);
  40583. _this.isPasting = false;
  40584. });
  40585. };
  40586. UndoRedoService.prototype.addFillListeners = function () {
  40587. var _this = this;
  40588. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_FILL_START, function () {
  40589. _this.isFilling = true;
  40590. });
  40591. this.addManagedListener(this.eventService, _eventKeys__WEBPACK_IMPORTED_MODULE_1__["Events"].EVENT_FILL_END, function (event) {
  40592. var action = new _undoRedoStack__WEBPACK_IMPORTED_MODULE_2__["FillUndoRedoAction"](_this.cellValueChanges, event.initialRange, event.finalRange);
  40593. _this.pushActionsToUndoStack(action);
  40594. _this.isFilling = false;
  40595. });
  40596. };
  40597. UndoRedoService.prototype.pushActionsToUndoStack = function (action) {
  40598. this.undoStack.push(action);
  40599. this.cellValueChanges = [];
  40600. this.redoStack.clear();
  40601. };
  40602. UndoRedoService.prototype.getRowNode = function (gridRow) {
  40603. switch (gridRow.rowPinned) {
  40604. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_TOP:
  40605. return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];
  40606. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].PINNED_BOTTOM:
  40607. return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];
  40608. default:
  40609. return this.rowModel.getRow(gridRow.rowIndex);
  40610. }
  40611. };
  40612. __decorate([
  40613. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  40614. ], UndoRedoService.prototype, "gridOptionsWrapper", void 0);
  40615. __decorate([
  40616. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('focusController')
  40617. ], UndoRedoService.prototype, "focusController", void 0);
  40618. __decorate([
  40619. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  40620. ], UndoRedoService.prototype, "gridApi", void 0);
  40621. __decorate([
  40622. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  40623. ], UndoRedoService.prototype, "rowModel", void 0);
  40624. __decorate([
  40625. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('pinnedRowModel')
  40626. ], UndoRedoService.prototype, "pinnedRowModel", void 0);
  40627. __decorate([
  40628. _context_context__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  40629. ], UndoRedoService.prototype, "init", null);
  40630. UndoRedoService = __decorate([
  40631. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('undoRedoService')
  40632. ], UndoRedoService);
  40633. return UndoRedoService;
  40634. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_6__["BeanStub"]));
  40635. /***/ }),
  40636. /* 190 */
  40637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40638. "use strict";
  40639. __webpack_require__.r(__webpack_exports__);
  40640. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UndoRedoAction", function() { return UndoRedoAction; });
  40641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FillUndoRedoAction", function() { return FillUndoRedoAction; });
  40642. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UndoRedoStack", function() { return UndoRedoStack; });
  40643. /**
  40644. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40645. * @version v23.2.1
  40646. * @link http://www.ag-grid.com/
  40647. * @license MIT
  40648. */
  40649. var __extends = (undefined && undefined.__extends) || (function () {
  40650. var extendStatics = function (d, b) {
  40651. extendStatics = Object.setPrototypeOf ||
  40652. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40653. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40654. return extendStatics(d, b);
  40655. };
  40656. return function (d, b) {
  40657. extendStatics(d, b);
  40658. function __() { this.constructor = d; }
  40659. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40660. };
  40661. })();
  40662. var UndoRedoAction = /** @class */ (function () {
  40663. function UndoRedoAction(cellValueChanges) {
  40664. this.cellValueChanges = cellValueChanges;
  40665. }
  40666. return UndoRedoAction;
  40667. }());
  40668. var FillUndoRedoAction = /** @class */ (function (_super) {
  40669. __extends(FillUndoRedoAction, _super);
  40670. function FillUndoRedoAction(cellValueChanges, initialRange, finalRange) {
  40671. var _this = _super.call(this, cellValueChanges) || this;
  40672. _this.initialRange = initialRange;
  40673. _this.finalRange = finalRange;
  40674. return _this;
  40675. }
  40676. return FillUndoRedoAction;
  40677. }(UndoRedoAction));
  40678. var UndoRedoStack = /** @class */ (function () {
  40679. function UndoRedoStack(maxStackSize) {
  40680. this.actionStack = [];
  40681. this.maxStackSize = maxStackSize ? maxStackSize : UndoRedoStack.DEFAULT_STACK_SIZE;
  40682. this.actionStack = new Array(this.maxStackSize);
  40683. }
  40684. UndoRedoStack.prototype.pop = function () {
  40685. return this.actionStack.pop();
  40686. };
  40687. UndoRedoStack.prototype.push = function (item) {
  40688. var shouldAddActions = item.cellValueChanges && item.cellValueChanges.length > 0;
  40689. if (!shouldAddActions) {
  40690. return;
  40691. }
  40692. if (this.actionStack.length === this.maxStackSize) {
  40693. this.actionStack.shift();
  40694. }
  40695. this.actionStack.push(item);
  40696. };
  40697. UndoRedoStack.prototype.clear = function () {
  40698. this.actionStack = [];
  40699. };
  40700. UndoRedoStack.DEFAULT_STACK_SIZE = 10;
  40701. return UndoRedoStack;
  40702. }());
  40703. /***/ }),
  40704. /* 191 */
  40705. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40706. "use strict";
  40707. __webpack_require__.r(__webpack_exports__);
  40708. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgStackComponentsRegistry", function() { return AgStackComponentsRegistry; });
  40709. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  40710. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
  40711. /**
  40712. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40713. * @version v23.2.1
  40714. * @link http://www.ag-grid.com/
  40715. * @license MIT
  40716. */
  40717. var __extends = (undefined && undefined.__extends) || (function () {
  40718. var extendStatics = function (d, b) {
  40719. extendStatics = Object.setPrototypeOf ||
  40720. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40721. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40722. return extendStatics(d, b);
  40723. };
  40724. return function (d, b) {
  40725. extendStatics(d, b);
  40726. function __() { this.constructor = d; }
  40727. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40728. };
  40729. })();
  40730. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  40731. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  40732. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  40733. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  40734. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40735. };
  40736. var AgStackComponentsRegistry = /** @class */ (function (_super) {
  40737. __extends(AgStackComponentsRegistry, _super);
  40738. function AgStackComponentsRegistry() {
  40739. var _this = _super !== null && _super.apply(this, arguments) || this;
  40740. _this.componentsMappedByName = {};
  40741. return _this;
  40742. }
  40743. AgStackComponentsRegistry.prototype.setupComponents = function (components) {
  40744. var _this = this;
  40745. if (components) {
  40746. components.forEach(function (componentMeta) { return _this.addComponent(componentMeta); });
  40747. }
  40748. };
  40749. AgStackComponentsRegistry.prototype.addComponent = function (componentMeta) {
  40750. // get name of the class as a string
  40751. // let className = _.getNameOfClass(ComponentClass);
  40752. // insert a dash after every capital letter
  40753. // let classEscaped = className.replace(/([A-Z])/g, "-$1").toLowerCase();
  40754. var classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
  40755. // put all to upper case
  40756. var classUpperCase = classEscaped.toUpperCase();
  40757. // finally store
  40758. this.componentsMappedByName[classUpperCase] = componentMeta.componentClass;
  40759. };
  40760. AgStackComponentsRegistry.prototype.getComponentClass = function (htmlTag) {
  40761. return this.componentsMappedByName[htmlTag];
  40762. };
  40763. AgStackComponentsRegistry = __decorate([
  40764. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Bean"])('agStackComponentsRegistry')
  40765. ], AgStackComponentsRegistry);
  40766. return AgStackComponentsRegistry;
  40767. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_1__["BeanStub"]));
  40768. /***/ }),
  40769. /* 192 */
  40770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40771. "use strict";
  40772. __webpack_require__.r(__webpack_exports__);
  40773. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HeaderPositionUtils", function() { return HeaderPositionUtils; });
  40774. /* harmony import */ var _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
  40775. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  40776. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  40777. /* harmony import */ var _headerRowComp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(110);
  40778. /**
  40779. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40780. * @version v23.2.1
  40781. * @link http://www.ag-grid.com/
  40782. * @license MIT
  40783. */
  40784. var __extends = (undefined && undefined.__extends) || (function () {
  40785. var extendStatics = function (d, b) {
  40786. extendStatics = Object.setPrototypeOf ||
  40787. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40788. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40789. return extendStatics(d, b);
  40790. };
  40791. return function (d, b) {
  40792. extendStatics(d, b);
  40793. function __() { this.constructor = d; }
  40794. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40795. };
  40796. })();
  40797. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  40798. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  40799. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  40800. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  40801. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40802. };
  40803. var HeaderPositionUtils = /** @class */ (function (_super) {
  40804. __extends(HeaderPositionUtils, _super);
  40805. function HeaderPositionUtils() {
  40806. return _super !== null && _super.apply(this, arguments) || this;
  40807. }
  40808. HeaderPositionUtils.prototype.findHeader = function (focusedHeader, direction) {
  40809. var nextColumn;
  40810. var getGroupMethod;
  40811. var getColMethod;
  40812. if (focusedHeader.column instanceof _entities_columnGroup__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  40813. getGroupMethod = "getDisplayedGroup" + direction;
  40814. nextColumn = this.columnController[getGroupMethod](focusedHeader.column);
  40815. }
  40816. else {
  40817. getColMethod = "getDisplayedCol" + direction;
  40818. nextColumn = this.columnController[getColMethod](focusedHeader.column);
  40819. }
  40820. if (nextColumn) {
  40821. return {
  40822. column: nextColumn,
  40823. headerRowIndex: focusedHeader.headerRowIndex
  40824. };
  40825. }
  40826. };
  40827. HeaderPositionUtils.prototype.findColAtEdgeForHeaderRow = function (level, position) {
  40828. var displayedColumns = this.columnController.getAllDisplayedColumns();
  40829. var column = displayedColumns[position === 'start' ? 0 : displayedColumns.length - 1];
  40830. if (!column) {
  40831. return;
  40832. }
  40833. var childContainer = this.headerNavigationService.getHeaderContainer(column.getPinned());
  40834. var headerRowComp = childContainer.getRowComps()[level];
  40835. var type = headerRowComp && headerRowComp.getType();
  40836. if (type == _headerRowComp__WEBPACK_IMPORTED_MODULE_3__["HeaderRowType"].COLUMN_GROUP) {
  40837. var columnGroup = this.columnController.getColumnGroupAtLevel(column, level);
  40838. return {
  40839. headerRowIndex: level,
  40840. column: columnGroup
  40841. };
  40842. }
  40843. return {
  40844. headerRowIndex: !headerRowComp ? -1 : level,
  40845. column: column
  40846. };
  40847. };
  40848. __decorate([
  40849. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('columnController')
  40850. ], HeaderPositionUtils.prototype, "columnController", void 0);
  40851. __decorate([
  40852. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Autowired"])('headerNavigationService')
  40853. ], HeaderPositionUtils.prototype, "headerNavigationService", void 0);
  40854. HeaderPositionUtils = __decorate([
  40855. Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Bean"])('headerPositionUtils')
  40856. ], HeaderPositionUtils);
  40857. return HeaderPositionUtils;
  40858. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  40859. /***/ }),
  40860. /* 193 */
  40861. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40862. "use strict";
  40863. __webpack_require__.r(__webpack_exports__);
  40864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithWebComponents", function() { return initialiseAgGridWithWebComponents; });
  40865. /* harmony import */ var _componentUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
  40866. /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95);
  40867. /**
  40868. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40869. * @version v23.2.1
  40870. * @link http://www.ag-grid.com/
  40871. * @license MIT
  40872. */
  40873. var registered = false;
  40874. function initialiseAgGridWithWebComponents() {
  40875. console.warn('ag-grid: initialiseAgGridWithWebComponents is deprecated. Please use the ag-grid-webcomponent dependency instead. ');
  40876. // only register to WebComponents once
  40877. if (registered) {
  40878. return;
  40879. }
  40880. registered = true;
  40881. if (typeof document === 'undefined' || !document.registerElement) {
  40882. console.error('ag-Grid: unable to find document.registerElement() function, unable to initialise ag-Grid as a Web Component');
  40883. }
  40884. // i don't think this type of extension is possible in TypeScript, so back to
  40885. // plain Javascript to create this object
  40886. var AgileGridProto = Object.create(HTMLElement.prototype);
  40887. // wrap each property with a get and set method, so we can track when changes are done
  40888. _componentUtil__WEBPACK_IMPORTED_MODULE_0__["ComponentUtil"].ALL_PROPERTIES.forEach(function (key) {
  40889. Object.defineProperty(AgileGridProto, key, {
  40890. set: function (v) {
  40891. this.__agGridSetProperty(key, v);
  40892. },
  40893. get: function () {
  40894. return this.__agGridGetProperty(key);
  40895. },
  40896. enumerable: true,
  40897. configurable: true
  40898. });
  40899. });
  40900. var agGridProtoNoType = AgileGridProto;
  40901. agGridProtoNoType.__agGridSetProperty = function (key, value) {
  40902. if (!this.__attributes) {
  40903. this.__attributes = {};
  40904. }
  40905. this.__attributes[key] = value;
  40906. // keeping this consistent with the ng2 onChange, so I can reuse the handling code
  40907. var changeObject = {};
  40908. changeObject[key] = { currentValue: value };
  40909. this.onChange(changeObject);
  40910. };
  40911. agGridProtoNoType.onChange = function (changes) {
  40912. if (this._initialised) {
  40913. _componentUtil__WEBPACK_IMPORTED_MODULE_0__["ComponentUtil"].processOnChange(changes, this._gridOptions, this.api, this.columnApi);
  40914. }
  40915. };
  40916. agGridProtoNoType.__agGridGetProperty = function (key) {
  40917. if (!this.__attributes) {
  40918. this.__attributes = {};
  40919. }
  40920. return this.__attributes[key];
  40921. };
  40922. agGridProtoNoType.setGridOptions = function (options) {
  40923. var globalEventListener = this.globalEventListener.bind(this);
  40924. this._gridOptions = _componentUtil__WEBPACK_IMPORTED_MODULE_0__["ComponentUtil"].copyAttributesToGridOptions(options, this);
  40925. var gridParams = {
  40926. globalEventListener: globalEventListener
  40927. };
  40928. this._agGrid = new _grid__WEBPACK_IMPORTED_MODULE_1__["Grid"](this, this._gridOptions, gridParams);
  40929. this.api = options.api;
  40930. this.columnApi = options.columnApi;
  40931. this._initialised = true;
  40932. };
  40933. // copies all the attributes into this object
  40934. agGridProtoNoType.createdCallback = function () {
  40935. for (var i = 0; i < this.attributes.length; i++) {
  40936. var attribute = this.attributes[i];
  40937. this.setPropertyFromAttribute(attribute);
  40938. }
  40939. };
  40940. agGridProtoNoType.setPropertyFromAttribute = function (attribute) {
  40941. var name = toCamelCase(attribute.nodeName);
  40942. var value = attribute.nodeValue;
  40943. if (_componentUtil__WEBPACK_IMPORTED_MODULE_0__["ComponentUtil"].ALL_PROPERTIES.indexOf(name) >= 0) {
  40944. this[name] = value;
  40945. }
  40946. };
  40947. agGridProtoNoType.attachedCallback = function (params) { };
  40948. agGridProtoNoType.detachedCallback = function (params) { };
  40949. agGridProtoNoType.attributeChangedCallback = function (attributeName) {
  40950. var attribute = this.attributes[attributeName];
  40951. this.setPropertyFromAttribute(attribute);
  40952. };
  40953. agGridProtoNoType.globalEventListener = function (eventType, event) {
  40954. var eventLowerCase = eventType.toLowerCase();
  40955. var browserEvent = new Event(eventLowerCase);
  40956. var browserEventNoType = browserEvent;
  40957. browserEventNoType.agGridDetails = event;
  40958. this.dispatchEvent(browserEvent);
  40959. var callbackMethod = 'on' + eventLowerCase;
  40960. if (typeof this[callbackMethod] === 'function') {
  40961. this[callbackMethod](browserEvent);
  40962. }
  40963. };
  40964. // finally, register
  40965. document.registerElement('ag-grid', { prototype: AgileGridProto });
  40966. }
  40967. function toCamelCase(myString) {
  40968. if (typeof myString === 'string') {
  40969. var result = myString.replace(/-([a-z])/g, function (g) {
  40970. return g[1].toUpperCase();
  40971. });
  40972. return result;
  40973. }
  40974. else {
  40975. return myString;
  40976. }
  40977. }
  40978. /***/ }),
  40979. /* 194 */
  40980. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40981. "use strict";
  40982. __webpack_require__.r(__webpack_exports__);
  40983. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabbedLayout", function() { return TabbedLayout; });
  40984. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  40985. /* harmony import */ var _widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  40986. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
  40987. /* harmony import */ var _widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(117);
  40988. /**
  40989. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  40990. * @version v23.2.1
  40991. * @link http://www.ag-grid.com/
  40992. * @license MIT
  40993. */
  40994. var __extends = (undefined && undefined.__extends) || (function () {
  40995. var extendStatics = function (d, b) {
  40996. extendStatics = Object.setPrototypeOf ||
  40997. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40998. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40999. return extendStatics(d, b);
  41000. };
  41001. return function (d, b) {
  41002. extendStatics(d, b);
  41003. function __() { this.constructor = d; }
  41004. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41005. };
  41006. })();
  41007. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  41008. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  41009. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  41010. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  41011. return c > 3 && r && Object.defineProperty(target, key, r), r;
  41012. };
  41013. var TabbedLayout = /** @class */ (function (_super) {
  41014. __extends(TabbedLayout, _super);
  41015. function TabbedLayout(params) {
  41016. var _this = _super.call(this, TabbedLayout.getTemplate(params.cssClass)) || this;
  41017. _this.items = [];
  41018. _this.params = params;
  41019. if (params.items) {
  41020. params.items.forEach(function (item) { return _this.addItem(item); });
  41021. }
  41022. return _this;
  41023. }
  41024. TabbedLayout.getTemplate = function (cssClass) {
  41025. return /* html */ "<div class=\"ag-tabs " + cssClass + "\">\n <div ref=\"eHeader\" class=\"ag-tabs-header " + (cssClass ? cssClass + "-header" : '') + "\"></div>\n <div ref=\"eBody\" class=\"ag-tabs-body " + (cssClass ? cssClass + "-body" : '') + "\"></div>\n </div>";
  41026. };
  41027. TabbedLayout.prototype.handleKeyDown = function (e) {
  41028. switch (e.keyCode) {
  41029. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_RIGHT:
  41030. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_LEFT:
  41031. if (!this.eHeader.contains(document.activeElement)) {
  41032. return;
  41033. }
  41034. var currentPosition = this.items.indexOf(this.activeItem);
  41035. var nextPosition = e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_RIGHT ? Math.min(currentPosition + 1, this.items.length - 1) : Math.max(currentPosition - 1, 0);
  41036. if (currentPosition === nextPosition) {
  41037. return;
  41038. }
  41039. e.preventDefault();
  41040. var nextItem = this.items[nextPosition];
  41041. this.showItemWrapper(nextItem);
  41042. nextItem.eHeaderButton.focus();
  41043. break;
  41044. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_UP:
  41045. case _constants__WEBPACK_IMPORTED_MODULE_2__["Constants"].KEY_DOWN:
  41046. e.stopPropagation();
  41047. break;
  41048. }
  41049. };
  41050. TabbedLayout.prototype.onTabKeyDown = function (e) {
  41051. var _a = this, focusController = _a.focusController, eHeader = _a.eHeader, eBody = _a.eBody, activeItem = _a.activeItem;
  41052. var activeElement = document.activeElement;
  41053. var focusInHeader = eHeader.contains(activeElement);
  41054. e.preventDefault();
  41055. if (focusInHeader) {
  41056. if (e.shiftKey) {
  41057. focusController.focusLastFocusableElement(eBody);
  41058. }
  41059. else {
  41060. focusController.focusFirstFocusableElement(eBody);
  41061. }
  41062. }
  41063. else {
  41064. var isFocusManaged = focusController.isFocusUnderManagedComponent(eBody);
  41065. if (isFocusManaged) {
  41066. activeItem.eHeaderButton.focus();
  41067. }
  41068. else {
  41069. var nextEl = focusController.findNextFocusableElement(eBody, false, e.shiftKey);
  41070. if (nextEl) {
  41071. nextEl.focus();
  41072. }
  41073. else {
  41074. activeItem.eHeaderButton.focus();
  41075. }
  41076. }
  41077. }
  41078. };
  41079. TabbedLayout.prototype.setAfterAttachedParams = function (params) {
  41080. this.afterAttachedParams = params;
  41081. };
  41082. TabbedLayout.prototype.getMinDimensions = function () {
  41083. var eDummyContainer = this.getGui().cloneNode(true);
  41084. var eDummyBody = eDummyContainer.querySelector('[ref="eBody"]');
  41085. // position fixed, so it isn't restricted to the boundaries of the parent
  41086. eDummyContainer.style.position = 'fixed';
  41087. // we put the dummy into the body container, so it will inherit all the
  41088. // css styles that the real cells are inheriting
  41089. this.getGui().appendChild(eDummyContainer);
  41090. var minWidth = 0;
  41091. var minHeight = 0;
  41092. this.items.forEach(function (itemWrapper) {
  41093. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].clearElement(eDummyBody);
  41094. var eClone = itemWrapper.tabbedItem.bodyPromise.resolveNow(null, function (body) { return body.cloneNode(true); });
  41095. if (eClone == null) {
  41096. return;
  41097. }
  41098. eDummyBody.appendChild(eClone);
  41099. if (minWidth < eDummyContainer.offsetWidth) {
  41100. minWidth = eDummyContainer.offsetWidth;
  41101. }
  41102. if (minHeight < eDummyContainer.offsetHeight) {
  41103. minHeight = eDummyContainer.offsetHeight;
  41104. }
  41105. });
  41106. this.getGui().removeChild(eDummyContainer);
  41107. return { height: minHeight, width: minWidth };
  41108. };
  41109. TabbedLayout.prototype.showFirstItem = function () {
  41110. if (this.items.length > 0) {
  41111. this.showItemWrapper(this.items[0]);
  41112. }
  41113. };
  41114. TabbedLayout.prototype.addItem = function (item) {
  41115. var eHeaderButton = document.createElement('span');
  41116. eHeaderButton.tabIndex = -1;
  41117. eHeaderButton.appendChild(item.title);
  41118. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].addCssClass(eHeaderButton, 'ag-tab');
  41119. this.eHeader.appendChild(eHeaderButton);
  41120. eHeaderButton.setAttribute('aria-label', item.titleLabel);
  41121. var wrapper = {
  41122. tabbedItem: item,
  41123. eHeaderButton: eHeaderButton
  41124. };
  41125. this.items.push(wrapper);
  41126. eHeaderButton.addEventListener('click', this.showItemWrapper.bind(this, wrapper));
  41127. };
  41128. TabbedLayout.prototype.showItem = function (tabbedItem) {
  41129. var itemWrapper = _utils__WEBPACK_IMPORTED_MODULE_0__["_"].find(this.items, function (wrapper) {
  41130. return wrapper.tabbedItem === tabbedItem;
  41131. });
  41132. if (itemWrapper) {
  41133. this.showItemWrapper(itemWrapper);
  41134. }
  41135. };
  41136. TabbedLayout.prototype.showItemWrapper = function (wrapper) {
  41137. var _this = this;
  41138. if (this.params.onItemClicked) {
  41139. this.params.onItemClicked({ item: wrapper.tabbedItem });
  41140. }
  41141. if (this.activeItem === wrapper) {
  41142. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].callIfPresent(this.params.onActiveItemClicked);
  41143. return;
  41144. }
  41145. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].clearElement(this.eBody);
  41146. wrapper.tabbedItem.bodyPromise.then(function (body) {
  41147. _this.eBody.appendChild(body);
  41148. var onlyUnmanaged = !_this.focusController.isKeyboardFocus();
  41149. _this.focusController.focusFirstFocusableElement(_this.eBody, onlyUnmanaged);
  41150. });
  41151. if (this.activeItem) {
  41152. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].removeCssClass(this.activeItem.eHeaderButton, 'ag-tab-selected');
  41153. }
  41154. _utils__WEBPACK_IMPORTED_MODULE_0__["_"].addCssClass(wrapper.eHeaderButton, 'ag-tab-selected');
  41155. this.activeItem = wrapper;
  41156. if (wrapper.tabbedItem.afterAttachedCallback) {
  41157. wrapper.tabbedItem.afterAttachedCallback(this.afterAttachedParams);
  41158. }
  41159. };
  41160. __decorate([
  41161. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eHeader')
  41162. ], TabbedLayout.prototype, "eHeader", void 0);
  41163. __decorate([
  41164. Object(_widgets_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eBody')
  41165. ], TabbedLayout.prototype, "eBody", void 0);
  41166. return TabbedLayout;
  41167. }(_widgets_managedFocusComponent__WEBPACK_IMPORTED_MODULE_3__["ManagedFocusComponent"]));
  41168. /***/ }),
  41169. /* 195 */
  41170. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41171. "use strict";
  41172. __webpack_require__.r(__webpack_exports__);
  41173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleHttpRequest", function() { return simpleHttpRequest; });
  41174. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  41175. /**
  41176. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  41177. * @version v23.2.1
  41178. * @link http://www.ag-grid.com/
  41179. * @license MIT
  41180. */
  41181. function simpleHttpRequest(params) {
  41182. return new _utils__WEBPACK_IMPORTED_MODULE_0__["Promise"](function (resolve) {
  41183. var httpRequest = new XMLHttpRequest();
  41184. httpRequest.open('GET', params.url);
  41185. httpRequest.send();
  41186. httpRequest.onreadystatechange = function () {
  41187. if (httpRequest.readyState === 4 && httpRequest.status === 200) {
  41188. resolve(JSON.parse(httpRequest.responseText));
  41189. }
  41190. };
  41191. });
  41192. }
  41193. /***/ }),
  41194. /* 196 */
  41195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41196. "use strict";
  41197. __webpack_require__.r(__webpack_exports__);
  41198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlock", function() { return RowNodeBlock; });
  41199. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  41200. /* harmony import */ var _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68);
  41201. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
  41202. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41);
  41203. /**
  41204. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  41205. * @version v23.2.1
  41206. * @link http://www.ag-grid.com/
  41207. * @license MIT
  41208. */
  41209. var __extends = (undefined && undefined.__extends) || (function () {
  41210. var extendStatics = function (d, b) {
  41211. extendStatics = Object.setPrototypeOf ||
  41212. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41213. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41214. return extendStatics(d, b);
  41215. };
  41216. return function (d, b) {
  41217. extendStatics(d, b);
  41218. function __() { this.constructor = d; }
  41219. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41220. };
  41221. })();
  41222. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  41223. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  41224. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  41225. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  41226. return c > 3 && r && Object.defineProperty(target, key, r), r;
  41227. };
  41228. var RowNodeBlock = /** @class */ (function (_super) {
  41229. __extends(RowNodeBlock, _super);
  41230. function RowNodeBlock(blockNumber, rowNodeCacheParams) {
  41231. var _this = _super.call(this) || this;
  41232. _this.version = 0;
  41233. _this.state = RowNodeBlock.STATE_DIRTY;
  41234. _this.rowNodeCacheParams = rowNodeCacheParams;
  41235. _this.blockNumber = blockNumber;
  41236. // we don't need to calculate these now, as the inputs don't change,
  41237. // however it makes the code easier to read if we work them out up front
  41238. _this.startRow = blockNumber * rowNodeCacheParams.blockSize;
  41239. _this.endRow = _this.startRow + rowNodeCacheParams.blockSize;
  41240. return _this;
  41241. }
  41242. RowNodeBlock.prototype.isAnyNodeOpen = function (rowCount) {
  41243. var result = false;
  41244. this.forEachNodeCallback(function (rowNode) {
  41245. if (rowNode.expanded) {
  41246. result = true;
  41247. }
  41248. }, rowCount);
  41249. return result;
  41250. };
  41251. RowNodeBlock.prototype.forEachNodeCallback = function (callback, rowCount) {
  41252. for (var rowIndex = this.startRow; rowIndex < this.endRow; rowIndex++) {
  41253. // we check against rowCount as this page may be the last one, and if it is, then
  41254. // the last rows are not part of the set
  41255. if (rowIndex < rowCount) {
  41256. var rowNode = this.getRowUsingLocalIndex(rowIndex);
  41257. callback(rowNode, rowIndex);
  41258. }
  41259. }
  41260. };
  41261. RowNodeBlock.prototype.forEachNode = function (callback, sequence, rowCount, deep) {
  41262. this.forEachNodeCallback(function (rowNode) {
  41263. callback(rowNode, sequence.next());
  41264. // this will only every happen for server side row model, as infinite
  41265. // row model doesn't have groups
  41266. if (deep && rowNode.childrenCache) {
  41267. rowNode.childrenCache.forEachNodeDeep(callback, sequence);
  41268. }
  41269. }, rowCount);
  41270. };
  41271. RowNodeBlock.prototype.forEachNodeDeep = function (callback, sequence, rowCount) {
  41272. this.forEachNode(callback, sequence, rowCount, true);
  41273. };
  41274. RowNodeBlock.prototype.forEachNodeShallow = function (callback, sequence, rowCount) {
  41275. this.forEachNode(callback, sequence, rowCount, false);
  41276. };
  41277. RowNodeBlock.prototype.getVersion = function () {
  41278. return this.version;
  41279. };
  41280. RowNodeBlock.prototype.getLastAccessed = function () {
  41281. return this.lastAccessed;
  41282. };
  41283. RowNodeBlock.prototype.getRowUsingLocalIndex = function (rowIndex, dontTouchLastAccessed) {
  41284. if (dontTouchLastAccessed === void 0) { dontTouchLastAccessed = false; }
  41285. if (!dontTouchLastAccessed) {
  41286. this.lastAccessed = this.rowNodeCacheParams.lastAccessedSequence.next();
  41287. }
  41288. var localIndex = rowIndex - this.startRow;
  41289. return this.rowNodes[localIndex];
  41290. };
  41291. RowNodeBlock.prototype.init = function (beans) {
  41292. this.beans = beans;
  41293. this.createRowNodes();
  41294. };
  41295. RowNodeBlock.prototype.getStartRow = function () {
  41296. return this.startRow;
  41297. };
  41298. RowNodeBlock.prototype.getEndRow = function () {
  41299. return this.endRow;
  41300. };
  41301. RowNodeBlock.prototype.getBlockNumber = function () {
  41302. return this.blockNumber;
  41303. };
  41304. RowNodeBlock.prototype.setDirty = function () {
  41305. // in case any current loads in progress, this will have their results ignored
  41306. this.version++;
  41307. this.state = RowNodeBlock.STATE_DIRTY;
  41308. };
  41309. RowNodeBlock.prototype.setDirtyAndPurge = function () {
  41310. this.setDirty();
  41311. this.rowNodes.forEach(function (rowNode) {
  41312. rowNode.setData(null);
  41313. });
  41314. };
  41315. RowNodeBlock.prototype.getState = function () {
  41316. return this.state;
  41317. };
  41318. RowNodeBlock.prototype.setRowNode = function (rowIndex, rowNode) {
  41319. var localIndex = rowIndex - this.startRow;
  41320. this.rowNodes[localIndex] = rowNode;
  41321. };
  41322. RowNodeBlock.prototype.setBlankRowNode = function (rowIndex) {
  41323. var localIndex = rowIndex - this.startRow;
  41324. var newRowNode = this.createBlankRowNode(rowIndex);
  41325. this.rowNodes[localIndex] = newRowNode;
  41326. return newRowNode;
  41327. };
  41328. RowNodeBlock.prototype.setNewData = function (rowIndex, dataItem) {
  41329. var newRowNode = this.setBlankRowNode(rowIndex);
  41330. this.setDataAndId(newRowNode, dataItem, this.startRow + rowIndex);
  41331. return newRowNode;
  41332. };
  41333. RowNodeBlock.prototype.createBlankRowNode = function (rowIndex) {
  41334. var rowNode = new _entities_rowNode__WEBPACK_IMPORTED_MODULE_1__["RowNode"]();
  41335. this.beans.context.createBean(rowNode);
  41336. rowNode.setRowHeight(this.rowNodeCacheParams.rowHeight);
  41337. return rowNode;
  41338. };
  41339. // creates empty row nodes, data is missing as not loaded yet
  41340. RowNodeBlock.prototype.createRowNodes = function () {
  41341. this.rowNodes = [];
  41342. for (var i = 0; i < this.rowNodeCacheParams.blockSize; i++) {
  41343. var rowIndex = this.startRow + i;
  41344. var rowNode = this.createBlankRowNode(rowIndex);
  41345. this.rowNodes.push(rowNode);
  41346. }
  41347. };
  41348. RowNodeBlock.prototype.load = function () {
  41349. this.state = RowNodeBlock.STATE_LOADING;
  41350. this.loadFromDatasource();
  41351. };
  41352. RowNodeBlock.prototype.pageLoadFailed = function () {
  41353. this.state = RowNodeBlock.STATE_FAILED;
  41354. var event = {
  41355. type: RowNodeBlock.EVENT_LOAD_COMPLETE,
  41356. success: false,
  41357. page: this,
  41358. lastRow: null
  41359. };
  41360. this.dispatchEvent(event);
  41361. };
  41362. RowNodeBlock.prototype.populateWithRowData = function (rows) {
  41363. var _this = this;
  41364. var rowNodesToRefresh = [];
  41365. this.rowNodes.forEach(function (rowNode, index) {
  41366. var data = rows[index];
  41367. if (rowNode.stub) {
  41368. rowNodesToRefresh.push(rowNode);
  41369. }
  41370. _this.setDataAndId(rowNode, data, _this.startRow + index);
  41371. });
  41372. if (rowNodesToRefresh.length > 0) {
  41373. this.beans.rowRenderer.redrawRows(rowNodesToRefresh);
  41374. }
  41375. };
  41376. RowNodeBlock.prototype.destroyRowNodes = function () {
  41377. var _this = this;
  41378. this.rowNodes.forEach(function (rowNode) {
  41379. if (rowNode.childrenCache) {
  41380. _this.destroyBean(rowNode.childrenCache);
  41381. rowNode.childrenCache = null;
  41382. }
  41383. // this is needed, so row render knows to fade out the row, otherwise it
  41384. // sees row top is present, and thinks the row should be shown. maybe
  41385. // rowNode should have a flag on whether it is visible???
  41386. rowNode.clearRowTop();
  41387. });
  41388. };
  41389. RowNodeBlock.prototype.pageLoaded = function (version, rows, lastRow) {
  41390. // we need to check the version, in case there was an old request
  41391. // from the server that was sent before we refreshed the cache,
  41392. // if the load was done as a result of a cache refresh
  41393. if (version === this.version) {
  41394. this.state = RowNodeBlock.STATE_LOADED;
  41395. this.populateWithRowData(rows);
  41396. }
  41397. lastRow = _utils__WEBPACK_IMPORTED_MODULE_0__["_"].cleanNumber(lastRow);
  41398. // check here if lastRow should be set
  41399. var event = {
  41400. type: RowNodeBlock.EVENT_LOAD_COMPLETE,
  41401. success: true,
  41402. page: this,
  41403. lastRow: lastRow
  41404. };
  41405. this.dispatchEvent(event);
  41406. };
  41407. RowNodeBlock.EVENT_LOAD_COMPLETE = 'loadComplete';
  41408. RowNodeBlock.STATE_DIRTY = 'dirty';
  41409. RowNodeBlock.STATE_LOADING = 'loading';
  41410. RowNodeBlock.STATE_LOADED = 'loaded';
  41411. RowNodeBlock.STATE_FAILED = 'failed';
  41412. __decorate([
  41413. _context_context__WEBPACK_IMPORTED_MODULE_2__["PreDestroy"]
  41414. ], RowNodeBlock.prototype, "destroyRowNodes", null);
  41415. return RowNodeBlock;
  41416. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]));
  41417. /***/ }),
  41418. /* 197 */
  41419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41420. "use strict";
  41421. __webpack_require__.r(__webpack_exports__);
  41422. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlockLoader", function() { return RowNodeBlockLoader; });
  41423. /* harmony import */ var _rowNodeBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(196);
  41424. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
  41425. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
  41426. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
  41427. /**
  41428. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  41429. * @version v23.2.1
  41430. * @link http://www.ag-grid.com/
  41431. * @license MIT
  41432. */
  41433. var __extends = (undefined && undefined.__extends) || (function () {
  41434. var extendStatics = function (d, b) {
  41435. extendStatics = Object.setPrototypeOf ||
  41436. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41437. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41438. return extendStatics(d, b);
  41439. };
  41440. return function (d, b) {
  41441. extendStatics(d, b);
  41442. function __() { this.constructor = d; }
  41443. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41444. };
  41445. })();
  41446. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  41447. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  41448. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  41449. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  41450. return c > 3 && r && Object.defineProperty(target, key, r), r;
  41451. };
  41452. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  41453. return function (target, key) { decorator(target, key, paramIndex); }
  41454. };
  41455. var RowNodeBlockLoader = /** @class */ (function (_super) {
  41456. __extends(RowNodeBlockLoader, _super);
  41457. function RowNodeBlockLoader(maxConcurrentRequests, blockLoadDebounceMillis) {
  41458. var _this = _super.call(this) || this;
  41459. _this.activeBlockLoadsCount = 0;
  41460. _this.blocks = [];
  41461. _this.active = true;
  41462. _this.maxConcurrentRequests = maxConcurrentRequests;
  41463. if (blockLoadDebounceMillis && blockLoadDebounceMillis > 0) {
  41464. _this.checkBlockToLoadDebounce = _utils__WEBPACK_IMPORTED_MODULE_3__["_"].debounce(_this.performCheckBlocksToLoad.bind(_this), blockLoadDebounceMillis);
  41465. }
  41466. return _this;
  41467. }
  41468. RowNodeBlockLoader.prototype.setBeans = function (loggerFactory) {
  41469. this.logger = loggerFactory.create('RowNodeBlockLoader');
  41470. };
  41471. RowNodeBlockLoader.prototype.addBlock = function (block) {
  41472. this.blocks.push(block);
  41473. };
  41474. RowNodeBlockLoader.prototype.removeBlock = function (block) {
  41475. _utils__WEBPACK_IMPORTED_MODULE_3__["_"].removeFromArray(this.blocks, block);
  41476. };
  41477. RowNodeBlockLoader.prototype.destroy = function () {
  41478. _super.prototype.destroy.call(this);
  41479. this.active = false;
  41480. };
  41481. RowNodeBlockLoader.prototype.loadComplete = function () {
  41482. this.activeBlockLoadsCount--;
  41483. };
  41484. RowNodeBlockLoader.prototype.checkBlockToLoad = function () {
  41485. if (this.checkBlockToLoadDebounce) {
  41486. this.checkBlockToLoadDebounce();
  41487. }
  41488. else {
  41489. this.performCheckBlocksToLoad();
  41490. }
  41491. };
  41492. RowNodeBlockLoader.prototype.performCheckBlocksToLoad = function () {
  41493. if (!this.active) {
  41494. return;
  41495. }
  41496. this.printCacheStatus();
  41497. if (this.activeBlockLoadsCount >= this.maxConcurrentRequests) {
  41498. this.logger.log("checkBlockToLoad: max loads exceeded");
  41499. return;
  41500. }
  41501. var blockToLoad = null;
  41502. this.blocks.forEach(function (block) {
  41503. if (block.getState() === _rowNodeBlock__WEBPACK_IMPORTED_MODULE_0__["RowNodeBlock"].STATE_DIRTY) {
  41504. blockToLoad = block;
  41505. }
  41506. });
  41507. if (blockToLoad) {
  41508. blockToLoad.load();
  41509. this.activeBlockLoadsCount++;
  41510. this.logger.log("checkBlockToLoad: loading page " + blockToLoad.getBlockNumber());
  41511. this.printCacheStatus();
  41512. }
  41513. else {
  41514. this.logger.log("checkBlockToLoad: no pages to load");
  41515. }
  41516. };
  41517. RowNodeBlockLoader.prototype.getBlockState = function () {
  41518. var result = {};
  41519. this.blocks.forEach(function (block) {
  41520. var nodeIdPrefix = block.getNodeIdPrefix();
  41521. var stateItem = {
  41522. blockNumber: block.getBlockNumber(),
  41523. startRow: block.getStartRow(),
  41524. endRow: block.getEndRow(),
  41525. pageStatus: block.getState()
  41526. };
  41527. if (_utils__WEBPACK_IMPORTED_MODULE_3__["_"].exists(nodeIdPrefix)) {
  41528. result[nodeIdPrefix + block.getBlockNumber()] = stateItem;
  41529. }
  41530. else {
  41531. result[block.getBlockNumber()] = stateItem;
  41532. }
  41533. });
  41534. return result;
  41535. };
  41536. RowNodeBlockLoader.prototype.printCacheStatus = function () {
  41537. if (this.logger.isLogging()) {
  41538. this.logger.log("printCacheStatus: activePageLoadsCount = " + this.activeBlockLoadsCount + ","
  41539. + (" blocks = " + JSON.stringify(this.getBlockState())));
  41540. }
  41541. };
  41542. RowNodeBlockLoader.prototype.isLoading = function () {
  41543. return this.activeBlockLoadsCount > 0;
  41544. };
  41545. __decorate([
  41546. __param(0, Object(_context_context__WEBPACK_IMPORTED_MODULE_1__["Qualifier"])('loggerFactory'))
  41547. ], RowNodeBlockLoader.prototype, "setBeans", null);
  41548. return RowNodeBlockLoader;
  41549. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_2__["BeanStub"]));
  41550. /***/ }),
  41551. /* 198 */
  41552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41553. "use strict";
  41554. __webpack_require__.r(__webpack_exports__);
  41555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowNodeCache", function() { return RowNodeCache; });
  41556. /* harmony import */ var _context_beanStub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41);
  41557. /* harmony import */ var _rowNodeBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(196);
  41558. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
  41559. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37);
  41560. /**
  41561. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  41562. * @version v23.2.1
  41563. * @link http://www.ag-grid.com/
  41564. * @license MIT
  41565. */
  41566. var __extends = (undefined && undefined.__extends) || (function () {
  41567. var extendStatics = function (d, b) {
  41568. extendStatics = Object.setPrototypeOf ||
  41569. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41570. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41571. return extendStatics(d, b);
  41572. };
  41573. return function (d, b) {
  41574. extendStatics(d, b);
  41575. function __() { this.constructor = d; }
  41576. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41577. };
  41578. })();
  41579. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  41580. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  41581. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  41582. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  41583. return c > 3 && r && Object.defineProperty(target, key, r), r;
  41584. };
  41585. var RowNodeCache = /** @class */ (function (_super) {
  41586. __extends(RowNodeCache, _super);
  41587. function RowNodeCache(cacheParams) {
  41588. var _this = _super.call(this) || this;
  41589. _this.maxRowFound = false;
  41590. _this.blocks = {};
  41591. _this.blockCount = 0;
  41592. _this.virtualRowCount = cacheParams.initialRowCount;
  41593. _this.cacheParams = cacheParams;
  41594. return _this;
  41595. }
  41596. RowNodeCache.prototype.destroyAllBlocks = function () {
  41597. var _this = this;
  41598. this.forEachBlockInOrder(function (block) { return _this.destroyBlock(block); });
  41599. };
  41600. RowNodeCache.prototype.init = function () {
  41601. var _this = this;
  41602. this.active = true;
  41603. this.addDestroyFunc(function () { return _this.active = false; });
  41604. };
  41605. RowNodeCache.prototype.isActive = function () {
  41606. return this.active;
  41607. };
  41608. RowNodeCache.prototype.getVirtualRowCount = function () {
  41609. return this.virtualRowCount;
  41610. };
  41611. RowNodeCache.prototype.hack_setVirtualRowCount = function (virtualRowCount) {
  41612. this.virtualRowCount = virtualRowCount;
  41613. };
  41614. RowNodeCache.prototype.isMaxRowFound = function () {
  41615. return this.maxRowFound;
  41616. };
  41617. // listener on EVENT_LOAD_COMPLETE
  41618. RowNodeCache.prototype.onPageLoaded = function (event) {
  41619. this.cacheParams.rowNodeBlockLoader.loadComplete();
  41620. this.checkBlockToLoad();
  41621. // if we are not active, then we ignore all events, otherwise we could end up getting the
  41622. // grid to refresh even though we are no longer the active cache
  41623. if (!this.isActive()) {
  41624. return;
  41625. }
  41626. this.logger.log("onPageLoaded: page = " + event.page.getBlockNumber() + ", lastRow = " + event.lastRow);
  41627. if (event.success) {
  41628. this.checkVirtualRowCount(event.page, event.lastRow);
  41629. }
  41630. };
  41631. RowNodeCache.prototype.purgeBlocksIfNeeded = function (blockToExclude) {
  41632. var _this = this;
  41633. // put all candidate blocks into a list for sorting
  41634. var blocksForPurging = [];
  41635. this.forEachBlockInOrder(function (block) {
  41636. // we exclude checking for the page just created, as this has yet to be accessed and hence
  41637. // the lastAccessed stamp will not be updated for the first time yet
  41638. if (block === blockToExclude) {
  41639. return;
  41640. }
  41641. blocksForPurging.push(block);
  41642. });
  41643. // note: need to verify that this sorts items in the right order
  41644. blocksForPurging.sort(function (a, b) { return b.getLastAccessed() - a.getLastAccessed(); });
  41645. // we remove (maxBlocksInCache - 1) as we already excluded the 'just created' page.
  41646. // in other words, after the splice operation below, we have taken out the blocks
  41647. // we want to keep, which means we are left with blocks that we can potentially purge
  41648. var maxBlocksProvided = this.cacheParams.maxBlocksInCache > 0;
  41649. var blocksToKeep = maxBlocksProvided ? this.cacheParams.maxBlocksInCache - 1 : null;
  41650. var emptyBlocksToKeep = RowNodeCache.MAX_EMPTY_BLOCKS_TO_KEEP - 1;
  41651. blocksForPurging.forEach(function (block, index) {
  41652. var purgeBecauseBlockEmpty = block.getState() === _rowNodeBlock__WEBPACK_IMPORTED_MODULE_1__["RowNodeBlock"].STATE_DIRTY && index >= emptyBlocksToKeep;
  41653. var purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false;
  41654. if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) {
  41655. // we never purge blocks if they are open, as purging them would mess up with
  41656. // our indexes, it would be very messy to restore the purged block to it's
  41657. // previous state if it had open children (and what if open children of open
  41658. // children, jeeeesus, just thinking about it freaks me out) so best is have a
  41659. // rule, if block is open, we never purge.
  41660. if (block.isAnyNodeOpen(_this.virtualRowCount)) {
  41661. return;
  41662. }
  41663. // if the block currently has rows been displayed, then don't remove it either.
  41664. // this can happen if user has maxBlocks=2, and blockSize=5 (thus 10 max rows in cache)
  41665. // but the screen is showing 20 rows, so at least 4 blocks are needed.
  41666. if (_this.isBlockCurrentlyDisplayed(block)) {
  41667. return;
  41668. }
  41669. // at this point, block is not needed, and no open nodes, so burn baby burn
  41670. _this.removeBlockFromCache(block);
  41671. }
  41672. });
  41673. };
  41674. RowNodeCache.prototype.isBlockCurrentlyDisplayed = function (block) {
  41675. var firstViewportRow = this.rowRenderer.getFirstVirtualRenderedRow();
  41676. var lastViewportRow = this.rowRenderer.getLastVirtualRenderedRow();
  41677. var firstRowIndex = block.getDisplayIndexStart();
  41678. var lastRowIndex = block.getDisplayIndexEnd() - 1;
  41679. // parent closed means the parent node is not expanded, thus these blocks are not visible
  41680. var parentClosed = firstRowIndex == null || lastRowIndex == null;
  41681. if (parentClosed) {
  41682. return false;
  41683. }
  41684. var blockBeforeViewport = firstRowIndex > lastViewportRow;
  41685. var blockAfterViewport = lastRowIndex < firstViewportRow;
  41686. var blockInsideViewport = !blockBeforeViewport && !blockAfterViewport;
  41687. return blockInsideViewport;
  41688. };
  41689. RowNodeCache.prototype.postCreateBlock = function (newBlock) {
  41690. newBlock.addEventListener(_rowNodeBlock__WEBPACK_IMPORTED_MODULE_1__["RowNodeBlock"].EVENT_LOAD_COMPLETE, this.onPageLoaded.bind(this));
  41691. this.setBlock(newBlock.getBlockNumber(), newBlock);
  41692. this.purgeBlocksIfNeeded(newBlock);
  41693. this.checkBlockToLoad();
  41694. };
  41695. RowNodeCache.prototype.removeBlockFromCache = function (blockToRemove) {
  41696. if (!blockToRemove) {
  41697. return;
  41698. }
  41699. this.destroyBlock(blockToRemove);
  41700. // we do not want to remove the 'loaded' event listener, as the
  41701. // concurrent loads count needs to be updated when the load is complete
  41702. // if the purged page is in loading state
  41703. };
  41704. // gets called after: 1) block loaded 2) block created 3) cache refresh
  41705. RowNodeCache.prototype.checkBlockToLoad = function () {
  41706. this.cacheParams.rowNodeBlockLoader.checkBlockToLoad();
  41707. };
  41708. RowNodeCache.prototype.checkVirtualRowCount = function (block, lastRow) {
  41709. // if client provided a last row, we always use it, as it could change between server calls
  41710. // if user deleted data and then called refresh on the grid.
  41711. if (typeof lastRow === 'number' && lastRow >= 0) {
  41712. this.virtualRowCount = lastRow;
  41713. this.maxRowFound = true;
  41714. this.onCacheUpdated();
  41715. }
  41716. else if (!this.maxRowFound) {
  41717. // otherwise, see if we need to add some virtual rows
  41718. var lastRowIndex = (block.getBlockNumber() + 1) * this.cacheParams.blockSize;
  41719. var lastRowIndexPlusOverflow = lastRowIndex + this.cacheParams.overflowSize;
  41720. if (this.virtualRowCount < lastRowIndexPlusOverflow) {
  41721. this.virtualRowCount = lastRowIndexPlusOverflow;
  41722. this.onCacheUpdated();
  41723. }
  41724. else if (this.cacheParams.dynamicRowHeight) {
  41725. // the only other time is if dynamic row height, as loading rows
  41726. // will change the height of the block, given the height of the rows
  41727. // is only known after the row is loaded.
  41728. this.onCacheUpdated();
  41729. }
  41730. }
  41731. };
  41732. RowNodeCache.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
  41733. this.virtualRowCount = rowCount;
  41734. // if undefined is passed, we do not set this value, if one of {true,false}
  41735. // is passed, we do set the value.
  41736. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].exists(maxRowFound)) {
  41737. this.maxRowFound = maxRowFound;
  41738. }
  41739. // if we are still searching, then the row count must not end at the end
  41740. // of a particular page, otherwise the searching will not pop into the
  41741. // next page
  41742. if (!this.maxRowFound) {
  41743. if (this.virtualRowCount % this.cacheParams.blockSize === 0) {
  41744. this.virtualRowCount++;
  41745. }
  41746. }
  41747. this.onCacheUpdated();
  41748. };
  41749. RowNodeCache.prototype.forEachNodeDeep = function (callback, sequence) {
  41750. var _this = this;
  41751. if (sequence === void 0) { sequence = new _utils__WEBPACK_IMPORTED_MODULE_2__["NumberSequence"](); }
  41752. this.forEachBlockInOrder(function (block) {
  41753. block.forEachNodeDeep(callback, sequence, _this.virtualRowCount);
  41754. });
  41755. };
  41756. RowNodeCache.prototype.forEachBlockInOrder = function (callback) {
  41757. var ids = this.getBlockIdsSorted();
  41758. this.forEachBlockId(ids, callback);
  41759. };
  41760. RowNodeCache.prototype.forEachBlockInReverseOrder = function (callback) {
  41761. var ids = this.getBlockIdsSorted().reverse();
  41762. this.forEachBlockId(ids, callback);
  41763. };
  41764. RowNodeCache.prototype.forEachBlockId = function (ids, callback) {
  41765. var _this = this;
  41766. ids.forEach(function (id) {
  41767. var block = _this.blocks[id];
  41768. callback(block, id);
  41769. });
  41770. };
  41771. RowNodeCache.prototype.getBlockIdsSorted = function () {
  41772. // get all page id's as NUMBERS (not strings, as we need to sort as numbers) and in descending order
  41773. var numberComparator = function (a, b) { return a - b; }; // default comparator for array is string comparison
  41774. var blockIds = Object.keys(this.blocks).map(function (idStr) { return parseInt(idStr, 10); }).sort(numberComparator);
  41775. return blockIds;
  41776. };
  41777. RowNodeCache.prototype.getBlock = function (blockId) {
  41778. return this.blocks[blockId];
  41779. };
  41780. RowNodeCache.prototype.setBlock = function (id, block) {
  41781. this.blocks[id] = block;
  41782. this.blockCount++;
  41783. this.cacheParams.rowNodeBlockLoader.addBlock(block);
  41784. };
  41785. RowNodeCache.prototype.destroyBlock = function (block) {
  41786. delete this.blocks[block.getBlockNumber()];
  41787. this.destroyBean(block);
  41788. this.blockCount--;
  41789. this.cacheParams.rowNodeBlockLoader.removeBlock(block);
  41790. };
  41791. // gets called 1) row count changed 2) cache purged 3) items inserted
  41792. RowNodeCache.prototype.onCacheUpdated = function () {
  41793. if (this.isActive()) {
  41794. // if the virtualRowCount is shortened, then it's possible blocks exist that are no longer
  41795. // in the valid range. so we must remove these. this can happen if user explicitly sets
  41796. // the virtual row count, or the datasource returns a result and sets lastRow to something
  41797. // less than virtualRowCount (can happen if user scrolls down, server reduces dataset size).
  41798. this.destroyAllBlocksPastVirtualRowCount();
  41799. // this results in both row models (infinite and server side) firing ModelUpdated,
  41800. // however server side row model also updates the row indexes first
  41801. var event_1 = {
  41802. type: RowNodeCache.EVENT_CACHE_UPDATED
  41803. };
  41804. this.dispatchEvent(event_1);
  41805. }
  41806. };
  41807. RowNodeCache.prototype.destroyAllBlocksPastVirtualRowCount = function () {
  41808. var _this = this;
  41809. var blocksToDestroy = [];
  41810. this.forEachBlockInOrder(function (block, id) {
  41811. var startRow = id * _this.cacheParams.blockSize;
  41812. if (startRow >= _this.virtualRowCount) {
  41813. blocksToDestroy.push(block);
  41814. }
  41815. });
  41816. if (blocksToDestroy.length > 0) {
  41817. blocksToDestroy.forEach(function (block) { return _this.destroyBlock(block); });
  41818. }
  41819. };
  41820. RowNodeCache.prototype.purgeCache = function () {
  41821. var _this = this;
  41822. this.forEachBlockInOrder(function (block) { return _this.removeBlockFromCache(block); });
  41823. this.maxRowFound = false;
  41824. // if zero rows in the cache, we need to get the SSRM to start asking for rows again.
  41825. // otherwise if set to zero rows last time, and we don't update the row count, then after
  41826. // the purge there will still be zero rows, meaning the SRRM won't request any rows.
  41827. // to kick things off, at lest one row needs to be asked for.
  41828. if (this.virtualRowCount === 0) {
  41829. this.virtualRowCount = this.cacheParams.initialRowCount;
  41830. }
  41831. this.onCacheUpdated();
  41832. };
  41833. RowNodeCache.prototype.getRowNodesInRange = function (firstInRange, lastInRange) {
  41834. var _this = this;
  41835. var result = [];
  41836. var lastBlockId = -1;
  41837. var inActiveRange = false;
  41838. var numberSequence = new _utils__WEBPACK_IMPORTED_MODULE_2__["NumberSequence"]();
  41839. // if only one node passed, we start the selection at the top
  41840. if (_utils__WEBPACK_IMPORTED_MODULE_2__["_"].missing(firstInRange)) {
  41841. inActiveRange = true;
  41842. }
  41843. var foundGapInSelection = false;
  41844. this.forEachBlockInOrder(function (block, id) {
  41845. if (foundGapInSelection) {
  41846. return;
  41847. }
  41848. if (inActiveRange && (lastBlockId + 1 !== id)) {
  41849. foundGapInSelection = true;
  41850. return;
  41851. }
  41852. lastBlockId = id;
  41853. block.forEachNodeShallow(function (rowNode) {
  41854. var hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange;
  41855. if (inActiveRange || hitFirstOrLast) {
  41856. result.push(rowNode);
  41857. }
  41858. if (hitFirstOrLast) {
  41859. inActiveRange = !inActiveRange;
  41860. }
  41861. }, numberSequence, _this.virtualRowCount);
  41862. });
  41863. // inActiveRange will be still true if we never hit the second rowNode
  41864. var invalidRange = foundGapInSelection || inActiveRange;
  41865. return invalidRange ? [] : result;
  41866. };
  41867. RowNodeCache.EVENT_CACHE_UPDATED = 'cacheUpdated';
  41868. // this property says how many empty blocks should be in a cache, eg if scrolls down fast and creates 10
  41869. // blocks all for loading, the grid will only load the last 2 - it will assume the blocks the user quickly
  41870. // scrolled over are not needed to be loaded.
  41871. RowNodeCache.MAX_EMPTY_BLOCKS_TO_KEEP = 2;
  41872. __decorate([
  41873. Object(_context_context__WEBPACK_IMPORTED_MODULE_3__["Autowired"])('rowRenderer')
  41874. ], RowNodeCache.prototype, "rowRenderer", void 0);
  41875. __decorate([
  41876. _context_context__WEBPACK_IMPORTED_MODULE_3__["PreDestroy"]
  41877. ], RowNodeCache.prototype, "destroyAllBlocks", null);
  41878. __decorate([
  41879. _context_context__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]
  41880. ], RowNodeCache.prototype, "init", null);
  41881. return RowNodeCache;
  41882. }(_context_beanStub__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  41883. /***/ }),
  41884. /* 199 */
  41885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41886. "use strict";
  41887. __webpack_require__.r(__webpack_exports__);
  41888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualList", function() { return VirtualList; });
  41889. /* harmony import */ var _context_context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
  41890. /* harmony import */ var _componentAnnotations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57);
  41891. /* harmony import */ var _managedFocusComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(117);
  41892. /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25);
  41893. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
  41894. /**
  41895. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  41896. * @version v23.2.1
  41897. * @link http://www.ag-grid.com/
  41898. * @license MIT
  41899. */
  41900. var __extends = (undefined && undefined.__extends) || (function () {
  41901. var extendStatics = function (d, b) {
  41902. extendStatics = Object.setPrototypeOf ||
  41903. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41904. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41905. return extendStatics(d, b);
  41906. };
  41907. return function (d, b) {
  41908. extendStatics(d, b);
  41909. function __() { this.constructor = d; }
  41910. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41911. };
  41912. })();
  41913. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  41914. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  41915. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  41916. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  41917. return c > 3 && r && Object.defineProperty(target, key, r), r;
  41918. };
  41919. var VirtualList = /** @class */ (function (_super) {
  41920. __extends(VirtualList, _super);
  41921. function VirtualList(cssIdentifier) {
  41922. if (cssIdentifier === void 0) { cssIdentifier = 'default'; }
  41923. var _this = _super.call(this, VirtualList.getTemplate(cssIdentifier)) || this;
  41924. _this.cssIdentifier = cssIdentifier;
  41925. _this.renderedRows = new Map();
  41926. _this.rowHeight = 20;
  41927. return _this;
  41928. }
  41929. VirtualList.prototype.postConstruct = function () {
  41930. this.addScrollListener();
  41931. this.rowHeight = this.getItemHeight();
  41932. _super.prototype.postConstruct.call(this);
  41933. };
  41934. VirtualList.prototype.isFocusableContainer = function () {
  41935. return true;
  41936. };
  41937. VirtualList.prototype.focusInnerElement = function (fromBottom) {
  41938. var rowCount = this.model.getRowCount();
  41939. this.focusRow(fromBottom ? rowCount - 1 : 0);
  41940. };
  41941. VirtualList.prototype.onFocusIn = function (e) {
  41942. _super.prototype.onFocusIn.call(this, e);
  41943. var target = e.target;
  41944. if (_utils__WEBPACK_IMPORTED_MODULE_4__["_"].containsClass(target, 'ag-virtual-list-item')) {
  41945. this.lastFocusedRow = parseInt(target.getAttribute('aria-rowindex'), 10) - 1;
  41946. }
  41947. };
  41948. VirtualList.prototype.onFocusOut = function (e) {
  41949. _super.prototype.onFocusOut.call(this, e);
  41950. if (!this.getFocusableElement().contains(e.relatedTarget)) {
  41951. this.lastFocusedRow = null;
  41952. }
  41953. };
  41954. VirtualList.prototype.handleKeyDown = function (e) {
  41955. switch (e.keyCode) {
  41956. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_UP:
  41957. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_DOWN:
  41958. case _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_TAB:
  41959. if (this.navigate(e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_UP ||
  41960. (e.keyCode === _constants__WEBPACK_IMPORTED_MODULE_3__["Constants"].KEY_TAB && e.shiftKey))) {
  41961. e.preventDefault();
  41962. }
  41963. break;
  41964. }
  41965. };
  41966. VirtualList.prototype.navigate = function (up) {
  41967. if (!_utils__WEBPACK_IMPORTED_MODULE_4__["_"].exists(this.lastFocusedRow)) {
  41968. return false;
  41969. }
  41970. var nextRow = this.lastFocusedRow + (up ? -1 : 1);
  41971. if (nextRow < 0 || nextRow >= this.model.getRowCount()) {
  41972. return false;
  41973. }
  41974. this.focusRow(nextRow);
  41975. return true;
  41976. };
  41977. VirtualList.prototype.getLastFocusedRow = function () {
  41978. return this.lastFocusedRow;
  41979. };
  41980. VirtualList.prototype.focusRow = function (rowNumber) {
  41981. var _this = this;
  41982. this.ensureIndexVisible(rowNumber);
  41983. window.setTimeout(function () {
  41984. var renderedRow = _this.renderedRows.get(rowNumber);
  41985. if (renderedRow) {
  41986. renderedRow.eDiv.focus();
  41987. }
  41988. }, 10);
  41989. };
  41990. VirtualList.prototype.getComponentAt = function (rowIndex) {
  41991. var comp = this.renderedRows.get(rowIndex);
  41992. return comp && comp.rowComponent;
  41993. };
  41994. VirtualList.getTemplate = function (cssIdentifier) {
  41995. return /* html */ "\n <div class=\"ag-virtual-list-viewport ag-" + cssIdentifier + "-virtual-list-viewport\">\n <div class=\"ag-virtual-list-container ag-" + cssIdentifier + "-virtual-list-container\" ref=\"eContainer\"></div>\n </div>";
  41996. };
  41997. VirtualList.prototype.getItemHeight = function () {
  41998. return this.gridOptionsWrapper.getListItemHeight();
  41999. };
  42000. VirtualList.prototype.ensureIndexVisible = function (index) {
  42001. var lastRow = this.model.getRowCount();
  42002. if (typeof index !== 'number' || index < 0 || index >= lastRow) {
  42003. console.warn('invalid row index for ensureIndexVisible: ' + index);
  42004. return;
  42005. }
  42006. var rowTopPixel = index * this.rowHeight;
  42007. var rowBottomPixel = rowTopPixel + this.rowHeight;
  42008. var eGui = this.getGui();
  42009. var viewportTopPixel = eGui.scrollTop;
  42010. var viewportHeight = eGui.offsetHeight;
  42011. var viewportBottomPixel = viewportTopPixel + viewportHeight;
  42012. var viewportScrolledPastRow = viewportTopPixel > rowTopPixel;
  42013. var viewportScrolledBeforeRow = viewportBottomPixel < rowBottomPixel;
  42014. if (viewportScrolledPastRow) {
  42015. // if row is before, scroll up with row at top
  42016. eGui.scrollTop = rowTopPixel;
  42017. }
  42018. else if (viewportScrolledBeforeRow) {
  42019. // if row is below, scroll down with row at bottom
  42020. var newScrollPosition = rowBottomPixel - viewportHeight;
  42021. eGui.scrollTop = newScrollPosition;
  42022. }
  42023. };
  42024. VirtualList.prototype.setComponentCreator = function (componentCreator) {
  42025. this.componentCreator = componentCreator;
  42026. };
  42027. VirtualList.prototype.getRowHeight = function () {
  42028. return this.rowHeight;
  42029. };
  42030. VirtualList.prototype.getScrollTop = function () {
  42031. return this.getGui().scrollTop;
  42032. };
  42033. VirtualList.prototype.setRowHeight = function (rowHeight) {
  42034. this.rowHeight = rowHeight;
  42035. this.refresh();
  42036. };
  42037. VirtualList.prototype.refresh = function () {
  42038. var _this = this;
  42039. if (this.model == null) {
  42040. return;
  42041. }
  42042. var rowCount = this.model.getRowCount();
  42043. this.eContainer.style.height = rowCount * this.rowHeight + "px";
  42044. this.eContainer.setAttribute('aria-rowcount', rowCount.toString());
  42045. // ensure height is applied before attempting to redraw rows
  42046. setTimeout(function () {
  42047. _this.clearVirtualRows();
  42048. _this.drawVirtualRows();
  42049. }, 0);
  42050. };
  42051. VirtualList.prototype.clearVirtualRows = function () {
  42052. var _this = this;
  42053. this.renderedRows.forEach(function (_, rowIndex) { return _this.removeRow(rowIndex); });
  42054. };
  42055. VirtualList.prototype.drawVirtualRows = function () {
  42056. var gui = this.getGui();
  42057. var topPixel = gui.scrollTop;
  42058. var bottomPixel = topPixel + gui.offsetHeight;
  42059. var firstRow = Math.floor(topPixel / this.rowHeight);
  42060. var lastRow = Math.floor(bottomPixel / this.rowHeight);
  42061. this.ensureRowsRendered(firstRow, lastRow);
  42062. };
  42063. VirtualList.prototype.ensureRowsRendered = function (start, finish) {
  42064. var _this = this;
  42065. // remove any rows that are no longer required
  42066. this.renderedRows.forEach(function (_, rowIndex) {
  42067. if ((rowIndex < start || rowIndex > finish) && rowIndex !== _this.lastFocusedRow) {
  42068. _this.removeRow(rowIndex);
  42069. }
  42070. });
  42071. // insert any required new rows
  42072. for (var rowIndex = start; rowIndex <= finish; rowIndex++) {
  42073. if (this.renderedRows.has(rowIndex)) {
  42074. continue;
  42075. }
  42076. // check this row actually exists (in case overflow buffer window exceeds real data)
  42077. if (rowIndex < this.model.getRowCount()) {
  42078. var value = this.model.getRow(rowIndex);
  42079. this.insertRow(value, rowIndex);
  42080. }
  42081. }
  42082. };
  42083. VirtualList.prototype.insertRow = function (value, rowIndex) {
  42084. var eDiv = document.createElement('div');
  42085. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eDiv, 'ag-virtual-list-item');
  42086. _utils__WEBPACK_IMPORTED_MODULE_4__["_"].addCssClass(eDiv, "ag-" + this.cssIdentifier + "-virtual-list-item");
  42087. eDiv.setAttribute('aria-rowindex', (rowIndex + 1).toString());
  42088. eDiv.setAttribute('tabindex', '-1');
  42089. eDiv.style.height = this.rowHeight + "px";
  42090. eDiv.style.top = this.rowHeight * rowIndex + "px";
  42091. var rowComponent = this.componentCreator(value);
  42092. eDiv.appendChild(rowComponent.getGui());
  42093. this.eContainer.appendChild(eDiv);
  42094. this.renderedRows.set(rowIndex, { rowComponent: rowComponent, eDiv: eDiv });
  42095. };
  42096. VirtualList.prototype.removeRow = function (rowIndex) {
  42097. var component = this.renderedRows.get(rowIndex);
  42098. this.eContainer.removeChild(component.eDiv);
  42099. this.destroyBean(component.rowComponent);
  42100. this.renderedRows.delete(rowIndex);
  42101. };
  42102. VirtualList.prototype.addScrollListener = function () {
  42103. var _this = this;
  42104. this.addGuiEventListener('scroll', function () { return _this.drawVirtualRows(); });
  42105. };
  42106. VirtualList.prototype.setModel = function (model) {
  42107. this.model = model;
  42108. };
  42109. __decorate([
  42110. Object(_context_context__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  42111. ], VirtualList.prototype, "gridOptionsWrapper", void 0);
  42112. __decorate([
  42113. Object(_componentAnnotations__WEBPACK_IMPORTED_MODULE_1__["RefSelector"])('eContainer')
  42114. ], VirtualList.prototype, "eContainer", void 0);
  42115. return VirtualList;
  42116. }(_managedFocusComponent__WEBPACK_IMPORTED_MODULE_2__["ManagedFocusComponent"]));
  42117. /***/ }),
  42118. /* 200 */
  42119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42120. "use strict";
  42121. __webpack_require__.r(__webpack_exports__);
  42122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultGroupComparator", function() { return defaultGroupComparator; });
  42123. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  42124. /**
  42125. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  42126. * @version v23.2.1
  42127. * @link http://www.ag-grid.com/
  42128. * @license MIT
  42129. */
  42130. function defaultGroupComparator(valueA, valueB, nodeA, nodeB, accentedCompare) {
  42131. if (accentedCompare === void 0) { accentedCompare = false; }
  42132. console.warn('ag-Grid: Since ag-grid 11.0.0 defaultGroupComparator is not necessary. You can remove this from your colDef');
  42133. var nodeAIsGroup = _utils__WEBPACK_IMPORTED_MODULE_0__["_"].exists(nodeA) && nodeA.group;
  42134. var nodeBIsGroup = _utils__WEBPACK_IMPORTED_MODULE_0__["_"].exists(nodeB) && nodeB.group;
  42135. var bothAreGroups = nodeAIsGroup && nodeBIsGroup;
  42136. var bothAreNormal = !nodeAIsGroup && !nodeBIsGroup;
  42137. if (bothAreGroups) {
  42138. return _utils__WEBPACK_IMPORTED_MODULE_0__["_"].defaultComparator(nodeA.key, nodeB.key, accentedCompare);
  42139. }
  42140. if (bothAreNormal) {
  42141. return _utils__WEBPACK_IMPORTED_MODULE_0__["_"].defaultComparator(valueA, valueB, accentedCompare);
  42142. }
  42143. if (nodeAIsGroup) {
  42144. return 1;
  42145. }
  42146. return -1;
  42147. }
  42148. /***/ }),
  42149. /* 201 */
  42150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42151. "use strict";
  42152. __webpack_require__.r(__webpack_exports__);
  42153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseComponentWrapper", function() { return BaseComponentWrapper; });
  42154. /**
  42155. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  42156. * @version v23.2.1
  42157. * @link http://www.ag-grid.com/
  42158. * @license MIT
  42159. */
  42160. var BaseComponentWrapper = /** @class */ (function () {
  42161. function BaseComponentWrapper() {
  42162. }
  42163. BaseComponentWrapper.prototype.wrap = function (OriginalConstructor, mandatoryMethodList, optionalMethodList, componentType, componentName) {
  42164. var _this = this;
  42165. if (optionalMethodList === void 0) { optionalMethodList = []; }
  42166. var wrapper = this.createWrapper(OriginalConstructor, componentType, componentName);
  42167. mandatoryMethodList.forEach((function (methodName) {
  42168. _this.createMethod(wrapper, methodName, true);
  42169. }));
  42170. optionalMethodList.forEach((function (methodName) {
  42171. _this.createMethod(wrapper, methodName, false);
  42172. }));
  42173. return wrapper;
  42174. };
  42175. BaseComponentWrapper.prototype.createMethod = function (wrapper, methodName, mandatory) {
  42176. wrapper.addMethod(methodName, this.createMethodProxy(wrapper, methodName, mandatory));
  42177. };
  42178. BaseComponentWrapper.prototype.createMethodProxy = function (wrapper, methodName, mandatory) {
  42179. return function () {
  42180. if (wrapper.hasMethod(methodName)) {
  42181. return wrapper.callMethod(methodName, arguments);
  42182. }
  42183. if (mandatory) {
  42184. console.warn('ag-Grid: Framework component is missing the method ' + methodName + '()');
  42185. }
  42186. return null;
  42187. };
  42188. };
  42189. return BaseComponentWrapper;
  42190. }());
  42191. /***/ }),
  42192. /* 202 */
  42193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42194. "use strict";
  42195. __webpack_require__.r(__webpack_exports__);
  42196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChartType", function() { return ChartType; });
  42197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LegendPosition", function() { return LegendPosition; });
  42198. /**
  42199. * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
  42200. * @version v23.2.1
  42201. * @link http://www.ag-grid.com/
  42202. * @license MIT
  42203. */
  42204. var ChartType;
  42205. (function (ChartType) {
  42206. ChartType["GroupedColumn"] = "groupedColumn";
  42207. ChartType["StackedColumn"] = "stackedColumn";
  42208. ChartType["NormalizedColumn"] = "normalizedColumn";
  42209. ChartType["GroupedBar"] = "groupedBar";
  42210. ChartType["StackedBar"] = "stackedBar";
  42211. ChartType["NormalizedBar"] = "normalizedBar";
  42212. ChartType["Line"] = "line";
  42213. ChartType["Scatter"] = "scatter";
  42214. ChartType["Bubble"] = "bubble";
  42215. ChartType["Pie"] = "pie";
  42216. ChartType["Doughnut"] = "doughnut";
  42217. ChartType["Area"] = "area";
  42218. ChartType["StackedArea"] = "stackedArea";
  42219. ChartType["NormalizedArea"] = "normalizedArea";
  42220. ChartType["Histogram"] = "histogram";
  42221. })(ChartType || (ChartType = {}));
  42222. var LegendPosition;
  42223. (function (LegendPosition) {
  42224. LegendPosition["Top"] = "top";
  42225. LegendPosition["Right"] = "right";
  42226. LegendPosition["Bottom"] = "bottom";
  42227. LegendPosition["Left"] = "left";
  42228. })(LegendPosition || (LegendPosition = {}));
  42229. /***/ }),
  42230. /* 203 */
  42231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42232. "use strict";
  42233. __webpack_require__.r(__webpack_exports__);
  42234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientSideRowModel", function() { return ClientSideRowModel; });
  42235. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  42236. /* harmony import */ var _clientSideNodeManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(204);
  42237. var __extends = (undefined && undefined.__extends) || (function () {
  42238. var extendStatics = function (d, b) {
  42239. extendStatics = Object.setPrototypeOf ||
  42240. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  42241. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  42242. return extendStatics(d, b);
  42243. };
  42244. return function (d, b) {
  42245. extendStatics(d, b);
  42246. function __() { this.constructor = d; }
  42247. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  42248. };
  42249. })();
  42250. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  42251. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  42252. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  42253. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  42254. return c > 3 && r && Object.defineProperty(target, key, r), r;
  42255. };
  42256. var RecursionType;
  42257. (function (RecursionType) {
  42258. RecursionType[RecursionType["Normal"] = 0] = "Normal";
  42259. RecursionType[RecursionType["AfterFilter"] = 1] = "AfterFilter";
  42260. RecursionType[RecursionType["AfterFilterAndSort"] = 2] = "AfterFilterAndSort";
  42261. RecursionType[RecursionType["PivotNodes"] = 3] = "PivotNodes";
  42262. })(RecursionType || (RecursionType = {}));
  42263. var ClientSideRowModel = /** @class */ (function (_super) {
  42264. __extends(ClientSideRowModel, _super);
  42265. function ClientSideRowModel() {
  42266. return _super !== null && _super.apply(this, arguments) || this;
  42267. }
  42268. ClientSideRowModel.prototype.init = function () {
  42269. var refreshEverythingFunc = this.refreshModel.bind(this, { step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_EVERYTHING });
  42270. var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_EVERYTHING, afterColumnsChanged: true, keepRenderedRows: true });
  42271. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED, refreshEverythingAfterColsChangedFunc);
  42272. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc);
  42273. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this));
  42274. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_PIVOT }));
  42275. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_ROW_GROUP_OPENED, this.onRowGroupOpened.bind(this));
  42276. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
  42277. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
  42278. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc);
  42279. var refreshMapListener = this.refreshModel.bind(this, {
  42280. step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_MAP,
  42281. keepRenderedRows: true,
  42282. animate: true
  42283. });
  42284. this.addManagedListener(this.gridOptionsWrapper, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_REMOVE_SINGLE_CHILDREN, refreshMapListener);
  42285. this.addManagedListener(this.gridOptionsWrapper, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["GridOptionsWrapper"].PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, refreshMapListener);
  42286. this.rootNode = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNode"]();
  42287. this.nodeManager = new _clientSideNodeManager__WEBPACK_IMPORTED_MODULE_1__["ClientSideNodeManager"](this.rootNode, this.gridOptionsWrapper, this.getContext(), this.eventService, this.columnController, this.gridApi, this.columnApi, this.selectionController);
  42288. this.createBean(this.rootNode);
  42289. };
  42290. ClientSideRowModel.prototype.start = function () {
  42291. var rowData = this.gridOptionsWrapper.getRowData();
  42292. if (rowData) {
  42293. this.setRowData(rowData);
  42294. }
  42295. };
  42296. ClientSideRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {
  42297. var atLeastOneChange;
  42298. var res = false;
  42299. // we do this multiple times as changing the row heights can also change the first and last rows,
  42300. // so the first pass can make lots of rows smaller, which means the second pass we end up changing
  42301. // more rows.
  42302. do {
  42303. atLeastOneChange = false;
  42304. var rowAtStartPixel = this.getRowIndexAtPixel(startPixel);
  42305. var rowAtEndPixel = this.getRowIndexAtPixel(endPixel);
  42306. // keep check to current page if doing pagination
  42307. var firstRow = Math.max(rowAtStartPixel, startLimitIndex);
  42308. var lastRow = Math.min(rowAtEndPixel, endLimitIndex);
  42309. for (var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {
  42310. var rowNode = this.getRow(rowIndex);
  42311. if (rowNode.rowHeightEstimated) {
  42312. var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode);
  42313. rowNode.setRowHeight(rowHeight.height);
  42314. atLeastOneChange = true;
  42315. res = true;
  42316. }
  42317. }
  42318. if (atLeastOneChange) {
  42319. this.setRowTops();
  42320. }
  42321. } while (atLeastOneChange);
  42322. return res;
  42323. };
  42324. ClientSideRowModel.prototype.setRowTops = function () {
  42325. var nextRowTop = 0;
  42326. for (var i = 0; i < this.rowsToDisplay.length; i++) {
  42327. // we don't estimate if doing fullHeight or autoHeight, as all rows get rendered all the time
  42328. // with these two layouts.
  42329. var allowEstimate = this.gridOptionsWrapper.getDomLayout() === _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].DOM_LAYOUT_NORMAL;
  42330. var rowNode = this.rowsToDisplay[i];
  42331. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(rowNode.rowHeight)) {
  42332. var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode, allowEstimate);
  42333. rowNode.setRowHeight(rowHeight.height, rowHeight.estimated);
  42334. }
  42335. rowNode.setRowTop(nextRowTop);
  42336. rowNode.setRowIndex(i);
  42337. nextRowTop += rowNode.rowHeight;
  42338. }
  42339. };
  42340. ClientSideRowModel.prototype.resetRowTops = function (rowNode, changedPath) {
  42341. rowNode.clearRowTop();
  42342. if (rowNode.hasChildren()) {
  42343. if (rowNode.childrenAfterGroup) {
  42344. // if a changedPath is active, it means we are here because of a transaction update or
  42345. // a change detection. neither of these impacts the open/closed state of groups. so if
  42346. // a group is not open this time, it was not open last time. so we know all closed groups
  42347. // already have their top positions cleared. so there is no need to traverse all the way
  42348. // when changedPath is active and the rowNode is not expanded.
  42349. var skipChildren = changedPath.isActive() && !rowNode.expanded;
  42350. if (!skipChildren) {
  42351. for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {
  42352. this.resetRowTops(rowNode.childrenAfterGroup[i], changedPath);
  42353. }
  42354. }
  42355. }
  42356. if (rowNode.sibling) {
  42357. rowNode.sibling.clearRowTop();
  42358. }
  42359. }
  42360. if (rowNode.detailNode) {
  42361. rowNode.detailNode.clearRowTop();
  42362. }
  42363. };
  42364. // returns false if row was moved, otherwise true
  42365. ClientSideRowModel.prototype.ensureRowsAtPixel = function (rowNodes, pixel, increment) {
  42366. var _this = this;
  42367. if (increment === void 0) { increment = 0; }
  42368. var indexAtPixelNow = this.getRowIndexAtPixel(pixel);
  42369. var rowNodeAtPixelNow = this.getRow(indexAtPixelNow);
  42370. if (rowNodeAtPixelNow === rowNodes[0]) {
  42371. return false;
  42372. }
  42373. rowNodes.forEach(function (rowNode) {
  42374. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].removeFromArray(_this.rootNode.allLeafChildren, rowNode);
  42375. });
  42376. rowNodes.forEach(function (rowNode, idx) {
  42377. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].insertIntoArray(_this.rootNode.allLeafChildren, rowNode, indexAtPixelNow + increment + idx);
  42378. });
  42379. this.refreshModel({
  42380. step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_EVERYTHING,
  42381. keepRenderedRows: true,
  42382. animate: true,
  42383. keepEditingRows: true
  42384. });
  42385. return true;
  42386. };
  42387. ClientSideRowModel.prototype.highlightRowAtPixel = function (rowNode, pixel) {
  42388. var indexAtPixelNow = pixel != null ? this.getRowIndexAtPixel(pixel) : null;
  42389. var rowNodeAtPixelNow = indexAtPixelNow != null ? this.getRow(indexAtPixelNow) : null;
  42390. if (!rowNodeAtPixelNow || !rowNode || rowNodeAtPixelNow === rowNode || pixel == null) {
  42391. if (this.lastHighlightedRow) {
  42392. this.lastHighlightedRow.setHighlighted(null);
  42393. this.lastHighlightedRow = null;
  42394. }
  42395. return;
  42396. }
  42397. var highlight = this.getHighlightPosition(pixel, rowNodeAtPixelNow);
  42398. if (this.lastHighlightedRow && this.lastHighlightedRow !== rowNodeAtPixelNow) {
  42399. this.lastHighlightedRow.setHighlighted(null);
  42400. this.lastHighlightedRow = null;
  42401. }
  42402. rowNodeAtPixelNow.setHighlighted(highlight);
  42403. this.lastHighlightedRow = rowNodeAtPixelNow;
  42404. };
  42405. ClientSideRowModel.prototype.getHighlightPosition = function (pixel, rowNode) {
  42406. if (!rowNode) {
  42407. var index = this.getRowIndexAtPixel(pixel);
  42408. rowNode = this.getRow(index || 0);
  42409. if (!rowNode) {
  42410. return 'below';
  42411. }
  42412. }
  42413. var rowTop = rowNode.rowTop, rowHeight = rowNode.rowHeight;
  42414. return pixel - rowTop < rowHeight / 2 ? 'above' : 'below';
  42415. };
  42416. ClientSideRowModel.prototype.getLastHighlightedRowNode = function () {
  42417. return this.lastHighlightedRow;
  42418. };
  42419. ClientSideRowModel.prototype.isLastRowFound = function () {
  42420. return true;
  42421. };
  42422. ClientSideRowModel.prototype.getRowCount = function () {
  42423. if (this.rowsToDisplay) {
  42424. return this.rowsToDisplay.length;
  42425. }
  42426. return 0;
  42427. };
  42428. ClientSideRowModel.prototype.getTopLevelRowCount = function () {
  42429. var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;
  42430. if (showingRootNode) {
  42431. return 1;
  42432. }
  42433. return this.rootNode.childrenAfterFilter ? this.rootNode.childrenAfterFilter.length : 0;
  42434. };
  42435. ClientSideRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {
  42436. var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;
  42437. if (showingRootNode) {
  42438. return topLevelIndex;
  42439. }
  42440. var rowNode = this.rootNode.childrenAfterSort[topLevelIndex];
  42441. if (this.gridOptionsWrapper.isGroupHideOpenParents()) {
  42442. // if hideOpenParents, and this row open, then this row is now displayed at this index, first child is
  42443. while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) {
  42444. rowNode = rowNode.childrenAfterSort[0];
  42445. }
  42446. }
  42447. return rowNode.rowIndex;
  42448. };
  42449. ClientSideRowModel.prototype.getRowBounds = function (index) {
  42450. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.rowsToDisplay)) {
  42451. return null;
  42452. }
  42453. var rowNode = this.rowsToDisplay[index];
  42454. if (rowNode) {
  42455. return {
  42456. rowTop: rowNode.rowTop,
  42457. rowHeight: rowNode.rowHeight
  42458. };
  42459. }
  42460. return null;
  42461. };
  42462. ClientSideRowModel.prototype.onRowGroupOpened = function () {
  42463. var animate = this.gridOptionsWrapper.isAnimateRows();
  42464. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_MAP, keepRenderedRows: true, animate: animate });
  42465. };
  42466. ClientSideRowModel.prototype.onFilterChanged = function (event) {
  42467. if (event.afterDataChange) {
  42468. return;
  42469. }
  42470. var animate = this.gridOptionsWrapper.isAnimateRows();
  42471. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_FILTER, keepRenderedRows: true, animate: animate });
  42472. };
  42473. ClientSideRowModel.prototype.onSortChanged = function () {
  42474. var animate = this.gridOptionsWrapper.isAnimateRows();
  42475. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_SORT, keepRenderedRows: true, animate: animate, keepEditingRows: true });
  42476. };
  42477. ClientSideRowModel.prototype.getType = function () {
  42478. return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
  42479. };
  42480. ClientSideRowModel.prototype.onValueChanged = function () {
  42481. if (this.columnController.isPivotActive()) {
  42482. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_PIVOT });
  42483. }
  42484. else {
  42485. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_AGGREGATE });
  42486. }
  42487. };
  42488. ClientSideRowModel.prototype.createChangePath = function (rowNodeTransactions) {
  42489. // for updates, if the row is updated at all, then we re-calc all the values
  42490. // in that row. we could compare each value to each old value, however if we
  42491. // did this, we would be calling the valueService twice, once on the old value
  42492. // and once on the new value. so it's less valueGetter calls if we just assume
  42493. // each column is different. that way the changedPath is used so that only
  42494. // the impacted parent rows are recalculated, parents who's children have
  42495. // not changed are not impacted.
  42496. var noTransactions = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missingOrEmpty(rowNodeTransactions);
  42497. var changedPath = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["ChangedPath"](false, this.rootNode);
  42498. if (noTransactions || this.gridOptionsWrapper.isTreeData()) {
  42499. changedPath.setInactive();
  42500. }
  42501. return changedPath;
  42502. };
  42503. ClientSideRowModel.prototype.refreshModel = function (params) {
  42504. // this goes through the pipeline of stages. what's in my head is similar
  42505. // to the diagram on this page:
  42506. // http://commons.apache.org/sandbox/commons-pipeline/pipeline_basics.html
  42507. // however we want to keep the results of each stage, hence we manually call
  42508. // each step rather than have them chain each other.
  42509. var _this = this;
  42510. // fallthrough in below switch is on purpose,
  42511. // eg if STEP_FILTER, then all steps below this
  42512. // step get done
  42513. // let start: number;
  42514. // console.log('======= start =======');
  42515. var changedPath = this.createChangePath(params.rowNodeTransactions);
  42516. switch (params.step) {
  42517. case _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_EVERYTHING:
  42518. // start = new Date().getTime();
  42519. this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, params.afterColumnsChanged);
  42520. // console.log('rowGrouping = ' + (new Date().getTime() - start));
  42521. case _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_FILTER:
  42522. // start = new Date().getTime();
  42523. this.doFilter(changedPath);
  42524. // console.log('filter = ' + (new Date().getTime() - start));
  42525. case _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_PIVOT:
  42526. this.doPivot(changedPath);
  42527. case _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_AGGREGATE: // depends on agg fields
  42528. // start = new Date().getTime();
  42529. this.doAggregate(changedPath);
  42530. // console.log('aggregation = ' + (new Date().getTime() - start));
  42531. case _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_SORT:
  42532. // start = new Date().getTime();
  42533. this.doSort(params.rowNodeTransactions, changedPath);
  42534. // console.log('sort = ' + (new Date().getTime() - start));
  42535. case _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_MAP:
  42536. // start = new Date().getTime();
  42537. this.doRowsToDisplay();
  42538. // console.log('rowsToDisplay = ' + (new Date().getTime() - start));
  42539. }
  42540. // set all row tops to null, then set row tops on all visible rows. if we don't
  42541. // do this, then the algorithm below only sets row tops, old row tops from old rows
  42542. // will still lie around
  42543. this.resetRowTops(this.rootNode, changedPath);
  42544. this.setRowTops();
  42545. var event = {
  42546. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_MODEL_UPDATED,
  42547. api: this.gridApi,
  42548. columnApi: this.columnApi,
  42549. animate: params.animate,
  42550. keepRenderedRows: params.keepRenderedRows,
  42551. newData: params.newData,
  42552. newPage: false
  42553. };
  42554. this.eventService.dispatchEvent(event);
  42555. if (this.$scope) {
  42556. window.setTimeout(function () {
  42557. _this.$scope.$apply();
  42558. }, 0);
  42559. }
  42560. };
  42561. ClientSideRowModel.prototype.isEmpty = function () {
  42562. var rowsMissing;
  42563. var doingLegacyTreeData = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
  42564. if (doingLegacyTreeData) {
  42565. rowsMissing = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.rootNode.childrenAfterGroup) || this.rootNode.childrenAfterGroup.length === 0;
  42566. }
  42567. else {
  42568. rowsMissing = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0;
  42569. }
  42570. var empty = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.rootNode) || rowsMissing || !this.columnController.isReady();
  42571. return empty;
  42572. };
  42573. ClientSideRowModel.prototype.isRowsToRender = function () {
  42574. return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0;
  42575. };
  42576. ClientSideRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
  42577. // if lastSelectedNode is missing, we start at the first row
  42578. var firstRowHit = !lastInRange;
  42579. var lastRowHit = false;
  42580. var lastRow;
  42581. var result = [];
  42582. var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();
  42583. this.forEachNodeAfterFilterAndSort(function (rowNode) {
  42584. var lookingForLastRow = firstRowHit && !lastRowHit;
  42585. // check if we need to flip the select switch
  42586. if (!firstRowHit) {
  42587. if (rowNode === lastInRange || rowNode === firstInRange) {
  42588. firstRowHit = true;
  42589. }
  42590. }
  42591. var skipThisGroupNode = rowNode.group && groupsSelectChildren;
  42592. if (!skipThisGroupNode) {
  42593. var inRange = firstRowHit && !lastRowHit;
  42594. var childOfLastRow = rowNode.isParentOfNode(lastRow);
  42595. if (inRange || childOfLastRow) {
  42596. result.push(rowNode);
  42597. }
  42598. }
  42599. if (lookingForLastRow) {
  42600. if (rowNode === lastInRange || rowNode === firstInRange) {
  42601. lastRowHit = true;
  42602. if (rowNode === lastInRange) {
  42603. lastRow = lastInRange;
  42604. }
  42605. else {
  42606. lastRow = firstInRange;
  42607. }
  42608. }
  42609. }
  42610. });
  42611. return result;
  42612. };
  42613. ClientSideRowModel.prototype.setDatasource = function (datasource) {
  42614. console.error('ag-Grid: should never call setDatasource on clientSideRowController');
  42615. };
  42616. ClientSideRowModel.prototype.getTopLevelNodes = function () {
  42617. return this.rootNode ? this.rootNode.childrenAfterGroup : null;
  42618. };
  42619. ClientSideRowModel.prototype.getRootNode = function () {
  42620. return this.rootNode;
  42621. };
  42622. ClientSideRowModel.prototype.getRow = function (index) {
  42623. return this.rowsToDisplay[index];
  42624. };
  42625. ClientSideRowModel.prototype.isRowPresent = function (rowNode) {
  42626. return this.rowsToDisplay.indexOf(rowNode) >= 0;
  42627. };
  42628. ClientSideRowModel.prototype.getRowIndexAtPixel = function (pixelToMatch) {
  42629. if (this.isEmpty()) {
  42630. return -1;
  42631. }
  42632. // do binary search of tree
  42633. // http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/
  42634. var bottomPointer = 0;
  42635. var topPointer = this.rowsToDisplay.length - 1;
  42636. // quick check, if the pixel is out of bounds, then return last row
  42637. if (pixelToMatch <= 0) {
  42638. // if pixel is less than or equal zero, it's always the first row
  42639. return 0;
  42640. }
  42641. var lastNode = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].last(this.rowsToDisplay);
  42642. if (lastNode.rowTop <= pixelToMatch) {
  42643. return this.rowsToDisplay.length - 1;
  42644. }
  42645. while (true) {
  42646. var midPointer = Math.floor((bottomPointer + topPointer) / 2);
  42647. var currentRowNode = this.rowsToDisplay[midPointer];
  42648. if (this.isRowInPixel(currentRowNode, pixelToMatch)) {
  42649. return midPointer;
  42650. }
  42651. if (currentRowNode.rowTop < pixelToMatch) {
  42652. bottomPointer = midPointer + 1;
  42653. }
  42654. else if (currentRowNode.rowTop > pixelToMatch) {
  42655. topPointer = midPointer - 1;
  42656. }
  42657. }
  42658. };
  42659. ClientSideRowModel.prototype.isRowInPixel = function (rowNode, pixelToMatch) {
  42660. var topPixel = rowNode.rowTop;
  42661. var bottomPixel = rowNode.rowTop + rowNode.rowHeight;
  42662. var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch;
  42663. return pixelInRow;
  42664. };
  42665. ClientSideRowModel.prototype.getCurrentPageHeight = function () {
  42666. if (this.rowsToDisplay && this.rowsToDisplay.length > 0) {
  42667. var lastRow = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].last(this.rowsToDisplay);
  42668. var lastPixel = lastRow.rowTop + lastRow.rowHeight;
  42669. return lastPixel;
  42670. }
  42671. return 0;
  42672. };
  42673. ClientSideRowModel.prototype.forEachLeafNode = function (callback) {
  42674. if (this.rootNode.allLeafChildren) {
  42675. this.rootNode.allLeafChildren.forEach(function (rowNode, index) { return callback(rowNode, index); });
  42676. }
  42677. };
  42678. ClientSideRowModel.prototype.forEachNode = function (callback) {
  42679. this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup, callback, RecursionType.Normal, 0);
  42680. };
  42681. ClientSideRowModel.prototype.forEachNodeAfterFilter = function (callback) {
  42682. this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterFilter, callback, RecursionType.AfterFilter, 0);
  42683. };
  42684. ClientSideRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback) {
  42685. this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort, callback, RecursionType.AfterFilterAndSort, 0);
  42686. };
  42687. ClientSideRowModel.prototype.forEachPivotNode = function (callback) {
  42688. this.recursivelyWalkNodesAndCallback([this.rootNode], callback, RecursionType.PivotNodes, 0);
  42689. };
  42690. // iterates through each item in memory, and calls the callback function
  42691. // nodes - the rowNodes to traverse
  42692. // callback - the user provided callback
  42693. // recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc
  42694. // index - works similar to the index in forEach in javascript's array function
  42695. ClientSideRowModel.prototype.recursivelyWalkNodesAndCallback = function (nodes, callback, recursionType, index) {
  42696. if (!nodes) {
  42697. return index;
  42698. }
  42699. for (var i = 0; i < nodes.length; i++) {
  42700. var node = nodes[i];
  42701. callback(node, index++);
  42702. // go to the next level if it is a group
  42703. if (node.hasChildren()) {
  42704. // depending on the recursion type, we pick a difference set of children
  42705. var nodeChildren = null;
  42706. switch (recursionType) {
  42707. case RecursionType.Normal:
  42708. nodeChildren = node.childrenAfterGroup;
  42709. break;
  42710. case RecursionType.AfterFilter:
  42711. nodeChildren = node.childrenAfterFilter;
  42712. break;
  42713. case RecursionType.AfterFilterAndSort:
  42714. nodeChildren = node.childrenAfterSort;
  42715. break;
  42716. case RecursionType.PivotNodes:
  42717. // for pivot, we don't go below leafGroup levels
  42718. nodeChildren = !node.leafGroup ? node.childrenAfterSort : null;
  42719. break;
  42720. }
  42721. if (nodeChildren) {
  42722. index = this.recursivelyWalkNodesAndCallback(nodeChildren, callback, recursionType, index);
  42723. }
  42724. }
  42725. }
  42726. return index;
  42727. };
  42728. // it's possible to recompute the aggregate without doing the other parts
  42729. // + gridApi.recomputeAggregates()
  42730. ClientSideRowModel.prototype.doAggregate = function (changedPath) {
  42731. if (this.aggregationStage) {
  42732. this.aggregationStage.execute({ rowNode: this.rootNode, changedPath: changedPath });
  42733. }
  42734. };
  42735. // + gridApi.expandAll()
  42736. // + gridApi.collapseAll()
  42737. ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) {
  42738. var usingTreeData = this.gridOptionsWrapper.isTreeData();
  42739. if (this.rootNode) {
  42740. recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup);
  42741. }
  42742. function recursiveExpandOrCollapse(rowNodes) {
  42743. if (!rowNodes) {
  42744. return;
  42745. }
  42746. rowNodes.forEach(function (rowNode) {
  42747. var shouldExpandOrCollapse = usingTreeData ? _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(rowNode.childrenAfterGroup) : rowNode.group;
  42748. if (shouldExpandOrCollapse) {
  42749. rowNode.expanded = expand;
  42750. recursiveExpandOrCollapse(rowNode.childrenAfterGroup);
  42751. }
  42752. });
  42753. }
  42754. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_MAP });
  42755. var eventSource = expand ? 'expandAll' : 'collapseAll';
  42756. var event = {
  42757. api: this.gridApi,
  42758. columnApi: this.columnApi,
  42759. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_EXPAND_COLLAPSE_ALL,
  42760. source: eventSource
  42761. };
  42762. this.eventService.dispatchEvent(event);
  42763. };
  42764. ClientSideRowModel.prototype.doSort = function (rowNodeTransactions, changedPath) {
  42765. this.sortStage.execute({
  42766. rowNode: this.rootNode,
  42767. rowNodeTransactions: rowNodeTransactions,
  42768. changedPath: changedPath
  42769. });
  42770. };
  42771. ClientSideRowModel.prototype.doRowGrouping = function (groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) {
  42772. // grouping is enterprise only, so if service missing, skip the step
  42773. var doingLegacyTreeData = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
  42774. if (doingLegacyTreeData) {
  42775. return;
  42776. }
  42777. if (this.groupStage) {
  42778. if (rowNodeTransactions) {
  42779. this.groupStage.execute({
  42780. rowNode: this.rootNode,
  42781. rowNodeTransactions: rowNodeTransactions,
  42782. rowNodeOrder: rowNodeOrder,
  42783. changedPath: changedPath
  42784. });
  42785. }
  42786. else {
  42787. // groups are about to get disposed, so need to deselect any that are selected
  42788. this.selectionController.removeGroupsFromSelection();
  42789. this.groupStage.execute({
  42790. rowNode: this.rootNode,
  42791. changedPath: changedPath,
  42792. afterColumnsChanged: afterColumnsChanged
  42793. });
  42794. // set open/closed state on groups
  42795. this.restoreGroupState(groupState);
  42796. }
  42797. if (this.gridOptionsWrapper.isGroupSelectsChildren()) {
  42798. this.selectionController.updateGroupsFromChildrenSelections(changedPath);
  42799. }
  42800. }
  42801. else {
  42802. this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren;
  42803. }
  42804. };
  42805. ClientSideRowModel.prototype.restoreGroupState = function (groupState) {
  42806. if (!groupState) {
  42807. return;
  42808. }
  42809. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) {
  42810. // if the group was open last time, then open it this time. however
  42811. // if was not open last time, then don't touch the group, so the 'groupDefaultExpanded'
  42812. // setting will take effect.
  42813. if (typeof groupState[key] === 'boolean') {
  42814. node.expanded = groupState[key];
  42815. }
  42816. });
  42817. };
  42818. ClientSideRowModel.prototype.doFilter = function (changedPath) {
  42819. this.filterStage.execute({ rowNode: this.rootNode, changedPath: changedPath });
  42820. };
  42821. ClientSideRowModel.prototype.doPivot = function (changedPath) {
  42822. if (this.pivotStage) {
  42823. this.pivotStage.execute({ rowNode: this.rootNode, changedPath: changedPath });
  42824. }
  42825. };
  42826. ClientSideRowModel.prototype.getGroupState = function () {
  42827. if (!this.rootNode.childrenAfterGroup || !this.gridOptionsWrapper.isRememberGroupStateWhenNewData()) {
  42828. return null;
  42829. }
  42830. var result = {};
  42831. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; });
  42832. return result;
  42833. };
  42834. ClientSideRowModel.prototype.getCopyOfNodesMap = function () {
  42835. return this.nodeManager.getCopyOfNodesMap();
  42836. };
  42837. ClientSideRowModel.prototype.getRowNode = function (id) {
  42838. return this.nodeManager.getRowNode(id);
  42839. };
  42840. // rows: the rows to put into the model
  42841. ClientSideRowModel.prototype.setRowData = function (rowData) {
  42842. // no need to invalidate cache, as the cache is stored on the rowNode,
  42843. // so new rowNodes means the cache is wiped anyway.
  42844. // remember group state, so we can expand groups that should be expanded
  42845. var groupState = this.getGroupState();
  42846. this.nodeManager.setRowData(rowData);
  42847. // this event kicks off:
  42848. // - clears selection
  42849. // - updates filters
  42850. // - shows 'no rows' overlay if needed
  42851. var rowDataChangedEvent = {
  42852. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_ROW_DATA_CHANGED,
  42853. api: this.gridApi,
  42854. columnApi: this.columnApi
  42855. };
  42856. this.eventService.dispatchEvent(rowDataChangedEvent);
  42857. this.refreshModel({
  42858. step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_EVERYTHING,
  42859. groupState: groupState,
  42860. newData: true
  42861. });
  42862. };
  42863. ClientSideRowModel.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {
  42864. var _this = this;
  42865. if (!this.rowDataTransactionBatch) {
  42866. this.rowDataTransactionBatch = [];
  42867. var waitMillis = this.gridOptionsWrapper.getAsyncTransactionWaitMillis();
  42868. window.setTimeout(function () {
  42869. _this.executeBatchUpdateRowData();
  42870. _this.rowDataTransactionBatch = null;
  42871. }, waitMillis);
  42872. }
  42873. this.rowDataTransactionBatch.push({ rowDataTransaction: rowDataTransaction, callback: callback });
  42874. };
  42875. ClientSideRowModel.prototype.executeBatchUpdateRowData = function () {
  42876. var _this = this;
  42877. this.valueCache.onDataChanged();
  42878. var callbackFuncsBound = [];
  42879. var rowNodeTrans = [];
  42880. if (this.rowDataTransactionBatch) {
  42881. this.rowDataTransactionBatch.forEach(function (tranItem) {
  42882. var rowNodeTran = _this.nodeManager.updateRowData(tranItem.rowDataTransaction, null);
  42883. rowNodeTrans.push(rowNodeTran);
  42884. if (tranItem.callback) {
  42885. callbackFuncsBound.push(tranItem.callback.bind(null, rowNodeTran));
  42886. }
  42887. });
  42888. }
  42889. this.commonUpdateRowData(rowNodeTrans);
  42890. // do callbacks in next VM turn so it's async
  42891. if (callbackFuncsBound.length > 0) {
  42892. window.setTimeout(function () {
  42893. callbackFuncsBound.forEach(function (func) { return func(); });
  42894. }, 0);
  42895. }
  42896. };
  42897. ClientSideRowModel.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {
  42898. this.valueCache.onDataChanged();
  42899. var rowNodeTran = this.nodeManager.updateRowData(rowDataTran, rowNodeOrder);
  42900. this.commonUpdateRowData([rowNodeTran], rowNodeOrder);
  42901. return rowNodeTran;
  42902. };
  42903. // common to updateRowData and batchUpdateRowData
  42904. ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder) {
  42905. this.refreshModel({
  42906. step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_EVERYTHING,
  42907. rowNodeTransactions: rowNodeTrans,
  42908. rowNodeOrder: rowNodeOrder,
  42909. keepRenderedRows: true,
  42910. animate: true,
  42911. keepEditingRows: true
  42912. });
  42913. var event = {
  42914. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_ROW_DATA_UPDATED,
  42915. api: this.gridApi,
  42916. columnApi: this.columnApi
  42917. };
  42918. this.eventService.dispatchEvent(event);
  42919. };
  42920. ClientSideRowModel.prototype.doRowsToDisplay = function () {
  42921. this.rowsToDisplay = this.flattenStage.execute({ rowNode: this.rootNode });
  42922. };
  42923. ClientSideRowModel.prototype.onRowHeightChanged = function () {
  42924. this.refreshModel({ step: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].STEP_MAP, keepRenderedRows: true, keepEditingRows: true });
  42925. };
  42926. ClientSideRowModel.prototype.resetRowHeights = function () {
  42927. this.forEachNode(function (rowNode) {
  42928. rowNode.setRowHeight(null);
  42929. // forEachNode doesn't go through detail rows, so need to check
  42930. // for detail nodes explicitly.
  42931. if (rowNode.detailNode) {
  42932. rowNode.detailNode.setRowHeight(null);
  42933. }
  42934. });
  42935. this.onRowHeightChanged();
  42936. };
  42937. __decorate([
  42938. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  42939. ], ClientSideRowModel.prototype, "gridOptionsWrapper", void 0);
  42940. __decorate([
  42941. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  42942. ], ClientSideRowModel.prototype, "columnController", void 0);
  42943. __decorate([
  42944. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  42945. ], ClientSideRowModel.prototype, "filterManager", void 0);
  42946. __decorate([
  42947. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('$scope')
  42948. ], ClientSideRowModel.prototype, "$scope", void 0);
  42949. __decorate([
  42950. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectionController')
  42951. ], ClientSideRowModel.prototype, "selectionController", void 0);
  42952. __decorate([
  42953. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueService')
  42954. ], ClientSideRowModel.prototype, "valueService", void 0);
  42955. __decorate([
  42956. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueCache')
  42957. ], ClientSideRowModel.prototype, "valueCache", void 0);
  42958. __decorate([
  42959. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  42960. ], ClientSideRowModel.prototype, "columnApi", void 0);
  42961. __decorate([
  42962. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  42963. ], ClientSideRowModel.prototype, "gridApi", void 0);
  42964. __decorate([
  42965. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterStage')
  42966. ], ClientSideRowModel.prototype, "filterStage", void 0);
  42967. __decorate([
  42968. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortStage')
  42969. ], ClientSideRowModel.prototype, "sortStage", void 0);
  42970. __decorate([
  42971. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('flattenStage')
  42972. ], ClientSideRowModel.prototype, "flattenStage", void 0);
  42973. __decorate([
  42974. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Optional"])('groupStage')
  42975. ], ClientSideRowModel.prototype, "groupStage", void 0);
  42976. __decorate([
  42977. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Optional"])('aggregationStage')
  42978. ], ClientSideRowModel.prototype, "aggregationStage", void 0);
  42979. __decorate([
  42980. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Optional"])('pivotStage')
  42981. ], ClientSideRowModel.prototype, "pivotStage", void 0);
  42982. __decorate([
  42983. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  42984. ], ClientSideRowModel.prototype, "init", null);
  42985. ClientSideRowModel = __decorate([
  42986. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('rowModel')
  42987. ], ClientSideRowModel);
  42988. return ClientSideRowModel;
  42989. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  42990. /***/ }),
  42991. /* 204 */
  42992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42993. "use strict";
  42994. __webpack_require__.r(__webpack_exports__);
  42995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientSideNodeManager", function() { return ClientSideNodeManager; });
  42996. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  42997. var ClientSideNodeManager = /** @class */ (function () {
  42998. function ClientSideNodeManager(rootNode, gridOptionsWrapper, context, eventService, columnController, gridApi, columnApi, selectionController) {
  42999. this.nextId = 0;
  43000. // when user is provide the id's, we also keep a map of ids to row nodes for convenience
  43001. this.allNodesMap = {};
  43002. this.rootNode = rootNode;
  43003. this.gridOptionsWrapper = gridOptionsWrapper;
  43004. this.context = context;
  43005. this.eventService = eventService;
  43006. this.columnController = columnController;
  43007. this.gridApi = gridApi;
  43008. this.columnApi = columnApi;
  43009. this.selectionController = selectionController;
  43010. this.rootNode.group = true;
  43011. this.rootNode.level = -1;
  43012. this.rootNode.id = ClientSideNodeManager.ROOT_NODE_ID;
  43013. this.rootNode.allLeafChildren = [];
  43014. this.rootNode.childrenAfterGroup = [];
  43015. this.rootNode.childrenAfterSort = [];
  43016. this.rootNode.childrenAfterFilter = [];
  43017. // if we make this class a bean, then can annotate postConstruct
  43018. this.postConstruct();
  43019. }
  43020. // @PostConstruct - this is not a bean, so postConstruct called by constructor
  43021. ClientSideNodeManager.prototype.postConstruct = function () {
  43022. // func below doesn't have 'this' pointer, so need to pull out these bits
  43023. this.getNodeChildDetails = this.gridOptionsWrapper.getNodeChildDetailsFunc();
  43024. this.suppressParentsInRowNodes = this.gridOptionsWrapper.isSuppressParentsInRowNodes();
  43025. this.doesDataFlower = this.gridOptionsWrapper.getDoesDataFlowerFunc();
  43026. this.isRowMasterFunc = this.gridOptionsWrapper.getIsRowMasterFunc();
  43027. this.doingTreeData = this.gridOptionsWrapper.isTreeData();
  43028. this.doingLegacyTreeData = !this.doingTreeData && _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.getNodeChildDetails);
  43029. this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail();
  43030. if (this.getNodeChildDetails) {
  43031. console.warn("ag-Grid: the callback nodeChildDetailsFunc() is now deprecated. The new way of doing\n tree data in ag-Grid was introduced in v14 (released November 2017). In the next\n major release of ag-Grid we will be dropping support for the old version of\n tree data. If you are reading this message, please go to the docs to see how\n to implement Tree Data without using nodeChildDetailsFunc().");
  43032. }
  43033. };
  43034. ClientSideNodeManager.prototype.getCopyOfNodesMap = function () {
  43035. var result = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].cloneObject(this.allNodesMap);
  43036. return result;
  43037. };
  43038. ClientSideNodeManager.prototype.getRowNode = function (id) {
  43039. return this.allNodesMap[id];
  43040. };
  43041. ClientSideNodeManager.prototype.setRowData = function (rowData) {
  43042. this.rootNode.childrenAfterFilter = null;
  43043. this.rootNode.childrenAfterGroup = null;
  43044. this.rootNode.childrenAfterSort = null;
  43045. this.rootNode.childrenMapped = null;
  43046. this.nextId = 0;
  43047. this.allNodesMap = {};
  43048. if (!rowData) {
  43049. this.rootNode.allLeafChildren = [];
  43050. this.rootNode.childrenAfterGroup = [];
  43051. return;
  43052. }
  43053. // kick off recursion
  43054. // we add rootNode as the parent, however if using ag-grid-enterprise, the grouping stage
  43055. // sets the parent node on each row (even if we are not grouping). so setting parent node
  43056. // here is for benefit of ag-grid-community users
  43057. var result = this.recursiveFunction(rowData, this.rootNode, ClientSideNodeManager.TOP_LEVEL);
  43058. if (this.doingLegacyTreeData) {
  43059. this.rootNode.childrenAfterGroup = result;
  43060. this.setLeafChildren(this.rootNode);
  43061. }
  43062. else {
  43063. this.rootNode.allLeafChildren = result;
  43064. }
  43065. };
  43066. ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {
  43067. if (this.isLegacyTreeData()) {
  43068. return null;
  43069. }
  43070. var rowNodeTransaction = {
  43071. remove: [],
  43072. update: [],
  43073. add: []
  43074. };
  43075. var nodesToUnselect = [];
  43076. this.executeAdd(rowDataTran, rowNodeTransaction);
  43077. this.executeRemove(rowDataTran, rowNodeTransaction, nodesToUnselect);
  43078. this.executeUpdate(rowDataTran, rowNodeTransaction, nodesToUnselect);
  43079. this.updateSelection(nodesToUnselect);
  43080. if (rowNodeOrder) {
  43081. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder);
  43082. }
  43083. return rowNodeTransaction;
  43084. };
  43085. ClientSideNodeManager.prototype.updateSelection = function (nodesToUnselect) {
  43086. var selectionChanged = nodesToUnselect.length > 0;
  43087. if (selectionChanged) {
  43088. nodesToUnselect.forEach(function (rowNode) {
  43089. rowNode.setSelected(false, false, true);
  43090. });
  43091. }
  43092. // we do this regardless of nodes to unselect or not, as it's possible
  43093. // a new node was inserted, so a parent that was previously selected (as all
  43094. // children were selected) should not be tri-state (as new one unselected against
  43095. // all other selected children).
  43096. this.selectionController.updateGroupsFromChildrenSelections();
  43097. if (selectionChanged) {
  43098. var event_1 = {
  43099. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_SELECTION_CHANGED,
  43100. api: this.gridApi,
  43101. columnApi: this.columnApi
  43102. };
  43103. this.eventService.dispatchEvent(event_1);
  43104. }
  43105. };
  43106. ClientSideNodeManager.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) {
  43107. var _this = this;
  43108. var add = rowDataTran.add, addIndex = rowDataTran.addIndex;
  43109. if (!add) {
  43110. return;
  43111. }
  43112. var useIndex = typeof addIndex === 'number' && addIndex >= 0;
  43113. if (useIndex) {
  43114. // items get inserted in reverse order for index insertion
  43115. add.reverse().forEach(function (item) {
  43116. var newRowNode = _this.addRowNode(item, addIndex);
  43117. rowNodeTransaction.add.push(newRowNode);
  43118. });
  43119. }
  43120. else {
  43121. add.forEach(function (item) {
  43122. var newRowNode = _this.addRowNode(item);
  43123. rowNodeTransaction.add.push(newRowNode);
  43124. });
  43125. }
  43126. };
  43127. ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {
  43128. var _this = this;
  43129. var remove = rowDataTran.remove;
  43130. if (!remove) {
  43131. return;
  43132. }
  43133. var rowIdsRemoved = {};
  43134. remove.forEach(function (item) {
  43135. var rowNode = _this.lookupRowNode(item);
  43136. if (!rowNode) {
  43137. return;
  43138. }
  43139. // do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for
  43140. // each row node updated, instead it is raised once by the calling code if any selected nodes exist.
  43141. if (rowNode.isSelected()) {
  43142. nodesToUnselect.push(rowNode);
  43143. }
  43144. // so row renderer knows to fade row out (and not reposition it)
  43145. rowNode.clearRowTop();
  43146. // NOTE: were we could remove from allLeaveChildren, however _.removeFromArray() is expensive, especially
  43147. // if called multiple times (eg deleting lots of rows) and if allLeafChildren is a large list
  43148. rowIdsRemoved[rowNode.id] = true;
  43149. // _.removeFromArray(this.rootNode.allLeafChildren, rowNode);
  43150. delete _this.allNodesMap[rowNode.id];
  43151. rowNodeTransaction.remove.push(rowNode);
  43152. });
  43153. this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; });
  43154. };
  43155. ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {
  43156. var _this = this;
  43157. var update = rowDataTran.update;
  43158. if (!update) {
  43159. return;
  43160. }
  43161. update.forEach(function (item) {
  43162. var rowNode = _this.lookupRowNode(item);
  43163. if (!rowNode) {
  43164. return;
  43165. }
  43166. rowNode.updateData(item);
  43167. if (!rowNode.selectable && rowNode.isSelected()) {
  43168. nodesToUnselect.push(rowNode);
  43169. }
  43170. _this.setMasterForRow(rowNode, item, ClientSideNodeManager.TOP_LEVEL, false);
  43171. rowNodeTransaction.update.push(rowNode);
  43172. });
  43173. };
  43174. ClientSideNodeManager.prototype.addRowNode = function (data, index) {
  43175. var newNode = this.createNode(data, this.rootNode, ClientSideNodeManager.TOP_LEVEL);
  43176. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(index)) {
  43177. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].insertIntoArray(this.rootNode.allLeafChildren, newNode, index);
  43178. }
  43179. else {
  43180. this.rootNode.allLeafChildren.push(newNode);
  43181. }
  43182. return newNode;
  43183. };
  43184. ClientSideNodeManager.prototype.lookupRowNode = function (data) {
  43185. var rowNodeIdFunc = this.gridOptionsWrapper.getRowNodeIdFunc();
  43186. var rowNode;
  43187. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(rowNodeIdFunc)) {
  43188. // find rowNode using id
  43189. var id = rowNodeIdFunc(data);
  43190. rowNode = this.allNodesMap[id];
  43191. if (!rowNode) {
  43192. console.error("ag-Grid: could not find row id=" + id + ", data item was not found for this id");
  43193. return null;
  43194. }
  43195. }
  43196. else {
  43197. // find rowNode using object references
  43198. rowNode = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].find(this.rootNode.allLeafChildren, function (rowNode) { return rowNode.data === data; });
  43199. if (!rowNode) {
  43200. console.error("ag-Grid: could not find data item as object was not found", data);
  43201. return null;
  43202. }
  43203. }
  43204. return rowNode;
  43205. };
  43206. ClientSideNodeManager.prototype.recursiveFunction = function (rowData, parent, level) {
  43207. var _this = this;
  43208. // make sure the rowData is an array and not a string of json - this was a commonly reported problem on the forum
  43209. if (typeof rowData === 'string') {
  43210. console.warn('ag-Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first');
  43211. return;
  43212. }
  43213. var rowNodes = [];
  43214. rowData.forEach(function (dataItem) {
  43215. var node = _this.createNode(dataItem, parent, level);
  43216. rowNodes.push(node);
  43217. });
  43218. return rowNodes;
  43219. };
  43220. ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) {
  43221. var node = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNode"]();
  43222. this.context.createBean(node);
  43223. var nodeChildDetails = this.doingLegacyTreeData ? this.getNodeChildDetails(dataItem) : null;
  43224. if (nodeChildDetails && nodeChildDetails.group) {
  43225. node.group = true;
  43226. node.childrenAfterGroup = this.recursiveFunction(nodeChildDetails.children, node, level + 1);
  43227. node.expanded = nodeChildDetails.expanded === true;
  43228. node.field = nodeChildDetails.field;
  43229. node.key = nodeChildDetails.key;
  43230. // pull out all the leaf children and add to our node
  43231. this.setLeafChildren(node);
  43232. }
  43233. else {
  43234. node.group = false;
  43235. this.setMasterForRow(node, dataItem, level, true);
  43236. }
  43237. // support for backwards compatibility, canFlow is now called 'master'
  43238. /** @deprecated is now 'master' */
  43239. node.canFlower = node.master;
  43240. if (parent && !this.suppressParentsInRowNodes) {
  43241. node.parent = parent;
  43242. }
  43243. node.level = level;
  43244. node.setDataAndId(dataItem, this.nextId.toString());
  43245. if (this.allNodesMap[node.id]) {
  43246. console.warn("ag-grid: duplicate node id '" + node.id + "' detected from getRowNodeId callback, this could cause issues in your grid.");
  43247. }
  43248. this.allNodesMap[node.id] = node;
  43249. this.nextId++;
  43250. return node;
  43251. };
  43252. ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) {
  43253. if (this.doingTreeData) {
  43254. rowNode.setMaster(false);
  43255. if (setExpanded) {
  43256. rowNode.expanded = false;
  43257. }
  43258. }
  43259. else {
  43260. // this is the default, for when doing grid data
  43261. if (this.doesDataFlower) {
  43262. rowNode.setMaster(this.doesDataFlower(data));
  43263. }
  43264. else if (this.doingMasterDetail) {
  43265. // if we are doing master detail, then the
  43266. // default is that everything can be a Master Row.
  43267. if (this.isRowMasterFunc) {
  43268. rowNode.setMaster(this.isRowMasterFunc(data));
  43269. }
  43270. else {
  43271. rowNode.setMaster(true);
  43272. }
  43273. }
  43274. else {
  43275. rowNode.setMaster(false);
  43276. }
  43277. if (setExpanded) {
  43278. var rowGroupColumns = this.columnController.getRowGroupColumns();
  43279. var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0;
  43280. // need to take row group into account when determining level
  43281. var masterRowLevel = level + numRowGroupColumns;
  43282. rowNode.expanded = rowNode.master ? this.isExpanded(masterRowLevel) : false;
  43283. }
  43284. }
  43285. };
  43286. ClientSideNodeManager.prototype.isExpanded = function (level) {
  43287. var expandByDefault = this.gridOptionsWrapper.getGroupDefaultExpanded();
  43288. if (expandByDefault === -1) {
  43289. return true;
  43290. }
  43291. else {
  43292. return level < expandByDefault;
  43293. }
  43294. };
  43295. // this is only used for doing legacy tree data
  43296. ClientSideNodeManager.prototype.setLeafChildren = function (node) {
  43297. node.allLeafChildren = [];
  43298. if (node.childrenAfterGroup) {
  43299. node.childrenAfterGroup.forEach(function (childAfterGroup) {
  43300. if (childAfterGroup.group) {
  43301. if (childAfterGroup.allLeafChildren) {
  43302. childAfterGroup.allLeafChildren.forEach(function (leafChild) { return node.allLeafChildren.push(leafChild); });
  43303. }
  43304. }
  43305. else {
  43306. node.allLeafChildren.push(childAfterGroup);
  43307. }
  43308. });
  43309. }
  43310. };
  43311. ClientSideNodeManager.prototype.isLegacyTreeData = function () {
  43312. var rowsAlreadyGrouped = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.gridOptionsWrapper.getNodeChildDetailsFunc());
  43313. if (rowsAlreadyGrouped) {
  43314. console.warn('ag-Grid: adding and removing rows is not supported when using nodeChildDetailsFunc, ie it is not ' +
  43315. 'supported for legacy tree data. Please see the docs on the new preferred way of providing tree data that works with delta updates.');
  43316. return true;
  43317. }
  43318. else {
  43319. return false;
  43320. }
  43321. };
  43322. ClientSideNodeManager.TOP_LEVEL = 0;
  43323. ClientSideNodeManager.ROOT_NODE_ID = 'ROOT_NODE_ID';
  43324. return ClientSideNodeManager;
  43325. }());
  43326. /***/ }),
  43327. /* 205 */
  43328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43329. "use strict";
  43330. __webpack_require__.r(__webpack_exports__);
  43331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterStage", function() { return FilterStage; });
  43332. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  43333. var __extends = (undefined && undefined.__extends) || (function () {
  43334. var extendStatics = function (d, b) {
  43335. extendStatics = Object.setPrototypeOf ||
  43336. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  43337. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  43338. return extendStatics(d, b);
  43339. };
  43340. return function (d, b) {
  43341. extendStatics(d, b);
  43342. function __() { this.constructor = d; }
  43343. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  43344. };
  43345. })();
  43346. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  43347. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  43348. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  43349. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  43350. return c > 3 && r && Object.defineProperty(target, key, r), r;
  43351. };
  43352. var FilterStage = /** @class */ (function (_super) {
  43353. __extends(FilterStage, _super);
  43354. function FilterStage() {
  43355. return _super !== null && _super.apply(this, arguments) || this;
  43356. }
  43357. FilterStage.prototype.execute = function (params) {
  43358. var rowNode = params.rowNode, changedPath = params.changedPath;
  43359. this.filterService.filter(changedPath);
  43360. this.selectableService.updateSelectableAfterFiltering(rowNode);
  43361. };
  43362. __decorate([
  43363. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  43364. ], FilterStage.prototype, "gridOptionsWrapper", void 0);
  43365. __decorate([
  43366. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectableService')
  43367. ], FilterStage.prototype, "selectableService", void 0);
  43368. __decorate([
  43369. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterService')
  43370. ], FilterStage.prototype, "filterService", void 0);
  43371. FilterStage = __decorate([
  43372. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('filterStage')
  43373. ], FilterStage);
  43374. return FilterStage;
  43375. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  43376. /***/ }),
  43377. /* 206 */
  43378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43379. "use strict";
  43380. __webpack_require__.r(__webpack_exports__);
  43381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortStage", function() { return SortStage; });
  43382. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  43383. var __extends = (undefined && undefined.__extends) || (function () {
  43384. var extendStatics = function (d, b) {
  43385. extendStatics = Object.setPrototypeOf ||
  43386. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  43387. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  43388. return extendStatics(d, b);
  43389. };
  43390. return function (d, b) {
  43391. extendStatics(d, b);
  43392. function __() { this.constructor = d; }
  43393. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  43394. };
  43395. })();
  43396. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  43397. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  43398. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  43399. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  43400. return c > 3 && r && Object.defineProperty(target, key, r), r;
  43401. };
  43402. var SortStage = /** @class */ (function (_super) {
  43403. __extends(SortStage, _super);
  43404. function SortStage() {
  43405. return _super !== null && _super.apply(this, arguments) || this;
  43406. }
  43407. SortStage.prototype.execute = function (params) {
  43408. var sortOptions = this.sortController.getSortForRowController();
  43409. var sortActive = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(sortOptions) && sortOptions.length > 0;
  43410. var deltaSort = sortActive
  43411. && _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(params.rowNodeTransactions)
  43412. // in time we can remove this check, so that delta sort is always
  43413. // on if transactions are present. it's off for now so that we can
  43414. // selectively turn it on and test it with some select users before
  43415. // rolling out to everyone.
  43416. && this.gridOptionsWrapper.isDeltaSort();
  43417. // we only need dirty nodes if doing delta sort
  43418. var dirtyLeafNodes = deltaSort ? this.calculateDirtyNodes(params.rowNodeTransactions) : null;
  43419. var valueColumns = this.columnController.getValueColumns();
  43420. var noAggregations = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missingOrEmpty(valueColumns);
  43421. this.sortService.sort(sortOptions, sortActive, deltaSort, dirtyLeafNodes, params.changedPath, noAggregations);
  43422. };
  43423. SortStage.prototype.calculateDirtyNodes = function (rowNodeTransactions) {
  43424. var dirtyNodes = {};
  43425. var addNodesFunc = function (rowNodes) {
  43426. if (rowNodes) {
  43427. rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; });
  43428. }
  43429. };
  43430. // all leaf level nodes in the transaction were impacted
  43431. rowNodeTransactions.forEach(function (tran) {
  43432. addNodesFunc(tran.add);
  43433. addNodesFunc(tran.update);
  43434. addNodesFunc(tran.remove);
  43435. });
  43436. return dirtyNodes;
  43437. };
  43438. __decorate([
  43439. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  43440. ], SortStage.prototype, "gridOptionsWrapper", void 0);
  43441. __decorate([
  43442. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortService')
  43443. ], SortStage.prototype, "sortService", void 0);
  43444. __decorate([
  43445. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
  43446. ], SortStage.prototype, "sortController", void 0);
  43447. __decorate([
  43448. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  43449. ], SortStage.prototype, "columnController", void 0);
  43450. SortStage = __decorate([
  43451. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('sortStage')
  43452. ], SortStage);
  43453. return SortStage;
  43454. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  43455. /***/ }),
  43456. /* 207 */
  43457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43458. "use strict";
  43459. __webpack_require__.r(__webpack_exports__);
  43460. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FlattenStage", function() { return FlattenStage; });
  43461. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  43462. var __extends = (undefined && undefined.__extends) || (function () {
  43463. var extendStatics = function (d, b) {
  43464. extendStatics = Object.setPrototypeOf ||
  43465. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  43466. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  43467. return extendStatics(d, b);
  43468. };
  43469. return function (d, b) {
  43470. extendStatics(d, b);
  43471. function __() { this.constructor = d; }
  43472. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  43473. };
  43474. })();
  43475. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  43476. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  43477. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  43478. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  43479. return c > 3 && r && Object.defineProperty(target, key, r), r;
  43480. };
  43481. var FlattenStage = /** @class */ (function (_super) {
  43482. __extends(FlattenStage, _super);
  43483. function FlattenStage() {
  43484. return _super !== null && _super.apply(this, arguments) || this;
  43485. }
  43486. FlattenStage.prototype.execute = function (params) {
  43487. var rootNode = params.rowNode;
  43488. // even if not doing grouping, we do the mapping, as the client might
  43489. // of passed in data that already has a grouping in it somewhere
  43490. var result = [];
  43491. // putting value into a wrapper so it's passed by reference
  43492. var nextRowTop = { value: 0 };
  43493. var skipLeafNodes = this.columnController.isPivotMode();
  43494. // if we are reducing, and not grouping, then we want to show the root node, as that
  43495. // is where the pivot values are
  43496. var showRootNode = skipLeafNodes && rootNode.leafGroup;
  43497. var topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort;
  43498. this.recursivelyAddToRowsToDisplay(topList, result, nextRowTop, skipLeafNodes, 0);
  43499. // we do not want the footer total if the gris is empty
  43500. var atLeastOneRowPresent = result.length > 0;
  43501. var includeGroupTotalFooter = !showRootNode
  43502. // don't show total footer when showRootNode is true (i.e. in pivot mode and no groups)
  43503. && atLeastOneRowPresent
  43504. && this.gridOptionsWrapper.isGroupIncludeTotalFooter();
  43505. if (includeGroupTotalFooter) {
  43506. this.ensureFooterNodeExists(rootNode);
  43507. this.addRowNodeToRowsToDisplay(rootNode.sibling, result, nextRowTop, 0);
  43508. }
  43509. return result;
  43510. };
  43511. FlattenStage.prototype.recursivelyAddToRowsToDisplay = function (rowsToFlatten, result, nextRowTop, skipLeafNodes, uiLevel) {
  43512. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missingOrEmpty(rowsToFlatten)) {
  43513. return;
  43514. }
  43515. var groupSuppressRow = this.gridOptionsWrapper.isGroupSuppressRow();
  43516. var hideOpenParents = this.gridOptionsWrapper.isGroupHideOpenParents();
  43517. // these two are mutually exclusive, so if first set, we don't set the second
  43518. var groupRemoveSingleChildren = this.gridOptionsWrapper.isGroupRemoveSingleChildren();
  43519. var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren();
  43520. for (var i = 0; i < rowsToFlatten.length; i++) {
  43521. var rowNode = rowsToFlatten[i];
  43522. // check all these cases, for working out if this row should be included in the final mapped list
  43523. var isParent = rowNode.hasChildren();
  43524. var isGroupSuppressedNode = groupSuppressRow && isParent;
  43525. var isSkippedLeafNode = skipLeafNodes && !isParent;
  43526. var isRemovedSingleChildrenGroup = groupRemoveSingleChildren &&
  43527. isParent &&
  43528. rowNode.childrenAfterGroup.length === 1;
  43529. var isRemovedLowestSingleChildrenGroup = groupRemoveLowestSingleChildren &&
  43530. isParent &&
  43531. rowNode.leafGroup &&
  43532. rowNode.childrenAfterGroup.length === 1;
  43533. // hide open parents means when group is open, we don't show it. we also need to make sure the
  43534. // group is expandable in the first place (as leaf groups are not expandable if pivot mode is on).
  43535. // the UI will never allow expanding leaf groups, however the user might via the API (or menu option 'expand all')
  43536. var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup;
  43537. var isHiddenOpenParent = hideOpenParents && rowNode.expanded && (!neverAllowToExpand);
  43538. var thisRowShouldBeRendered = !isSkippedLeafNode &&
  43539. !isGroupSuppressedNode &&
  43540. !isHiddenOpenParent &&
  43541. !isRemovedSingleChildrenGroup &&
  43542. !isRemovedLowestSingleChildrenGroup;
  43543. if (thisRowShouldBeRendered) {
  43544. this.addRowNodeToRowsToDisplay(rowNode, result, nextRowTop, uiLevel);
  43545. }
  43546. // if we are pivoting, we never map below the leaf group
  43547. if (skipLeafNodes && rowNode.leafGroup) {
  43548. continue;
  43549. }
  43550. if (isParent) {
  43551. var excludedParent = isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup;
  43552. // we traverse the group if it is expended, however we always traverse if the parent node
  43553. // was removed (as the group will never be opened if it is not displayed, we show the children instead)
  43554. if (rowNode.expanded || excludedParent) {
  43555. // if the parent was excluded, then ui level is that of the parent
  43556. var uiLevelForChildren = excludedParent ? uiLevel : uiLevel + 1;
  43557. this.recursivelyAddToRowsToDisplay(rowNode.childrenAfterSort, result, nextRowTop, skipLeafNodes, uiLevelForChildren);
  43558. // put a footer in if user is looking for it
  43559. if (this.gridOptionsWrapper.isGroupIncludeFooter()) {
  43560. this.ensureFooterNodeExists(rowNode);
  43561. this.addRowNodeToRowsToDisplay(rowNode.sibling, result, nextRowTop, uiLevel);
  43562. }
  43563. }
  43564. }
  43565. else if (rowNode.master && rowNode.expanded) {
  43566. var detailNode = this.createDetailNode(rowNode);
  43567. this.addRowNodeToRowsToDisplay(detailNode, result, nextRowTop, uiLevel);
  43568. }
  43569. }
  43570. };
  43571. // duplicated method, it's also in floatingRowModel
  43572. FlattenStage.prototype.addRowNodeToRowsToDisplay = function (rowNode, result, nextRowTop, uiLevel) {
  43573. var isGroupMultiAutoColumn = this.gridOptionsWrapper.isGroupMultiAutoColumn();
  43574. result.push(rowNode);
  43575. rowNode.setUiLevel(isGroupMultiAutoColumn ? 0 : uiLevel);
  43576. };
  43577. FlattenStage.prototype.ensureFooterNodeExists = function (groupNode) {
  43578. // only create footer node once, otherwise we have daemons and
  43579. // the animate screws up with the daemons hanging around
  43580. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(groupNode.sibling)) {
  43581. return;
  43582. }
  43583. var footerNode = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNode"]();
  43584. this.context.createBean(footerNode);
  43585. Object.keys(groupNode).forEach(function (key) {
  43586. footerNode[key] = groupNode[key];
  43587. });
  43588. footerNode.footer = true;
  43589. footerNode.rowTop = null;
  43590. footerNode.oldRowTop = null;
  43591. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(footerNode.id)) {
  43592. footerNode.id = 'rowGroupFooter_' + footerNode.id;
  43593. }
  43594. // get both header and footer to reference each other as siblings. this is never undone,
  43595. // only overwritten. so if a group is expanded, then contracted, it will have a ghost
  43596. // sibling - but that's fine, as we can ignore this if the header is contracted.
  43597. footerNode.sibling = groupNode;
  43598. groupNode.sibling = footerNode;
  43599. };
  43600. FlattenStage.prototype.createDetailNode = function (masterNode) {
  43601. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(masterNode.detailNode)) {
  43602. return masterNode.detailNode;
  43603. }
  43604. var detailNode = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNode"]();
  43605. this.context.createBean(detailNode);
  43606. detailNode.detail = true;
  43607. detailNode.selectable = false;
  43608. // flower was renamed to 'detail', but keeping for backwards compatibility
  43609. detailNode.flower = detailNode.detail;
  43610. detailNode.parent = masterNode;
  43611. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(masterNode.id)) {
  43612. detailNode.id = 'detail_' + masterNode.id;
  43613. }
  43614. detailNode.data = masterNode.data;
  43615. detailNode.level = masterNode.level + 1;
  43616. masterNode.detailNode = detailNode;
  43617. masterNode.childFlower = masterNode.detailNode; // for backwards compatibility
  43618. return detailNode;
  43619. };
  43620. __decorate([
  43621. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  43622. ], FlattenStage.prototype, "gridOptionsWrapper", void 0);
  43623. __decorate([
  43624. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectionController')
  43625. ], FlattenStage.prototype, "selectionController", void 0);
  43626. __decorate([
  43627. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  43628. ], FlattenStage.prototype, "columnController", void 0);
  43629. FlattenStage = __decorate([
  43630. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('flattenStage')
  43631. ], FlattenStage);
  43632. return FlattenStage;
  43633. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  43634. /***/ }),
  43635. /* 208 */
  43636. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43637. "use strict";
  43638. __webpack_require__.r(__webpack_exports__);
  43639. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SortService", function() { return SortService; });
  43640. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  43641. var __extends = (undefined && undefined.__extends) || (function () {
  43642. var extendStatics = function (d, b) {
  43643. extendStatics = Object.setPrototypeOf ||
  43644. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  43645. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  43646. return extendStatics(d, b);
  43647. };
  43648. return function (d, b) {
  43649. extendStatics(d, b);
  43650. function __() { this.constructor = d; }
  43651. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  43652. };
  43653. })();
  43654. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  43655. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  43656. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  43657. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  43658. return c > 3 && r && Object.defineProperty(target, key, r), r;
  43659. };
  43660. var SortService = /** @class */ (function (_super) {
  43661. __extends(SortService, _super);
  43662. function SortService() {
  43663. return _super !== null && _super.apply(this, arguments) || this;
  43664. }
  43665. SortService.prototype.init = function () {
  43666. this.postSortFunc = this.gridOptionsWrapper.getPostSortFunc();
  43667. };
  43668. SortService.prototype.sort = function (sortOptions, sortActive, deltaSort, dirtyLeafNodes, changedPath, noAggregations) {
  43669. var _this = this;
  43670. var callback = function (rowNode) {
  43671. // we clear out the 'pull down open parents' first, as the values mix up the sorting
  43672. _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterFilter, true);
  43673. // Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0,
  43674. // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we
  43675. // are going to inspect the original array position. This is what sortedRowNodes is for.
  43676. if (sortActive) {
  43677. var sortedRowNodes = deltaSort ?
  43678. _this.doDeltaSort(rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations)
  43679. : _this.doFullSort(rowNode, sortOptions);
  43680. rowNode.childrenAfterSort = sortedRowNodes.map(function (sorted) { return sorted.rowNode; });
  43681. }
  43682. else {
  43683. rowNode.childrenAfterSort = rowNode.childrenAfterFilter.slice(0);
  43684. }
  43685. _this.updateChildIndexes(rowNode);
  43686. if (_this.postSortFunc) {
  43687. _this.postSortFunc(rowNode.childrenAfterSort);
  43688. }
  43689. };
  43690. changedPath.forEachChangedNodeDepthFirst(callback);
  43691. this.updateGroupDataForHiddenOpenParents(changedPath);
  43692. };
  43693. SortService.prototype.doFullSort = function (rowNode, sortOptions) {
  43694. var sortedRowNodes = rowNode.childrenAfterFilter
  43695. .map(this.mapNodeToSortedNode.bind(this));
  43696. sortedRowNodes.sort(this.compareRowNodes.bind(this, sortOptions));
  43697. return sortedRowNodes;
  43698. };
  43699. SortService.prototype.mapNodeToSortedNode = function (rowNode, pos) {
  43700. return { currentPos: pos, rowNode: rowNode };
  43701. };
  43702. SortService.prototype.doDeltaSort = function (rowNode, sortOptions, dirtyLeafNodes, changedPath, noAggregations) {
  43703. // clean nodes will be a list of all row nodes that remain in the set
  43704. // and ordered. we start with the old sorted set and take out any nodes
  43705. // that were removed or changed (but not added, added doesn't make sense,
  43706. // if a node was added, there is no way it could be here from last time).
  43707. var cleanNodes = rowNode.childrenAfterSort
  43708. .filter(function (rowNode) {
  43709. // take out all nodes that were changed as part of the current transaction.
  43710. // a changed node could a) be in a different sort position or b) may
  43711. // no longer be in this set as the changed node may not pass filtering,
  43712. // or be in a different group.
  43713. var passesDirtyNodesCheck = !dirtyLeafNodes[rowNode.id];
  43714. // also remove group nodes in the changed path, as they can have different aggregate
  43715. // values which could impact the sort order.
  43716. // note: changed path is not active if a) no value columns or b) no transactions. it is never
  43717. // (b) in deltaSort as we only do deltaSort for transactions. for (a) if no value columns, then
  43718. // there is no value in the group that could of changed (ie no aggregate values)
  43719. var passesChangedPathCheck = noAggregations || changedPath.canSkip(rowNode);
  43720. return passesDirtyNodesCheck && passesChangedPathCheck;
  43721. })
  43722. .map(this.mapNodeToSortedNode.bind(this));
  43723. // for fast access below, we map them
  43724. var cleanNodesMapped = {};
  43725. cleanNodes.forEach(function (sortedRowNode) { return cleanNodesMapped[sortedRowNode.rowNode.id] = sortedRowNode.rowNode; });
  43726. // these are all nodes that need to be placed
  43727. var changedNodes = rowNode.childrenAfterFilter
  43728. // ignore nodes in the clean list
  43729. .filter(function (rowNode) { return !cleanNodesMapped[rowNode.id]; })
  43730. .map(this.mapNodeToSortedNode.bind(this));
  43731. // sort changed nodes. note that we don't need to sort cleanNodes as they are
  43732. // already sorted from last time.
  43733. changedNodes.sort(this.compareRowNodes.bind(this, sortOptions));
  43734. if (changedNodes.length === 0) {
  43735. return cleanNodes;
  43736. }
  43737. else if (cleanNodes.length === 0) {
  43738. return changedNodes;
  43739. }
  43740. else {
  43741. return this.mergeSortedArrays(sortOptions, cleanNodes, changedNodes);
  43742. }
  43743. };
  43744. // Merge two sorted arrays into each other
  43745. SortService.prototype.mergeSortedArrays = function (sortOptions, arr1, arr2) {
  43746. var res = [];
  43747. var i = 0;
  43748. var j = 0;
  43749. // Traverse both array, adding them in order
  43750. while (i < arr1.length && j < arr2.length) {
  43751. // Check if current element of first
  43752. // array is smaller than current element
  43753. // of second array. If yes, store first
  43754. // array element and increment first array
  43755. // index. Otherwise do same with second array
  43756. var compareResult = this.compareRowNodes(sortOptions, arr1[i], arr2[j]);
  43757. if (compareResult < 0) {
  43758. res.push(arr1[i++]);
  43759. }
  43760. else {
  43761. res.push(arr2[j++]);
  43762. }
  43763. }
  43764. // add remaining from arr1
  43765. while (i < arr1.length) {
  43766. res.push(arr1[i++]);
  43767. }
  43768. // add remaining from arr2
  43769. while (j < arr2.length) {
  43770. res.push(arr2[j++]);
  43771. }
  43772. return res;
  43773. };
  43774. SortService.prototype.compareRowNodes = function (sortOptions, sortedNodeA, sortedNodeB) {
  43775. var nodeA = sortedNodeA.rowNode;
  43776. var nodeB = sortedNodeB.rowNode;
  43777. // Iterate columns, return the first that doesn't match
  43778. for (var i = 0, len = sortOptions.length; i < len; i++) {
  43779. var sortOption = sortOptions[i];
  43780. // let compared = compare(nodeA, nodeB, sortOption.column, sortOption.inverter === -1);
  43781. var isInverted = sortOption.inverter === -1;
  43782. var valueA = this.getValue(nodeA, sortOption.column);
  43783. var valueB = this.getValue(nodeB, sortOption.column);
  43784. var comparatorResult = void 0;
  43785. if (sortOption.column.getColDef().comparator) {
  43786. //if comparator provided, use it
  43787. comparatorResult = sortOption.column.getColDef().comparator(valueA, valueB, nodeA, nodeB, isInverted);
  43788. }
  43789. else {
  43790. //otherwise do our own comparison
  43791. comparatorResult = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].defaultComparator(valueA, valueB, this.gridOptionsWrapper.isAccentedSort());
  43792. }
  43793. if (comparatorResult !== 0) {
  43794. return comparatorResult * sortOption.inverter;
  43795. }
  43796. }
  43797. // All matched, we make is so that the original sort order is kept:
  43798. return sortedNodeA.currentPos - sortedNodeB.currentPos;
  43799. };
  43800. SortService.prototype.getValue = function (nodeA, column) {
  43801. return this.valueService.getValue(column, nodeA);
  43802. };
  43803. SortService.prototype.updateChildIndexes = function (rowNode) {
  43804. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(rowNode.childrenAfterSort)) {
  43805. return;
  43806. }
  43807. var listToSort = rowNode.childrenAfterSort;
  43808. for (var i = 0; i < listToSort.length; i++) {
  43809. var child = listToSort[i];
  43810. var firstChild = i === 0;
  43811. var lastChild = i === rowNode.childrenAfterSort.length - 1;
  43812. child.setFirstChild(firstChild);
  43813. child.setLastChild(lastChild);
  43814. child.setChildIndex(i);
  43815. }
  43816. };
  43817. SortService.prototype.updateGroupDataForHiddenOpenParents = function (changedPath) {
  43818. var _this = this;
  43819. if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {
  43820. return;
  43821. }
  43822. // recurse breadth first over group nodes after sort to 'pull down' group data to child groups
  43823. var callback = function (rowNode) {
  43824. _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterSort, false);
  43825. rowNode.childrenAfterSort.forEach(function (child) {
  43826. if (child.hasChildren()) {
  43827. callback(child);
  43828. }
  43829. });
  43830. };
  43831. changedPath.executeFromRootNode(function (rowNode) { return callback(rowNode); });
  43832. };
  43833. SortService.prototype.pullDownGroupDataForHideOpenParents = function (rowNodes, clearOperation) {
  43834. var _this = this;
  43835. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(rowNodes)) {
  43836. return;
  43837. }
  43838. if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {
  43839. return;
  43840. }
  43841. rowNodes.forEach(function (childRowNode) {
  43842. var groupDisplayCols = _this.columnController.getGroupDisplayColumns();
  43843. groupDisplayCols.forEach(function (groupDisplayCol) {
  43844. var showRowGroup = groupDisplayCol.getColDef().showRowGroup;
  43845. if (typeof showRowGroup !== 'string') {
  43846. console.error('ag-Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup');
  43847. return;
  43848. }
  43849. var displayingGroupKey = showRowGroup;
  43850. var rowGroupColumn = _this.columnController.getPrimaryColumn(displayingGroupKey);
  43851. var thisRowNodeMatches = rowGroupColumn === childRowNode.rowGroupColumn;
  43852. if (thisRowNodeMatches) {
  43853. return;
  43854. }
  43855. if (clearOperation) {
  43856. // if doing a clear operation, we clear down the value for every possible group column
  43857. childRowNode.setGroupValue(groupDisplayCol.getId(), null);
  43858. }
  43859. else {
  43860. // if doing a set operation, we set only where the pull down is to occur
  43861. var parentToStealFrom = childRowNode.getFirstChildOfFirstChild(rowGroupColumn);
  43862. if (parentToStealFrom) {
  43863. childRowNode.setGroupValue(groupDisplayCol.getId(), parentToStealFrom.key);
  43864. }
  43865. }
  43866. });
  43867. });
  43868. };
  43869. __decorate([
  43870. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
  43871. ], SortService.prototype, "sortController", void 0);
  43872. __decorate([
  43873. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  43874. ], SortService.prototype, "columnController", void 0);
  43875. __decorate([
  43876. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueService')
  43877. ], SortService.prototype, "valueService", void 0);
  43878. __decorate([
  43879. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  43880. ], SortService.prototype, "gridOptionsWrapper", void 0);
  43881. __decorate([
  43882. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  43883. ], SortService.prototype, "init", null);
  43884. SortService = __decorate([
  43885. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('sortService')
  43886. ], SortService);
  43887. return SortService;
  43888. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  43889. /***/ }),
  43890. /* 209 */
  43891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43892. "use strict";
  43893. __webpack_require__.r(__webpack_exports__);
  43894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterService", function() { return FilterService; });
  43895. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  43896. var __extends = (undefined && undefined.__extends) || (function () {
  43897. var extendStatics = function (d, b) {
  43898. extendStatics = Object.setPrototypeOf ||
  43899. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  43900. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  43901. return extendStatics(d, b);
  43902. };
  43903. return function (d, b) {
  43904. extendStatics(d, b);
  43905. function __() { this.constructor = d; }
  43906. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  43907. };
  43908. })();
  43909. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  43910. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  43911. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  43912. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  43913. return c > 3 && r && Object.defineProperty(target, key, r), r;
  43914. };
  43915. var FilterService = /** @class */ (function (_super) {
  43916. __extends(FilterService, _super);
  43917. function FilterService() {
  43918. return _super !== null && _super.apply(this, arguments) || this;
  43919. }
  43920. FilterService.prototype.postConstruct = function () {
  43921. this.doingTreeData = this.gridOptionsWrapper.isTreeData();
  43922. };
  43923. FilterService.prototype.filter = function (changedPath) {
  43924. var filterActive = this.filterManager.isAnyFilterPresent();
  43925. this.filterNodes(filterActive, changedPath);
  43926. };
  43927. FilterService.prototype.filterNodes = function (filterActive, changedPath) {
  43928. var _this = this;
  43929. var filterCallback = function (rowNode, includeChildNodes) {
  43930. // recursively get all children that are groups to also filter
  43931. if (rowNode.hasChildren()) {
  43932. // result of filter for this node. when filtering tree data, includeChildNodes = true when parent passes
  43933. if (filterActive && !includeChildNodes) {
  43934. rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter(function (childNode) {
  43935. // a group is included in the result if it has any children of it's own.
  43936. // by this stage, the child groups are already filtered
  43937. var passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0;
  43938. // both leaf level nodes and tree data nodes have data. these get added if
  43939. // the data passes the filter
  43940. var passBecauseDataPasses = childNode.data && _this.filterManager.doesRowPassFilter(childNode);
  43941. // note - tree data nodes pass either if a) they pass themselves or b) any children of that node pass
  43942. return passBecauseChildren || passBecauseDataPasses;
  43943. });
  43944. }
  43945. else {
  43946. // if not filtering, the result is the original list
  43947. rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
  43948. }
  43949. _this.setAllChildrenCount(rowNode);
  43950. }
  43951. else {
  43952. rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;
  43953. rowNode.setAllChildrenCount(null);
  43954. }
  43955. };
  43956. if (this.doingTreeDataFiltering()) {
  43957. var treeDataDepthFirstFilter_1 = function (rowNode, alreadyFoundInParent) {
  43958. // tree data filter traverses the hierarchy depth first and includes child nodes if parent passes
  43959. // filter, and parent nodes will be include if any children exist.
  43960. if (rowNode.childrenAfterGroup) {
  43961. for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {
  43962. var childNode = rowNode.childrenAfterGroup[i];
  43963. // first check if current node passes filter before invoking child nodes
  43964. var foundInParent = alreadyFoundInParent || _this.filterManager.doesRowPassFilter(childNode);
  43965. if (childNode.childrenAfterGroup) {
  43966. treeDataDepthFirstFilter_1(rowNode.childrenAfterGroup[i], foundInParent);
  43967. }
  43968. else {
  43969. filterCallback(childNode, foundInParent);
  43970. }
  43971. }
  43972. }
  43973. filterCallback(rowNode, alreadyFoundInParent);
  43974. };
  43975. var treeDataFilterCallback = function (rowNode) { return treeDataDepthFirstFilter_1(rowNode, false); };
  43976. changedPath.executeFromRootNode(treeDataFilterCallback);
  43977. }
  43978. else {
  43979. var defaultFilterCallback = function (rowNode) { return filterCallback(rowNode, false); };
  43980. changedPath.forEachChangedNodeDepthFirst(defaultFilterCallback, true);
  43981. }
  43982. };
  43983. FilterService.prototype.setAllChildrenCountTreeData = function (rowNode) {
  43984. // for tree data, we include all children, groups and leafs
  43985. var allChildrenCount = 0;
  43986. rowNode.childrenAfterFilter.forEach(function (child) {
  43987. // include child itself
  43988. allChildrenCount++;
  43989. // include children of children
  43990. allChildrenCount += child.allChildrenCount;
  43991. });
  43992. rowNode.setAllChildrenCount(allChildrenCount);
  43993. };
  43994. FilterService.prototype.setAllChildrenCountGridGrouping = function (rowNode) {
  43995. // for grid data, we only count the leafs
  43996. var allChildrenCount = 0;
  43997. rowNode.childrenAfterFilter.forEach(function (child) {
  43998. if (child.group) {
  43999. allChildrenCount += child.allChildrenCount;
  44000. }
  44001. else {
  44002. allChildrenCount++;
  44003. }
  44004. });
  44005. rowNode.setAllChildrenCount(allChildrenCount);
  44006. };
  44007. FilterService.prototype.setAllChildrenCount = function (rowNode) {
  44008. if (this.doingTreeData) {
  44009. this.setAllChildrenCountTreeData(rowNode);
  44010. }
  44011. else {
  44012. this.setAllChildrenCountGridGrouping(rowNode);
  44013. }
  44014. };
  44015. FilterService.prototype.doingTreeDataFiltering = function () {
  44016. return this.gridOptionsWrapper.isTreeData() && !this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering();
  44017. };
  44018. __decorate([
  44019. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  44020. ], FilterService.prototype, "filterManager", void 0);
  44021. __decorate([
  44022. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  44023. ], FilterService.prototype, "gridOptionsWrapper", void 0);
  44024. __decorate([
  44025. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  44026. ], FilterService.prototype, "postConstruct", null);
  44027. FilterService = __decorate([
  44028. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])("filterService")
  44029. ], FilterService);
  44030. return FilterService;
  44031. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  44032. /***/ }),
  44033. /* 210 */
  44034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44035. "use strict";
  44036. __webpack_require__.r(__webpack_exports__);
  44037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmutableService", function() { return ImmutableService; });
  44038. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44039. var __extends = (undefined && undefined.__extends) || (function () {
  44040. var extendStatics = function (d, b) {
  44041. extendStatics = Object.setPrototypeOf ||
  44042. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  44043. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  44044. return extendStatics(d, b);
  44045. };
  44046. return function (d, b) {
  44047. extendStatics(d, b);
  44048. function __() { this.constructor = d; }
  44049. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  44050. };
  44051. })();
  44052. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  44053. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  44054. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  44055. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  44056. return c > 3 && r && Object.defineProperty(target, key, r), r;
  44057. };
  44058. var ImmutableService = /** @class */ (function (_super) {
  44059. __extends(ImmutableService, _super);
  44060. function ImmutableService() {
  44061. return _super !== null && _super.apply(this, arguments) || this;
  44062. }
  44063. ImmutableService.prototype.postConstruct = function () {
  44064. if (this.rowModel.getType() === _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE) {
  44065. this.clientSideRowModel = this.rowModel;
  44066. }
  44067. };
  44068. // converts the setRowData() command to a transaction
  44069. ImmutableService.prototype.createTransactionForRowData = function (data) {
  44070. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.clientSideRowModel)) {
  44071. console.error('ag-Grid: ImmutableService only works with ClientSideRowModel');
  44072. return;
  44073. }
  44074. var getRowNodeIdFunc = this.gridOptionsWrapper.getRowNodeIdFunc();
  44075. if (!getRowNodeIdFunc || _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(getRowNodeIdFunc)) {
  44076. console.error('ag-Grid: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs!');
  44077. return;
  44078. }
  44079. // convert the data into a transaction object by working out adds, removes and updates
  44080. var transaction = {
  44081. remove: [],
  44082. update: [],
  44083. add: []
  44084. };
  44085. var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap();
  44086. var suppressSortOrder = this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder();
  44087. var orderMap = suppressSortOrder ? null : {};
  44088. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(data)) {
  44089. // split all the new data in the following:
  44090. // if new, push to 'add'
  44091. // if update, push to 'update'
  44092. // if not changed, do not include in the transaction
  44093. data.forEach(function (dataItem, index) {
  44094. var id = getRowNodeIdFunc(dataItem);
  44095. var existingNode = existingNodesMap[id];
  44096. if (orderMap) {
  44097. orderMap[id] = index;
  44098. }
  44099. if (existingNode) {
  44100. var dataHasChanged = existingNode.data !== dataItem;
  44101. if (dataHasChanged) {
  44102. transaction.update.push(dataItem);
  44103. }
  44104. // otherwise, if data not changed, we just don't include it anywhere, as it's not a delta
  44105. // remove from list, so we know the item is not to be removed
  44106. existingNodesMap[id] = undefined;
  44107. }
  44108. else {
  44109. transaction.add.push(dataItem);
  44110. }
  44111. });
  44112. }
  44113. // at this point, all rows that are left, should be removed
  44114. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].iterateObject(existingNodesMap, function (id, rowNode) {
  44115. if (rowNode) {
  44116. transaction.remove.push(rowNode.data);
  44117. }
  44118. });
  44119. return [transaction, orderMap];
  44120. };
  44121. __decorate([
  44122. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  44123. ], ImmutableService.prototype, "rowModel", void 0);
  44124. __decorate([
  44125. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  44126. ], ImmutableService.prototype, "gridOptionsWrapper", void 0);
  44127. __decorate([
  44128. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  44129. ], ImmutableService.prototype, "postConstruct", null);
  44130. ImmutableService = __decorate([
  44131. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('immutableService')
  44132. ], ImmutableService);
  44133. return ImmutableService;
  44134. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  44135. /***/ }),
  44136. /* 211 */
  44137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44138. "use strict";
  44139. __webpack_require__.r(__webpack_exports__);
  44140. /* harmony import */ var _csvExportModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(212);
  44141. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CsvExportModule", function() { return _csvExportModule__WEBPACK_IMPORTED_MODULE_0__["CsvExportModule"]; });
  44142. /* harmony import */ var _csvExport_csvCreator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
  44143. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseCreator", function() { return _csvExport_csvCreator__WEBPACK_IMPORTED_MODULE_1__["BaseCreator"]; });
  44144. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CsvCreator", function() { return _csvExport_csvCreator__WEBPACK_IMPORTED_MODULE_1__["CsvCreator"]; });
  44145. /* harmony import */ var _csvExport_downloader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(215);
  44146. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Downloader", function() { return _csvExport_downloader__WEBPACK_IMPORTED_MODULE_2__["Downloader"]; });
  44147. /* harmony import */ var _csvExport_gridSerializer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(214);
  44148. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridSerializer", function() { return _csvExport_gridSerializer__WEBPACK_IMPORTED_MODULE_3__["GridSerializer"]; });
  44149. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowType", function() { return _csvExport_gridSerializer__WEBPACK_IMPORTED_MODULE_3__["RowType"]; });
  44150. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseGridSerializingSession", function() { return _csvExport_gridSerializer__WEBPACK_IMPORTED_MODULE_3__["BaseGridSerializingSession"]; });
  44151. /* harmony import */ var _csvExport_zipContainer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(217);
  44152. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ZipContainer", function() { return _csvExport_zipContainer__WEBPACK_IMPORTED_MODULE_4__["ZipContainer"]; });
  44153. /* harmony import */ var _csvExport_xmlFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(216);
  44154. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlFactory", function() { return _csvExport_xmlFactory__WEBPACK_IMPORTED_MODULE_5__["XmlFactory"]; });
  44155. /***/ }),
  44156. /* 212 */
  44157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44158. "use strict";
  44159. __webpack_require__.r(__webpack_exports__);
  44160. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CsvExportModule", function() { return CsvExportModule; });
  44161. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44162. /* harmony import */ var _csvExport_csvCreator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213);
  44163. /* harmony import */ var _csvExport_downloader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(215);
  44164. /* harmony import */ var _csvExport_xmlFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(216);
  44165. /* harmony import */ var _csvExport_gridSerializer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(214);
  44166. /* harmony import */ var _csvExport_zipContainer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(217);
  44167. var CsvExportModule = {
  44168. moduleName: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["ModuleNames"].CsvExportModule,
  44169. beans: [_csvExport_csvCreator__WEBPACK_IMPORTED_MODULE_1__["CsvCreator"], _csvExport_downloader__WEBPACK_IMPORTED_MODULE_2__["Downloader"], _csvExport_xmlFactory__WEBPACK_IMPORTED_MODULE_3__["XmlFactory"], _csvExport_gridSerializer__WEBPACK_IMPORTED_MODULE_4__["GridSerializer"], _csvExport_zipContainer__WEBPACK_IMPORTED_MODULE_5__["ZipContainer"]]
  44170. };
  44171. /***/ }),
  44172. /* 213 */
  44173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44174. "use strict";
  44175. __webpack_require__.r(__webpack_exports__);
  44176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CsvSerializingSession", function() { return CsvSerializingSession; });
  44177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseCreator", function() { return BaseCreator; });
  44178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CsvCreator", function() { return CsvCreator; });
  44179. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44180. /* harmony import */ var _gridSerializer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(214);
  44181. var __extends = (undefined && undefined.__extends) || (function () {
  44182. var extendStatics = function (d, b) {
  44183. extendStatics = Object.setPrototypeOf ||
  44184. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  44185. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  44186. return extendStatics(d, b);
  44187. };
  44188. return function (d, b) {
  44189. extendStatics(d, b);
  44190. function __() { this.constructor = d; }
  44191. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  44192. };
  44193. })();
  44194. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  44195. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  44196. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  44197. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  44198. return c > 3 && r && Object.defineProperty(target, key, r), r;
  44199. };
  44200. var LINE_SEPARATOR = '\r\n';
  44201. var CsvSerializingSession = /** @class */ (function (_super) {
  44202. __extends(CsvSerializingSession, _super);
  44203. function CsvSerializingSession(config) {
  44204. var _this = _super.call(this, config) || this;
  44205. _this.isFirstLine = true;
  44206. _this.result = '';
  44207. var suppressQuotes = config.suppressQuotes, columnSeparator = config.columnSeparator;
  44208. _this.suppressQuotes = suppressQuotes;
  44209. _this.columnSeparator = columnSeparator;
  44210. return _this;
  44211. }
  44212. CsvSerializingSession.prototype.addCustomContent = function (content) {
  44213. var _this = this;
  44214. if (!content) {
  44215. return;
  44216. }
  44217. if (typeof content === 'string') {
  44218. // we used to require the customFooter to be prefixed with a newline but no longer do,
  44219. // so only add the newline if the user has not supplied one
  44220. if (!/^\s*\n/.test(content)) {
  44221. this.beginNewLine();
  44222. }
  44223. // replace whatever newlines are supplied with the style we're using
  44224. content = content.replace(/\r?\n/g, LINE_SEPARATOR);
  44225. this.result += content;
  44226. }
  44227. else {
  44228. content.forEach(function (row) {
  44229. _this.beginNewLine();
  44230. row.forEach(function (cell, index) {
  44231. if (index !== 0) {
  44232. _this.result += _this.columnSeparator;
  44233. }
  44234. _this.result += _this.putInQuotes(cell.data.value || '');
  44235. if (cell.mergeAcross) {
  44236. _this.appendEmptyCells(cell.mergeAcross);
  44237. }
  44238. });
  44239. });
  44240. }
  44241. };
  44242. CsvSerializingSession.prototype.onNewHeaderGroupingRow = function () {
  44243. this.beginNewLine();
  44244. return {
  44245. onColumn: this.onNewHeaderGroupingRowColumn.bind(this)
  44246. };
  44247. };
  44248. CsvSerializingSession.prototype.onNewHeaderGroupingRowColumn = function (header, index, span) {
  44249. if (index != 0) {
  44250. this.result += this.columnSeparator;
  44251. }
  44252. this.result += this.putInQuotes(header);
  44253. this.appendEmptyCells(span);
  44254. };
  44255. CsvSerializingSession.prototype.appendEmptyCells = function (count) {
  44256. for (var i = 1; i <= count; i++) {
  44257. this.result += this.columnSeparator + this.putInQuotes("");
  44258. }
  44259. };
  44260. CsvSerializingSession.prototype.onNewHeaderRow = function () {
  44261. this.beginNewLine();
  44262. return {
  44263. onColumn: this.onNewHeaderRowColumn.bind(this)
  44264. };
  44265. };
  44266. CsvSerializingSession.prototype.onNewHeaderRowColumn = function (column, index, node) {
  44267. if (index != 0) {
  44268. this.result += this.columnSeparator;
  44269. }
  44270. this.result += this.putInQuotes(this.extractHeaderValue(column));
  44271. };
  44272. CsvSerializingSession.prototype.onNewBodyRow = function () {
  44273. this.beginNewLine();
  44274. return {
  44275. onColumn: this.onNewBodyRowColumn.bind(this)
  44276. };
  44277. };
  44278. CsvSerializingSession.prototype.onNewBodyRowColumn = function (column, index, node) {
  44279. if (index != 0) {
  44280. this.result += this.columnSeparator;
  44281. }
  44282. this.result += this.putInQuotes(this.extractRowCellValue(column, index, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].EXPORT_TYPE_CSV, node));
  44283. };
  44284. CsvSerializingSession.prototype.putInQuotes = function (value) {
  44285. if (this.suppressQuotes) {
  44286. return value;
  44287. }
  44288. if (value === null || value === undefined) {
  44289. return '""';
  44290. }
  44291. var stringValue;
  44292. if (typeof value === 'string') {
  44293. stringValue = value;
  44294. }
  44295. else if (typeof value.toString === 'function') {
  44296. stringValue = value.toString();
  44297. }
  44298. else {
  44299. console.warn('unknown value type during csv conversion');
  44300. stringValue = '';
  44301. }
  44302. // replace each " with "" (ie two sets of double quotes is how to do double quotes in csv)
  44303. var valueEscaped = stringValue.replace(/"/g, "\"\"");
  44304. return '"' + valueEscaped + '"';
  44305. };
  44306. CsvSerializingSession.prototype.parse = function () {
  44307. return this.result;
  44308. };
  44309. CsvSerializingSession.prototype.beginNewLine = function () {
  44310. if (!this.isFirstLine) {
  44311. this.result += LINE_SEPARATOR;
  44312. }
  44313. this.isFirstLine = false;
  44314. };
  44315. return CsvSerializingSession;
  44316. }(_gridSerializer__WEBPACK_IMPORTED_MODULE_1__["BaseGridSerializingSession"]));
  44317. var BaseCreator = /** @class */ (function () {
  44318. function BaseCreator() {
  44319. }
  44320. BaseCreator.prototype.setBeans = function (beans) {
  44321. this.beans = beans;
  44322. };
  44323. BaseCreator.prototype.export = function (userParams) {
  44324. if (this.isExportSuppressed()) {
  44325. console.warn("ag-grid: Export cancelled. Export is not allowed as per your configuration.");
  44326. return '';
  44327. }
  44328. var _a = this.getMergedParamsAndData(userParams), mergedParams = _a.mergedParams, data = _a.data;
  44329. var fileNamePresent = mergedParams && mergedParams.fileName && mergedParams.fileName.length !== 0;
  44330. var fileName = fileNamePresent ? mergedParams.fileName : this.getDefaultFileName();
  44331. if (fileName.indexOf(".") === -1) {
  44332. fileName = fileName + "." + this.getDefaultFileExtension();
  44333. }
  44334. this.beans.downloader.download(fileName, this.packageFile(data));
  44335. return data;
  44336. };
  44337. BaseCreator.prototype.getData = function (params) {
  44338. return this.getMergedParamsAndData(params).data;
  44339. };
  44340. BaseCreator.prototype.getMergedParamsAndData = function (userParams) {
  44341. var mergedParams = this.mergeDefaultParams(userParams);
  44342. var data = this.beans.gridSerializer.serialize(this.createSerializingSession(mergedParams), mergedParams);
  44343. return { mergedParams: mergedParams, data: data };
  44344. };
  44345. BaseCreator.prototype.mergeDefaultParams = function (userParams) {
  44346. var baseParams = this.beans.gridOptionsWrapper.getDefaultExportParams();
  44347. var params = {};
  44348. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].assign(params, baseParams);
  44349. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].assign(params, userParams);
  44350. return params;
  44351. };
  44352. BaseCreator.prototype.packageFile = function (data) {
  44353. return new Blob(["\ufeff", data], {
  44354. type: window.navigator.msSaveOrOpenBlob ? this.getMimeType() : 'octet/stream'
  44355. });
  44356. };
  44357. return BaseCreator;
  44358. }());
  44359. var CsvCreator = /** @class */ (function (_super) {
  44360. __extends(CsvCreator, _super);
  44361. function CsvCreator() {
  44362. return _super !== null && _super.apply(this, arguments) || this;
  44363. }
  44364. CsvCreator.prototype.postConstruct = function () {
  44365. this.setBeans({
  44366. downloader: this.downloader,
  44367. gridSerializer: this.gridSerializer,
  44368. gridOptionsWrapper: this.gridOptionsWrapper
  44369. });
  44370. };
  44371. CsvCreator.prototype.exportDataAsCsv = function (params) {
  44372. return this.export(params);
  44373. };
  44374. CsvCreator.prototype.getDataAsCsv = function (params) {
  44375. return this.getData(params);
  44376. };
  44377. CsvCreator.prototype.getMimeType = function () {
  44378. return 'text/csv;charset=utf-8;';
  44379. };
  44380. CsvCreator.prototype.getDefaultFileName = function () {
  44381. return 'export.csv';
  44382. };
  44383. CsvCreator.prototype.getDefaultFileExtension = function () {
  44384. return 'csv';
  44385. };
  44386. CsvCreator.prototype.createSerializingSession = function (params) {
  44387. var _a = this, columnController = _a.columnController, valueService = _a.valueService, gridOptionsWrapper = _a.gridOptionsWrapper;
  44388. var processCellCallback = params.processCellCallback, processHeaderCallback = params.processHeaderCallback, processGroupHeaderCallback = params.processGroupHeaderCallback, processRowGroupCallback = params.processRowGroupCallback, suppressQuotes = params.suppressQuotes, columnSeparator = params.columnSeparator;
  44389. return new CsvSerializingSession({
  44390. columnController: columnController,
  44391. valueService: valueService,
  44392. gridOptionsWrapper: gridOptionsWrapper,
  44393. processCellCallback: processCellCallback || undefined,
  44394. processHeaderCallback: processHeaderCallback || undefined,
  44395. processGroupHeaderCallback: processGroupHeaderCallback || undefined,
  44396. processRowGroupCallback: processRowGroupCallback || undefined,
  44397. suppressQuotes: suppressQuotes || false,
  44398. columnSeparator: columnSeparator || ','
  44399. });
  44400. };
  44401. CsvCreator.prototype.isExportSuppressed = function () {
  44402. return this.gridOptionsWrapper.isSuppressCsvExport();
  44403. };
  44404. __decorate([
  44405. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  44406. ], CsvCreator.prototype, "columnController", void 0);
  44407. __decorate([
  44408. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('valueService')
  44409. ], CsvCreator.prototype, "valueService", void 0);
  44410. __decorate([
  44411. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('downloader')
  44412. ], CsvCreator.prototype, "downloader", void 0);
  44413. __decorate([
  44414. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridSerializer')
  44415. ], CsvCreator.prototype, "gridSerializer", void 0);
  44416. __decorate([
  44417. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  44418. ], CsvCreator.prototype, "gridOptionsWrapper", void 0);
  44419. __decorate([
  44420. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  44421. ], CsvCreator.prototype, "postConstruct", null);
  44422. CsvCreator = __decorate([
  44423. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('csvCreator')
  44424. ], CsvCreator);
  44425. return CsvCreator;
  44426. }(BaseCreator));
  44427. /***/ }),
  44428. /* 214 */
  44429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44430. "use strict";
  44431. __webpack_require__.r(__webpack_exports__);
  44432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseGridSerializingSession", function() { return BaseGridSerializingSession; });
  44433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GridSerializer", function() { return GridSerializer; });
  44434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RowType", function() { return RowType; });
  44435. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44436. var __extends = (undefined && undefined.__extends) || (function () {
  44437. var extendStatics = function (d, b) {
  44438. extendStatics = Object.setPrototypeOf ||
  44439. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  44440. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  44441. return extendStatics(d, b);
  44442. };
  44443. return function (d, b) {
  44444. extendStatics(d, b);
  44445. function __() { this.constructor = d; }
  44446. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  44447. };
  44448. })();
  44449. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  44450. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  44451. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  44452. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  44453. return c > 3 && r && Object.defineProperty(target, key, r), r;
  44454. };
  44455. var BaseGridSerializingSession = /** @class */ (function () {
  44456. function BaseGridSerializingSession(config) {
  44457. var columnController = config.columnController, valueService = config.valueService, gridOptionsWrapper = config.gridOptionsWrapper, processCellCallback = config.processCellCallback, processHeaderCallback = config.processHeaderCallback, processGroupHeaderCallback = config.processGroupHeaderCallback, processRowGroupCallback = config.processRowGroupCallback;
  44458. this.columnController = columnController;
  44459. this.valueService = valueService;
  44460. this.gridOptionsWrapper = gridOptionsWrapper;
  44461. this.processCellCallback = processCellCallback;
  44462. this.processHeaderCallback = processHeaderCallback;
  44463. this.processGroupHeaderCallback = processGroupHeaderCallback;
  44464. this.processRowGroupCallback = processRowGroupCallback;
  44465. }
  44466. BaseGridSerializingSession.prototype.prepare = function (columnsToExport) {
  44467. this.firstGroupColumn = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].find(columnsToExport, function (col) { return !!col.getColDef().showRowGroup; });
  44468. };
  44469. BaseGridSerializingSession.prototype.extractHeaderValue = function (column) {
  44470. var value = this.getHeaderName(this.processHeaderCallback, column);
  44471. return value != null ? value : '';
  44472. };
  44473. BaseGridSerializingSession.prototype.extractRowCellValue = function (column, index, type, node) {
  44474. // we render the group summary text e.g. "-> Parent -> Child"...
  44475. var renderGroupSummaryCell =
  44476. // on group rows
  44477. node && node.group
  44478. && (
  44479. // in the first group column if groups appear in regular grid cells
  44480. column === this.firstGroupColumn
  44481. // or the first cell in the row, if we're doing full width rows
  44482. || (index === 0 && this.gridOptionsWrapper.isGroupUseEntireRow(this.columnController.isPivotMode())));
  44483. var valueForCell;
  44484. if (renderGroupSummaryCell) {
  44485. valueForCell = this.createValueForGroupNode(node);
  44486. }
  44487. else {
  44488. valueForCell = this.valueService.getValue(column, node);
  44489. }
  44490. var value = this.processCell(node, column, valueForCell, this.processCellCallback, type);
  44491. return value != null ? value : '';
  44492. };
  44493. BaseGridSerializingSession.prototype.getHeaderName = function (callback, column) {
  44494. if (callback) {
  44495. return callback({
  44496. column: column,
  44497. api: this.gridOptionsWrapper.getApi(),
  44498. columnApi: this.gridOptionsWrapper.getColumnApi(),
  44499. context: this.gridOptionsWrapper.getContext()
  44500. });
  44501. }
  44502. else {
  44503. return this.columnController.getDisplayNameForColumn(column, 'csv', true);
  44504. }
  44505. };
  44506. BaseGridSerializingSession.prototype.createValueForGroupNode = function (node) {
  44507. if (this.processRowGroupCallback) {
  44508. return this.processRowGroupCallback({
  44509. node: node,
  44510. api: this.gridOptionsWrapper.getApi(),
  44511. columnApi: this.gridOptionsWrapper.getColumnApi(),
  44512. context: this.gridOptionsWrapper.getContext(),
  44513. });
  44514. }
  44515. var keys = [node.key];
  44516. while (node.parent) {
  44517. node = node.parent;
  44518. keys.push(node.key);
  44519. }
  44520. return keys.reverse().join(' -> ');
  44521. };
  44522. BaseGridSerializingSession.prototype.processCell = function (rowNode, column, value, processCellCallback, type) {
  44523. if (processCellCallback) {
  44524. return processCellCallback({
  44525. column: column,
  44526. node: rowNode,
  44527. value: value,
  44528. api: this.gridOptionsWrapper.getApi(),
  44529. columnApi: this.gridOptionsWrapper.getColumnApi(),
  44530. context: this.gridOptionsWrapper.getContext(),
  44531. type: type
  44532. });
  44533. }
  44534. else {
  44535. return value;
  44536. }
  44537. };
  44538. return BaseGridSerializingSession;
  44539. }());
  44540. var GridSerializer = /** @class */ (function (_super) {
  44541. __extends(GridSerializer, _super);
  44542. function GridSerializer() {
  44543. return _super !== null && _super.apply(this, arguments) || this;
  44544. }
  44545. GridSerializer.prototype.serialize = function (gridSerializingSession, params) {
  44546. if (params === void 0) { params = {}; }
  44547. var rowSkipper = params.shouldRowBeSkipped || (function () { return false; });
  44548. var api = this.gridOptionsWrapper.getApi();
  44549. var columnApi = this.gridOptionsWrapper.getColumnApi();
  44550. var skipSingleChildrenGroup = this.gridOptionsWrapper.isGroupRemoveSingleChildren();
  44551. var skipLowestSingleChildrenGroup = this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren();
  44552. var context = this.gridOptionsWrapper.getContext();
  44553. // when in pivot mode, we always render cols on screen, never 'all columns'
  44554. var isPivotMode = this.columnController.isPivotMode();
  44555. var rowModelNormal = this.rowModel.getType() === _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].ROW_MODEL_TYPE_CLIENT_SIDE;
  44556. var onlySelectedNonStandardModel = !rowModelNormal && params.onlySelected;
  44557. var columnsToExport = [];
  44558. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].existsAndNotEmpty(params.columnKeys)) {
  44559. columnsToExport = this.columnController.getGridColumns(params.columnKeys);
  44560. }
  44561. else if (params.allColumns && !isPivotMode) {
  44562. // add auto group column for tree data
  44563. columnsToExport = this.gridOptionsWrapper.isTreeData() ?
  44564. this.columnController.getGridColumns([_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].GROUP_AUTO_COLUMN_ID]) : [];
  44565. columnsToExport = columnsToExport.concat(this.columnController.getAllPrimaryColumns() || []);
  44566. }
  44567. else {
  44568. columnsToExport = this.columnController.getAllDisplayedColumns();
  44569. }
  44570. if (params.customHeader) {
  44571. gridSerializingSession.addCustomContent(params.customHeader);
  44572. }
  44573. gridSerializingSession.prepare(columnsToExport);
  44574. // first pass, put in the header names of the cols
  44575. if (params.columnGroups) {
  44576. var groupInstanceIdCreator = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["GroupInstanceIdCreator"]();
  44577. var displayedGroups = this.displayedGroupCreator.createDisplayedGroups(columnsToExport, this.columnController.getGridBalancedTree(), groupInstanceIdCreator, null);
  44578. this.recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession, params.processGroupHeaderCallback);
  44579. }
  44580. if (!params.skipHeader) {
  44581. var gridRowIterator_1 = gridSerializingSession.onNewHeaderRow();
  44582. columnsToExport.forEach(function (column, index) {
  44583. gridRowIterator_1.onColumn(column, index, undefined);
  44584. });
  44585. }
  44586. this.pinnedRowModel.forEachPinnedTopRow(processRow);
  44587. if (isPivotMode) {
  44588. if (this.rowModel.forEachPivotNode) {
  44589. this.rowModel.forEachPivotNode(processRow);
  44590. }
  44591. else {
  44592. //Must be enterprise, so we can just loop through all the nodes
  44593. this.rowModel.forEachNode(processRow);
  44594. }
  44595. }
  44596. else {
  44597. // onlySelectedAllPages: user doing pagination and wants selected items from
  44598. // other pages, so cannot use the standard row model as it won't have rows from
  44599. // other pages.
  44600. // onlySelectedNonStandardModel: if user wants selected in non standard row model
  44601. // (eg viewport) then again rowmodel cannot be used, so need to use selected instead.
  44602. if (params.onlySelectedAllPages || onlySelectedNonStandardModel) {
  44603. var selectedNodes = this.selectionController.getSelectedNodes();
  44604. selectedNodes.forEach(function (node) {
  44605. processRow(node);
  44606. });
  44607. }
  44608. else {
  44609. // here is everything else - including standard row model and selected. we don't use
  44610. // the selection model even when just using selected, so that the result is the order
  44611. // of the rows appearing on the screen.
  44612. if (rowModelNormal) {
  44613. this.rowModel.forEachNodeAfterFilterAndSort(processRow);
  44614. }
  44615. else {
  44616. this.rowModel.forEachNode(processRow);
  44617. }
  44618. }
  44619. }
  44620. this.pinnedRowModel.forEachPinnedBottomRow(processRow);
  44621. if (params.customFooter) {
  44622. gridSerializingSession.addCustomContent(params.customFooter);
  44623. }
  44624. function processRow(node) {
  44625. var shouldSkipLowestGroup = skipLowestSingleChildrenGroup && node.leafGroup;
  44626. var shouldSkipCurrentGroup = node.allChildrenCount === 1 && (skipSingleChildrenGroup || shouldSkipLowestGroup);
  44627. if (node.group && (params.skipGroups || shouldSkipCurrentGroup)) {
  44628. return;
  44629. }
  44630. if (params.skipFooters && node.footer) {
  44631. return;
  44632. }
  44633. if (params.onlySelected && !node.isSelected()) {
  44634. return;
  44635. }
  44636. if (params.skipPinnedTop && node.rowPinned === 'top') {
  44637. return;
  44638. }
  44639. if (params.skipPinnedBottom && node.rowPinned === 'bottom') {
  44640. return;
  44641. }
  44642. // if we are in pivotMode, then the grid will show the root node only
  44643. // if it's not a leaf group
  44644. var nodeIsRootNode = node.level === -1;
  44645. if (nodeIsRootNode && !node.leafGroup) {
  44646. return;
  44647. }
  44648. var shouldRowBeSkipped = rowSkipper({ node: node, api: api, context: context });
  44649. if (shouldRowBeSkipped) {
  44650. return;
  44651. }
  44652. var rowAccumulator = gridSerializingSession.onNewBodyRow();
  44653. columnsToExport.forEach(function (column, index) {
  44654. rowAccumulator.onColumn(column, index, node);
  44655. });
  44656. if (params.getCustomContentBelowRow) {
  44657. var content = params.getCustomContentBelowRow({ node: node, api: api, columnApi: columnApi, context: context });
  44658. if (content) {
  44659. gridSerializingSession.addCustomContent(content);
  44660. }
  44661. }
  44662. }
  44663. return gridSerializingSession.parse();
  44664. };
  44665. GridSerializer.prototype.recursivelyAddHeaderGroups = function (displayedGroups, gridSerializingSession, processGroupHeaderCallback) {
  44666. var directChildrenHeaderGroups = [];
  44667. displayedGroups.forEach(function (columnGroupChild) {
  44668. var columnGroup = columnGroupChild;
  44669. if (!columnGroup.getChildren) {
  44670. return;
  44671. }
  44672. columnGroup.getChildren().forEach(function (it) { return directChildrenHeaderGroups.push(it); });
  44673. });
  44674. if (displayedGroups.length > 0 && displayedGroups[0] instanceof _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["ColumnGroup"]) {
  44675. this.doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback);
  44676. }
  44677. if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) {
  44678. this.recursivelyAddHeaderGroups(directChildrenHeaderGroups, gridSerializingSession, processGroupHeaderCallback);
  44679. }
  44680. };
  44681. GridSerializer.prototype.doAddHeaderHeader = function (gridSerializingSession, displayedGroups, processGroupHeaderCallback) {
  44682. var _this = this;
  44683. var gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow();
  44684. var columnIndex = 0;
  44685. displayedGroups.forEach(function (columnGroupChild) {
  44686. var columnGroup = columnGroupChild;
  44687. var name;
  44688. if (processGroupHeaderCallback) {
  44689. name = processGroupHeaderCallback({
  44690. columnGroup: columnGroup,
  44691. api: _this.gridOptionsWrapper.getApi(),
  44692. columnApi: _this.gridOptionsWrapper.getColumnApi(),
  44693. context: _this.gridOptionsWrapper.getContext()
  44694. });
  44695. }
  44696. else {
  44697. name = _this.columnController.getDisplayNameForColumnGroup(columnGroup, 'header');
  44698. }
  44699. gridRowIterator.onColumn(name || '', columnIndex++, columnGroup.getLeafColumns().length - 1);
  44700. });
  44701. };
  44702. __decorate([
  44703. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('displayedGroupCreator')
  44704. ], GridSerializer.prototype, "displayedGroupCreator", void 0);
  44705. __decorate([
  44706. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnController')
  44707. ], GridSerializer.prototype, "columnController", void 0);
  44708. __decorate([
  44709. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowModel')
  44710. ], GridSerializer.prototype, "rowModel", void 0);
  44711. __decorate([
  44712. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('pinnedRowModel')
  44713. ], GridSerializer.prototype, "pinnedRowModel", void 0);
  44714. __decorate([
  44715. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectionController')
  44716. ], GridSerializer.prototype, "selectionController", void 0);
  44717. __decorate([
  44718. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnFactory')
  44719. ], GridSerializer.prototype, "columnFactory", void 0);
  44720. __decorate([
  44721. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  44722. ], GridSerializer.prototype, "gridOptionsWrapper", void 0);
  44723. GridSerializer = __decorate([
  44724. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])("gridSerializer")
  44725. ], GridSerializer);
  44726. return GridSerializer;
  44727. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  44728. var RowType;
  44729. (function (RowType) {
  44730. RowType[RowType["HEADER_GROUPING"] = 0] = "HEADER_GROUPING";
  44731. RowType[RowType["HEADER"] = 1] = "HEADER";
  44732. RowType[RowType["BODY"] = 2] = "BODY";
  44733. })(RowType || (RowType = {}));
  44734. /***/ }),
  44735. /* 215 */
  44736. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44737. "use strict";
  44738. __webpack_require__.r(__webpack_exports__);
  44739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Downloader", function() { return Downloader; });
  44740. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44741. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  44742. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  44743. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  44744. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  44745. return c > 3 && r && Object.defineProperty(target, key, r), r;
  44746. };
  44747. var Downloader = /** @class */ (function () {
  44748. function Downloader() {
  44749. }
  44750. Downloader.prototype.download = function (fileName, content) {
  44751. // Internet Explorer
  44752. if (window.navigator.msSaveOrOpenBlob) {
  44753. window.navigator.msSaveOrOpenBlob(content, fileName);
  44754. }
  44755. else {
  44756. // Other Browsers
  44757. var element = document.createElement("a");
  44758. var url_1 = window.URL.createObjectURL(content);
  44759. element.setAttribute("href", url_1);
  44760. element.setAttribute("download", fileName);
  44761. element.style.display = "none";
  44762. document.body.appendChild(element);
  44763. element.dispatchEvent(new MouseEvent('click', {
  44764. bubbles: false,
  44765. cancelable: true,
  44766. view: window
  44767. }));
  44768. document.body.removeChild(element);
  44769. window.setTimeout(function () {
  44770. window.URL.revokeObjectURL(url_1);
  44771. }, 0);
  44772. }
  44773. };
  44774. Downloader = __decorate([
  44775. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])("downloader")
  44776. ], Downloader);
  44777. return Downloader;
  44778. }());
  44779. /***/ }),
  44780. /* 216 */
  44781. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44782. "use strict";
  44783. __webpack_require__.r(__webpack_exports__);
  44784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XmlFactory", function() { return XmlFactory; });
  44785. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44786. var __extends = (undefined && undefined.__extends) || (function () {
  44787. var extendStatics = function (d, b) {
  44788. extendStatics = Object.setPrototypeOf ||
  44789. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  44790. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  44791. return extendStatics(d, b);
  44792. };
  44793. return function (d, b) {
  44794. extendStatics(d, b);
  44795. function __() { this.constructor = d; }
  44796. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  44797. };
  44798. })();
  44799. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  44800. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  44801. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  44802. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  44803. return c > 3 && r && Object.defineProperty(target, key, r), r;
  44804. };
  44805. var LINE_SEPARATOR = '\r\n';
  44806. var XmlFactory = /** @class */ (function (_super) {
  44807. __extends(XmlFactory, _super);
  44808. function XmlFactory() {
  44809. return _super !== null && _super.apply(this, arguments) || this;
  44810. }
  44811. XmlFactory.prototype.createHeader = function (headerElement) {
  44812. if (headerElement === void 0) { headerElement = {}; }
  44813. var headerStart = '<?';
  44814. var headerEnd = '?>';
  44815. var keys = ['version'];
  44816. if (!headerElement.version) {
  44817. headerElement.version = "1.0";
  44818. }
  44819. if (headerElement.encoding) {
  44820. keys.push('encoding');
  44821. }
  44822. if (headerElement.standalone) {
  44823. keys.push('standalone');
  44824. }
  44825. var att = keys.map(function (key) { return key + "=\"" + headerElement[key] + "\""; }).join(' ');
  44826. return headerStart + "xml " + att + " " + headerEnd;
  44827. };
  44828. XmlFactory.prototype.createXml = function (xmlElement, booleanTransformer) {
  44829. var _this = this;
  44830. var props = '';
  44831. if (xmlElement.properties) {
  44832. if (xmlElement.properties.prefixedAttributes) {
  44833. xmlElement.properties.prefixedAttributes.forEach(function (prefixedSet) {
  44834. Object.keys(prefixedSet.map).forEach(function (key) {
  44835. props += _this.returnAttributeIfPopulated(prefixedSet.prefix + key, prefixedSet.map[key], booleanTransformer);
  44836. });
  44837. });
  44838. }
  44839. if (xmlElement.properties.rawMap) {
  44840. Object.keys(xmlElement.properties.rawMap).forEach(function (key) {
  44841. props += _this.returnAttributeIfPopulated(key, xmlElement.properties.rawMap[key], booleanTransformer);
  44842. });
  44843. }
  44844. }
  44845. var result = '<' + xmlElement.name + props;
  44846. if (!xmlElement.children && xmlElement.textNode == null) {
  44847. return result + '/>' + LINE_SEPARATOR;
  44848. }
  44849. if (xmlElement.textNode != null) {
  44850. return result + '>' + xmlElement.textNode + '</' + xmlElement.name + '>' + LINE_SEPARATOR;
  44851. }
  44852. result += '>' + LINE_SEPARATOR;
  44853. if (xmlElement.children) {
  44854. xmlElement.children.forEach(function (it) {
  44855. result += _this.createXml(it, booleanTransformer);
  44856. });
  44857. }
  44858. return result + '</' + xmlElement.name + '>' + LINE_SEPARATOR;
  44859. };
  44860. XmlFactory.prototype.returnAttributeIfPopulated = function (key, value, booleanTransformer) {
  44861. if (!value && value !== '' && value !== 0) {
  44862. return '';
  44863. }
  44864. var xmlValue = value;
  44865. if ((typeof (value) === 'boolean')) {
  44866. if (booleanTransformer) {
  44867. xmlValue = booleanTransformer(value);
  44868. }
  44869. }
  44870. return " " + key + "=\"" + xmlValue + "\"";
  44871. };
  44872. XmlFactory = __decorate([
  44873. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('xmlFactory')
  44874. ], XmlFactory);
  44875. return XmlFactory;
  44876. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  44877. /***/ }),
  44878. /* 217 */
  44879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44880. "use strict";
  44881. __webpack_require__.r(__webpack_exports__);
  44882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipContainer", function() { return ZipContainer; });
  44883. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  44884. var __extends = (undefined && undefined.__extends) || (function () {
  44885. var extendStatics = function (d, b) {
  44886. extendStatics = Object.setPrototypeOf ||
  44887. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  44888. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  44889. return extendStatics(d, b);
  44890. };
  44891. return function (d, b) {
  44892. extendStatics(d, b);
  44893. function __() { this.constructor = d; }
  44894. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  44895. };
  44896. })();
  44897. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  44898. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  44899. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  44900. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  44901. return c > 3 && r && Object.defineProperty(target, key, r), r;
  44902. };
  44903. // table for crc calculation
  44904. // from: https://referencesource.microsoft.com/#System/sys/System/IO/compression/Crc32Helper.cs,3b31978c7d7f7246,references
  44905. var crcTable = [
  44906. 0, 1996959894, -301047508, -1727442502, 124634137, 1886057615, -379345611, -1637575261, 249268274,
  44907. 2044508324, -522852066, -1747789432, 162941995, 2125561021, -407360249, -1866523247, 498536548,
  44908. 1789927666, -205950648, -2067906082, 450548861, 1843258603, -187386543, -2083289657, 325883990,
  44909. 1684777152, -43845254, -1973040660, 335633487, 1661365465, -99664541, -1928851979, 997073096,
  44910. 1281953886, -715111964, -1570279054, 1006888145, 1258607687, -770865667, -1526024853, 901097722,
  44911. 1119000684, -608450090, -1396901568, 853044451, 1172266101, -589951537, -1412350631, 651767980,
  44912. 1373503546, -925412992, -1076862698, 565507253, 1454621731, -809855591, -1195530993, 671266974,
  44913. 1594198024, -972236366, -1324619484, 795835527, 1483230225, -1050600021, -1234817731, 1994146192,
  44914. 31158534, -1731059524, -271249366, 1907459465, 112637215, -1614814043, -390540237, 2013776290,
  44915. 251722036, -1777751922, -519137256, 2137656763, 141376813, -1855689577, -429695999, 1802195444,
  44916. 476864866, -2056965928, -228458418, 1812370925, 453092731, -2113342271, -183516073, 1706088902,
  44917. 314042704, -1950435094, -54949764, 1658658271, 366619977, -1932296973, -69972891, 1303535960,
  44918. 984961486, -1547960204, -725929758, 1256170817, 1037604311, -1529756563, -740887301, 1131014506,
  44919. 879679996, -1385723834, -631195440, 1141124467, 855842277, -1442165665, -586318647, 1342533948,
  44920. 654459306, -1106571248, -921952122, 1466479909, 544179635, -1184443383, -832445281, 1591671054,
  44921. 702138776, -1328506846, -942167884, 1504918807, 783551873, -1212326853, -1061524307, -306674912,
  44922. -1698712650, 62317068, 1957810842, -355121351, -1647151185, 81470997, 1943803523, -480048366,
  44923. -1805370492, 225274430, 2053790376, -468791541, -1828061283, 167816743, 2097651377, -267414716,
  44924. -2029476910, 503444072, 1762050814, -144550051, -2140837941, 426522225, 1852507879, -19653770,
  44925. -1982649376, 282753626, 1742555852, -105259153, -1900089351, 397917763, 1622183637, -690576408,
  44926. -1580100738, 953729732, 1340076626, -776247311, -1497606297, 1068828381, 1219638859, -670225446,
  44927. -1358292148, 906185462, 1090812512, -547295293, -1469587627, 829329135, 1181335161, -882789492,
  44928. -1134132454, 628085408, 1382605366, -871598187, -1156888829, 570562233, 1426400815, -977650754,
  44929. -1296233688, 733239954, 1555261956, -1026031705, -1244606671, 752459403, 1541320221, -1687895376,
  44930. -328994266, 1969922972, 40735498, -1677130071, -351390145, 1913087877, 83908371, -1782625662,
  44931. -491226604, 2075208622, 213261112, -1831694693, -438977011, 2094854071, 198958881, -2032938284,
  44932. -237706686, 1759359992, 534414190, -2118248755, -155638181, 1873836001, 414664567, -2012718362,
  44933. -15766928, 1711684554, 285281116, -1889165569, -127750551, 1634467795, 376229701, -1609899400,
  44934. -686959890, 1308918612, 956543938, -1486412191, -799009033, 1231636301, 1047427035, -1362007478,
  44935. -640263460, 1088359270, 936918000, -1447252397, -558129467, 1202900863, 817233897, -1111625188,
  44936. -893730166, 1404277552, 615818150, -1160759803, -841546093, 1423857449, 601450431, -1285129682,
  44937. -1000256840, 1567103746, 711928724, -1274298825, -1022587231, 1510334235, 755167117
  44938. ];
  44939. var ZipContainer = /** @class */ (function (_super) {
  44940. __extends(ZipContainer, _super);
  44941. function ZipContainer() {
  44942. var _this = _super !== null && _super.apply(this, arguments) || this;
  44943. _this.folders = [];
  44944. _this.files = [];
  44945. _this.addFolder = function (path) {
  44946. _this.folders.push({
  44947. path: path,
  44948. created: new Date()
  44949. });
  44950. };
  44951. return _this;
  44952. }
  44953. ZipContainer.prototype.addFolders = function (paths) {
  44954. paths.forEach(this.addFolder);
  44955. };
  44956. ZipContainer.prototype.addFile = function (path, content) {
  44957. this.files.push({
  44958. path: path,
  44959. created: new Date(),
  44960. content: content
  44961. });
  44962. };
  44963. ZipContainer.prototype.clearStream = function () {
  44964. this.folders = [];
  44965. this.files = [];
  44966. };
  44967. ZipContainer.prototype.getContent = function (mimeType) {
  44968. if (mimeType === void 0) { mimeType = 'application/zip'; }
  44969. var textOutput = this.buildFileStream();
  44970. var uInt8Output = this.buildUint8Array(textOutput);
  44971. this.clearStream();
  44972. return new Blob([uInt8Output], { type: mimeType });
  44973. };
  44974. ZipContainer.prototype.buildFileStream = function (fData) {
  44975. if (fData === void 0) { fData = ''; }
  44976. var totalFiles = this.folders.concat(this.files);
  44977. var len = totalFiles.length;
  44978. var foData = '';
  44979. var lL = 0;
  44980. var cL = 0;
  44981. for (var _i = 0, totalFiles_1 = totalFiles; _i < totalFiles_1.length; _i++) {
  44982. var currentFile = totalFiles_1[_i];
  44983. var _a = this.getHeader(currentFile, lL), fileHeader = _a.fileHeader, folderHeader = _a.folderHeader, content = _a.content;
  44984. lL += fileHeader.length + content.length;
  44985. cL += folderHeader.length;
  44986. fData += fileHeader + content;
  44987. foData += folderHeader;
  44988. }
  44989. var foEnd = this.buildFolderEnd(len, cL, lL);
  44990. return fData + foData + foEnd;
  44991. };
  44992. ZipContainer.prototype.getHeader = function (currentFile, offset) {
  44993. var content = currentFile.content, path = currentFile.path, created = currentFile.created;
  44994. var utf8_encode = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].utf8_encode, decToHex = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].decToHex;
  44995. var utfPath = utf8_encode(path);
  44996. var isUTF8 = utfPath !== path;
  44997. var time = this.convertTime(created);
  44998. var dt = this.convertDate(created);
  44999. var extraFields = '';
  45000. if (isUTF8) {
  45001. var uExtraFieldPath = decToHex(1, 1) + decToHex(this.getFromCrc32Table(utfPath), 4) + utfPath;
  45002. extraFields = "\x75\x70" + decToHex(uExtraFieldPath.length, 2) + uExtraFieldPath;
  45003. }
  45004. var header = '\x0A\x00' +
  45005. (isUTF8 ? '\x00\x08' : '\x00\x00') +
  45006. '\x00\x00' +
  45007. decToHex(time, 2) + // last modified time
  45008. decToHex(dt, 2) + // last modified date
  45009. decToHex(content ? this.getFromCrc32Table(content) : 0, 4) +
  45010. decToHex(content ? content.length : 0, 4) + // compressed size
  45011. decToHex(content ? content.length : 0, 4) + // uncompressed size
  45012. decToHex(utfPath.length, 2) + // file name length
  45013. decToHex(extraFields.length, 2); // extra field length
  45014. var fileHeader = 'PK\x03\x04' + header + utfPath + extraFields;
  45015. var folderHeader = 'PK\x01\x02' + // central header
  45016. '\x14\x00' +
  45017. header + // file header
  45018. '\x00\x00' +
  45019. '\x00\x00' +
  45020. '\x00\x00' +
  45021. (content ? '\x00\x00\x00\x00' : '\x10\x00\x00\x00') + // external file attributes
  45022. decToHex(offset, 4) + // relative offset of local header
  45023. utfPath + // file name
  45024. extraFields; // extra field
  45025. return { fileHeader: fileHeader, folderHeader: folderHeader, content: content || '' };
  45026. };
  45027. ZipContainer.prototype.buildFolderEnd = function (tLen, cLen, lLen) {
  45028. var decToHex = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].decToHex;
  45029. return 'PK\x05\x06' + // central folder end
  45030. '\x00\x00' +
  45031. '\x00\x00' +
  45032. decToHex(tLen, 2) + // total number of entries in the central folder
  45033. decToHex(tLen, 2) + // total number of entries in the central folder
  45034. decToHex(cLen, 4) + // size of the central folder
  45035. decToHex(lLen, 4) + // central folder start offset
  45036. '\x00\x00';
  45037. };
  45038. ZipContainer.prototype.buildUint8Array = function (content) {
  45039. var uint8 = new Uint8Array(content.length);
  45040. for (var i = 0; i < uint8.length; i++) {
  45041. uint8[i] = content.charCodeAt(i);
  45042. }
  45043. return uint8;
  45044. };
  45045. ZipContainer.prototype.getFromCrc32Table = function (content, crc) {
  45046. if (crc === void 0) { crc = 0; }
  45047. if (!content.length) {
  45048. return 0;
  45049. }
  45050. crc ^= (-1);
  45051. var j = 0;
  45052. var k = 0;
  45053. var l = 0;
  45054. for (var i = 0; i < content.length; i++) {
  45055. j = content.charCodeAt(i);
  45056. k = (crc ^ j) & 0xFF;
  45057. l = crcTable[k];
  45058. crc = (crc >>> 8) ^ l;
  45059. }
  45060. return crc ^ (-1);
  45061. };
  45062. ZipContainer.prototype.convertTime = function (date) {
  45063. var time = date.getHours();
  45064. time <<= 6;
  45065. time = time | date.getMinutes();
  45066. time <<= 5;
  45067. time = time | date.getSeconds() / 2;
  45068. return time;
  45069. };
  45070. ZipContainer.prototype.convertDate = function (date) {
  45071. var dt = date.getFullYear() - 1980;
  45072. dt <<= 4;
  45073. dt = dt | (date.getMonth() + 1);
  45074. dt <<= 5;
  45075. dt = dt | date.getDate();
  45076. return dt;
  45077. };
  45078. ZipContainer = __decorate([
  45079. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('zipContainer')
  45080. ], ZipContainer);
  45081. return ZipContainer;
  45082. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  45083. /***/ }),
  45084. /* 218 */
  45085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45086. "use strict";
  45087. __webpack_require__.r(__webpack_exports__);
  45088. /* harmony import */ var _infiniteRowModelModule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(219);
  45089. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfiniteRowModelModule", function() { return _infiniteRowModelModule__WEBPACK_IMPORTED_MODULE_0__["InfiniteRowModelModule"]; });
  45090. /***/ }),
  45091. /* 219 */
  45092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45093. "use strict";
  45094. __webpack_require__.r(__webpack_exports__);
  45095. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfiniteRowModelModule", function() { return InfiniteRowModelModule; });
  45096. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  45097. /* harmony import */ var _infiniteRowModel_infiniteRowModel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(220);
  45098. var InfiniteRowModelModule = {
  45099. moduleName: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["ModuleNames"].InfiniteRowModelModule,
  45100. rowModels: { 'infinite': _infiniteRowModel_infiniteRowModel__WEBPACK_IMPORTED_MODULE_1__["InfiniteRowModel"] }
  45101. };
  45102. /***/ }),
  45103. /* 220 */
  45104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45105. "use strict";
  45106. __webpack_require__.r(__webpack_exports__);
  45107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfiniteRowModel", function() { return InfiniteRowModel; });
  45108. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  45109. /* harmony import */ var _infiniteCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(221);
  45110. var __extends = (undefined && undefined.__extends) || (function () {
  45111. var extendStatics = function (d, b) {
  45112. extendStatics = Object.setPrototypeOf ||
  45113. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  45114. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  45115. return extendStatics(d, b);
  45116. };
  45117. return function (d, b) {
  45118. extendStatics(d, b);
  45119. function __() { this.constructor = d; }
  45120. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  45121. };
  45122. })();
  45123. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  45124. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  45125. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  45126. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  45127. return c > 3 && r && Object.defineProperty(target, key, r), r;
  45128. };
  45129. var InfiniteRowModel = /** @class */ (function (_super) {
  45130. __extends(InfiniteRowModel, _super);
  45131. function InfiniteRowModel() {
  45132. return _super !== null && _super.apply(this, arguments) || this;
  45133. }
  45134. InfiniteRowModel.prototype.getRowBounds = function (index) {
  45135. return {
  45136. rowHeight: this.rowHeight,
  45137. rowTop: this.rowHeight * index
  45138. };
  45139. };
  45140. // we don't implement as lazy row heights is not supported in this row model
  45141. InfiniteRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {
  45142. return false;
  45143. };
  45144. InfiniteRowModel.prototype.init = function () {
  45145. var _this = this;
  45146. if (!this.gridOptionsWrapper.isRowModelInfinite()) {
  45147. return;
  45148. }
  45149. this.rowHeight = this.gridOptionsWrapper.getRowHeightAsNumber();
  45150. this.addEventListeners();
  45151. this.addDestroyFunc(function () { return _this.destroyCache(); });
  45152. };
  45153. InfiniteRowModel.prototype.start = function () {
  45154. this.setDatasource(this.gridOptionsWrapper.getDatasource());
  45155. };
  45156. InfiniteRowModel.prototype.destroyDatasource = function () {
  45157. if (this.datasource) {
  45158. this.getContext().destroyBean(this.datasource);
  45159. this.rowRenderer.datasourceChanged();
  45160. this.datasource = null;
  45161. }
  45162. };
  45163. InfiniteRowModel.prototype.isLastRowFound = function () {
  45164. return this.infiniteCache ? this.infiniteCache.isMaxRowFound() : false;
  45165. };
  45166. InfiniteRowModel.prototype.addEventListeners = function () {
  45167. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));
  45168. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_SORT_CHANGED, this.onSortChanged.bind(this));
  45169. this.addManagedListener(this.eventService, _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_COLUMN_EVERYTHING_CHANGED, this.onColumnEverything.bind(this));
  45170. };
  45171. InfiniteRowModel.prototype.onFilterChanged = function () {
  45172. this.reset();
  45173. };
  45174. InfiniteRowModel.prototype.onSortChanged = function () {
  45175. this.reset();
  45176. };
  45177. InfiniteRowModel.prototype.onColumnEverything = function () {
  45178. var resetRequired;
  45179. // if cache params, we require reset only if sort model has changed. we don't need to check
  45180. // for filter model, as the filter manager will fire an event when columns change that result
  45181. // in the filter changing.
  45182. if (this.cacheParams) {
  45183. resetRequired = this.isSortModelDifferent();
  45184. }
  45185. else {
  45186. // if no cacheParams, means first time creating the cache, so always create one
  45187. resetRequired = true;
  45188. }
  45189. if (resetRequired) {
  45190. this.reset();
  45191. }
  45192. };
  45193. InfiniteRowModel.prototype.isSortModelDifferent = function () {
  45194. return !_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].jsonEquals(this.cacheParams.sortModel, this.sortController.getSortModel());
  45195. };
  45196. InfiniteRowModel.prototype.getType = function () {
  45197. return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Constants"].ROW_MODEL_TYPE_INFINITE;
  45198. };
  45199. InfiniteRowModel.prototype.setDatasource = function (datasource) {
  45200. this.destroyDatasource();
  45201. this.datasource = datasource;
  45202. // only reset if we have a valid datasource to working with
  45203. if (datasource) {
  45204. this.checkForDeprecated();
  45205. this.reset();
  45206. }
  45207. };
  45208. InfiniteRowModel.prototype.checkForDeprecated = function () {
  45209. var ds = this.datasource;
  45210. // the number of concurrent loads we are allowed to the server
  45211. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(ds.maxConcurrentRequests)) {
  45212. console.error('ag-Grid: since version 5.1.x, maxConcurrentRequests is replaced with grid property maxConcurrentDatasourceRequests');
  45213. }
  45214. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(ds.maxPagesInCache)) {
  45215. console.error('ag-Grid: since version 5.1.x, maxPagesInCache is replaced with grid property maxPagesInPaginationCache');
  45216. }
  45217. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(ds.overflowSize)) {
  45218. console.error('ag-Grid: since version 5.1.x, overflowSize is replaced with grid property paginationOverflowSize');
  45219. }
  45220. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(ds.blockSize)) {
  45221. console.error('ag-Grid: since version 5.1.x, pageSize/blockSize is replaced with grid property infinitePageSize');
  45222. }
  45223. };
  45224. InfiniteRowModel.prototype.isEmpty = function () {
  45225. return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.infiniteCache);
  45226. };
  45227. InfiniteRowModel.prototype.isRowsToRender = function () {
  45228. return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.infiniteCache);
  45229. };
  45230. InfiniteRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {
  45231. return this.infiniteCache ? this.infiniteCache.getRowNodesInRange(firstInRange, lastInRange) : [];
  45232. };
  45233. InfiniteRowModel.prototype.reset = function () {
  45234. // important to return here, as the user could be setting filter or sort before
  45235. // data-source is set
  45236. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.datasource)) {
  45237. return;
  45238. }
  45239. // if user is providing id's, then this means we can keep the selection between datasource hits,
  45240. // as the rows will keep their unique id's even if, for example, server side sorting or filtering
  45241. // is done.
  45242. var userGeneratingIds = _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(this.gridOptionsWrapper.getRowNodeIdFunc());
  45243. if (!userGeneratingIds) {
  45244. this.selectionController.reset();
  45245. }
  45246. this.resetCache();
  45247. var event = this.createModelUpdatedEvent();
  45248. this.eventService.dispatchEvent(event);
  45249. };
  45250. InfiniteRowModel.prototype.createModelUpdatedEvent = function () {
  45251. return {
  45252. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_MODEL_UPDATED,
  45253. api: this.gridApi,
  45254. columnApi: this.columnApi,
  45255. // not sure if these should all be false - noticed if after implementing,
  45256. // maybe they should be true?
  45257. newPage: false,
  45258. newData: false,
  45259. keepRenderedRows: false,
  45260. animate: false
  45261. };
  45262. };
  45263. InfiniteRowModel.prototype.resetCache = function () {
  45264. // if not first time creating a cache, need to destroy the old one
  45265. this.destroyCache();
  45266. var maxConcurrentRequests = this.gridOptionsWrapper.getMaxConcurrentDatasourceRequests();
  45267. var blockLoadDebounceMillis = this.gridOptionsWrapper.getBlockLoadDebounceMillis();
  45268. // there is a bi-directional dependency between the loader and the cache,
  45269. // so we create loader here, and then pass dependencies in setDependencies() method later
  45270. this.rowNodeBlockLoader = new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNodeBlockLoader"](maxConcurrentRequests, blockLoadDebounceMillis);
  45271. this.getContext().createBean(this.rowNodeBlockLoader);
  45272. this.cacheParams = {
  45273. // the user provided datasource
  45274. datasource: this.datasource,
  45275. // sort and filter model
  45276. filterModel: this.filterManager.getFilterModel(),
  45277. sortModel: this.sortController.getSortModel(),
  45278. rowNodeBlockLoader: this.rowNodeBlockLoader,
  45279. // properties - this way we take a snapshot of them, so if user changes any, they will be
  45280. // used next time we create a new cache, which is generally after a filter or sort change,
  45281. // or a new datasource is set
  45282. maxConcurrentRequests: maxConcurrentRequests,
  45283. overflowSize: this.gridOptionsWrapper.getCacheOverflowSize(),
  45284. initialRowCount: this.gridOptionsWrapper.getInfiniteInitialRowCount(),
  45285. maxBlocksInCache: this.gridOptionsWrapper.getMaxBlocksInCache(),
  45286. blockSize: this.gridOptionsWrapper.getCacheBlockSize(),
  45287. rowHeight: this.gridOptionsWrapper.getRowHeightAsNumber(),
  45288. // the cache could create this, however it is also used by the pages, so handy to create it
  45289. // here as the settings are also passed to the pages
  45290. lastAccessedSequence: new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["NumberSequence"]()
  45291. };
  45292. // set defaults
  45293. if (!this.cacheParams.maxConcurrentRequests || !(this.cacheParams.maxConcurrentRequests >= 1)) {
  45294. this.cacheParams.maxConcurrentRequests = 2;
  45295. }
  45296. // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the
  45297. // server for one page at a time. so the default if not specified is 100.
  45298. if (!this.cacheParams.blockSize || !(this.cacheParams.blockSize >= 1)) {
  45299. this.cacheParams.blockSize = 100;
  45300. }
  45301. // if user doesn't give initial rows to display, we assume one
  45302. if (!(this.cacheParams.initialRowCount >= 1)) {
  45303. this.cacheParams.initialRowCount = 1;
  45304. }
  45305. // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past
  45306. // the current page and request first row of next page
  45307. if (!(this.cacheParams.overflowSize >= 1)) {
  45308. this.cacheParams.overflowSize = 1;
  45309. }
  45310. this.infiniteCache = new _infiniteCache__WEBPACK_IMPORTED_MODULE_1__["InfiniteCache"](this.cacheParams);
  45311. this.getContext().createBean(this.infiniteCache);
  45312. this.infiniteCache.addEventListener(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNodeCache"].EVENT_CACHE_UPDATED, this.onCacheUpdated.bind(this));
  45313. };
  45314. InfiniteRowModel.prototype.destroyCache = function () {
  45315. if (this.infiniteCache) {
  45316. this.infiniteCache = this.destroyBean(this.infiniteCache);
  45317. }
  45318. if (this.rowNodeBlockLoader) {
  45319. this.rowNodeBlockLoader = this.destroyBean(this.rowNodeBlockLoader);
  45320. }
  45321. };
  45322. InfiniteRowModel.prototype.onCacheUpdated = function () {
  45323. var event = this.createModelUpdatedEvent();
  45324. this.eventService.dispatchEvent(event);
  45325. };
  45326. InfiniteRowModel.prototype.getRow = function (rowIndex) {
  45327. return this.infiniteCache ? this.infiniteCache.getRow(rowIndex) : null;
  45328. };
  45329. InfiniteRowModel.prototype.getRowNode = function (id) {
  45330. var result = null;
  45331. this.forEachNode(function (rowNode) {
  45332. if (rowNode.id === id) {
  45333. result = rowNode;
  45334. }
  45335. });
  45336. return result;
  45337. };
  45338. InfiniteRowModel.prototype.forEachNode = function (callback) {
  45339. if (this.infiniteCache) {
  45340. this.infiniteCache.forEachNodeDeep(callback, new _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["NumberSequence"]());
  45341. }
  45342. };
  45343. InfiniteRowModel.prototype.getCurrentPageHeight = function () {
  45344. return this.getRowCount() * this.rowHeight;
  45345. };
  45346. InfiniteRowModel.prototype.getTopLevelRowCount = function () {
  45347. return this.getRowCount();
  45348. };
  45349. InfiniteRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {
  45350. return topLevelIndex;
  45351. };
  45352. InfiniteRowModel.prototype.getRowIndexAtPixel = function (pixel) {
  45353. if (this.rowHeight !== 0) { // avoid divide by zero error
  45354. var rowIndexForPixel = Math.floor(pixel / this.rowHeight);
  45355. var lastRowIndex = this.getRowCount() - 1;
  45356. if (rowIndexForPixel > lastRowIndex) {
  45357. return lastRowIndex;
  45358. }
  45359. else {
  45360. return rowIndexForPixel;
  45361. }
  45362. }
  45363. else {
  45364. return 0;
  45365. }
  45366. };
  45367. InfiniteRowModel.prototype.getRowCount = function () {
  45368. return this.infiniteCache ? this.infiniteCache.getVirtualRowCount() : 0;
  45369. };
  45370. InfiniteRowModel.prototype.updateRowData = function (transaction) {
  45371. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(transaction.remove) || _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(transaction.update)) {
  45372. console.warn('ag-Grid: updateRowData for InfiniteRowModel does not support remove or update, only add');
  45373. return;
  45374. }
  45375. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(transaction.addIndex)) {
  45376. console.warn('ag-Grid: updateRowData for InfiniteRowModel requires add and addIndex to be set');
  45377. return;
  45378. }
  45379. if (this.infiniteCache) {
  45380. this.infiniteCache.insertItemsAtIndex(transaction.addIndex, transaction.add);
  45381. }
  45382. };
  45383. InfiniteRowModel.prototype.isRowPresent = function (rowNode) {
  45384. return false;
  45385. };
  45386. InfiniteRowModel.prototype.refreshCache = function () {
  45387. if (this.infiniteCache) {
  45388. this.infiniteCache.refreshCache();
  45389. }
  45390. };
  45391. InfiniteRowModel.prototype.purgeCache = function () {
  45392. if (this.infiniteCache) {
  45393. this.infiniteCache.purgeCache();
  45394. }
  45395. };
  45396. InfiniteRowModel.prototype.getVirtualRowCount = function () {
  45397. if (this.infiniteCache) {
  45398. return this.infiniteCache.getVirtualRowCount();
  45399. }
  45400. else {
  45401. return null;
  45402. }
  45403. };
  45404. InfiniteRowModel.prototype.isMaxRowFound = function () {
  45405. if (this.infiniteCache) {
  45406. return this.infiniteCache.isMaxRowFound();
  45407. }
  45408. };
  45409. InfiniteRowModel.prototype.setVirtualRowCount = function (rowCount, maxRowFound) {
  45410. if (this.infiniteCache) {
  45411. this.infiniteCache.setVirtualRowCount(rowCount, maxRowFound);
  45412. }
  45413. };
  45414. InfiniteRowModel.prototype.getBlockState = function () {
  45415. if (this.rowNodeBlockLoader) {
  45416. return this.rowNodeBlockLoader.getBlockState();
  45417. }
  45418. else {
  45419. return null;
  45420. }
  45421. };
  45422. __decorate([
  45423. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  45424. ], InfiniteRowModel.prototype, "gridOptionsWrapper", void 0);
  45425. __decorate([
  45426. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('filterManager')
  45427. ], InfiniteRowModel.prototype, "filterManager", void 0);
  45428. __decorate([
  45429. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('sortController')
  45430. ], InfiniteRowModel.prototype, "sortController", void 0);
  45431. __decorate([
  45432. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('selectionController')
  45433. ], InfiniteRowModel.prototype, "selectionController", void 0);
  45434. __decorate([
  45435. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  45436. ], InfiniteRowModel.prototype, "gridApi", void 0);
  45437. __decorate([
  45438. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  45439. ], InfiniteRowModel.prototype, "columnApi", void 0);
  45440. __decorate([
  45441. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  45442. ], InfiniteRowModel.prototype, "rowRenderer", void 0);
  45443. __decorate([
  45444. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  45445. ], InfiniteRowModel.prototype, "init", null);
  45446. __decorate([
  45447. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PreDestroy"]
  45448. ], InfiniteRowModel.prototype, "destroyDatasource", null);
  45449. InfiniteRowModel = __decorate([
  45450. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Bean"])('rowModel')
  45451. ], InfiniteRowModel);
  45452. return InfiniteRowModel;
  45453. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["BeanStub"]));
  45454. /***/ }),
  45455. /* 221 */
  45456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45457. "use strict";
  45458. __webpack_require__.r(__webpack_exports__);
  45459. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfiniteCache", function() { return InfiniteCache; });
  45460. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  45461. /* harmony import */ var _infiniteBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(222);
  45462. var __extends = (undefined && undefined.__extends) || (function () {
  45463. var extendStatics = function (d, b) {
  45464. extendStatics = Object.setPrototypeOf ||
  45465. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  45466. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  45467. return extendStatics(d, b);
  45468. };
  45469. return function (d, b) {
  45470. extendStatics(d, b);
  45471. function __() { this.constructor = d; }
  45472. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  45473. };
  45474. })();
  45475. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  45476. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  45477. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  45478. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  45479. return c > 3 && r && Object.defineProperty(target, key, r), r;
  45480. };
  45481. var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
  45482. return function (target, key) { decorator(target, key, paramIndex); }
  45483. };
  45484. var InfiniteCache = /** @class */ (function (_super) {
  45485. __extends(InfiniteCache, _super);
  45486. function InfiniteCache(params) {
  45487. return _super.call(this, params) || this;
  45488. }
  45489. InfiniteCache.prototype.setBeans = function (loggerFactory) {
  45490. this.logger = loggerFactory.create('InfiniteCache');
  45491. };
  45492. InfiniteCache.prototype.moveItemsDown = function (block, moveFromIndex, moveCount) {
  45493. var startRow = block.getStartRow();
  45494. var endRow = block.getEndRow();
  45495. var indexOfLastRowToMove = moveFromIndex + moveCount;
  45496. // all rows need to be moved down below the insertion index
  45497. for (var currentRowIndex = endRow - 1; currentRowIndex >= startRow; currentRowIndex--) {
  45498. // don't move rows at or before the insertion index
  45499. if (currentRowIndex < indexOfLastRowToMove) {
  45500. continue;
  45501. }
  45502. var indexOfNodeWeWant = currentRowIndex - moveCount;
  45503. var nodeForThisIndex = this.getRow(indexOfNodeWeWant, true);
  45504. if (nodeForThisIndex) {
  45505. block.setRowNode(currentRowIndex, nodeForThisIndex);
  45506. }
  45507. else {
  45508. block.setBlankRowNode(currentRowIndex);
  45509. block.setDirty();
  45510. }
  45511. }
  45512. };
  45513. InfiniteCache.prototype.insertItems = function (block, indexToInsert, items) {
  45514. var pageStartRow = block.getStartRow();
  45515. var pageEndRow = block.getEndRow();
  45516. var newRowNodes = [];
  45517. // next stage is insert the rows into this page, if applicable
  45518. for (var index = 0; index < items.length; index++) {
  45519. var rowIndex = indexToInsert + index;
  45520. var currentRowInThisPage = rowIndex >= pageStartRow && rowIndex < pageEndRow;
  45521. if (currentRowInThisPage) {
  45522. var dataItem = items[index];
  45523. var newRowNode = block.setNewData(rowIndex, dataItem);
  45524. newRowNodes.push(newRowNode);
  45525. }
  45526. }
  45527. return newRowNodes;
  45528. };
  45529. InfiniteCache.prototype.insertItemsAtIndex = function (indexToInsert, items) {
  45530. // get all page id's as NUMBERS (not strings, as we need to sort as numbers) and in descending order
  45531. var _this = this;
  45532. var newNodes = [];
  45533. this.forEachBlockInReverseOrder(function (block) {
  45534. var pageEndRow = block.getEndRow();
  45535. // if the insertion is after this page, then this page is not impacted
  45536. if (pageEndRow <= indexToInsert) {
  45537. return;
  45538. }
  45539. _this.moveItemsDown(block, indexToInsert, items.length);
  45540. var newNodesThisPage = _this.insertItems(block, indexToInsert, items);
  45541. newNodesThisPage.forEach(function (rowNode) { return newNodes.push(rowNode); });
  45542. });
  45543. if (this.isMaxRowFound()) {
  45544. this.hack_setVirtualRowCount(this.getVirtualRowCount() + items.length);
  45545. }
  45546. this.onCacheUpdated();
  45547. var event = {
  45548. type: _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Events"].EVENT_ROW_DATA_UPDATED,
  45549. api: this.gridApi,
  45550. columnApi: this.columnApi
  45551. };
  45552. this.eventService.dispatchEvent(event);
  45553. };
  45554. // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid,
  45555. // it will want new pages in the cache as it asks for rows. only when we are inserting /
  45556. // removing rows via the api is dontCreatePage set, where we move rows between the pages.
  45557. InfiniteCache.prototype.getRow = function (rowIndex, dontCreatePage) {
  45558. if (dontCreatePage === void 0) { dontCreatePage = false; }
  45559. var blockId = Math.floor(rowIndex / this.cacheParams.blockSize);
  45560. var block = this.getBlock(blockId);
  45561. if (!block) {
  45562. if (dontCreatePage) {
  45563. return null;
  45564. }
  45565. else {
  45566. block = this.createBlock(blockId);
  45567. }
  45568. }
  45569. return block.getRow(rowIndex);
  45570. };
  45571. InfiniteCache.prototype.createBlock = function (blockNumber) {
  45572. var newBlock = new _infiniteBlock__WEBPACK_IMPORTED_MODULE_1__["InfiniteBlock"](blockNumber, this.cacheParams);
  45573. this.getContext().createBean(newBlock);
  45574. this.postCreateBlock(newBlock);
  45575. return newBlock;
  45576. };
  45577. // we have this on infinite row model only, not server side row model,
  45578. // because for server side, it would leave the children in inconsistent
  45579. // state - eg if a node had children, but after the refresh it had data
  45580. // for a different row, then the children would be with the wrong row node.
  45581. InfiniteCache.prototype.refreshCache = function () {
  45582. this.forEachBlockInOrder(function (block) { return block.setDirty(); });
  45583. this.checkBlockToLoad();
  45584. };
  45585. __decorate([
  45586. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('columnApi')
  45587. ], InfiniteCache.prototype, "columnApi", void 0);
  45588. __decorate([
  45589. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridApi')
  45590. ], InfiniteCache.prototype, "gridApi", void 0);
  45591. __decorate([
  45592. __param(0, Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Qualifier"])('loggerFactory'))
  45593. ], InfiniteCache.prototype, "setBeans", null);
  45594. return InfiniteCache;
  45595. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNodeCache"]));
  45596. /***/ }),
  45597. /* 222 */
  45598. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45599. "use strict";
  45600. __webpack_require__.r(__webpack_exports__);
  45601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfiniteBlock", function() { return InfiniteBlock; });
  45602. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  45603. var __extends = (undefined && undefined.__extends) || (function () {
  45604. var extendStatics = function (d, b) {
  45605. extendStatics = Object.setPrototypeOf ||
  45606. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  45607. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  45608. return extendStatics(d, b);
  45609. };
  45610. return function (d, b) {
  45611. extendStatics(d, b);
  45612. function __() { this.constructor = d; }
  45613. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  45614. };
  45615. })();
  45616. var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
  45617. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  45618. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  45619. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  45620. return c > 3 && r && Object.defineProperty(target, key, r), r;
  45621. };
  45622. var InfiniteBlock = /** @class */ (function (_super) {
  45623. __extends(InfiniteBlock, _super);
  45624. function InfiniteBlock(pageNumber, params) {
  45625. var _this = _super.call(this, pageNumber, params) || this;
  45626. _this.cacheParams = params;
  45627. return _this;
  45628. }
  45629. InfiniteBlock.prototype.getDisplayIndexStart = function () {
  45630. return this.getBlockNumber() * this.cacheParams.blockSize;
  45631. };
  45632. // this is an estimate, as the last block will probably only be partially full. however
  45633. // this method is used to know if this block is been rendered, before destroying, so
  45634. // and this estimate works in that use case.
  45635. InfiniteBlock.prototype.getDisplayIndexEnd = function () {
  45636. return this.getDisplayIndexStart() + this.cacheParams.blockSize;
  45637. };
  45638. InfiniteBlock.prototype.createBlankRowNode = function (rowIndex) {
  45639. var rowNode = _super.prototype.createBlankRowNode.call(this, rowIndex);
  45640. rowNode.uiLevel = 0;
  45641. this.setIndexAndTopOnRowNode(rowNode, rowIndex);
  45642. return rowNode;
  45643. };
  45644. InfiniteBlock.prototype.setDataAndId = function (rowNode, data, index) {
  45645. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].exists(data)) {
  45646. // this means if the user is not providing id's we just use the
  45647. // index for the row. this will allow selection to work (that is based
  45648. // on index) as long user is not inserting or deleting rows,
  45649. // or wanting to keep selection between server side sorting or filtering
  45650. rowNode.setDataAndId(data, index.toString());
  45651. }
  45652. else {
  45653. rowNode.setDataAndId(undefined, undefined);
  45654. }
  45655. };
  45656. InfiniteBlock.prototype.setRowNode = function (rowIndex, rowNode) {
  45657. _super.prototype.setRowNode.call(this, rowIndex, rowNode);
  45658. this.setIndexAndTopOnRowNode(rowNode, rowIndex);
  45659. };
  45660. InfiniteBlock.prototype.init = function () {
  45661. _super.prototype.init.call(this, {
  45662. context: this.getContext(),
  45663. rowRenderer: this.rowRenderer
  45664. });
  45665. };
  45666. InfiniteBlock.prototype.getNodeIdPrefix = function () {
  45667. return null;
  45668. };
  45669. InfiniteBlock.prototype.getRow = function (displayIndex) {
  45670. return this.getRowUsingLocalIndex(displayIndex);
  45671. };
  45672. InfiniteBlock.prototype.setIndexAndTopOnRowNode = function (rowNode, rowIndex) {
  45673. rowNode.setRowIndex(rowIndex);
  45674. rowNode.rowTop = this.cacheParams.rowHeight * rowIndex;
  45675. };
  45676. InfiniteBlock.prototype.loadFromDatasource = function () {
  45677. var _this = this;
  45678. // PROBLEM . . . . when the user sets sort via colDef.sort, then this code
  45679. // is executing before the sort is set up, so server is not getting the sort
  45680. // model. need to change with regards order - so the server side request is
  45681. // AFTER thus it gets the right sort model.
  45682. var params = {
  45683. startRow: this.getStartRow(),
  45684. endRow: this.getEndRow(),
  45685. successCallback: this.pageLoaded.bind(this, this.getVersion()),
  45686. failCallback: this.pageLoadFailed.bind(this),
  45687. sortModel: this.cacheParams.sortModel,
  45688. filterModel: this.cacheParams.filterModel,
  45689. context: this.gridOptionsWrapper.getContext()
  45690. };
  45691. if (_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["_"].missing(this.cacheParams.datasource.getRows)) {
  45692. console.warn("ag-Grid: datasource is missing getRows method");
  45693. return;
  45694. }
  45695. // put in timeout, to force result to be async
  45696. window.setTimeout(function () {
  45697. _this.cacheParams.datasource.getRows(params);
  45698. }, 0);
  45699. };
  45700. __decorate([
  45701. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('gridOptionsWrapper')
  45702. ], InfiniteBlock.prototype, "gridOptionsWrapper", void 0);
  45703. __decorate([
  45704. Object(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["Autowired"])('rowRenderer')
  45705. ], InfiniteBlock.prototype, "rowRenderer", void 0);
  45706. __decorate([
  45707. _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["PostConstruct"]
  45708. ], InfiniteBlock.prototype, "init", null);
  45709. return InfiniteBlock;
  45710. }(_ag_grid_community_core__WEBPACK_IMPORTED_MODULE_0__["RowNodeBlock"]));
  45711. /***/ }),
  45712. /* 223 */
  45713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45714. "use strict";
  45715. __webpack_require__.r(__webpack_exports__);
  45716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AllCommunityModules", function() { return AllCommunityModules; });
  45717. /* harmony import */ var _ag_grid_community_client_side_row_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
  45718. /* harmony import */ var _ag_grid_community_infinite_row_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(218);
  45719. /* harmony import */ var _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(211);
  45720. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClientSideRowModelModule", function() { return _ag_grid_community_client_side_row_model__WEBPACK_IMPORTED_MODULE_0__["ClientSideRowModelModule"]; });
  45721. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CsvExportModule", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["CsvExportModule"]; });
  45722. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseCreator", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["BaseCreator"]; });
  45723. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CsvCreator", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["CsvCreator"]; });
  45724. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Downloader", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["Downloader"]; });
  45725. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridSerializer", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["GridSerializer"]; });
  45726. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowType", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["RowType"]; });
  45727. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseGridSerializingSession", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["BaseGridSerializingSession"]; });
  45728. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ZipContainer", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["ZipContainer"]; });
  45729. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlFactory", function() { return _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["XmlFactory"]; });
  45730. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfiniteRowModelModule", function() { return _ag_grid_community_infinite_row_model__WEBPACK_IMPORTED_MODULE_1__["InfiniteRowModelModule"]; });
  45731. /* harmony import */ var _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
  45732. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnFactory", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColumnFactory"]; });
  45733. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnController", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColumnController"]; });
  45734. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnKeyCreator", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColumnKeyCreator"]; });
  45735. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnUtils", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColumnUtils"]; });
  45736. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DisplayedGroupCreator", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["DisplayedGroupCreator"]; });
  45737. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupInstanceIdCreator", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GroupInstanceIdCreator"]; });
  45738. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ComponentUtil", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ComponentUtil"]; });
  45739. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColDefUtil", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColDefUtil"]; });
  45740. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserComponentRegistry", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["UserComponentRegistry"]; });
  45741. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UserComponentFactory", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["UserComponentFactory"]; });
  45742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithAngular1", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["initialiseAgGridWithAngular1"]; });
  45743. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initialiseAgGridWithWebComponents", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["initialiseAgGridWithWebComponents"]; });
  45744. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BeanStub", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["BeanStub"]; });
  45745. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Context"]; });
  45746. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Autowired", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Autowired"]; });
  45747. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostConstruct", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PostConstruct"]; });
  45748. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreConstruct", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PreConstruct"]; });
  45749. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Optional", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Optional"]; });
  45750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Bean", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Bean"]; });
  45751. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Qualifier", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Qualifier"]; });
  45752. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PreDestroy", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PreDestroy"]; });
  45753. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "QuerySelector", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["QuerySelector"]; });
  45754. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GuiListener", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GuiListener"]; });
  45755. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RefSelector", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RefSelector"]; });
  45756. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridListener", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GridListener"]; });
  45757. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragAndDropService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["DragAndDropService"]; });
  45758. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragSourceType", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["DragSourceType"]; });
  45759. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalDirection", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HorizontalDirection"]; });
  45760. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VerticalDirection", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["VerticalDirection"]; });
  45761. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DragService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["DragService"]; });
  45762. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Column", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Column"]; });
  45763. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnGroup", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColumnGroup"]; });
  45764. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OriginalColumnGroup", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["OriginalColumnGroup"]; });
  45765. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNode", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowNode"]; });
  45766. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FilterManager", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["FilterManager"]; });
  45767. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProvidedFilter", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ProvidedFilter"]; });
  45768. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SimpleFilter", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SimpleFilter"]; });
  45769. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScalarFilter", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ScalarFilter"]; });
  45770. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberFilter", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["NumberFilter"]; });
  45771. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextFilter", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["TextFilter"]; });
  45772. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DateFilter", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["DateFilter"]; });
  45773. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridPanel", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GridPanel"]; });
  45774. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScrollVisibleService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ScrollVisibleService"]; });
  45775. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MouseEventService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["MouseEventService"]; });
  45776. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyDropPivotTarget", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["BodyDropPivotTarget"]; });
  45777. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BodyDropTarget", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["BodyDropTarget"]; });
  45778. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CssClassApplier", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CssClassApplier"]; });
  45779. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderContainer", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HeaderContainer"]; });
  45780. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRootComp", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HeaderRootComp"]; });
  45781. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderRowComp", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HeaderRowComp"]; });
  45782. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HorizontalResizeService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HorizontalResizeService"]; });
  45783. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MoveColumnController", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["MoveColumnController"]; });
  45784. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StandardMenuFactory", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["StandardMenuFactory"]; });
  45785. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabbedLayout", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["TabbedLayout"]; });
  45786. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "simpleHttpRequest", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["simpleHttpRequest"]; });
  45787. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResizeObserverService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ResizeObserverService"]; });
  45788. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LargeTextCellEditor", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["LargeTextCellEditor"]; });
  45789. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupEditorWrapper", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PopupEditorWrapper"]; });
  45790. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupSelectCellEditor", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PopupSelectCellEditor"]; });
  45791. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupTextCellEditor", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PopupTextCellEditor"]; });
  45792. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectCellEditor", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SelectCellEditor"]; });
  45793. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextCellEditor", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["TextCellEditor"]; });
  45794. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimateShowChangeCellRenderer", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AnimateShowChangeCellRenderer"]; });
  45795. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AnimateSlideCellRenderer", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AnimateSlideCellRenderer"]; });
  45796. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupCellRenderer", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GroupCellRenderer"]; });
  45797. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SetLeftFeature", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SetLeftFeature"]; });
  45798. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoWidthCalculator", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AutoWidthCalculator"]; });
  45799. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellRendererFactory", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CellRendererFactory"]; });
  45800. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CheckboxSelectionComponent", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CheckboxSelectionComponent"]; });
  45801. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellComp", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CellComp"]; });
  45802. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowComp", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowComp"]; });
  45803. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowRenderer", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowRenderer"]; });
  45804. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueFormatterService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ValueFormatterService"]; });
  45805. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PinnedRowModel", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PinnedRowModel"]; });
  45806. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChangedPath", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ChangedPath"]; });
  45807. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlock", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowNodeBlock"]; });
  45808. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeBlockLoader", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowNodeBlockLoader"]; });
  45809. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowNodeCache", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowNodeCache"]; });
  45810. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PaginationProxy", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PaginationProxy"]; });
  45811. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StylingService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["StylingService"]; });
  45812. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgAbstractField", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgAbstractField"]; });
  45813. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgCheckbox", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgCheckbox"]; });
  45814. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgRadioButton", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgRadioButton"]; });
  45815. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgToggleButton", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgToggleButton"]; });
  45816. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputTextField", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgInputTextField"]; });
  45817. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputTextArea", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgInputTextArea"]; });
  45818. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputNumberField", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgInputNumberField"]; });
  45819. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgInputRange", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgInputRange"]; });
  45820. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgSelect", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgSelect"]; });
  45821. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgSlider", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgSlider"]; });
  45822. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgAngleSelect", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgAngleSelect"]; });
  45823. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgColorPicker", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgColorPicker"]; });
  45824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgGroupComponent", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgGroupComponent"]; });
  45825. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgDialog", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgDialog"]; });
  45826. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AgPanel", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AgPanel"]; });
  45827. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Component", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Component"]; });
  45828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ManagedFocusComponent", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ManagedFocusComponent"]; });
  45829. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupComponent", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PopupComponent"]; });
  45830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopupService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PopupService"]; });
  45831. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchListener", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["TouchListener"]; });
  45832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualList", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["VirtualList"]; });
  45833. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellRangeType", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CellRangeType"]; });
  45834. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionHandleType", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SelectionHandleType"]; });
  45835. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VanillaFrameworkOverrides", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["VanillaFrameworkOverrides"]; });
  45836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellNavigationService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CellNavigationService"]; });
  45837. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AlignedGridsService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["AlignedGridsService"]; });
  45838. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Constants", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Constants"]; });
  45839. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Grid", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Grid"]; });
  45840. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridApi", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GridApi"]; });
  45841. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Events", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Events"]; });
  45842. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FocusController", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["FocusController"]; });
  45843. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultGroupComparator", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["defaultGroupComparator"]; });
  45844. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridOptionsWrapper", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GridOptionsWrapper"]; });
  45845. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EventService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["EventService"]; });
  45846. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectableService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SelectableService"]; });
  45847. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GridCore", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["GridCore"]; });
  45848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Logger"]; });
  45849. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LoggerFactory", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["LoggerFactory"]; });
  45850. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionController", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SelectionController"]; });
  45851. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SortController", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["SortController"]; });
  45852. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TemplateService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["TemplateService"]; });
  45853. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Color"]; });
  45854. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stringToArray", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["stringToArray"]; });
  45855. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "_", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["_"]; });
  45856. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NumberSequence", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["NumberSequence"]; });
  45857. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PromiseStatus", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PromiseStatus"]; });
  45858. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Promise", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Promise"]; });
  45859. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Timer", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Timer"]; });
  45860. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ValueService"]; });
  45861. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ValueCache", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ValueCache"]; });
  45862. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ExpressionService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ExpressionService"]; });
  45863. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CellPositionUtils", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["CellPositionUtils"]; });
  45864. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RowPositionUtils", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["RowPositionUtils"]; });
  45865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderPositionUtils", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HeaderPositionUtils"]; });
  45866. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationService", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HeaderNavigationService"]; });
  45867. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HeaderNavigationDirection", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["HeaderNavigationDirection"]; });
  45868. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyKeys", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["PropertyKeys"]; });
  45869. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColumnApi", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ColumnApi"]; });
  45870. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseComponentWrapper", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["BaseComponentWrapper"]; });
  45871. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["Environment"]; });
  45872. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TooltipFeature", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["TooltipFeature"]; });
  45873. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ChartType", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ChartType"]; });
  45874. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LegendPosition", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["LegendPosition"]; });
  45875. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleNames", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ModuleNames"]; });
  45876. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModuleRegistry", function() { return _ag_grid_community_core__WEBPACK_IMPORTED_MODULE_3__["ModuleRegistry"]; });
  45877. var AllCommunityModules = [_ag_grid_community_client_side_row_model__WEBPACK_IMPORTED_MODULE_0__["ClientSideRowModelModule"], _ag_grid_community_infinite_row_model__WEBPACK_IMPORTED_MODULE_1__["InfiniteRowModelModule"], _ag_grid_community_csv_export__WEBPACK_IMPORTED_MODULE_2__["CsvExportModule"]];
  45878. /***/ })
  45879. /******/ ]);
  45880. });