vue-grid-layout.umd.js 413 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("vue"));
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["VueGridLayout"] = factory(require("vue"));
  8. else
  9. root["VueGridLayout"] = factory(root["Vue"]);
  10. })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "fb15");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "01f9":
  99. /***/ (function(module, exports, __webpack_require__) {
  100. "use strict";
  101. var LIBRARY = __webpack_require__("2d00");
  102. var $export = __webpack_require__("5ca1");
  103. var redefine = __webpack_require__("2aba");
  104. var hide = __webpack_require__("32e9");
  105. var Iterators = __webpack_require__("84f2");
  106. var $iterCreate = __webpack_require__("41a0");
  107. var setToStringTag = __webpack_require__("7f20");
  108. var getPrototypeOf = __webpack_require__("38fd");
  109. var ITERATOR = __webpack_require__("2b4c")('iterator');
  110. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  111. var FF_ITERATOR = '@@iterator';
  112. var KEYS = 'keys';
  113. var VALUES = 'values';
  114. var returnThis = function () { return this; };
  115. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  116. $iterCreate(Constructor, NAME, next);
  117. var getMethod = function (kind) {
  118. if (!BUGGY && kind in proto) return proto[kind];
  119. switch (kind) {
  120. case KEYS: return function keys() { return new Constructor(this, kind); };
  121. case VALUES: return function values() { return new Constructor(this, kind); };
  122. } return function entries() { return new Constructor(this, kind); };
  123. };
  124. var TAG = NAME + ' Iterator';
  125. var DEF_VALUES = DEFAULT == VALUES;
  126. var VALUES_BUG = false;
  127. var proto = Base.prototype;
  128. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  129. var $default = $native || getMethod(DEFAULT);
  130. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  131. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  132. var methods, key, IteratorPrototype;
  133. // Fix native
  134. if ($anyNative) {
  135. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  136. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  137. // Set @@toStringTag to native iterators
  138. setToStringTag(IteratorPrototype, TAG, true);
  139. // fix for some old engines
  140. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  141. }
  142. }
  143. // fix Array#{values, @@iterator}.name in V8 / FF
  144. if (DEF_VALUES && $native && $native.name !== VALUES) {
  145. VALUES_BUG = true;
  146. $default = function values() { return $native.call(this); };
  147. }
  148. // Define iterator
  149. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  150. hide(proto, ITERATOR, $default);
  151. }
  152. // Plug for library
  153. Iterators[NAME] = $default;
  154. Iterators[TAG] = returnThis;
  155. if (DEFAULT) {
  156. methods = {
  157. values: DEF_VALUES ? $default : getMethod(VALUES),
  158. keys: IS_SET ? $default : getMethod(KEYS),
  159. entries: $entries
  160. };
  161. if (FORCED) for (key in methods) {
  162. if (!(key in proto)) redefine(proto, key, methods[key]);
  163. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  164. }
  165. return methods;
  166. };
  167. /***/ }),
  168. /***/ "02f4":
  169. /***/ (function(module, exports, __webpack_require__) {
  170. var toInteger = __webpack_require__("4588");
  171. var defined = __webpack_require__("be13");
  172. // true -> String#at
  173. // false -> String#codePointAt
  174. module.exports = function (TO_STRING) {
  175. return function (that, pos) {
  176. var s = String(defined(that));
  177. var i = toInteger(pos);
  178. var l = s.length;
  179. var a, b;
  180. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  181. a = s.charCodeAt(i);
  182. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  183. ? TO_STRING ? s.charAt(i) : a
  184. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  185. };
  186. };
  187. /***/ }),
  188. /***/ "0390":
  189. /***/ (function(module, exports, __webpack_require__) {
  190. "use strict";
  191. var at = __webpack_require__("02f4")(true);
  192. // `AdvanceStringIndex` abstract operation
  193. // https://tc39.github.io/ecma262/#sec-advancestringindex
  194. module.exports = function (S, index, unicode) {
  195. return index + (unicode ? at(S, index).length : 1);
  196. };
  197. /***/ }),
  198. /***/ "07e3":
  199. /***/ (function(module, exports) {
  200. var hasOwnProperty = {}.hasOwnProperty;
  201. module.exports = function (it, key) {
  202. return hasOwnProperty.call(it, key);
  203. };
  204. /***/ }),
  205. /***/ "0bfb":
  206. /***/ (function(module, exports, __webpack_require__) {
  207. "use strict";
  208. // 21.2.5.3 get RegExp.prototype.flags
  209. var anObject = __webpack_require__("cb7c");
  210. module.exports = function () {
  211. var that = anObject(this);
  212. var result = '';
  213. if (that.global) result += 'g';
  214. if (that.ignoreCase) result += 'i';
  215. if (that.multiline) result += 'm';
  216. if (that.unicode) result += 'u';
  217. if (that.sticky) result += 'y';
  218. return result;
  219. };
  220. /***/ }),
  221. /***/ "0d58":
  222. /***/ (function(module, exports, __webpack_require__) {
  223. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  224. var $keys = __webpack_require__("ce10");
  225. var enumBugKeys = __webpack_require__("e11e");
  226. module.exports = Object.keys || function keys(O) {
  227. return $keys(O, enumBugKeys);
  228. };
  229. /***/ }),
  230. /***/ "0fc9":
  231. /***/ (function(module, exports, __webpack_require__) {
  232. var toInteger = __webpack_require__("3a38");
  233. var max = Math.max;
  234. var min = Math.min;
  235. module.exports = function (index, length) {
  236. index = toInteger(index);
  237. return index < 0 ? max(index + length, 0) : min(index, length);
  238. };
  239. /***/ }),
  240. /***/ "1156":
  241. /***/ (function(module, exports, __webpack_require__) {
  242. // style-loader: Adds some css to the DOM by adding a <style> tag
  243. // load the styles
  244. var content = __webpack_require__("ad20");
  245. if(typeof content === 'string') content = [[module.i, content, '']];
  246. if(content.locals) module.exports = content.locals;
  247. // add the styles to the DOM
  248. var add = __webpack_require__("499e").default
  249. var update = add("c1ec597e", content, true, {"sourceMap":false,"shadowMode":false});
  250. /***/ }),
  251. /***/ "11e9":
  252. /***/ (function(module, exports, __webpack_require__) {
  253. var pIE = __webpack_require__("52a7");
  254. var createDesc = __webpack_require__("4630");
  255. var toIObject = __webpack_require__("6821");
  256. var toPrimitive = __webpack_require__("6a99");
  257. var has = __webpack_require__("69a8");
  258. var IE8_DOM_DEFINE = __webpack_require__("c69a");
  259. var gOPD = Object.getOwnPropertyDescriptor;
  260. exports.f = __webpack_require__("9e1e") ? gOPD : function getOwnPropertyDescriptor(O, P) {
  261. O = toIObject(O);
  262. P = toPrimitive(P, true);
  263. if (IE8_DOM_DEFINE) try {
  264. return gOPD(O, P);
  265. } catch (e) { /* empty */ }
  266. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  267. };
  268. /***/ }),
  269. /***/ "1495":
  270. /***/ (function(module, exports, __webpack_require__) {
  271. var dP = __webpack_require__("86cc");
  272. var anObject = __webpack_require__("cb7c");
  273. var getKeys = __webpack_require__("0d58");
  274. module.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
  275. anObject(O);
  276. var keys = getKeys(Properties);
  277. var length = keys.length;
  278. var i = 0;
  279. var P;
  280. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  281. return O;
  282. };
  283. /***/ }),
  284. /***/ "1691":
  285. /***/ (function(module, exports) {
  286. // IE 8- don't enum bug keys
  287. module.exports = (
  288. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  289. ).split(',');
  290. /***/ }),
  291. /***/ "18d2":
  292. /***/ (function(module, exports, __webpack_require__) {
  293. "use strict";
  294. /**
  295. * Resize detection strategy that injects objects to elements in order to detect resize events.
  296. * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/
  297. */
  298. var browserDetector = __webpack_require__("18e9");
  299. module.exports = function(options) {
  300. options = options || {};
  301. var reporter = options.reporter;
  302. var batchProcessor = options.batchProcessor;
  303. var getState = options.stateHandler.getState;
  304. if(!reporter) {
  305. throw new Error("Missing required dependency: reporter.");
  306. }
  307. /**
  308. * Adds a resize event listener to the element.
  309. * @public
  310. * @param {element} element The element that should have the listener added.
  311. * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
  312. */
  313. function addListener(element, listener) {
  314. if(!getObject(element)) {
  315. throw new Error("Element is not detectable by this strategy.");
  316. }
  317. function listenerProxy() {
  318. listener(element);
  319. }
  320. if(browserDetector.isIE(8)) {
  321. //IE 8 does not support object, but supports the resize event directly on elements.
  322. getState(element).object = {
  323. proxy: listenerProxy
  324. };
  325. element.attachEvent("onresize", listenerProxy);
  326. } else {
  327. var object = getObject(element);
  328. object.contentDocument.defaultView.addEventListener("resize", listenerProxy);
  329. }
  330. }
  331. /**
  332. * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
  333. * @private
  334. * @param {object} options Optional options object.
  335. * @param {element} element The element to make detectable
  336. * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
  337. */
  338. function makeDetectable(options, element, callback) {
  339. if (!callback) {
  340. callback = element;
  341. element = options;
  342. options = null;
  343. }
  344. options = options || {};
  345. var debug = options.debug;
  346. function injectObject(element, callback) {
  347. var OBJECT_STYLE = "display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;";
  348. //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.
  349. // Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.
  350. var positionCheckPerformed = false;
  351. // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.
  352. // Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.
  353. var style = window.getComputedStyle(element);
  354. var width = element.offsetWidth;
  355. var height = element.offsetHeight;
  356. getState(element).startSize = {
  357. width: width,
  358. height: height
  359. };
  360. function mutateDom() {
  361. function alterPositionStyles() {
  362. if(style.position === "static") {
  363. element.style.position = "relative";
  364. var removeRelativeStyles = function(reporter, element, style, property) {
  365. function getNumericalValue(value) {
  366. return value.replace(/[^-\d\.]/g, "");
  367. }
  368. var value = style[property];
  369. if(value !== "auto" && getNumericalValue(value) !== "0") {
  370. reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
  371. element.style[property] = 0;
  372. }
  373. };
  374. //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
  375. //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
  376. removeRelativeStyles(reporter, element, style, "top");
  377. removeRelativeStyles(reporter, element, style, "right");
  378. removeRelativeStyles(reporter, element, style, "bottom");
  379. removeRelativeStyles(reporter, element, style, "left");
  380. }
  381. }
  382. function onObjectLoad() {
  383. // The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.
  384. if (!positionCheckPerformed) {
  385. alterPositionStyles();
  386. }
  387. /*jshint validthis: true */
  388. function getDocument(element, callback) {
  389. //Opera 12 seem to call the object.onload before the actual document has been created.
  390. //So if it is not present, poll it with an timeout until it is present.
  391. //TODO: Could maybe be handled better with object.onreadystatechange or similar.
  392. if(!element.contentDocument) {
  393. setTimeout(function checkForObjectDocument() {
  394. getDocument(element, callback);
  395. }, 100);
  396. return;
  397. }
  398. callback(element.contentDocument);
  399. }
  400. //Mutating the object element here seems to fire another load event.
  401. //Mutating the inner document of the object element is fine though.
  402. var objectElement = this;
  403. //Create the style element to be added to the object.
  404. getDocument(objectElement, function onObjectDocumentReady(objectDocument) {
  405. //Notify that the element is ready to be listened to.
  406. callback(element);
  407. });
  408. }
  409. // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.
  410. // The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.
  411. if (style.position !== "") {
  412. alterPositionStyles(style);
  413. positionCheckPerformed = true;
  414. }
  415. //Add an object element as a child to the target element that will be listened to for resize events.
  416. var object = document.createElement("object");
  417. object.style.cssText = OBJECT_STYLE;
  418. object.tabIndex = -1;
  419. object.type = "text/html";
  420. object.setAttribute("aria-hidden", "true");
  421. object.onload = onObjectLoad;
  422. //Safari: This must occur before adding the object to the DOM.
  423. //IE: Does not like that this happens before, even if it is also added after.
  424. if(!browserDetector.isIE()) {
  425. object.data = "about:blank";
  426. }
  427. element.appendChild(object);
  428. getState(element).object = object;
  429. //IE: This must occur after adding the object to the DOM.
  430. if(browserDetector.isIE()) {
  431. object.data = "about:blank";
  432. }
  433. }
  434. if(batchProcessor) {
  435. batchProcessor.add(mutateDom);
  436. } else {
  437. mutateDom();
  438. }
  439. }
  440. if(browserDetector.isIE(8)) {
  441. //IE 8 does not support objects properly. Luckily they do support the resize event.
  442. //So do not inject the object and notify that the element is already ready to be listened to.
  443. //The event handler for the resize event is attached in the utils.addListener instead.
  444. callback(element);
  445. } else {
  446. injectObject(element, callback);
  447. }
  448. }
  449. /**
  450. * Returns the child object of the target element.
  451. * @private
  452. * @param {element} element The target element.
  453. * @returns The object element of the target.
  454. */
  455. function getObject(element) {
  456. return getState(element).object;
  457. }
  458. function uninstall(element) {
  459. if(browserDetector.isIE(8)) {
  460. element.detachEvent("onresize", getState(element).object.proxy);
  461. } else {
  462. element.removeChild(getObject(element));
  463. }
  464. delete getState(element).object;
  465. }
  466. return {
  467. makeDetectable: makeDetectable,
  468. addListener: addListener,
  469. uninstall: uninstall
  470. };
  471. };
  472. /***/ }),
  473. /***/ "18e9":
  474. /***/ (function(module, exports, __webpack_require__) {
  475. "use strict";
  476. var detector = module.exports = {};
  477. detector.isIE = function(version) {
  478. function isAnyIeVersion() {
  479. var agent = navigator.userAgent.toLowerCase();
  480. return agent.indexOf("msie") !== -1 || agent.indexOf("trident") !== -1 || agent.indexOf(" edge/") !== -1;
  481. }
  482. if(!isAnyIeVersion()) {
  483. return false;
  484. }
  485. if(!version) {
  486. return true;
  487. }
  488. //Shamelessly stolen from https://gist.github.com/padolsey/527683
  489. var ieVersion = (function(){
  490. var undef,
  491. v = 3,
  492. div = document.createElement("div"),
  493. all = div.getElementsByTagName("i");
  494. do {
  495. div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->";
  496. }
  497. while (all[0]);
  498. return v > 4 ? v : undef;
  499. }());
  500. return version === ieVersion;
  501. };
  502. detector.isLegacyOpera = function() {
  503. return !!window.opera;
  504. };
  505. /***/ }),
  506. /***/ "1af6":
  507. /***/ (function(module, exports, __webpack_require__) {
  508. // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
  509. var $export = __webpack_require__("63b6");
  510. $export($export.S, 'Array', { isArray: __webpack_require__("9003") });
  511. /***/ }),
  512. /***/ "1bc3":
  513. /***/ (function(module, exports, __webpack_require__) {
  514. // 7.1.1 ToPrimitive(input [, PreferredType])
  515. var isObject = __webpack_require__("f772");
  516. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  517. // and the second argument - flag - preferred type is a string
  518. module.exports = function (it, S) {
  519. if (!isObject(it)) return it;
  520. var fn, val;
  521. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  522. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  523. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  524. throw TypeError("Can't convert object to primitive value");
  525. };
  526. /***/ }),
  527. /***/ "1ec9":
  528. /***/ (function(module, exports, __webpack_require__) {
  529. var isObject = __webpack_require__("f772");
  530. var document = __webpack_require__("e53d").document;
  531. // typeof document.createElement is 'object' in old IE
  532. var is = isObject(document) && isObject(document.createElement);
  533. module.exports = function (it) {
  534. return is ? document.createElement(it) : {};
  535. };
  536. /***/ }),
  537. /***/ "214f":
  538. /***/ (function(module, exports, __webpack_require__) {
  539. "use strict";
  540. __webpack_require__("b0c5");
  541. var redefine = __webpack_require__("2aba");
  542. var hide = __webpack_require__("32e9");
  543. var fails = __webpack_require__("79e5");
  544. var defined = __webpack_require__("be13");
  545. var wks = __webpack_require__("2b4c");
  546. var regexpExec = __webpack_require__("520a");
  547. var SPECIES = wks('species');
  548. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  549. // #replace needs built-in support for named groups.
  550. // #match works fine because it just return the exec results, even if it has
  551. // a "grops" property.
  552. var re = /./;
  553. re.exec = function () {
  554. var result = [];
  555. result.groups = { a: '7' };
  556. return result;
  557. };
  558. return ''.replace(re, '$<a>') !== '7';
  559. });
  560. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
  561. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  562. var re = /(?:)/;
  563. var originalExec = re.exec;
  564. re.exec = function () { return originalExec.apply(this, arguments); };
  565. var result = 'ab'.split(re);
  566. return result.length === 2 && result[0] === 'a' && result[1] === 'b';
  567. })();
  568. module.exports = function (KEY, length, exec) {
  569. var SYMBOL = wks(KEY);
  570. var DELEGATES_TO_SYMBOL = !fails(function () {
  571. // String methods call symbol-named RegEp methods
  572. var O = {};
  573. O[SYMBOL] = function () { return 7; };
  574. return ''[KEY](O) != 7;
  575. });
  576. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
  577. // Symbol-named RegExp methods call .exec
  578. var execCalled = false;
  579. var re = /a/;
  580. re.exec = function () { execCalled = true; return null; };
  581. if (KEY === 'split') {
  582. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  583. // a new one. We need to return the patched regex when creating the new one.
  584. re.constructor = {};
  585. re.constructor[SPECIES] = function () { return re; };
  586. }
  587. re[SYMBOL]('');
  588. return !execCalled;
  589. }) : undefined;
  590. if (
  591. !DELEGATES_TO_SYMBOL ||
  592. !DELEGATES_TO_EXEC ||
  593. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  594. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  595. ) {
  596. var nativeRegExpMethod = /./[SYMBOL];
  597. var fns = exec(
  598. defined,
  599. SYMBOL,
  600. ''[KEY],
  601. function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
  602. if (regexp.exec === regexpExec) {
  603. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  604. // The native String method already delegates to @@method (this
  605. // polyfilled function), leasing to infinite recursion.
  606. // We avoid it by directly calling the native @@method method.
  607. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  608. }
  609. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  610. }
  611. return { done: false };
  612. }
  613. );
  614. var strfn = fns[0];
  615. var rxfn = fns[1];
  616. redefine(String.prototype, KEY, strfn);
  617. hide(RegExp.prototype, SYMBOL, length == 2
  618. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  619. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  620. ? function (string, arg) { return rxfn.call(string, this, arg); }
  621. // 21.2.5.6 RegExp.prototype[@@match](string)
  622. // 21.2.5.9 RegExp.prototype[@@search](string)
  623. : function (string) { return rxfn.call(string, this); }
  624. );
  625. }
  626. };
  627. /***/ }),
  628. /***/ "230e":
  629. /***/ (function(module, exports, __webpack_require__) {
  630. var isObject = __webpack_require__("d3f4");
  631. var document = __webpack_require__("7726").document;
  632. // typeof document.createElement is 'object' in old IE
  633. var is = isObject(document) && isObject(document.createElement);
  634. module.exports = function (it) {
  635. return is ? document.createElement(it) : {};
  636. };
  637. /***/ }),
  638. /***/ "2350":
  639. /***/ (function(module, exports) {
  640. /*
  641. MIT License http://www.opensource.org/licenses/mit-license.php
  642. Author Tobias Koppers @sokra
  643. */
  644. // css base code, injected by the css-loader
  645. module.exports = function(useSourceMap) {
  646. var list = [];
  647. // return the list of modules as css string
  648. list.toString = function toString() {
  649. return this.map(function (item) {
  650. var content = cssWithMappingToString(item, useSourceMap);
  651. if(item[2]) {
  652. return "@media " + item[2] + "{" + content + "}";
  653. } else {
  654. return content;
  655. }
  656. }).join("");
  657. };
  658. // import a list of modules into the list
  659. list.i = function(modules, mediaQuery) {
  660. if(typeof modules === "string")
  661. modules = [[null, modules, ""]];
  662. var alreadyImportedModules = {};
  663. for(var i = 0; i < this.length; i++) {
  664. var id = this[i][0];
  665. if(typeof id === "number")
  666. alreadyImportedModules[id] = true;
  667. }
  668. for(i = 0; i < modules.length; i++) {
  669. var item = modules[i];
  670. // skip already imported module
  671. // this implementation is not 100% perfect for weird media query combinations
  672. // when a module is imported multiple times with different media queries.
  673. // I hope this will never occur (Hey this way we have smaller bundles)
  674. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  675. if(mediaQuery && !item[2]) {
  676. item[2] = mediaQuery;
  677. } else if(mediaQuery) {
  678. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  679. }
  680. list.push(item);
  681. }
  682. }
  683. };
  684. return list;
  685. };
  686. function cssWithMappingToString(item, useSourceMap) {
  687. var content = item[1] || '';
  688. var cssMapping = item[3];
  689. if (!cssMapping) {
  690. return content;
  691. }
  692. if (useSourceMap && typeof btoa === 'function') {
  693. var sourceMapping = toComment(cssMapping);
  694. var sourceURLs = cssMapping.sources.map(function (source) {
  695. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
  696. });
  697. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  698. }
  699. return [content].join('\n');
  700. }
  701. // Adapted from convert-source-map (MIT)
  702. function toComment(sourceMap) {
  703. // eslint-disable-next-line no-undef
  704. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  705. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  706. return '/*# ' + data + ' */';
  707. }
  708. /***/ }),
  709. /***/ "23c6":
  710. /***/ (function(module, exports, __webpack_require__) {
  711. // getting tag from 19.1.3.6 Object.prototype.toString()
  712. var cof = __webpack_require__("2d95");
  713. var TAG = __webpack_require__("2b4c")('toStringTag');
  714. // ES3 wrong here
  715. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  716. // fallback for IE11 Script Access Denied error
  717. var tryGet = function (it, key) {
  718. try {
  719. return it[key];
  720. } catch (e) { /* empty */ }
  721. };
  722. module.exports = function (it) {
  723. var O, T, B;
  724. return it === undefined ? 'Undefined' : it === null ? 'Null'
  725. // @@toStringTag case
  726. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  727. // builtinTag case
  728. : ARG ? cof(O)
  729. // ES3 arguments fallback
  730. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  731. };
  732. /***/ }),
  733. /***/ "241e":
  734. /***/ (function(module, exports, __webpack_require__) {
  735. // 7.1.13 ToObject(argument)
  736. var defined = __webpack_require__("25eb");
  737. module.exports = function (it) {
  738. return Object(defined(it));
  739. };
  740. /***/ }),
  741. /***/ "25eb":
  742. /***/ (function(module, exports) {
  743. // 7.2.1 RequireObjectCoercible(argument)
  744. module.exports = function (it) {
  745. if (it == undefined) throw TypeError("Can't call method on " + it);
  746. return it;
  747. };
  748. /***/ }),
  749. /***/ "294c":
  750. /***/ (function(module, exports) {
  751. module.exports = function (exec) {
  752. try {
  753. return !!exec();
  754. } catch (e) {
  755. return true;
  756. }
  757. };
  758. /***/ }),
  759. /***/ "2aba":
  760. /***/ (function(module, exports, __webpack_require__) {
  761. var global = __webpack_require__("7726");
  762. var hide = __webpack_require__("32e9");
  763. var has = __webpack_require__("69a8");
  764. var SRC = __webpack_require__("ca5a")('src');
  765. var $toString = __webpack_require__("fa5b");
  766. var TO_STRING = 'toString';
  767. var TPL = ('' + $toString).split(TO_STRING);
  768. __webpack_require__("8378").inspectSource = function (it) {
  769. return $toString.call(it);
  770. };
  771. (module.exports = function (O, key, val, safe) {
  772. var isFunction = typeof val == 'function';
  773. if (isFunction) has(val, 'name') || hide(val, 'name', key);
  774. if (O[key] === val) return;
  775. if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  776. if (O === global) {
  777. O[key] = val;
  778. } else if (!safe) {
  779. delete O[key];
  780. hide(O, key, val);
  781. } else if (O[key]) {
  782. O[key] = val;
  783. } else {
  784. hide(O, key, val);
  785. }
  786. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  787. })(Function.prototype, TO_STRING, function toString() {
  788. return typeof this == 'function' && this[SRC] || $toString.call(this);
  789. });
  790. /***/ }),
  791. /***/ "2aeb":
  792. /***/ (function(module, exports, __webpack_require__) {
  793. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  794. var anObject = __webpack_require__("cb7c");
  795. var dPs = __webpack_require__("1495");
  796. var enumBugKeys = __webpack_require__("e11e");
  797. var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
  798. var Empty = function () { /* empty */ };
  799. var PROTOTYPE = 'prototype';
  800. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  801. var createDict = function () {
  802. // Thrash, waste and sodomy: IE GC bug
  803. var iframe = __webpack_require__("230e")('iframe');
  804. var i = enumBugKeys.length;
  805. var lt = '<';
  806. var gt = '>';
  807. var iframeDocument;
  808. iframe.style.display = 'none';
  809. __webpack_require__("fab2").appendChild(iframe);
  810. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  811. // createDict = iframe.contentWindow.Object;
  812. // html.removeChild(iframe);
  813. iframeDocument = iframe.contentWindow.document;
  814. iframeDocument.open();
  815. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  816. iframeDocument.close();
  817. createDict = iframeDocument.F;
  818. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  819. return createDict();
  820. };
  821. module.exports = Object.create || function create(O, Properties) {
  822. var result;
  823. if (O !== null) {
  824. Empty[PROTOTYPE] = anObject(O);
  825. result = new Empty();
  826. Empty[PROTOTYPE] = null;
  827. // add "__proto__" for Object.getPrototypeOf polyfill
  828. result[IE_PROTO] = O;
  829. } else result = createDict();
  830. return Properties === undefined ? result : dPs(result, Properties);
  831. };
  832. /***/ }),
  833. /***/ "2b4c":
  834. /***/ (function(module, exports, __webpack_require__) {
  835. var store = __webpack_require__("5537")('wks');
  836. var uid = __webpack_require__("ca5a");
  837. var Symbol = __webpack_require__("7726").Symbol;
  838. var USE_SYMBOL = typeof Symbol == 'function';
  839. var $exports = module.exports = function (name) {
  840. return store[name] || (store[name] =
  841. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  842. };
  843. $exports.store = store;
  844. /***/ }),
  845. /***/ "2cef":
  846. /***/ (function(module, exports, __webpack_require__) {
  847. "use strict";
  848. module.exports = function() {
  849. var idCount = 1;
  850. /**
  851. * Generates a new unique id in the context.
  852. * @public
  853. * @returns {number} A unique id in the context.
  854. */
  855. function generate() {
  856. return idCount++;
  857. }
  858. return {
  859. generate: generate
  860. };
  861. };
  862. /***/ }),
  863. /***/ "2d00":
  864. /***/ (function(module, exports) {
  865. module.exports = false;
  866. /***/ }),
  867. /***/ "2d95":
  868. /***/ (function(module, exports) {
  869. var toString = {}.toString;
  870. module.exports = function (it) {
  871. return toString.call(it).slice(8, -1);
  872. };
  873. /***/ }),
  874. /***/ "2f21":
  875. /***/ (function(module, exports, __webpack_require__) {
  876. "use strict";
  877. var fails = __webpack_require__("79e5");
  878. module.exports = function (method, arg) {
  879. return !!method && fails(function () {
  880. // eslint-disable-next-line no-useless-call
  881. arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
  882. });
  883. };
  884. /***/ }),
  885. /***/ "32a6":
  886. /***/ (function(module, exports, __webpack_require__) {
  887. // 19.1.2.14 Object.keys(O)
  888. var toObject = __webpack_require__("241e");
  889. var $keys = __webpack_require__("c3a1");
  890. __webpack_require__("ce7e")('keys', function () {
  891. return function keys(it) {
  892. return $keys(toObject(it));
  893. };
  894. });
  895. /***/ }),
  896. /***/ "32e9":
  897. /***/ (function(module, exports, __webpack_require__) {
  898. var dP = __webpack_require__("86cc");
  899. var createDesc = __webpack_require__("4630");
  900. module.exports = __webpack_require__("9e1e") ? function (object, key, value) {
  901. return dP.f(object, key, createDesc(1, value));
  902. } : function (object, key, value) {
  903. object[key] = value;
  904. return object;
  905. };
  906. /***/ }),
  907. /***/ "335c":
  908. /***/ (function(module, exports, __webpack_require__) {
  909. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  910. var cof = __webpack_require__("6b4c");
  911. // eslint-disable-next-line no-prototype-builtins
  912. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  913. return cof(it) == 'String' ? it.split('') : Object(it);
  914. };
  915. /***/ }),
  916. /***/ "35e8":
  917. /***/ (function(module, exports, __webpack_require__) {
  918. var dP = __webpack_require__("d9f6");
  919. var createDesc = __webpack_require__("aebd");
  920. module.exports = __webpack_require__("8e60") ? function (object, key, value) {
  921. return dP.f(object, key, createDesc(1, value));
  922. } : function (object, key, value) {
  923. object[key] = value;
  924. return object;
  925. };
  926. /***/ }),
  927. /***/ "36c3":
  928. /***/ (function(module, exports, __webpack_require__) {
  929. // to indexed object, toObject with fallback for non-array-like ES3 strings
  930. var IObject = __webpack_require__("335c");
  931. var defined = __webpack_require__("25eb");
  932. module.exports = function (it) {
  933. return IObject(defined(it));
  934. };
  935. /***/ }),
  936. /***/ "38fd":
  937. /***/ (function(module, exports, __webpack_require__) {
  938. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  939. var has = __webpack_require__("69a8");
  940. var toObject = __webpack_require__("4bf8");
  941. var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
  942. var ObjectProto = Object.prototype;
  943. module.exports = Object.getPrototypeOf || function (O) {
  944. O = toObject(O);
  945. if (has(O, IE_PROTO)) return O[IE_PROTO];
  946. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  947. return O.constructor.prototype;
  948. } return O instanceof Object ? ObjectProto : null;
  949. };
  950. /***/ }),
  951. /***/ "3a38":
  952. /***/ (function(module, exports) {
  953. // 7.1.4 ToInteger
  954. var ceil = Math.ceil;
  955. var floor = Math.floor;
  956. module.exports = function (it) {
  957. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  958. };
  959. /***/ }),
  960. /***/ "41a0":
  961. /***/ (function(module, exports, __webpack_require__) {
  962. "use strict";
  963. var create = __webpack_require__("2aeb");
  964. var descriptor = __webpack_require__("4630");
  965. var setToStringTag = __webpack_require__("7f20");
  966. var IteratorPrototype = {};
  967. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  968. __webpack_require__("32e9")(IteratorPrototype, __webpack_require__("2b4c")('iterator'), function () { return this; });
  969. module.exports = function (Constructor, NAME, next) {
  970. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  971. setToStringTag(Constructor, NAME + ' Iterator');
  972. };
  973. /***/ }),
  974. /***/ "4588":
  975. /***/ (function(module, exports) {
  976. // 7.1.4 ToInteger
  977. var ceil = Math.ceil;
  978. var floor = Math.floor;
  979. module.exports = function (it) {
  980. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  981. };
  982. /***/ }),
  983. /***/ "4630":
  984. /***/ (function(module, exports) {
  985. module.exports = function (bitmap, value) {
  986. return {
  987. enumerable: !(bitmap & 1),
  988. configurable: !(bitmap & 2),
  989. writable: !(bitmap & 4),
  990. value: value
  991. };
  992. };
  993. /***/ }),
  994. /***/ "499e":
  995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  996. "use strict";
  997. __webpack_require__.r(__webpack_exports__);
  998. // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/listToStyles.js
  999. /**
  1000. * Translates the list format produced by css-loader into something
  1001. * easier to manipulate.
  1002. */
  1003. function listToStyles (parentId, list) {
  1004. var styles = []
  1005. var newStyles = {}
  1006. for (var i = 0; i < list.length; i++) {
  1007. var item = list[i]
  1008. var id = item[0]
  1009. var css = item[1]
  1010. var media = item[2]
  1011. var sourceMap = item[3]
  1012. var part = {
  1013. id: parentId + ':' + i,
  1014. css: css,
  1015. media: media,
  1016. sourceMap: sourceMap
  1017. }
  1018. if (!newStyles[id]) {
  1019. styles.push(newStyles[id] = { id: id, parts: [part] })
  1020. } else {
  1021. newStyles[id].parts.push(part)
  1022. }
  1023. }
  1024. return styles
  1025. }
  1026. // CONCATENATED MODULE: ./node_modules/vue-style-loader/lib/addStylesClient.js
  1027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return addStylesClient; });
  1028. /*
  1029. MIT License http://www.opensource.org/licenses/mit-license.php
  1030. Author Tobias Koppers @sokra
  1031. Modified by Evan You @yyx990803
  1032. */
  1033. var hasDocument = typeof document !== 'undefined'
  1034. if (typeof DEBUG !== 'undefined' && DEBUG) {
  1035. if (!hasDocument) {
  1036. throw new Error(
  1037. 'vue-style-loader cannot be used in a non-browser environment. ' +
  1038. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  1039. ) }
  1040. }
  1041. /*
  1042. type StyleObject = {
  1043. id: number;
  1044. parts: Array<StyleObjectPart>
  1045. }
  1046. type StyleObjectPart = {
  1047. css: string;
  1048. media: string;
  1049. sourceMap: ?string
  1050. }
  1051. */
  1052. var stylesInDom = {/*
  1053. [id: number]: {
  1054. id: number,
  1055. refs: number,
  1056. parts: Array<(obj?: StyleObjectPart) => void>
  1057. }
  1058. */}
  1059. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  1060. var singletonElement = null
  1061. var singletonCounter = 0
  1062. var isProduction = false
  1063. var noop = function () {}
  1064. var options = null
  1065. var ssrIdKey = 'data-vue-ssr-id'
  1066. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  1067. // tags it will allow on a page
  1068. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  1069. function addStylesClient (parentId, list, _isProduction, _options) {
  1070. isProduction = _isProduction
  1071. options = _options || {}
  1072. var styles = listToStyles(parentId, list)
  1073. addStylesToDom(styles)
  1074. return function update (newList) {
  1075. var mayRemove = []
  1076. for (var i = 0; i < styles.length; i++) {
  1077. var item = styles[i]
  1078. var domStyle = stylesInDom[item.id]
  1079. domStyle.refs--
  1080. mayRemove.push(domStyle)
  1081. }
  1082. if (newList) {
  1083. styles = listToStyles(parentId, newList)
  1084. addStylesToDom(styles)
  1085. } else {
  1086. styles = []
  1087. }
  1088. for (var i = 0; i < mayRemove.length; i++) {
  1089. var domStyle = mayRemove[i]
  1090. if (domStyle.refs === 0) {
  1091. for (var j = 0; j < domStyle.parts.length; j++) {
  1092. domStyle.parts[j]()
  1093. }
  1094. delete stylesInDom[domStyle.id]
  1095. }
  1096. }
  1097. }
  1098. }
  1099. function addStylesToDom (styles /* Array<StyleObject> */) {
  1100. for (var i = 0; i < styles.length; i++) {
  1101. var item = styles[i]
  1102. var domStyle = stylesInDom[item.id]
  1103. if (domStyle) {
  1104. domStyle.refs++
  1105. for (var j = 0; j < domStyle.parts.length; j++) {
  1106. domStyle.parts[j](item.parts[j])
  1107. }
  1108. for (; j < item.parts.length; j++) {
  1109. domStyle.parts.push(addStyle(item.parts[j]))
  1110. }
  1111. if (domStyle.parts.length > item.parts.length) {
  1112. domStyle.parts.length = item.parts.length
  1113. }
  1114. } else {
  1115. var parts = []
  1116. for (var j = 0; j < item.parts.length; j++) {
  1117. parts.push(addStyle(item.parts[j]))
  1118. }
  1119. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  1120. }
  1121. }
  1122. }
  1123. function createStyleElement () {
  1124. var styleElement = document.createElement('style')
  1125. styleElement.type = 'text/css'
  1126. head.appendChild(styleElement)
  1127. return styleElement
  1128. }
  1129. function addStyle (obj /* StyleObjectPart */) {
  1130. var update, remove
  1131. var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]')
  1132. if (styleElement) {
  1133. if (isProduction) {
  1134. // has SSR styles and in production mode.
  1135. // simply do nothing.
  1136. return noop
  1137. } else {
  1138. // has SSR styles but in dev mode.
  1139. // for some reason Chrome can't handle source map in server-rendered
  1140. // style tags - source maps in <style> only works if the style tag is
  1141. // created and inserted dynamically. So we remove the server rendered
  1142. // styles and inject new ones.
  1143. styleElement.parentNode.removeChild(styleElement)
  1144. }
  1145. }
  1146. if (isOldIE) {
  1147. // use singleton mode for IE9.
  1148. var styleIndex = singletonCounter++
  1149. styleElement = singletonElement || (singletonElement = createStyleElement())
  1150. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  1151. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  1152. } else {
  1153. // use multi-style-tag mode in all other cases
  1154. styleElement = createStyleElement()
  1155. update = applyToTag.bind(null, styleElement)
  1156. remove = function () {
  1157. styleElement.parentNode.removeChild(styleElement)
  1158. }
  1159. }
  1160. update(obj)
  1161. return function updateStyle (newObj /* StyleObjectPart */) {
  1162. if (newObj) {
  1163. if (newObj.css === obj.css &&
  1164. newObj.media === obj.media &&
  1165. newObj.sourceMap === obj.sourceMap) {
  1166. return
  1167. }
  1168. update(obj = newObj)
  1169. } else {
  1170. remove()
  1171. }
  1172. }
  1173. }
  1174. var replaceText = (function () {
  1175. var textStore = []
  1176. return function (index, replacement) {
  1177. textStore[index] = replacement
  1178. return textStore.filter(Boolean).join('\n')
  1179. }
  1180. })()
  1181. function applyToSingletonTag (styleElement, index, remove, obj) {
  1182. var css = remove ? '' : obj.css
  1183. if (styleElement.styleSheet) {
  1184. styleElement.styleSheet.cssText = replaceText(index, css)
  1185. } else {
  1186. var cssNode = document.createTextNode(css)
  1187. var childNodes = styleElement.childNodes
  1188. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  1189. if (childNodes.length) {
  1190. styleElement.insertBefore(cssNode, childNodes[index])
  1191. } else {
  1192. styleElement.appendChild(cssNode)
  1193. }
  1194. }
  1195. }
  1196. function applyToTag (styleElement, obj) {
  1197. var css = obj.css
  1198. var media = obj.media
  1199. var sourceMap = obj.sourceMap
  1200. if (media) {
  1201. styleElement.setAttribute('media', media)
  1202. }
  1203. if (options.ssrId) {
  1204. styleElement.setAttribute(ssrIdKey, obj.id)
  1205. }
  1206. if (sourceMap) {
  1207. // https://developer.chrome.com/devtools/docs/javascript-debugging
  1208. // this makes source maps inside style tags work properly in Chrome
  1209. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  1210. // http://stackoverflow.com/a/26603875
  1211. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  1212. }
  1213. if (styleElement.styleSheet) {
  1214. styleElement.styleSheet.cssText = css
  1215. } else {
  1216. while (styleElement.firstChild) {
  1217. styleElement.removeChild(styleElement.firstChild)
  1218. }
  1219. styleElement.appendChild(document.createTextNode(css))
  1220. }
  1221. }
  1222. /***/ }),
  1223. /***/ "49ad":
  1224. /***/ (function(module, exports, __webpack_require__) {
  1225. "use strict";
  1226. module.exports = function(idHandler) {
  1227. var eventListeners = {};
  1228. /**
  1229. * Gets all listeners for the given element.
  1230. * @public
  1231. * @param {element} element The element to get all listeners for.
  1232. * @returns All listeners for the given element.
  1233. */
  1234. function getListeners(element) {
  1235. var id = idHandler.get(element);
  1236. if (id === undefined) {
  1237. return [];
  1238. }
  1239. return eventListeners[id] || [];
  1240. }
  1241. /**
  1242. * Stores the given listener for the given element. Will not actually add the listener to the element.
  1243. * @public
  1244. * @param {element} element The element that should have the listener added.
  1245. * @param {function} listener The callback that the element has added.
  1246. */
  1247. function addListener(element, listener) {
  1248. var id = idHandler.get(element);
  1249. if(!eventListeners[id]) {
  1250. eventListeners[id] = [];
  1251. }
  1252. eventListeners[id].push(listener);
  1253. }
  1254. function removeListener(element, listener) {
  1255. var listeners = getListeners(element);
  1256. for (var i = 0, len = listeners.length; i < len; ++i) {
  1257. if (listeners[i] === listener) {
  1258. listeners.splice(i, 1);
  1259. break;
  1260. }
  1261. }
  1262. }
  1263. function removeAllListeners(element) {
  1264. var listeners = getListeners(element);
  1265. if (!listeners) { return; }
  1266. listeners.length = 0;
  1267. }
  1268. return {
  1269. get: getListeners,
  1270. add: addListener,
  1271. removeListener: removeListener,
  1272. removeAllListeners: removeAllListeners
  1273. };
  1274. };
  1275. /***/ }),
  1276. /***/ "4bf8":
  1277. /***/ (function(module, exports, __webpack_require__) {
  1278. // 7.1.13 ToObject(argument)
  1279. var defined = __webpack_require__("be13");
  1280. module.exports = function (it) {
  1281. return Object(defined(it));
  1282. };
  1283. /***/ }),
  1284. /***/ "5058":
  1285. /***/ (function(module, exports, __webpack_require__) {
  1286. "use strict";
  1287. module.exports = function(options) {
  1288. var idGenerator = options.idGenerator;
  1289. var getState = options.stateHandler.getState;
  1290. /**
  1291. * Gets the resize detector id of the element.
  1292. * @public
  1293. * @param {element} element The target element to get the id of.
  1294. * @returns {string|number|null} The id of the element. Null if it has no id.
  1295. */
  1296. function getId(element) {
  1297. var state = getState(element);
  1298. if (state && state.id !== undefined) {
  1299. return state.id;
  1300. }
  1301. return null;
  1302. }
  1303. /**
  1304. * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.
  1305. * @public
  1306. * @param {element} element The target element to set the id of.
  1307. * @returns {string|number|null} The id of the element.
  1308. */
  1309. function setId(element) {
  1310. var state = getState(element);
  1311. if (!state) {
  1312. throw new Error("setId required the element to have a resize detection state.");
  1313. }
  1314. var id = idGenerator.generate();
  1315. state.id = id;
  1316. return id;
  1317. }
  1318. return {
  1319. get: getId,
  1320. set: setId
  1321. };
  1322. };
  1323. /***/ }),
  1324. /***/ "50bf":
  1325. /***/ (function(module, exports, __webpack_require__) {
  1326. "use strict";
  1327. var utils = module.exports = {};
  1328. utils.getOption = getOption;
  1329. function getOption(options, name, defaultValue) {
  1330. var value = options[name];
  1331. if((value === undefined || value === null) && defaultValue !== undefined) {
  1332. return defaultValue;
  1333. }
  1334. return value;
  1335. }
  1336. /***/ }),
  1337. /***/ "520a":
  1338. /***/ (function(module, exports, __webpack_require__) {
  1339. "use strict";
  1340. var regexpFlags = __webpack_require__("0bfb");
  1341. var nativeExec = RegExp.prototype.exec;
  1342. // This always refers to the native implementation, because the
  1343. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  1344. // which loads this file before patching the method.
  1345. var nativeReplace = String.prototype.replace;
  1346. var patchedExec = nativeExec;
  1347. var LAST_INDEX = 'lastIndex';
  1348. var UPDATES_LAST_INDEX_WRONG = (function () {
  1349. var re1 = /a/,
  1350. re2 = /b*/g;
  1351. nativeExec.call(re1, 'a');
  1352. nativeExec.call(re2, 'a');
  1353. return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
  1354. })();
  1355. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  1356. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  1357. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  1358. if (PATCH) {
  1359. patchedExec = function exec(str) {
  1360. var re = this;
  1361. var lastIndex, reCopy, match, i;
  1362. if (NPCG_INCLUDED) {
  1363. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  1364. }
  1365. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
  1366. match = nativeExec.call(re, str);
  1367. if (UPDATES_LAST_INDEX_WRONG && match) {
  1368. re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
  1369. }
  1370. if (NPCG_INCLUDED && match && match.length > 1) {
  1371. // Fix browsers whose `exec` methods don't consistently return `undefined`
  1372. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  1373. // eslint-disable-next-line no-loop-func
  1374. nativeReplace.call(match[0], reCopy, function () {
  1375. for (i = 1; i < arguments.length - 2; i++) {
  1376. if (arguments[i] === undefined) match[i] = undefined;
  1377. }
  1378. });
  1379. }
  1380. return match;
  1381. };
  1382. }
  1383. module.exports = patchedExec;
  1384. /***/ }),
  1385. /***/ "52a7":
  1386. /***/ (function(module, exports) {
  1387. exports.f = {}.propertyIsEnumerable;
  1388. /***/ }),
  1389. /***/ "5537":
  1390. /***/ (function(module, exports, __webpack_require__) {
  1391. var core = __webpack_require__("8378");
  1392. var global = __webpack_require__("7726");
  1393. var SHARED = '__core-js_shared__';
  1394. var store = global[SHARED] || (global[SHARED] = {});
  1395. (module.exports = function (key, value) {
  1396. return store[key] || (store[key] = value !== undefined ? value : {});
  1397. })('versions', []).push({
  1398. version: core.version,
  1399. mode: __webpack_require__("2d00") ? 'pure' : 'global',
  1400. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  1401. });
  1402. /***/ }),
  1403. /***/ "5559":
  1404. /***/ (function(module, exports, __webpack_require__) {
  1405. var shared = __webpack_require__("dbdb")('keys');
  1406. var uid = __webpack_require__("62a0");
  1407. module.exports = function (key) {
  1408. return shared[key] || (shared[key] = uid(key));
  1409. };
  1410. /***/ }),
  1411. /***/ "55dd":
  1412. /***/ (function(module, exports, __webpack_require__) {
  1413. "use strict";
  1414. var $export = __webpack_require__("5ca1");
  1415. var aFunction = __webpack_require__("d8e8");
  1416. var toObject = __webpack_require__("4bf8");
  1417. var fails = __webpack_require__("79e5");
  1418. var $sort = [].sort;
  1419. var test = [1, 2, 3];
  1420. $export($export.P + $export.F * (fails(function () {
  1421. // IE8-
  1422. test.sort(undefined);
  1423. }) || !fails(function () {
  1424. // V8 bug
  1425. test.sort(null);
  1426. // Old WebKit
  1427. }) || !__webpack_require__("2f21")($sort)), 'Array', {
  1428. // 22.1.3.25 Array.prototype.sort(comparefn)
  1429. sort: function sort(comparefn) {
  1430. return comparefn === undefined
  1431. ? $sort.call(toObject(this))
  1432. : $sort.call(toObject(this), aFunction(comparefn));
  1433. }
  1434. });
  1435. /***/ }),
  1436. /***/ "584a":
  1437. /***/ (function(module, exports) {
  1438. var core = module.exports = { version: '2.6.5' };
  1439. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  1440. /***/ }),
  1441. /***/ "5b4e":
  1442. /***/ (function(module, exports, __webpack_require__) {
  1443. // false -> Array#indexOf
  1444. // true -> Array#includes
  1445. var toIObject = __webpack_require__("36c3");
  1446. var toLength = __webpack_require__("b447");
  1447. var toAbsoluteIndex = __webpack_require__("0fc9");
  1448. module.exports = function (IS_INCLUDES) {
  1449. return function ($this, el, fromIndex) {
  1450. var O = toIObject($this);
  1451. var length = toLength(O.length);
  1452. var index = toAbsoluteIndex(fromIndex, length);
  1453. var value;
  1454. // Array#includes uses SameValueZero equality algorithm
  1455. // eslint-disable-next-line no-self-compare
  1456. if (IS_INCLUDES && el != el) while (length > index) {
  1457. value = O[index++];
  1458. // eslint-disable-next-line no-self-compare
  1459. if (value != value) return true;
  1460. // Array#indexOf ignores holes, Array#includes - not
  1461. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  1462. if (O[index] === el) return IS_INCLUDES || index || 0;
  1463. } return !IS_INCLUDES && -1;
  1464. };
  1465. };
  1466. /***/ }),
  1467. /***/ "5be5":
  1468. /***/ (function(module, exports, __webpack_require__) {
  1469. "use strict";
  1470. module.exports = function(options) {
  1471. var getState = options.stateHandler.getState;
  1472. /**
  1473. * Tells if the element has been made detectable and ready to be listened for resize events.
  1474. * @public
  1475. * @param {element} The element to check.
  1476. * @returns {boolean} True or false depending on if the element is detectable or not.
  1477. */
  1478. function isDetectable(element) {
  1479. var state = getState(element);
  1480. return state && !!state.isDetectable;
  1481. }
  1482. /**
  1483. * Marks the element that it has been made detectable and ready to be listened for resize events.
  1484. * @public
  1485. * @param {element} The element to mark.
  1486. */
  1487. function markAsDetectable(element) {
  1488. getState(element).isDetectable = true;
  1489. }
  1490. /**
  1491. * Tells if the element is busy or not.
  1492. * @public
  1493. * @param {element} The element to check.
  1494. * @returns {boolean} True or false depending on if the element is busy or not.
  1495. */
  1496. function isBusy(element) {
  1497. return !!getState(element).busy;
  1498. }
  1499. /**
  1500. * Marks the object is busy and should not be made detectable.
  1501. * @public
  1502. * @param {element} element The element to mark.
  1503. * @param {boolean} busy If the element is busy or not.
  1504. */
  1505. function markBusy(element, busy) {
  1506. getState(element).busy = !!busy;
  1507. }
  1508. return {
  1509. isDetectable: isDetectable,
  1510. markAsDetectable: markAsDetectable,
  1511. isBusy: isBusy,
  1512. markBusy: markBusy
  1513. };
  1514. };
  1515. /***/ }),
  1516. /***/ "5ca1":
  1517. /***/ (function(module, exports, __webpack_require__) {
  1518. var global = __webpack_require__("7726");
  1519. var core = __webpack_require__("8378");
  1520. var hide = __webpack_require__("32e9");
  1521. var redefine = __webpack_require__("2aba");
  1522. var ctx = __webpack_require__("9b43");
  1523. var PROTOTYPE = 'prototype';
  1524. var $export = function (type, name, source) {
  1525. var IS_FORCED = type & $export.F;
  1526. var IS_GLOBAL = type & $export.G;
  1527. var IS_STATIC = type & $export.S;
  1528. var IS_PROTO = type & $export.P;
  1529. var IS_BIND = type & $export.B;
  1530. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  1531. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  1532. var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  1533. var key, own, out, exp;
  1534. if (IS_GLOBAL) source = name;
  1535. for (key in source) {
  1536. // contains in native
  1537. own = !IS_FORCED && target && target[key] !== undefined;
  1538. // export native or passed
  1539. out = (own ? target : source)[key];
  1540. // bind timers to global for call from export context
  1541. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  1542. // extend global
  1543. if (target) redefine(target, key, out, type & $export.U);
  1544. // export
  1545. if (exports[key] != out) hide(exports, key, exp);
  1546. if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  1547. }
  1548. };
  1549. global.core = core;
  1550. // type bitmap
  1551. $export.F = 1; // forced
  1552. $export.G = 2; // global
  1553. $export.S = 4; // static
  1554. $export.P = 8; // proto
  1555. $export.B = 16; // bind
  1556. $export.W = 32; // wrap
  1557. $export.U = 64; // safe
  1558. $export.R = 128; // real proto method for `library`
  1559. module.exports = $export;
  1560. /***/ }),
  1561. /***/ "5d6b":
  1562. /***/ (function(module, exports, __webpack_require__) {
  1563. var $parseInt = __webpack_require__("e53d").parseInt;
  1564. var $trim = __webpack_require__("a1ce").trim;
  1565. var ws = __webpack_require__("e692");
  1566. var hex = /^[-+]?0[xX]/;
  1567. module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
  1568. var string = $trim(String(str), 3);
  1569. return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  1570. } : $parseInt;
  1571. /***/ }),
  1572. /***/ "5dbc":
  1573. /***/ (function(module, exports, __webpack_require__) {
  1574. var isObject = __webpack_require__("d3f4");
  1575. var setPrototypeOf = __webpack_require__("8b97").set;
  1576. module.exports = function (that, target, C) {
  1577. var S = target.constructor;
  1578. var P;
  1579. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
  1580. setPrototypeOf(that, P);
  1581. } return that;
  1582. };
  1583. /***/ }),
  1584. /***/ "5ed4":
  1585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1586. "use strict";
  1587. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridItem_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("6e21");
  1588. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridItem_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridItem_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  1589. /* unused harmony reexport * */
  1590. /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridItem_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
  1591. /***/ }),
  1592. /***/ "5f1b":
  1593. /***/ (function(module, exports, __webpack_require__) {
  1594. "use strict";
  1595. var classof = __webpack_require__("23c6");
  1596. var builtinExec = RegExp.prototype.exec;
  1597. // `RegExpExec` abstract operation
  1598. // https://tc39.github.io/ecma262/#sec-regexpexec
  1599. module.exports = function (R, S) {
  1600. var exec = R.exec;
  1601. if (typeof exec === 'function') {
  1602. var result = exec.call(R, S);
  1603. if (typeof result !== 'object') {
  1604. throw new TypeError('RegExp exec method returned something other than an Object or null');
  1605. }
  1606. return result;
  1607. }
  1608. if (classof(R) !== 'RegExp') {
  1609. throw new TypeError('RegExp#exec called on incompatible receiver');
  1610. }
  1611. return builtinExec.call(R, S);
  1612. };
  1613. /***/ }),
  1614. /***/ "613b":
  1615. /***/ (function(module, exports, __webpack_require__) {
  1616. var shared = __webpack_require__("5537")('keys');
  1617. var uid = __webpack_require__("ca5a");
  1618. module.exports = function (key) {
  1619. return shared[key] || (shared[key] = uid(key));
  1620. };
  1621. /***/ }),
  1622. /***/ "626a":
  1623. /***/ (function(module, exports, __webpack_require__) {
  1624. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1625. var cof = __webpack_require__("2d95");
  1626. // eslint-disable-next-line no-prototype-builtins
  1627. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  1628. return cof(it) == 'String' ? it.split('') : Object(it);
  1629. };
  1630. /***/ }),
  1631. /***/ "62a0":
  1632. /***/ (function(module, exports) {
  1633. var id = 0;
  1634. var px = Math.random();
  1635. module.exports = function (key) {
  1636. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  1637. };
  1638. /***/ }),
  1639. /***/ "63b6":
  1640. /***/ (function(module, exports, __webpack_require__) {
  1641. var global = __webpack_require__("e53d");
  1642. var core = __webpack_require__("584a");
  1643. var ctx = __webpack_require__("d864");
  1644. var hide = __webpack_require__("35e8");
  1645. var has = __webpack_require__("07e3");
  1646. var PROTOTYPE = 'prototype';
  1647. var $export = function (type, name, source) {
  1648. var IS_FORCED = type & $export.F;
  1649. var IS_GLOBAL = type & $export.G;
  1650. var IS_STATIC = type & $export.S;
  1651. var IS_PROTO = type & $export.P;
  1652. var IS_BIND = type & $export.B;
  1653. var IS_WRAP = type & $export.W;
  1654. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  1655. var expProto = exports[PROTOTYPE];
  1656. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  1657. var key, own, out;
  1658. if (IS_GLOBAL) source = name;
  1659. for (key in source) {
  1660. // contains in native
  1661. own = !IS_FORCED && target && target[key] !== undefined;
  1662. if (own && has(exports, key)) continue;
  1663. // export native or passed
  1664. out = own ? target[key] : source[key];
  1665. // prevent global pollution for namespaces
  1666. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  1667. // bind timers to global for call from export context
  1668. : IS_BIND && own ? ctx(out, global)
  1669. // wrap global constructors for prevent change them in library
  1670. : IS_WRAP && target[key] == out ? (function (C) {
  1671. var F = function (a, b, c) {
  1672. if (this instanceof C) {
  1673. switch (arguments.length) {
  1674. case 0: return new C();
  1675. case 1: return new C(a);
  1676. case 2: return new C(a, b);
  1677. } return new C(a, b, c);
  1678. } return C.apply(this, arguments);
  1679. };
  1680. F[PROTOTYPE] = C[PROTOTYPE];
  1681. return F;
  1682. // make static versions for prototype methods
  1683. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  1684. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  1685. if (IS_PROTO) {
  1686. (exports.virtual || (exports.virtual = {}))[key] = out;
  1687. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  1688. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  1689. }
  1690. }
  1691. };
  1692. // type bitmap
  1693. $export.F = 1; // forced
  1694. $export.G = 2; // global
  1695. $export.S = 4; // static
  1696. $export.P = 8; // proto
  1697. $export.B = 16; // bind
  1698. $export.W = 32; // wrap
  1699. $export.U = 64; // safe
  1700. $export.R = 128; // real proto method for `library`
  1701. module.exports = $export;
  1702. /***/ }),
  1703. /***/ "6821":
  1704. /***/ (function(module, exports, __webpack_require__) {
  1705. // to indexed object, toObject with fallback for non-array-like ES3 strings
  1706. var IObject = __webpack_require__("626a");
  1707. var defined = __webpack_require__("be13");
  1708. module.exports = function (it) {
  1709. return IObject(defined(it));
  1710. };
  1711. /***/ }),
  1712. /***/ "69a8":
  1713. /***/ (function(module, exports) {
  1714. var hasOwnProperty = {}.hasOwnProperty;
  1715. module.exports = function (it, key) {
  1716. return hasOwnProperty.call(it, key);
  1717. };
  1718. /***/ }),
  1719. /***/ "6a99":
  1720. /***/ (function(module, exports, __webpack_require__) {
  1721. // 7.1.1 ToPrimitive(input [, PreferredType])
  1722. var isObject = __webpack_require__("d3f4");
  1723. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  1724. // and the second argument - flag - preferred type is a string
  1725. module.exports = function (it, S) {
  1726. if (!isObject(it)) return it;
  1727. var fn, val;
  1728. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  1729. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  1730. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  1731. throw TypeError("Can't convert object to primitive value");
  1732. };
  1733. /***/ }),
  1734. /***/ "6b4c":
  1735. /***/ (function(module, exports) {
  1736. var toString = {}.toString;
  1737. module.exports = function (it) {
  1738. return toString.call(it).slice(8, -1);
  1739. };
  1740. /***/ }),
  1741. /***/ "6e21":
  1742. /***/ (function(module, exports, __webpack_require__) {
  1743. // style-loader: Adds some css to the DOM by adding a <style> tag
  1744. // load the styles
  1745. var content = __webpack_require__("9cbe");
  1746. if(typeof content === 'string') content = [[module.i, content, '']];
  1747. if(content.locals) module.exports = content.locals;
  1748. // add the styles to the DOM
  1749. var add = __webpack_require__("499e").default
  1750. var update = add("3cbd0c21", content, true, {"sourceMap":false,"shadowMode":false});
  1751. /***/ }),
  1752. /***/ "7445":
  1753. /***/ (function(module, exports, __webpack_require__) {
  1754. var $export = __webpack_require__("63b6");
  1755. var $parseInt = __webpack_require__("5d6b");
  1756. // 18.2.5 parseInt(string, radix)
  1757. $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
  1758. /***/ }),
  1759. /***/ "7726":
  1760. /***/ (function(module, exports) {
  1761. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1762. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  1763. ? window : typeof self != 'undefined' && self.Math == Math ? self
  1764. // eslint-disable-next-line no-new-func
  1765. : Function('return this')();
  1766. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  1767. /***/ }),
  1768. /***/ "77f1":
  1769. /***/ (function(module, exports, __webpack_require__) {
  1770. var toInteger = __webpack_require__("4588");
  1771. var max = Math.max;
  1772. var min = Math.min;
  1773. module.exports = function (index, length) {
  1774. index = toInteger(index);
  1775. return index < 0 ? max(index + length, 0) : min(index, length);
  1776. };
  1777. /***/ }),
  1778. /***/ "794b":
  1779. /***/ (function(module, exports, __webpack_require__) {
  1780. module.exports = !__webpack_require__("8e60") && !__webpack_require__("294c")(function () {
  1781. return Object.defineProperty(__webpack_require__("1ec9")('div'), 'a', { get: function () { return 7; } }).a != 7;
  1782. });
  1783. /***/ }),
  1784. /***/ "79aa":
  1785. /***/ (function(module, exports) {
  1786. module.exports = function (it) {
  1787. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  1788. return it;
  1789. };
  1790. /***/ }),
  1791. /***/ "79e5":
  1792. /***/ (function(module, exports) {
  1793. module.exports = function (exec) {
  1794. try {
  1795. return !!exec();
  1796. } catch (e) {
  1797. return true;
  1798. }
  1799. };
  1800. /***/ }),
  1801. /***/ "7f20":
  1802. /***/ (function(module, exports, __webpack_require__) {
  1803. var def = __webpack_require__("86cc").f;
  1804. var has = __webpack_require__("69a8");
  1805. var TAG = __webpack_require__("2b4c")('toStringTag');
  1806. module.exports = function (it, tag, stat) {
  1807. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  1808. };
  1809. /***/ }),
  1810. /***/ "7f7f":
  1811. /***/ (function(module, exports, __webpack_require__) {
  1812. var dP = __webpack_require__("86cc").f;
  1813. var FProto = Function.prototype;
  1814. var nameRE = /^\s*function ([^ (]*)/;
  1815. var NAME = 'name';
  1816. // 19.2.4.2 name
  1817. NAME in FProto || __webpack_require__("9e1e") && dP(FProto, NAME, {
  1818. configurable: true,
  1819. get: function () {
  1820. try {
  1821. return ('' + this).match(nameRE)[1];
  1822. } catch (e) {
  1823. return '';
  1824. }
  1825. }
  1826. });
  1827. /***/ }),
  1828. /***/ "8378":
  1829. /***/ (function(module, exports) {
  1830. var core = module.exports = { version: '2.6.5' };
  1831. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  1832. /***/ }),
  1833. /***/ "84f2":
  1834. /***/ (function(module, exports) {
  1835. module.exports = {};
  1836. /***/ }),
  1837. /***/ "86cc":
  1838. /***/ (function(module, exports, __webpack_require__) {
  1839. var anObject = __webpack_require__("cb7c");
  1840. var IE8_DOM_DEFINE = __webpack_require__("c69a");
  1841. var toPrimitive = __webpack_require__("6a99");
  1842. var dP = Object.defineProperty;
  1843. exports.f = __webpack_require__("9e1e") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  1844. anObject(O);
  1845. P = toPrimitive(P, true);
  1846. anObject(Attributes);
  1847. if (IE8_DOM_DEFINE) try {
  1848. return dP(O, P, Attributes);
  1849. } catch (e) { /* empty */ }
  1850. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  1851. if ('value' in Attributes) O[P] = Attributes.value;
  1852. return O;
  1853. };
  1854. /***/ }),
  1855. /***/ "8aae":
  1856. /***/ (function(module, exports, __webpack_require__) {
  1857. __webpack_require__("32a6");
  1858. module.exports = __webpack_require__("584a").Object.keys;
  1859. /***/ }),
  1860. /***/ "8b97":
  1861. /***/ (function(module, exports, __webpack_require__) {
  1862. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1863. /* eslint-disable no-proto */
  1864. var isObject = __webpack_require__("d3f4");
  1865. var anObject = __webpack_require__("cb7c");
  1866. var check = function (O, proto) {
  1867. anObject(O);
  1868. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  1869. };
  1870. module.exports = {
  1871. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  1872. function (test, buggy, set) {
  1873. try {
  1874. set = __webpack_require__("9b43")(Function.call, __webpack_require__("11e9").f(Object.prototype, '__proto__').set, 2);
  1875. set(test, []);
  1876. buggy = !(test instanceof Array);
  1877. } catch (e) { buggy = true; }
  1878. return function setPrototypeOf(O, proto) {
  1879. check(O, proto);
  1880. if (buggy) O.__proto__ = proto;
  1881. else set(O, proto);
  1882. return O;
  1883. };
  1884. }({}, false) : undefined),
  1885. check: check
  1886. };
  1887. /***/ }),
  1888. /***/ "8bbf":
  1889. /***/ (function(module, exports) {
  1890. module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;
  1891. /***/ }),
  1892. /***/ "8e60":
  1893. /***/ (function(module, exports, __webpack_require__) {
  1894. // Thank's IE8 for his funny defineProperty
  1895. module.exports = !__webpack_require__("294c")(function () {
  1896. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  1897. });
  1898. /***/ }),
  1899. /***/ "9003":
  1900. /***/ (function(module, exports, __webpack_require__) {
  1901. // 7.2.2 IsArray(argument)
  1902. var cof = __webpack_require__("6b4c");
  1903. module.exports = Array.isArray || function isArray(arg) {
  1904. return cof(arg) == 'Array';
  1905. };
  1906. /***/ }),
  1907. /***/ "9093":
  1908. /***/ (function(module, exports, __webpack_require__) {
  1909. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  1910. var $keys = __webpack_require__("ce10");
  1911. var hiddenKeys = __webpack_require__("e11e").concat('length', 'prototype');
  1912. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1913. return $keys(O, hiddenKeys);
  1914. };
  1915. /***/ }),
  1916. /***/ "9b43":
  1917. /***/ (function(module, exports, __webpack_require__) {
  1918. // optional / simple context binding
  1919. var aFunction = __webpack_require__("d8e8");
  1920. module.exports = function (fn, that, length) {
  1921. aFunction(fn);
  1922. if (that === undefined) return fn;
  1923. switch (length) {
  1924. case 1: return function (a) {
  1925. return fn.call(that, a);
  1926. };
  1927. case 2: return function (a, b) {
  1928. return fn.call(that, a, b);
  1929. };
  1930. case 3: return function (a, b, c) {
  1931. return fn.call(that, a, b, c);
  1932. };
  1933. }
  1934. return function (/* ...args */) {
  1935. return fn.apply(that, arguments);
  1936. };
  1937. };
  1938. /***/ }),
  1939. /***/ "9c6c":
  1940. /***/ (function(module, exports, __webpack_require__) {
  1941. // 22.1.3.31 Array.prototype[@@unscopables]
  1942. var UNSCOPABLES = __webpack_require__("2b4c")('unscopables');
  1943. var ArrayProto = Array.prototype;
  1944. if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("32e9")(ArrayProto, UNSCOPABLES, {});
  1945. module.exports = function (key) {
  1946. ArrayProto[UNSCOPABLES][key] = true;
  1947. };
  1948. /***/ }),
  1949. /***/ "9cbe":
  1950. /***/ (function(module, exports, __webpack_require__) {
  1951. exports = module.exports = __webpack_require__("2350")(false);
  1952. // imports
  1953. // module
  1954. exports.push([module.i, ".vue-grid-item{-webkit-transition:all .2s ease;transition:all .2s ease;-webkit-transition-property:left,top,right;transition-property:left,top,right}.vue-grid-item.no-touch{-ms-touch-action:none;touch-action:none}.vue-grid-item.cssTransforms{-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;left:0;right:auto}.vue-grid-item.cssTransforms.render-rtl{left:auto;right:0}.vue-grid-item.resizing{opacity:.6;z-index:3}.vue-grid-item.vue-draggable-dragging{-webkit-transition:none;transition:none;z-index:3}.vue-grid-item.vue-grid-placeholder{background:red;opacity:.2;-webkit-transition-duration:.1s;transition-duration:.1s;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.vue-grid-item>.vue-resizable-handle{position:absolute;width:20px;height:20px;bottom:0;right:0;background:url(\"data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZ6IiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+\");background-position:100% 100%;padding:0 3px 3px 0;background-repeat:no-repeat;background-origin:content-box;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:se-resize}.vue-grid-item>.vue-rtl-resizable-handle{bottom:0;left:0;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS0xLTFoMTJ2MTJILTF6Ii8+PGc+PHBhdGggc3Ryb2tlLWxpbmVjYXA9InVuZGVmaW5lZCIgc3Ryb2tlLWxpbmVqb2luPSJ1bmRlZmluZWQiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiIGQ9Ik0xNDQuODIxLTM4LjM5M2wtMjAuMzU3LTMxLjc4NSIvPjxwYXRoIHN0cm9rZT0iIzY2NiIgc3Ryb2tlLWxpbmVjYXA9InVuZGVmaW5lZCIgc3Ryb2tlLWxpbmVqb2luPSJ1bmRlZmluZWQiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIgZD0iTS45NDctLjAxOHY5LjEyNU0tLjY1NiA5aDEwLjczIi8+PC9nPjwvc3ZnPg==);background-position:0 100%;padding-left:3px;background-repeat:no-repeat;background-origin:content-box;cursor:sw-resize;right:auto}.vue-grid-item.disable-userselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}", ""]);
  1955. // exports
  1956. /***/ }),
  1957. /***/ "9def":
  1958. /***/ (function(module, exports, __webpack_require__) {
  1959. // 7.1.15 ToLength
  1960. var toInteger = __webpack_require__("4588");
  1961. var min = Math.min;
  1962. module.exports = function (it) {
  1963. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  1964. };
  1965. /***/ }),
  1966. /***/ "9e1e":
  1967. /***/ (function(module, exports, __webpack_require__) {
  1968. // Thank's IE8 for his funny defineProperty
  1969. module.exports = !__webpack_require__("79e5")(function () {
  1970. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  1971. });
  1972. /***/ }),
  1973. /***/ "a1ce":
  1974. /***/ (function(module, exports, __webpack_require__) {
  1975. var $export = __webpack_require__("63b6");
  1976. var defined = __webpack_require__("25eb");
  1977. var fails = __webpack_require__("294c");
  1978. var spaces = __webpack_require__("e692");
  1979. var space = '[' + spaces + ']';
  1980. var non = '\u200b\u0085';
  1981. var ltrim = RegExp('^' + space + space + '*');
  1982. var rtrim = RegExp(space + space + '*$');
  1983. var exporter = function (KEY, exec, ALIAS) {
  1984. var exp = {};
  1985. var FORCE = fails(function () {
  1986. return !!spaces[KEY]() || non[KEY]() != non;
  1987. });
  1988. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  1989. if (ALIAS) exp[ALIAS] = fn;
  1990. $export($export.P + $export.F * FORCE, 'String', exp);
  1991. };
  1992. // 1 -> String#trimLeft
  1993. // 2 -> String#trimRight
  1994. // 3 -> String#trim
  1995. var trim = exporter.trim = function (string, TYPE) {
  1996. string = String(defined(string));
  1997. if (TYPE & 1) string = string.replace(ltrim, '');
  1998. if (TYPE & 2) string = string.replace(rtrim, '');
  1999. return string;
  2000. };
  2001. module.exports = exporter;
  2002. /***/ }),
  2003. /***/ "a21f":
  2004. /***/ (function(module, exports, __webpack_require__) {
  2005. var core = __webpack_require__("584a");
  2006. var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
  2007. module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
  2008. return $JSON.stringify.apply($JSON, arguments);
  2009. };
  2010. /***/ }),
  2011. /***/ "a481":
  2012. /***/ (function(module, exports, __webpack_require__) {
  2013. "use strict";
  2014. var anObject = __webpack_require__("cb7c");
  2015. var toObject = __webpack_require__("4bf8");
  2016. var toLength = __webpack_require__("9def");
  2017. var toInteger = __webpack_require__("4588");
  2018. var advanceStringIndex = __webpack_require__("0390");
  2019. var regExpExec = __webpack_require__("5f1b");
  2020. var max = Math.max;
  2021. var min = Math.min;
  2022. var floor = Math.floor;
  2023. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  2024. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  2025. var maybeToString = function (it) {
  2026. return it === undefined ? it : String(it);
  2027. };
  2028. // @@replace logic
  2029. __webpack_require__("214f")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
  2030. return [
  2031. // `String.prototype.replace` method
  2032. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  2033. function replace(searchValue, replaceValue) {
  2034. var O = defined(this);
  2035. var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  2036. return fn !== undefined
  2037. ? fn.call(searchValue, O, replaceValue)
  2038. : $replace.call(String(O), searchValue, replaceValue);
  2039. },
  2040. // `RegExp.prototype[@@replace]` method
  2041. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  2042. function (regexp, replaceValue) {
  2043. var res = maybeCallNative($replace, regexp, this, replaceValue);
  2044. if (res.done) return res.value;
  2045. var rx = anObject(regexp);
  2046. var S = String(this);
  2047. var functionalReplace = typeof replaceValue === 'function';
  2048. if (!functionalReplace) replaceValue = String(replaceValue);
  2049. var global = rx.global;
  2050. if (global) {
  2051. var fullUnicode = rx.unicode;
  2052. rx.lastIndex = 0;
  2053. }
  2054. var results = [];
  2055. while (true) {
  2056. var result = regExpExec(rx, S);
  2057. if (result === null) break;
  2058. results.push(result);
  2059. if (!global) break;
  2060. var matchStr = String(result[0]);
  2061. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  2062. }
  2063. var accumulatedResult = '';
  2064. var nextSourcePosition = 0;
  2065. for (var i = 0; i < results.length; i++) {
  2066. result = results[i];
  2067. var matched = String(result[0]);
  2068. var position = max(min(toInteger(result.index), S.length), 0);
  2069. var captures = [];
  2070. // NOTE: This is equivalent to
  2071. // captures = result.slice(1).map(maybeToString)
  2072. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  2073. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  2074. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  2075. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  2076. var namedCaptures = result.groups;
  2077. if (functionalReplace) {
  2078. var replacerArgs = [matched].concat(captures, position, S);
  2079. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  2080. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  2081. } else {
  2082. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  2083. }
  2084. if (position >= nextSourcePosition) {
  2085. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  2086. nextSourcePosition = position + matched.length;
  2087. }
  2088. }
  2089. return accumulatedResult + S.slice(nextSourcePosition);
  2090. }
  2091. ];
  2092. // https://tc39.github.io/ecma262/#sec-getsubstitution
  2093. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  2094. var tailPos = position + matched.length;
  2095. var m = captures.length;
  2096. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2097. if (namedCaptures !== undefined) {
  2098. namedCaptures = toObject(namedCaptures);
  2099. symbols = SUBSTITUTION_SYMBOLS;
  2100. }
  2101. return $replace.call(replacement, symbols, function (match, ch) {
  2102. var capture;
  2103. switch (ch.charAt(0)) {
  2104. case '$': return '$';
  2105. case '&': return matched;
  2106. case '`': return str.slice(0, position);
  2107. case "'": return str.slice(tailPos);
  2108. case '<':
  2109. capture = namedCaptures[ch.slice(1, -1)];
  2110. break;
  2111. default: // \d\d?
  2112. var n = +ch;
  2113. if (n === 0) return match;
  2114. if (n > m) {
  2115. var f = floor(n / 10);
  2116. if (f === 0) return match;
  2117. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  2118. return match;
  2119. }
  2120. capture = captures[n - 1];
  2121. }
  2122. return capture === undefined ? '' : capture;
  2123. });
  2124. }
  2125. });
  2126. /***/ }),
  2127. /***/ "a4bb":
  2128. /***/ (function(module, exports, __webpack_require__) {
  2129. module.exports = __webpack_require__("8aae");
  2130. /***/ }),
  2131. /***/ "a745":
  2132. /***/ (function(module, exports, __webpack_require__) {
  2133. module.exports = __webpack_require__("f410");
  2134. /***/ }),
  2135. /***/ "aa77":
  2136. /***/ (function(module, exports, __webpack_require__) {
  2137. var $export = __webpack_require__("5ca1");
  2138. var defined = __webpack_require__("be13");
  2139. var fails = __webpack_require__("79e5");
  2140. var spaces = __webpack_require__("fdef");
  2141. var space = '[' + spaces + ']';
  2142. var non = '\u200b\u0085';
  2143. var ltrim = RegExp('^' + space + space + '*');
  2144. var rtrim = RegExp(space + space + '*$');
  2145. var exporter = function (KEY, exec, ALIAS) {
  2146. var exp = {};
  2147. var FORCE = fails(function () {
  2148. return !!spaces[KEY]() || non[KEY]() != non;
  2149. });
  2150. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  2151. if (ALIAS) exp[ALIAS] = fn;
  2152. $export($export.P + $export.F * FORCE, 'String', exp);
  2153. };
  2154. // 1 -> String#trimLeft
  2155. // 2 -> String#trimRight
  2156. // 3 -> String#trim
  2157. var trim = exporter.trim = function (string, TYPE) {
  2158. string = String(defined(string));
  2159. if (TYPE & 1) string = string.replace(ltrim, '');
  2160. if (TYPE & 2) string = string.replace(rtrim, '');
  2161. return string;
  2162. };
  2163. module.exports = exporter;
  2164. /***/ }),
  2165. /***/ "abb4":
  2166. /***/ (function(module, exports, __webpack_require__) {
  2167. "use strict";
  2168. /* global console: false */
  2169. /**
  2170. * Reporter that handles the reporting of logs, warnings and errors.
  2171. * @public
  2172. * @param {boolean} quiet Tells if the reporter should be quiet or not.
  2173. */
  2174. module.exports = function(quiet) {
  2175. function noop() {
  2176. //Does nothing.
  2177. }
  2178. var reporter = {
  2179. log: noop,
  2180. warn: noop,
  2181. error: noop
  2182. };
  2183. if(!quiet && window.console) {
  2184. var attachFunction = function(reporter, name) {
  2185. //The proxy is needed to be able to call the method with the console context,
  2186. //since we cannot use bind.
  2187. reporter[name] = function reporterProxy() {
  2188. var f = console[name];
  2189. if (f.apply) { //IE9 does not support console.log.apply :)
  2190. f.apply(console, arguments);
  2191. } else {
  2192. for (var i = 0; i < arguments.length; i++) {
  2193. f(arguments[i]);
  2194. }
  2195. }
  2196. };
  2197. };
  2198. attachFunction(reporter, "log");
  2199. attachFunction(reporter, "warn");
  2200. attachFunction(reporter, "error");
  2201. }
  2202. return reporter;
  2203. };
  2204. /***/ }),
  2205. /***/ "ac6a":
  2206. /***/ (function(module, exports, __webpack_require__) {
  2207. var $iterators = __webpack_require__("cadf");
  2208. var getKeys = __webpack_require__("0d58");
  2209. var redefine = __webpack_require__("2aba");
  2210. var global = __webpack_require__("7726");
  2211. var hide = __webpack_require__("32e9");
  2212. var Iterators = __webpack_require__("84f2");
  2213. var wks = __webpack_require__("2b4c");
  2214. var ITERATOR = wks('iterator');
  2215. var TO_STRING_TAG = wks('toStringTag');
  2216. var ArrayValues = Iterators.Array;
  2217. var DOMIterables = {
  2218. CSSRuleList: true, // TODO: Not spec compliant, should be false.
  2219. CSSStyleDeclaration: false,
  2220. CSSValueList: false,
  2221. ClientRectList: false,
  2222. DOMRectList: false,
  2223. DOMStringList: false,
  2224. DOMTokenList: true,
  2225. DataTransferItemList: false,
  2226. FileList: false,
  2227. HTMLAllCollection: false,
  2228. HTMLCollection: false,
  2229. HTMLFormElement: false,
  2230. HTMLSelectElement: false,
  2231. MediaList: true, // TODO: Not spec compliant, should be false.
  2232. MimeTypeArray: false,
  2233. NamedNodeMap: false,
  2234. NodeList: true,
  2235. PaintRequestList: false,
  2236. Plugin: false,
  2237. PluginArray: false,
  2238. SVGLengthList: false,
  2239. SVGNumberList: false,
  2240. SVGPathSegList: false,
  2241. SVGPointList: false,
  2242. SVGStringList: false,
  2243. SVGTransformList: false,
  2244. SourceBufferList: false,
  2245. StyleSheetList: true, // TODO: Not spec compliant, should be false.
  2246. TextTrackCueList: false,
  2247. TextTrackList: false,
  2248. TouchList: false
  2249. };
  2250. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  2251. var NAME = collections[i];
  2252. var explicit = DOMIterables[NAME];
  2253. var Collection = global[NAME];
  2254. var proto = Collection && Collection.prototype;
  2255. var key;
  2256. if (proto) {
  2257. if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
  2258. if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  2259. Iterators[NAME] = ArrayValues;
  2260. if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  2261. }
  2262. }
  2263. /***/ }),
  2264. /***/ "ad20":
  2265. /***/ (function(module, exports, __webpack_require__) {
  2266. exports = module.exports = __webpack_require__("2350")(false);
  2267. // imports
  2268. // module
  2269. exports.push([module.i, ".vue-grid-layout{position:relative;-webkit-transition:height .2s ease;transition:height .2s ease}", ""]);
  2270. // exports
  2271. /***/ }),
  2272. /***/ "aebd":
  2273. /***/ (function(module, exports) {
  2274. module.exports = function (bitmap, value) {
  2275. return {
  2276. enumerable: !(bitmap & 1),
  2277. configurable: !(bitmap & 2),
  2278. writable: !(bitmap & 4),
  2279. value: value
  2280. };
  2281. };
  2282. /***/ }),
  2283. /***/ "b0c5":
  2284. /***/ (function(module, exports, __webpack_require__) {
  2285. "use strict";
  2286. var regexpExec = __webpack_require__("520a");
  2287. __webpack_require__("5ca1")({
  2288. target: 'RegExp',
  2289. proto: true,
  2290. forced: regexpExec !== /./.exec
  2291. }, {
  2292. exec: regexpExec
  2293. });
  2294. /***/ }),
  2295. /***/ "b447":
  2296. /***/ (function(module, exports, __webpack_require__) {
  2297. // 7.1.15 ToLength
  2298. var toInteger = __webpack_require__("3a38");
  2299. var min = Math.min;
  2300. module.exports = function (it) {
  2301. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  2302. };
  2303. /***/ }),
  2304. /***/ "b770":
  2305. /***/ (function(module, exports, __webpack_require__) {
  2306. "use strict";
  2307. var utils = module.exports = {};
  2308. /**
  2309. * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.
  2310. * @public
  2311. * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.
  2312. * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.
  2313. * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.
  2314. */
  2315. utils.forEach = function(collection, callback) {
  2316. for(var i = 0; i < collection.length; i++) {
  2317. var result = callback(collection[i]);
  2318. if(result) {
  2319. return result;
  2320. }
  2321. }
  2322. };
  2323. /***/ }),
  2324. /***/ "b8e3":
  2325. /***/ (function(module, exports) {
  2326. module.exports = true;
  2327. /***/ }),
  2328. /***/ "b9e9":
  2329. /***/ (function(module, exports, __webpack_require__) {
  2330. __webpack_require__("7445");
  2331. module.exports = __webpack_require__("584a").parseInt;
  2332. /***/ }),
  2333. /***/ "be13":
  2334. /***/ (function(module, exports) {
  2335. // 7.2.1 RequireObjectCoercible(argument)
  2336. module.exports = function (it) {
  2337. if (it == undefined) throw TypeError("Can't call method on " + it);
  2338. return it;
  2339. };
  2340. /***/ }),
  2341. /***/ "c274":
  2342. /***/ (function(module, exports, __webpack_require__) {
  2343. "use strict";
  2344. var utils = __webpack_require__("50bf");
  2345. module.exports = function batchProcessorMaker(options) {
  2346. options = options || {};
  2347. var reporter = options.reporter;
  2348. var asyncProcess = utils.getOption(options, "async", true);
  2349. var autoProcess = utils.getOption(options, "auto", true);
  2350. if(autoProcess && !asyncProcess) {
  2351. reporter && reporter.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true.");
  2352. asyncProcess = true;
  2353. }
  2354. var batch = Batch();
  2355. var asyncFrameHandler;
  2356. var isProcessing = false;
  2357. function addFunction(level, fn) {
  2358. if(!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {
  2359. // Since this is async, it is guaranteed to be executed after that the fn is added to the batch.
  2360. // This needs to be done before, since we're checking the size of the batch to be 0.
  2361. processBatchAsync();
  2362. }
  2363. batch.add(level, fn);
  2364. }
  2365. function processBatch() {
  2366. // Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.
  2367. // Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).
  2368. isProcessing = true;
  2369. while (batch.size()) {
  2370. var processingBatch = batch;
  2371. batch = Batch();
  2372. processingBatch.process();
  2373. }
  2374. isProcessing = false;
  2375. }
  2376. function forceProcessBatch(localAsyncProcess) {
  2377. if (isProcessing) {
  2378. return;
  2379. }
  2380. if(localAsyncProcess === undefined) {
  2381. localAsyncProcess = asyncProcess;
  2382. }
  2383. if(asyncFrameHandler) {
  2384. cancelFrame(asyncFrameHandler);
  2385. asyncFrameHandler = null;
  2386. }
  2387. if(localAsyncProcess) {
  2388. processBatchAsync();
  2389. } else {
  2390. processBatch();
  2391. }
  2392. }
  2393. function processBatchAsync() {
  2394. asyncFrameHandler = requestFrame(processBatch);
  2395. }
  2396. function clearBatch() {
  2397. batch = {};
  2398. batchSize = 0;
  2399. topLevel = 0;
  2400. bottomLevel = 0;
  2401. }
  2402. function cancelFrame(listener) {
  2403. // var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
  2404. var cancel = clearTimeout;
  2405. return cancel(listener);
  2406. }
  2407. function requestFrame(callback) {
  2408. // var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };
  2409. var raf = function(fn) { return setTimeout(fn, 0); };
  2410. return raf(callback);
  2411. }
  2412. return {
  2413. add: addFunction,
  2414. force: forceProcessBatch
  2415. };
  2416. };
  2417. function Batch() {
  2418. var batch = {};
  2419. var size = 0;
  2420. var topLevel = 0;
  2421. var bottomLevel = 0;
  2422. function add(level, fn) {
  2423. if(!fn) {
  2424. fn = level;
  2425. level = 0;
  2426. }
  2427. if(level > topLevel) {
  2428. topLevel = level;
  2429. } else if(level < bottomLevel) {
  2430. bottomLevel = level;
  2431. }
  2432. if(!batch[level]) {
  2433. batch[level] = [];
  2434. }
  2435. batch[level].push(fn);
  2436. size++;
  2437. }
  2438. function process() {
  2439. for(var level = bottomLevel; level <= topLevel; level++) {
  2440. var fns = batch[level];
  2441. for(var i = 0; i < fns.length; i++) {
  2442. var fn = fns[i];
  2443. fn();
  2444. }
  2445. }
  2446. }
  2447. function getSize() {
  2448. return size;
  2449. }
  2450. return {
  2451. add: add,
  2452. process: process,
  2453. size: getSize
  2454. };
  2455. }
  2456. /***/ }),
  2457. /***/ "c366":
  2458. /***/ (function(module, exports, __webpack_require__) {
  2459. // false -> Array#indexOf
  2460. // true -> Array#includes
  2461. var toIObject = __webpack_require__("6821");
  2462. var toLength = __webpack_require__("9def");
  2463. var toAbsoluteIndex = __webpack_require__("77f1");
  2464. module.exports = function (IS_INCLUDES) {
  2465. return function ($this, el, fromIndex) {
  2466. var O = toIObject($this);
  2467. var length = toLength(O.length);
  2468. var index = toAbsoluteIndex(fromIndex, length);
  2469. var value;
  2470. // Array#includes uses SameValueZero equality algorithm
  2471. // eslint-disable-next-line no-self-compare
  2472. if (IS_INCLUDES && el != el) while (length > index) {
  2473. value = O[index++];
  2474. // eslint-disable-next-line no-self-compare
  2475. if (value != value) return true;
  2476. // Array#indexOf ignores holes, Array#includes - not
  2477. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  2478. if (O[index] === el) return IS_INCLUDES || index || 0;
  2479. } return !IS_INCLUDES && -1;
  2480. };
  2481. };
  2482. /***/ }),
  2483. /***/ "c3a1":
  2484. /***/ (function(module, exports, __webpack_require__) {
  2485. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  2486. var $keys = __webpack_require__("e6f3");
  2487. var enumBugKeys = __webpack_require__("1691");
  2488. module.exports = Object.keys || function keys(O) {
  2489. return $keys(O, enumBugKeys);
  2490. };
  2491. /***/ }),
  2492. /***/ "c5f6":
  2493. /***/ (function(module, exports, __webpack_require__) {
  2494. "use strict";
  2495. var global = __webpack_require__("7726");
  2496. var has = __webpack_require__("69a8");
  2497. var cof = __webpack_require__("2d95");
  2498. var inheritIfRequired = __webpack_require__("5dbc");
  2499. var toPrimitive = __webpack_require__("6a99");
  2500. var fails = __webpack_require__("79e5");
  2501. var gOPN = __webpack_require__("9093").f;
  2502. var gOPD = __webpack_require__("11e9").f;
  2503. var dP = __webpack_require__("86cc").f;
  2504. var $trim = __webpack_require__("aa77").trim;
  2505. var NUMBER = 'Number';
  2506. var $Number = global[NUMBER];
  2507. var Base = $Number;
  2508. var proto = $Number.prototype;
  2509. // Opera ~12 has broken Object#toString
  2510. var BROKEN_COF = cof(__webpack_require__("2aeb")(proto)) == NUMBER;
  2511. var TRIM = 'trim' in String.prototype;
  2512. // 7.1.3 ToNumber(argument)
  2513. var toNumber = function (argument) {
  2514. var it = toPrimitive(argument, false);
  2515. if (typeof it == 'string' && it.length > 2) {
  2516. it = TRIM ? it.trim() : $trim(it, 3);
  2517. var first = it.charCodeAt(0);
  2518. var third, radix, maxCode;
  2519. if (first === 43 || first === 45) {
  2520. third = it.charCodeAt(2);
  2521. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  2522. } else if (first === 48) {
  2523. switch (it.charCodeAt(1)) {
  2524. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
  2525. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
  2526. default: return +it;
  2527. }
  2528. for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
  2529. code = digits.charCodeAt(i);
  2530. // parseInt parses a string to a first unavailable symbol
  2531. // but ToNumber should return NaN if a string contains unavailable symbols
  2532. if (code < 48 || code > maxCode) return NaN;
  2533. } return parseInt(digits, radix);
  2534. }
  2535. } return +it;
  2536. };
  2537. if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
  2538. $Number = function Number(value) {
  2539. var it = arguments.length < 1 ? 0 : value;
  2540. var that = this;
  2541. return that instanceof $Number
  2542. // check on 1..constructor(foo) case
  2543. && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
  2544. ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  2545. };
  2546. for (var keys = __webpack_require__("9e1e") ? gOPN(Base) : (
  2547. // ES3:
  2548. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  2549. // ES6 (in case, if modules with ES6 Number statics required before):
  2550. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  2551. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  2552. ).split(','), j = 0, key; keys.length > j; j++) {
  2553. if (has(Base, key = keys[j]) && !has($Number, key)) {
  2554. dP($Number, key, gOPD(Base, key));
  2555. }
  2556. }
  2557. $Number.prototype = proto;
  2558. proto.constructor = $Number;
  2559. __webpack_require__("2aba")(global, NUMBER, $Number);
  2560. }
  2561. /***/ }),
  2562. /***/ "c69a":
  2563. /***/ (function(module, exports, __webpack_require__) {
  2564. module.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function () {
  2565. return Object.defineProperty(__webpack_require__("230e")('div'), 'a', { get: function () { return 7; } }).a != 7;
  2566. });
  2567. /***/ }),
  2568. /***/ "c946":
  2569. /***/ (function(module, exports, __webpack_require__) {
  2570. "use strict";
  2571. /**
  2572. * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.
  2573. * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js
  2574. */
  2575. var forEach = __webpack_require__("b770").forEach;
  2576. module.exports = function(options) {
  2577. options = options || {};
  2578. var reporter = options.reporter;
  2579. var batchProcessor = options.batchProcessor;
  2580. var getState = options.stateHandler.getState;
  2581. var hasState = options.stateHandler.hasState;
  2582. var idHandler = options.idHandler;
  2583. if (!batchProcessor) {
  2584. throw new Error("Missing required dependency: batchProcessor");
  2585. }
  2586. if (!reporter) {
  2587. throw new Error("Missing required dependency: reporter.");
  2588. }
  2589. //TODO: Could this perhaps be done at installation time?
  2590. var scrollbarSizes = getScrollbarSizes();
  2591. // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.
  2592. // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).
  2593. var styleId = "erd_scroll_detection_scrollbar_style";
  2594. var detectionContainerClass = "erd_scroll_detection_container";
  2595. injectScrollStyle(styleId, detectionContainerClass);
  2596. function getScrollbarSizes() {
  2597. var width = 500;
  2598. var height = 500;
  2599. var child = document.createElement("div");
  2600. child.style.cssText = "position: absolute; width: " + width*2 + "px; height: " + height*2 + "px; visibility: hidden; margin: 0; padding: 0;";
  2601. var container = document.createElement("div");
  2602. container.style.cssText = "position: absolute; width: " + width + "px; height: " + height + "px; overflow: scroll; visibility: none; top: " + -width*3 + "px; left: " + -height*3 + "px; visibility: hidden; margin: 0; padding: 0;";
  2603. container.appendChild(child);
  2604. document.body.insertBefore(container, document.body.firstChild);
  2605. var widthSize = width - container.clientWidth;
  2606. var heightSize = height - container.clientHeight;
  2607. document.body.removeChild(container);
  2608. return {
  2609. width: widthSize,
  2610. height: heightSize
  2611. };
  2612. }
  2613. function injectScrollStyle(styleId, containerClass) {
  2614. function injectStyle(style, method) {
  2615. method = method || function (element) {
  2616. document.head.appendChild(element);
  2617. };
  2618. var styleElement = document.createElement("style");
  2619. styleElement.innerHTML = style;
  2620. styleElement.id = styleId;
  2621. method(styleElement);
  2622. return styleElement;
  2623. }
  2624. if (!document.getElementById(styleId)) {
  2625. var containerAnimationClass = containerClass + "_animation";
  2626. var containerAnimationActiveClass = containerClass + "_animation_active";
  2627. var style = "/* Created by the element-resize-detector library. */\n";
  2628. style += "." + containerClass + " > div::-webkit-scrollbar { display: none; }\n\n";
  2629. style += "." + containerAnimationActiveClass + " { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: " + containerAnimationClass + "; animation-name: " + containerAnimationClass + "; }\n";
  2630. style += "@-webkit-keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n";
  2631. style += "@keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }";
  2632. injectStyle(style);
  2633. }
  2634. }
  2635. function addAnimationClass(element) {
  2636. element.className += " " + detectionContainerClass + "_animation_active";
  2637. }
  2638. function addEvent(el, name, cb) {
  2639. if (el.addEventListener) {
  2640. el.addEventListener(name, cb);
  2641. } else if(el.attachEvent) {
  2642. el.attachEvent("on" + name, cb);
  2643. } else {
  2644. return reporter.error("[scroll] Don't know how to add event listeners.");
  2645. }
  2646. }
  2647. function removeEvent(el, name, cb) {
  2648. if (el.removeEventListener) {
  2649. el.removeEventListener(name, cb);
  2650. } else if(el.detachEvent) {
  2651. el.detachEvent("on" + name, cb);
  2652. } else {
  2653. return reporter.error("[scroll] Don't know how to remove event listeners.");
  2654. }
  2655. }
  2656. function getExpandElement(element) {
  2657. return getState(element).container.childNodes[0].childNodes[0].childNodes[0];
  2658. }
  2659. function getShrinkElement(element) {
  2660. return getState(element).container.childNodes[0].childNodes[0].childNodes[1];
  2661. }
  2662. /**
  2663. * Adds a resize event listener to the element.
  2664. * @public
  2665. * @param {element} element The element that should have the listener added.
  2666. * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
  2667. */
  2668. function addListener(element, listener) {
  2669. var listeners = getState(element).listeners;
  2670. if (!listeners.push) {
  2671. throw new Error("Cannot add listener to an element that is not detectable.");
  2672. }
  2673. getState(element).listeners.push(listener);
  2674. }
  2675. /**
  2676. * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
  2677. * @private
  2678. * @param {object} options Optional options object.
  2679. * @param {element} element The element to make detectable
  2680. * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
  2681. */
  2682. function makeDetectable(options, element, callback) {
  2683. if (!callback) {
  2684. callback = element;
  2685. element = options;
  2686. options = null;
  2687. }
  2688. options = options || {};
  2689. function debug() {
  2690. if (options.debug) {
  2691. var args = Array.prototype.slice.call(arguments);
  2692. args.unshift(idHandler.get(element), "Scroll: ");
  2693. if (reporter.log.apply) {
  2694. reporter.log.apply(null, args);
  2695. } else {
  2696. for (var i = 0; i < args.length; i++) {
  2697. reporter.log(args[i]);
  2698. }
  2699. }
  2700. }
  2701. }
  2702. function isDetached(element) {
  2703. function isInDocument(element) {
  2704. return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);
  2705. }
  2706. if (!isInDocument(element)) {
  2707. return true;
  2708. }
  2709. // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520
  2710. if (window.getComputedStyle(element) === null) {
  2711. return true;
  2712. }
  2713. return false;
  2714. }
  2715. function isUnrendered(element) {
  2716. // Check the absolute positioned container since the top level container is display: inline.
  2717. var container = getState(element).container.childNodes[0];
  2718. var style = window.getComputedStyle(container);
  2719. return !style.width || style.width.indexOf("px") === -1; //Can only compute pixel value when rendered.
  2720. }
  2721. function getStyle() {
  2722. // Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,
  2723. // so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).
  2724. var elementStyle = window.getComputedStyle(element);
  2725. var style = {};
  2726. style.position = elementStyle.position;
  2727. style.width = element.offsetWidth;
  2728. style.height = element.offsetHeight;
  2729. style.top = elementStyle.top;
  2730. style.right = elementStyle.right;
  2731. style.bottom = elementStyle.bottom;
  2732. style.left = elementStyle.left;
  2733. style.widthCSS = elementStyle.width;
  2734. style.heightCSS = elementStyle.height;
  2735. return style;
  2736. }
  2737. function storeStartSize() {
  2738. var style = getStyle();
  2739. getState(element).startSize = {
  2740. width: style.width,
  2741. height: style.height
  2742. };
  2743. debug("Element start size", getState(element).startSize);
  2744. }
  2745. function initListeners() {
  2746. getState(element).listeners = [];
  2747. }
  2748. function storeStyle() {
  2749. debug("storeStyle invoked.");
  2750. if (!getState(element)) {
  2751. debug("Aborting because element has been uninstalled");
  2752. return;
  2753. }
  2754. var style = getStyle();
  2755. getState(element).style = style;
  2756. }
  2757. function storeCurrentSize(element, width, height) {
  2758. getState(element).lastWidth = width;
  2759. getState(element).lastHeight = height;
  2760. }
  2761. function getExpandChildElement(element) {
  2762. return getExpandElement(element).childNodes[0];
  2763. }
  2764. function getWidthOffset() {
  2765. return 2 * scrollbarSizes.width + 1;
  2766. }
  2767. function getHeightOffset() {
  2768. return 2 * scrollbarSizes.height + 1;
  2769. }
  2770. function getExpandWidth(width) {
  2771. return width + 10 + getWidthOffset();
  2772. }
  2773. function getExpandHeight(height) {
  2774. return height + 10 + getHeightOffset();
  2775. }
  2776. function getShrinkWidth(width) {
  2777. return width * 2 + getWidthOffset();
  2778. }
  2779. function getShrinkHeight(height) {
  2780. return height * 2 + getHeightOffset();
  2781. }
  2782. function positionScrollbars(element, width, height) {
  2783. var expand = getExpandElement(element);
  2784. var shrink = getShrinkElement(element);
  2785. var expandWidth = getExpandWidth(width);
  2786. var expandHeight = getExpandHeight(height);
  2787. var shrinkWidth = getShrinkWidth(width);
  2788. var shrinkHeight = getShrinkHeight(height);
  2789. expand.scrollLeft = expandWidth;
  2790. expand.scrollTop = expandHeight;
  2791. shrink.scrollLeft = shrinkWidth;
  2792. shrink.scrollTop = shrinkHeight;
  2793. }
  2794. function injectContainerElement() {
  2795. var container = getState(element).container;
  2796. if (!container) {
  2797. container = document.createElement("div");
  2798. container.className = detectionContainerClass;
  2799. container.style.cssText = "visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;";
  2800. getState(element).container = container;
  2801. addAnimationClass(container);
  2802. element.appendChild(container);
  2803. var onAnimationStart = function () {
  2804. getState(element).onRendered && getState(element).onRendered();
  2805. };
  2806. addEvent(container, "animationstart", onAnimationStart);
  2807. // Store the event handler here so that they may be removed when uninstall is called.
  2808. // See uninstall function for an explanation why it is needed.
  2809. getState(element).onAnimationStart = onAnimationStart;
  2810. }
  2811. return container;
  2812. }
  2813. function injectScrollElements() {
  2814. function alterPositionStyles() {
  2815. var style = getState(element).style;
  2816. if(style.position === "static") {
  2817. element.style.position = "relative";
  2818. var removeRelativeStyles = function(reporter, element, style, property) {
  2819. function getNumericalValue(value) {
  2820. return value.replace(/[^-\d\.]/g, "");
  2821. }
  2822. var value = style[property];
  2823. if(value !== "auto" && getNumericalValue(value) !== "0") {
  2824. reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
  2825. element.style[property] = 0;
  2826. }
  2827. };
  2828. //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
  2829. //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
  2830. removeRelativeStyles(reporter, element, style, "top");
  2831. removeRelativeStyles(reporter, element, style, "right");
  2832. removeRelativeStyles(reporter, element, style, "bottom");
  2833. removeRelativeStyles(reporter, element, style, "left");
  2834. }
  2835. }
  2836. function getLeftTopBottomRightCssText(left, top, bottom, right) {
  2837. left = (!left ? "0" : (left + "px"));
  2838. top = (!top ? "0" : (top + "px"));
  2839. bottom = (!bottom ? "0" : (bottom + "px"));
  2840. right = (!right ? "0" : (right + "px"));
  2841. return "left: " + left + "; top: " + top + "; right: " + right + "; bottom: " + bottom + ";";
  2842. }
  2843. debug("Injecting elements");
  2844. if (!getState(element)) {
  2845. debug("Aborting because element has been uninstalled");
  2846. return;
  2847. }
  2848. alterPositionStyles();
  2849. var rootContainer = getState(element).container;
  2850. if (!rootContainer) {
  2851. rootContainer = injectContainerElement();
  2852. }
  2853. // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),
  2854. // we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than
  2855. // the targeted element.
  2856. // When the bug is resolved, "containerContainer" may be removed.
  2857. // The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).
  2858. // This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.
  2859. var scrollbarWidth = scrollbarSizes.width;
  2860. var scrollbarHeight = scrollbarSizes.height;
  2861. var containerContainerStyle = "position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;";
  2862. var containerStyle = "position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; " + getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth);
  2863. var expandStyle = "position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;";
  2864. var shrinkStyle = "position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;";
  2865. var expandChildStyle = "position: absolute; left: 0; top: 0;";
  2866. var shrinkChildStyle = "position: absolute; width: 200%; height: 200%;";
  2867. var containerContainer = document.createElement("div");
  2868. var container = document.createElement("div");
  2869. var expand = document.createElement("div");
  2870. var expandChild = document.createElement("div");
  2871. var shrink = document.createElement("div");
  2872. var shrinkChild = document.createElement("div");
  2873. // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56
  2874. // However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.
  2875. containerContainer.dir = "ltr";
  2876. containerContainer.style.cssText = containerContainerStyle;
  2877. containerContainer.className = detectionContainerClass;
  2878. container.className = detectionContainerClass;
  2879. container.style.cssText = containerStyle;
  2880. expand.style.cssText = expandStyle;
  2881. expandChild.style.cssText = expandChildStyle;
  2882. shrink.style.cssText = shrinkStyle;
  2883. shrinkChild.style.cssText = shrinkChildStyle;
  2884. expand.appendChild(expandChild);
  2885. shrink.appendChild(shrinkChild);
  2886. container.appendChild(expand);
  2887. container.appendChild(shrink);
  2888. containerContainer.appendChild(container);
  2889. rootContainer.appendChild(containerContainer);
  2890. function onExpandScroll() {
  2891. getState(element).onExpand && getState(element).onExpand();
  2892. }
  2893. function onShrinkScroll() {
  2894. getState(element).onShrink && getState(element).onShrink();
  2895. }
  2896. addEvent(expand, "scroll", onExpandScroll);
  2897. addEvent(shrink, "scroll", onShrinkScroll);
  2898. // Store the event handlers here so that they may be removed when uninstall is called.
  2899. // See uninstall function for an explanation why it is needed.
  2900. getState(element).onExpandScroll = onExpandScroll;
  2901. getState(element).onShrinkScroll = onShrinkScroll;
  2902. }
  2903. function registerListenersAndPositionElements() {
  2904. function updateChildSizes(element, width, height) {
  2905. var expandChild = getExpandChildElement(element);
  2906. var expandWidth = getExpandWidth(width);
  2907. var expandHeight = getExpandHeight(height);
  2908. expandChild.style.width = expandWidth + "px";
  2909. expandChild.style.height = expandHeight + "px";
  2910. }
  2911. function updateDetectorElements(done) {
  2912. var width = element.offsetWidth;
  2913. var height = element.offsetHeight;
  2914. debug("Storing current size", width, height);
  2915. // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.
  2916. // Otherwise the if-check in handleScroll is useless.
  2917. storeCurrentSize(element, width, height);
  2918. // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.
  2919. // Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.
  2920. batchProcessor.add(0, function performUpdateChildSizes() {
  2921. if (!getState(element)) {
  2922. debug("Aborting because element has been uninstalled");
  2923. return;
  2924. }
  2925. if (!areElementsInjected()) {
  2926. debug("Aborting because element container has not been initialized");
  2927. return;
  2928. }
  2929. if (options.debug) {
  2930. var w = element.offsetWidth;
  2931. var h = element.offsetHeight;
  2932. if (w !== width || h !== height) {
  2933. reporter.warn(idHandler.get(element), "Scroll: Size changed before updating detector elements.");
  2934. }
  2935. }
  2936. updateChildSizes(element, width, height);
  2937. });
  2938. batchProcessor.add(1, function updateScrollbars() {
  2939. if (!getState(element)) {
  2940. debug("Aborting because element has been uninstalled");
  2941. return;
  2942. }
  2943. if (!areElementsInjected()) {
  2944. debug("Aborting because element container has not been initialized");
  2945. return;
  2946. }
  2947. positionScrollbars(element, width, height);
  2948. });
  2949. if (done) {
  2950. batchProcessor.add(2, function () {
  2951. if (!getState(element)) {
  2952. debug("Aborting because element has been uninstalled");
  2953. return;
  2954. }
  2955. if (!areElementsInjected()) {
  2956. debug("Aborting because element container has not been initialized");
  2957. return;
  2958. }
  2959. done();
  2960. });
  2961. }
  2962. }
  2963. function areElementsInjected() {
  2964. return !!getState(element).container;
  2965. }
  2966. function notifyListenersIfNeeded() {
  2967. function isFirstNotify() {
  2968. return getState(element).lastNotifiedWidth === undefined;
  2969. }
  2970. debug("notifyListenersIfNeeded invoked");
  2971. var state = getState(element);
  2972. // Don't notify the if the current size is the start size, and this is the first notification.
  2973. if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {
  2974. return debug("Not notifying: Size is the same as the start size, and there has been no notification yet.");
  2975. }
  2976. // Don't notify if the size already has been notified.
  2977. if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {
  2978. return debug("Not notifying: Size already notified");
  2979. }
  2980. debug("Current size not notified, notifying...");
  2981. state.lastNotifiedWidth = state.lastWidth;
  2982. state.lastNotifiedHeight = state.lastHeight;
  2983. forEach(getState(element).listeners, function (listener) {
  2984. listener(element);
  2985. });
  2986. }
  2987. function handleRender() {
  2988. debug("startanimation triggered.");
  2989. if (isUnrendered(element)) {
  2990. debug("Ignoring since element is still unrendered...");
  2991. return;
  2992. }
  2993. debug("Element rendered.");
  2994. var expand = getExpandElement(element);
  2995. var shrink = getShrinkElement(element);
  2996. if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {
  2997. debug("Scrollbars out of sync. Updating detector elements...");
  2998. updateDetectorElements(notifyListenersIfNeeded);
  2999. }
  3000. }
  3001. function handleScroll() {
  3002. debug("Scroll detected.");
  3003. if (isUnrendered(element)) {
  3004. // Element is still unrendered. Skip this scroll event.
  3005. debug("Scroll event fired while unrendered. Ignoring...");
  3006. return;
  3007. }
  3008. var width = element.offsetWidth;
  3009. var height = element.offsetHeight;
  3010. if (width !== getState(element).lastWidth || height !== getState(element).lastHeight) {
  3011. debug("Element size changed.");
  3012. updateDetectorElements(notifyListenersIfNeeded);
  3013. } else {
  3014. debug("Element size has not changed (" + width + "x" + height + ").");
  3015. }
  3016. }
  3017. debug("registerListenersAndPositionElements invoked.");
  3018. if (!getState(element)) {
  3019. debug("Aborting because element has been uninstalled");
  3020. return;
  3021. }
  3022. getState(element).onRendered = handleRender;
  3023. getState(element).onExpand = handleScroll;
  3024. getState(element).onShrink = handleScroll;
  3025. var style = getState(element).style;
  3026. updateChildSizes(element, style.width, style.height);
  3027. }
  3028. function finalizeDomMutation() {
  3029. debug("finalizeDomMutation invoked.");
  3030. if (!getState(element)) {
  3031. debug("Aborting because element has been uninstalled");
  3032. return;
  3033. }
  3034. var style = getState(element).style;
  3035. storeCurrentSize(element, style.width, style.height);
  3036. positionScrollbars(element, style.width, style.height);
  3037. }
  3038. function ready() {
  3039. callback(element);
  3040. }
  3041. function install() {
  3042. debug("Installing...");
  3043. initListeners();
  3044. storeStartSize();
  3045. batchProcessor.add(0, storeStyle);
  3046. batchProcessor.add(1, injectScrollElements);
  3047. batchProcessor.add(2, registerListenersAndPositionElements);
  3048. batchProcessor.add(3, finalizeDomMutation);
  3049. batchProcessor.add(4, ready);
  3050. }
  3051. debug("Making detectable...");
  3052. if (isDetached(element)) {
  3053. debug("Element is detached");
  3054. injectContainerElement();
  3055. debug("Waiting until element is attached...");
  3056. getState(element).onRendered = function () {
  3057. debug("Element is now attached");
  3058. install();
  3059. };
  3060. } else {
  3061. install();
  3062. }
  3063. }
  3064. function uninstall(element) {
  3065. var state = getState(element);
  3066. if (!state) {
  3067. // Uninstall has been called on a non-erd element.
  3068. return;
  3069. }
  3070. // Uninstall may have been called in the following scenarios:
  3071. // (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).
  3072. // (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).
  3073. // (3) After the installation process (here, state.busy = false and all the stuff has been injected).
  3074. // So to be on the safe side, let's check for each thing before removing.
  3075. // We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.
  3076. state.onExpandScroll && removeEvent(getExpandElement(element), "scroll", state.onExpandScroll);
  3077. state.onShrinkScroll && removeEvent(getShrinkElement(element), "scroll", state.onShrinkScroll);
  3078. state.onAnimationStart && removeEvent(state.container, "animationstart", state.onAnimationStart);
  3079. state.container && element.removeChild(state.container);
  3080. }
  3081. return {
  3082. makeDetectable: makeDetectable,
  3083. addListener: addListener,
  3084. uninstall: uninstall
  3085. };
  3086. };
  3087. /***/ }),
  3088. /***/ "ca5a":
  3089. /***/ (function(module, exports) {
  3090. var id = 0;
  3091. var px = Math.random();
  3092. module.exports = function (key) {
  3093. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  3094. };
  3095. /***/ }),
  3096. /***/ "cadf":
  3097. /***/ (function(module, exports, __webpack_require__) {
  3098. "use strict";
  3099. var addToUnscopables = __webpack_require__("9c6c");
  3100. var step = __webpack_require__("d53b");
  3101. var Iterators = __webpack_require__("84f2");
  3102. var toIObject = __webpack_require__("6821");
  3103. // 22.1.3.4 Array.prototype.entries()
  3104. // 22.1.3.13 Array.prototype.keys()
  3105. // 22.1.3.29 Array.prototype.values()
  3106. // 22.1.3.30 Array.prototype[@@iterator]()
  3107. module.exports = __webpack_require__("01f9")(Array, 'Array', function (iterated, kind) {
  3108. this._t = toIObject(iterated); // target
  3109. this._i = 0; // next index
  3110. this._k = kind; // kind
  3111. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  3112. }, function () {
  3113. var O = this._t;
  3114. var kind = this._k;
  3115. var index = this._i++;
  3116. if (!O || index >= O.length) {
  3117. this._t = undefined;
  3118. return step(1);
  3119. }
  3120. if (kind == 'keys') return step(0, index);
  3121. if (kind == 'values') return step(0, O[index]);
  3122. return step(0, [index, O[index]]);
  3123. }, 'values');
  3124. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  3125. Iterators.Arguments = Iterators.Array;
  3126. addToUnscopables('keys');
  3127. addToUnscopables('values');
  3128. addToUnscopables('entries');
  3129. /***/ }),
  3130. /***/ "cb7c":
  3131. /***/ (function(module, exports, __webpack_require__) {
  3132. var isObject = __webpack_require__("d3f4");
  3133. module.exports = function (it) {
  3134. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  3135. return it;
  3136. };
  3137. /***/ }),
  3138. /***/ "ce10":
  3139. /***/ (function(module, exports, __webpack_require__) {
  3140. var has = __webpack_require__("69a8");
  3141. var toIObject = __webpack_require__("6821");
  3142. var arrayIndexOf = __webpack_require__("c366")(false);
  3143. var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
  3144. module.exports = function (object, names) {
  3145. var O = toIObject(object);
  3146. var i = 0;
  3147. var result = [];
  3148. var key;
  3149. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  3150. // Don't enum bug & hidden keys
  3151. while (names.length > i) if (has(O, key = names[i++])) {
  3152. ~arrayIndexOf(result, key) || result.push(key);
  3153. }
  3154. return result;
  3155. };
  3156. /***/ }),
  3157. /***/ "ce7e":
  3158. /***/ (function(module, exports, __webpack_require__) {
  3159. // most Object methods by ES6 should accept primitives
  3160. var $export = __webpack_require__("63b6");
  3161. var core = __webpack_require__("584a");
  3162. var fails = __webpack_require__("294c");
  3163. module.exports = function (KEY, exec) {
  3164. var fn = (core.Object || {})[KEY] || Object[KEY];
  3165. var exp = {};
  3166. exp[KEY] = exec(fn);
  3167. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  3168. };
  3169. /***/ }),
  3170. /***/ "d3f4":
  3171. /***/ (function(module, exports) {
  3172. module.exports = function (it) {
  3173. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3174. };
  3175. /***/ }),
  3176. /***/ "d53b":
  3177. /***/ (function(module, exports) {
  3178. module.exports = function (done, value) {
  3179. return { value: value, done: !!done };
  3180. };
  3181. /***/ }),
  3182. /***/ "d6eb":
  3183. /***/ (function(module, exports, __webpack_require__) {
  3184. "use strict";
  3185. var prop = "_erd";
  3186. function initState(element) {
  3187. element[prop] = {};
  3188. return getState(element);
  3189. }
  3190. function getState(element) {
  3191. return element[prop];
  3192. }
  3193. function cleanState(element) {
  3194. delete element[prop];
  3195. }
  3196. module.exports = {
  3197. initState: initState,
  3198. getState: getState,
  3199. cleanState: cleanState
  3200. };
  3201. /***/ }),
  3202. /***/ "d864":
  3203. /***/ (function(module, exports, __webpack_require__) {
  3204. // optional / simple context binding
  3205. var aFunction = __webpack_require__("79aa");
  3206. module.exports = function (fn, that, length) {
  3207. aFunction(fn);
  3208. if (that === undefined) return fn;
  3209. switch (length) {
  3210. case 1: return function (a) {
  3211. return fn.call(that, a);
  3212. };
  3213. case 2: return function (a, b) {
  3214. return fn.call(that, a, b);
  3215. };
  3216. case 3: return function (a, b, c) {
  3217. return fn.call(that, a, b, c);
  3218. };
  3219. }
  3220. return function (/* ...args */) {
  3221. return fn.apply(that, arguments);
  3222. };
  3223. };
  3224. /***/ }),
  3225. /***/ "d8e8":
  3226. /***/ (function(module, exports) {
  3227. module.exports = function (it) {
  3228. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  3229. return it;
  3230. };
  3231. /***/ }),
  3232. /***/ "d9f6":
  3233. /***/ (function(module, exports, __webpack_require__) {
  3234. var anObject = __webpack_require__("e4ae");
  3235. var IE8_DOM_DEFINE = __webpack_require__("794b");
  3236. var toPrimitive = __webpack_require__("1bc3");
  3237. var dP = Object.defineProperty;
  3238. exports.f = __webpack_require__("8e60") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  3239. anObject(O);
  3240. P = toPrimitive(P, true);
  3241. anObject(Attributes);
  3242. if (IE8_DOM_DEFINE) try {
  3243. return dP(O, P, Attributes);
  3244. } catch (e) { /* empty */ }
  3245. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  3246. if ('value' in Attributes) O[P] = Attributes.value;
  3247. return O;
  3248. };
  3249. /***/ }),
  3250. /***/ "dbdb":
  3251. /***/ (function(module, exports, __webpack_require__) {
  3252. var core = __webpack_require__("584a");
  3253. var global = __webpack_require__("e53d");
  3254. var SHARED = '__core-js_shared__';
  3255. var store = global[SHARED] || (global[SHARED] = {});
  3256. (module.exports = function (key, value) {
  3257. return store[key] || (store[key] = value !== undefined ? value : {});
  3258. })('versions', []).push({
  3259. version: core.version,
  3260. mode: __webpack_require__("b8e3") ? 'pure' : 'global',
  3261. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  3262. });
  3263. /***/ }),
  3264. /***/ "e11e":
  3265. /***/ (function(module, exports) {
  3266. // IE 8- don't enum bug keys
  3267. module.exports = (
  3268. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  3269. ).split(',');
  3270. /***/ }),
  3271. /***/ "e279":
  3272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3273. "use strict";
  3274. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridLayout_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1156");
  3275. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridLayout_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridLayout_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  3276. /* unused harmony reexport * */
  3277. /* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_GridLayout_vue_vue_type_style_index_0_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
  3278. /***/ }),
  3279. /***/ "e4ae":
  3280. /***/ (function(module, exports, __webpack_require__) {
  3281. var isObject = __webpack_require__("f772");
  3282. module.exports = function (it) {
  3283. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  3284. return it;
  3285. };
  3286. /***/ }),
  3287. /***/ "e53d":
  3288. /***/ (function(module, exports) {
  3289. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  3290. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  3291. ? window : typeof self != 'undefined' && self.Math == Math ? self
  3292. // eslint-disable-next-line no-new-func
  3293. : Function('return this')();
  3294. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  3295. /***/ }),
  3296. /***/ "e692":
  3297. /***/ (function(module, exports) {
  3298. module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  3299. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  3300. /***/ }),
  3301. /***/ "e6f3":
  3302. /***/ (function(module, exports, __webpack_require__) {
  3303. var has = __webpack_require__("07e3");
  3304. var toIObject = __webpack_require__("36c3");
  3305. var arrayIndexOf = __webpack_require__("5b4e")(false);
  3306. var IE_PROTO = __webpack_require__("5559")('IE_PROTO');
  3307. module.exports = function (object, names) {
  3308. var O = toIObject(object);
  3309. var i = 0;
  3310. var result = [];
  3311. var key;
  3312. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  3313. // Don't enum bug & hidden keys
  3314. while (names.length > i) if (has(O, key = names[i++])) {
  3315. ~arrayIndexOf(result, key) || result.push(key);
  3316. }
  3317. return result;
  3318. };
  3319. /***/ }),
  3320. /***/ "e814":
  3321. /***/ (function(module, exports, __webpack_require__) {
  3322. module.exports = __webpack_require__("b9e9");
  3323. /***/ }),
  3324. /***/ "eec4":
  3325. /***/ (function(module, exports, __webpack_require__) {
  3326. "use strict";
  3327. var forEach = __webpack_require__("b770").forEach;
  3328. var elementUtilsMaker = __webpack_require__("5be5");
  3329. var listenerHandlerMaker = __webpack_require__("49ad");
  3330. var idGeneratorMaker = __webpack_require__("2cef");
  3331. var idHandlerMaker = __webpack_require__("5058");
  3332. var reporterMaker = __webpack_require__("abb4");
  3333. var browserDetector = __webpack_require__("18e9");
  3334. var batchProcessorMaker = __webpack_require__("c274");
  3335. var stateHandler = __webpack_require__("d6eb");
  3336. //Detection strategies.
  3337. var objectStrategyMaker = __webpack_require__("18d2");
  3338. var scrollStrategyMaker = __webpack_require__("c946");
  3339. function isCollection(obj) {
  3340. return Array.isArray(obj) || obj.length !== undefined;
  3341. }
  3342. function toArray(collection) {
  3343. if (!Array.isArray(collection)) {
  3344. var array = [];
  3345. forEach(collection, function (obj) {
  3346. array.push(obj);
  3347. });
  3348. return array;
  3349. } else {
  3350. return collection;
  3351. }
  3352. }
  3353. function isElement(obj) {
  3354. return obj && obj.nodeType === 1;
  3355. }
  3356. /**
  3357. * @typedef idHandler
  3358. * @type {object}
  3359. * @property {function} get Gets the resize detector id of the element.
  3360. * @property {function} set Generate and sets the resize detector id of the element.
  3361. */
  3362. /**
  3363. * @typedef Options
  3364. * @type {object}
  3365. * @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.
  3366. Default is true. If true, the listener is guaranteed to be called when it has been added.
  3367. If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).
  3368. * @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.
  3369. If not provided, a default id handler will be used.
  3370. * @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.
  3371. If not provided, a default id handler will be used.
  3372. If set to false, then nothing will be reported.
  3373. * @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.
  3374. */
  3375. /**
  3376. * Creates an element resize detector instance.
  3377. * @public
  3378. * @param {Options?} options Optional global options object that will decide how this instance will work.
  3379. */
  3380. module.exports = function(options) {
  3381. options = options || {};
  3382. //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.
  3383. var idHandler;
  3384. if (options.idHandler) {
  3385. // To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler
  3386. // so that readonly flag always is true when it's used here. This may be removed next major version bump.
  3387. idHandler = {
  3388. get: function (element) { return options.idHandler.get(element, true); },
  3389. set: options.idHandler.set
  3390. };
  3391. } else {
  3392. var idGenerator = idGeneratorMaker();
  3393. var defaultIdHandler = idHandlerMaker({
  3394. idGenerator: idGenerator,
  3395. stateHandler: stateHandler
  3396. });
  3397. idHandler = defaultIdHandler;
  3398. }
  3399. //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.
  3400. var reporter = options.reporter;
  3401. if(!reporter) {
  3402. //If options.reporter is false, then the reporter should be quiet.
  3403. var quiet = reporter === false;
  3404. reporter = reporterMaker(quiet);
  3405. }
  3406. //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.
  3407. var batchProcessor = getOption(options, "batchProcessor", batchProcessorMaker({ reporter: reporter }));
  3408. //Options to be used as default for the listenTo function.
  3409. var globalOptions = {};
  3410. globalOptions.callOnAdd = !!getOption(options, "callOnAdd", true);
  3411. globalOptions.debug = !!getOption(options, "debug", false);
  3412. var eventListenerHandler = listenerHandlerMaker(idHandler);
  3413. var elementUtils = elementUtilsMaker({
  3414. stateHandler: stateHandler
  3415. });
  3416. //The detection strategy to be used.
  3417. var detectionStrategy;
  3418. var desiredStrategy = getOption(options, "strategy", "object");
  3419. var strategyOptions = {
  3420. reporter: reporter,
  3421. batchProcessor: batchProcessor,
  3422. stateHandler: stateHandler,
  3423. idHandler: idHandler
  3424. };
  3425. if(desiredStrategy === "scroll") {
  3426. if (browserDetector.isLegacyOpera()) {
  3427. reporter.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy.");
  3428. desiredStrategy = "object";
  3429. } else if (browserDetector.isIE(9)) {
  3430. reporter.warn("Scroll strategy is not supported on IE9. Changing to object strategy.");
  3431. desiredStrategy = "object";
  3432. }
  3433. }
  3434. if(desiredStrategy === "scroll") {
  3435. detectionStrategy = scrollStrategyMaker(strategyOptions);
  3436. } else if(desiredStrategy === "object") {
  3437. detectionStrategy = objectStrategyMaker(strategyOptions);
  3438. } else {
  3439. throw new Error("Invalid strategy name: " + desiredStrategy);
  3440. }
  3441. //Calls can be made to listenTo with elements that are still being installed.
  3442. //Also, same elements can occur in the elements list in the listenTo function.
  3443. //With this map, the ready callbacks can be synchronized between the calls
  3444. //so that the ready callback can always be called when an element is ready - even if
  3445. //it wasn't installed from the function itself.
  3446. var onReadyCallbacks = {};
  3447. /**
  3448. * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.
  3449. * @public
  3450. * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.
  3451. * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.
  3452. * @param {function} listener The callback to be executed for each resize event for each element.
  3453. */
  3454. function listenTo(options, elements, listener) {
  3455. function onResizeCallback(element) {
  3456. var listeners = eventListenerHandler.get(element);
  3457. forEach(listeners, function callListenerProxy(listener) {
  3458. listener(element);
  3459. });
  3460. }
  3461. function addListener(callOnAdd, element, listener) {
  3462. eventListenerHandler.add(element, listener);
  3463. if(callOnAdd) {
  3464. listener(element);
  3465. }
  3466. }
  3467. //Options object may be omitted.
  3468. if(!listener) {
  3469. listener = elements;
  3470. elements = options;
  3471. options = {};
  3472. }
  3473. if(!elements) {
  3474. throw new Error("At least one element required.");
  3475. }
  3476. if(!listener) {
  3477. throw new Error("Listener required.");
  3478. }
  3479. if (isElement(elements)) {
  3480. // A single element has been passed in.
  3481. elements = [elements];
  3482. } else if (isCollection(elements)) {
  3483. // Convert collection to array for plugins.
  3484. // TODO: May want to check so that all the elements in the collection are valid elements.
  3485. elements = toArray(elements);
  3486. } else {
  3487. return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
  3488. }
  3489. var elementsReady = 0;
  3490. var callOnAdd = getOption(options, "callOnAdd", globalOptions.callOnAdd);
  3491. var onReadyCallback = getOption(options, "onReady", function noop() {});
  3492. var debug = getOption(options, "debug", globalOptions.debug);
  3493. forEach(elements, function attachListenerToElement(element) {
  3494. if (!stateHandler.getState(element)) {
  3495. stateHandler.initState(element);
  3496. idHandler.set(element);
  3497. }
  3498. var id = idHandler.get(element);
  3499. debug && reporter.log("Attaching listener to element", id, element);
  3500. if(!elementUtils.isDetectable(element)) {
  3501. debug && reporter.log(id, "Not detectable.");
  3502. if(elementUtils.isBusy(element)) {
  3503. debug && reporter.log(id, "System busy making it detectable");
  3504. //The element is being prepared to be detectable. Do not make it detectable.
  3505. //Just add the listener, because the element will soon be detectable.
  3506. addListener(callOnAdd, element, listener);
  3507. onReadyCallbacks[id] = onReadyCallbacks[id] || [];
  3508. onReadyCallbacks[id].push(function onReady() {
  3509. elementsReady++;
  3510. if(elementsReady === elements.length) {
  3511. onReadyCallback();
  3512. }
  3513. });
  3514. return;
  3515. }
  3516. debug && reporter.log(id, "Making detectable...");
  3517. //The element is not prepared to be detectable, so do prepare it and add a listener to it.
  3518. elementUtils.markBusy(element, true);
  3519. return detectionStrategy.makeDetectable({ debug: debug }, element, function onElementDetectable(element) {
  3520. debug && reporter.log(id, "onElementDetectable");
  3521. if (stateHandler.getState(element)) {
  3522. elementUtils.markAsDetectable(element);
  3523. elementUtils.markBusy(element, false);
  3524. detectionStrategy.addListener(element, onResizeCallback);
  3525. addListener(callOnAdd, element, listener);
  3526. // Since the element size might have changed since the call to "listenTo", we need to check for this change,
  3527. // so that a resize event may be emitted.
  3528. // Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.
  3529. // Also, check the state existance before since the element may have been uninstalled in the installation process.
  3530. var state = stateHandler.getState(element);
  3531. if (state && state.startSize) {
  3532. var width = element.offsetWidth;
  3533. var height = element.offsetHeight;
  3534. if (state.startSize.width !== width || state.startSize.height !== height) {
  3535. onResizeCallback(element);
  3536. }
  3537. }
  3538. if(onReadyCallbacks[id]) {
  3539. forEach(onReadyCallbacks[id], function(callback) {
  3540. callback();
  3541. });
  3542. }
  3543. } else {
  3544. // The element has been unisntalled before being detectable.
  3545. debug && reporter.log(id, "Element uninstalled before being detectable.");
  3546. }
  3547. delete onReadyCallbacks[id];
  3548. elementsReady++;
  3549. if(elementsReady === elements.length) {
  3550. onReadyCallback();
  3551. }
  3552. });
  3553. }
  3554. debug && reporter.log(id, "Already detecable, adding listener.");
  3555. //The element has been prepared to be detectable and is ready to be listened to.
  3556. addListener(callOnAdd, element, listener);
  3557. elementsReady++;
  3558. });
  3559. if(elementsReady === elements.length) {
  3560. onReadyCallback();
  3561. }
  3562. }
  3563. function uninstall(elements) {
  3564. if(!elements) {
  3565. return reporter.error("At least one element is required.");
  3566. }
  3567. if (isElement(elements)) {
  3568. // A single element has been passed in.
  3569. elements = [elements];
  3570. } else if (isCollection(elements)) {
  3571. // Convert collection to array for plugins.
  3572. // TODO: May want to check so that all the elements in the collection are valid elements.
  3573. elements = toArray(elements);
  3574. } else {
  3575. return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
  3576. }
  3577. forEach(elements, function (element) {
  3578. eventListenerHandler.removeAllListeners(element);
  3579. detectionStrategy.uninstall(element);
  3580. stateHandler.cleanState(element);
  3581. });
  3582. }
  3583. return {
  3584. listenTo: listenTo,
  3585. removeListener: eventListenerHandler.removeListener,
  3586. removeAllListeners: eventListenerHandler.removeAllListeners,
  3587. uninstall: uninstall
  3588. };
  3589. };
  3590. function getOption(options, name, defaultValue) {
  3591. var value = options[name];
  3592. if((value === undefined || value === null) && defaultValue !== undefined) {
  3593. return defaultValue;
  3594. }
  3595. return value;
  3596. }
  3597. /***/ }),
  3598. /***/ "f410":
  3599. /***/ (function(module, exports, __webpack_require__) {
  3600. __webpack_require__("1af6");
  3601. module.exports = __webpack_require__("584a").Array.isArray;
  3602. /***/ }),
  3603. /***/ "f499":
  3604. /***/ (function(module, exports, __webpack_require__) {
  3605. module.exports = __webpack_require__("a21f");
  3606. /***/ }),
  3607. /***/ "f772":
  3608. /***/ (function(module, exports) {
  3609. module.exports = function (it) {
  3610. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3611. };
  3612. /***/ }),
  3613. /***/ "fa5b":
  3614. /***/ (function(module, exports, __webpack_require__) {
  3615. module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
  3616. /***/ }),
  3617. /***/ "fab2":
  3618. /***/ (function(module, exports, __webpack_require__) {
  3619. var document = __webpack_require__("7726").document;
  3620. module.exports = document && document.documentElement;
  3621. /***/ }),
  3622. /***/ "fb15":
  3623. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3624. "use strict";
  3625. __webpack_require__.r(__webpack_exports__);
  3626. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  3627. // This file is imported into lib/wc client bundles.
  3628. if (typeof window !== 'undefined') {
  3629. var setPublicPath_i
  3630. if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
  3631. __webpack_require__.p = setPublicPath_i[1] // eslint-disable-line
  3632. }
  3633. }
  3634. // Indicate to webpack that this file can be concatenated
  3635. /* harmony default export */ var setPublicPath = (null);
  3636. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.function.name.js
  3637. var es6_function_name = __webpack_require__("7f7f");
  3638. // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs2/core-js/object/keys.js
  3639. var object_keys = __webpack_require__("a4bb");
  3640. var keys_default = /*#__PURE__*/__webpack_require__.n(object_keys);
  3641. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
  3642. var web_dom_iterable = __webpack_require__("ac6a");
  3643. // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
  3644. var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
  3645. var external_commonjs_vue_commonjs2_vue_root_Vue_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_vue_commonjs2_vue_root_Vue_);
  3646. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3028f95f-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GridItem.vue?vue&type=template&id=6724f499&
  3647. var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"item",staticClass:"vue-grid-item",class:{ 'vue-resizable' : _vm.resizableAndNotStatic, 'static': _vm.static, 'resizing' : _vm.isResizing, 'vue-draggable-dragging' : _vm.isDragging, 'cssTransforms' : _vm.useCssTransforms, 'render-rtl' : _vm.renderRtl, 'disable-userselect': _vm.isDragging, 'no-touch': _vm.isAndroid },style:(_vm.style)},[_vm._t("default"),(_vm.resizableAndNotStatic)?_c('span',{ref:"handle",class:_vm.resizableHandleClass}):_vm._e()],2)}
  3648. var staticRenderFns = []
  3649. // CONCATENATED MODULE: ./src/components/GridItem.vue?vue&type=template&id=6724f499&
  3650. // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs2/core-js/parse-int.js
  3651. var parse_int = __webpack_require__("e814");
  3652. var parse_int_default = /*#__PURE__*/__webpack_require__.n(parse_int);
  3653. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.number.constructor.js
  3654. var es6_number_constructor = __webpack_require__("c5f6");
  3655. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.replace.js
  3656. var es6_regexp_replace = __webpack_require__("a481");
  3657. // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs2/core-js/array/is-array.js
  3658. var is_array = __webpack_require__("a745");
  3659. var is_array_default = /*#__PURE__*/__webpack_require__.n(is_array);
  3660. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.sort.js
  3661. var es6_array_sort = __webpack_require__("55dd");
  3662. // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs2/core-js/json/stringify.js
  3663. var stringify = __webpack_require__("f499");
  3664. var stringify_default = /*#__PURE__*/__webpack_require__.n(stringify);
  3665. // CONCATENATED MODULE: ./src/helpers/utils.js
  3666. // @flow
  3667. /*:: export type LayoutItemRequired = {w: number, h: number, x: number, y: number, i: string};*/
  3668. /*:: export type LayoutItem = LayoutItemRequired &
  3669. {minW?: number, minH?: number, maxW?: number, maxH?: number,
  3670. moved?: boolean, static?: boolean,
  3671. isDraggable?: ?boolean, isResizable?: ?boolean};*/
  3672. // export type Position = {left: number, top: number, width: number, height: number};
  3673. /*
  3674. export type DragCallbackData = {
  3675. node: HTMLElement,
  3676. x: number, y: number,
  3677. deltaX: number, deltaY: number,
  3678. lastX: number, lastY: number
  3679. };
  3680. */
  3681. // export type DragEvent = {e: Event} & DragCallbackData;
  3682. /*:: export type Layout = Array<LayoutItem>;*/
  3683. // export type ResizeEvent = {e: Event, node: HTMLElement, size: Size};
  3684. // const isProduction = process.env.NODE_ENV === 'production';
  3685. /**
  3686. * Return the bottom coordinate of the layout.
  3687. *
  3688. * @param {Array} layout Layout array.
  3689. * @return {Number} Bottom coordinate.
  3690. */
  3691. /*:: export type Size = {width: number, height: number};*/
  3692. function bottom(layout
  3693. /*: Layout*/
  3694. )
  3695. /*: number*/
  3696. {
  3697. var max = 0,
  3698. bottomY;
  3699. for (var i = 0, len = layout.length; i < len; i++) {
  3700. bottomY = layout[i].y + layout[i].h;
  3701. if (bottomY > max) max = bottomY;
  3702. }
  3703. return max;
  3704. }
  3705. function cloneLayout(layout
  3706. /*: Layout*/
  3707. )
  3708. /*: Layout*/
  3709. {
  3710. var newLayout = Array(layout.length);
  3711. for (var i = 0, len = layout.length; i < len; i++) {
  3712. newLayout[i] = cloneLayoutItem(layout[i]);
  3713. }
  3714. return newLayout;
  3715. } // Fast path to cloning, since this is monomorphic
  3716. function cloneLayoutItem(layoutItem
  3717. /*: LayoutItem*/
  3718. )
  3719. /*: LayoutItem*/
  3720. {
  3721. /*return {
  3722. w: layoutItem.w, h: layoutItem.h, x: layoutItem.x, y: layoutItem.y, i: layoutItem.i,
  3723. minW: layoutItem.minW, maxW: layoutItem.maxW, minH: layoutItem.minH, maxH: layoutItem.maxH,
  3724. moved: Boolean(layoutItem.moved), static: Boolean(layoutItem.static),
  3725. // These can be null
  3726. isDraggable: layoutItem.isDraggable, isResizable: layoutItem.isResizable
  3727. };*/
  3728. return JSON.parse(stringify_default()(layoutItem));
  3729. }
  3730. /**
  3731. * Given two layoutitems, check if they collide.
  3732. *
  3733. * @return {Boolean} True if colliding.
  3734. */
  3735. function collides(l1
  3736. /*: LayoutItem*/
  3737. , l2
  3738. /*: LayoutItem*/
  3739. )
  3740. /*: boolean*/
  3741. {
  3742. if (l1 === l2) return false; // same element
  3743. if (l1.x + l1.w <= l2.x) return false; // l1 is left of l2
  3744. if (l1.x >= l2.x + l2.w) return false; // l1 is right of l2
  3745. if (l1.y + l1.h <= l2.y) return false; // l1 is above l2
  3746. if (l1.y >= l2.y + l2.h) return false; // l1 is below l2
  3747. return true; // boxes overlap
  3748. }
  3749. /**
  3750. * Given a layout, compact it. This involves going down each y coordinate and removing gaps
  3751. * between items.
  3752. *
  3753. * @param {Array} layout Layout.
  3754. * @param {Boolean} verticalCompact Whether or not to compact the layout
  3755. * vertically.
  3756. * @return {Array} Compacted Layout.
  3757. */
  3758. function compact(layout
  3759. /*: Layout*/
  3760. , verticalCompact
  3761. /*: Boolean*/
  3762. )
  3763. /*: Layout*/
  3764. {
  3765. // Statics go in the compareWith array right away so items flow around them.
  3766. var compareWith = getStatics(layout); // We go through the items by row and column.
  3767. var sorted = sortLayoutItemsByRowCol(layout); // Holding for new items.
  3768. var out = Array(layout.length);
  3769. for (var i = 0, len = sorted.length; i < len; i++) {
  3770. var l = sorted[i]; // Don't move static elements
  3771. if (!l.static) {
  3772. l = compactItem(compareWith, l, verticalCompact); // Add to comparison array. We only collide with items before this one.
  3773. // Statics are already in this array.
  3774. compareWith.push(l);
  3775. } // Add to output array to make sure they still come out in the right order.
  3776. out[layout.indexOf(l)] = l; // Clear moved flag, if it exists.
  3777. l.moved = false;
  3778. }
  3779. return out;
  3780. }
  3781. /**
  3782. * Compact an item in the layout.
  3783. */
  3784. function compactItem(compareWith
  3785. /*: Layout*/
  3786. , l
  3787. /*: LayoutItem*/
  3788. , verticalCompact
  3789. /*: boolean*/
  3790. )
  3791. /*: LayoutItem*/
  3792. {
  3793. if (verticalCompact) {
  3794. // Move the element up as far as it can go without colliding.
  3795. while (l.y > 0 && !getFirstCollision(compareWith, l)) {
  3796. l.y--;
  3797. }
  3798. } // Move it down, and keep moving it down if it's colliding.
  3799. var collides;
  3800. while (collides = getFirstCollision(compareWith, l)) {
  3801. l.y = collides.y + collides.h;
  3802. }
  3803. return l;
  3804. }
  3805. /**
  3806. * Given a layout, make sure all elements fit within its bounds.
  3807. *
  3808. * @param {Array} layout Layout array.
  3809. * @param {Number} bounds Number of columns.
  3810. */
  3811. function correctBounds(layout
  3812. /*: Layout*/
  3813. , bounds
  3814. /*: {cols: number}*/
  3815. )
  3816. /*: Layout*/
  3817. {
  3818. var collidesWith = getStatics(layout);
  3819. for (var i = 0, len = layout.length; i < len; i++) {
  3820. var l = layout[i]; // Overflows right
  3821. if (l.x + l.w > bounds.cols) l.x = bounds.cols - l.w; // Overflows left
  3822. if (l.x < 0) {
  3823. l.x = 0;
  3824. l.w = bounds.cols;
  3825. }
  3826. if (!l.static) collidesWith.push(l);else {
  3827. // If this is static and collides with other statics, we must move it down.
  3828. // We have to do something nicer than just letting them overlap.
  3829. while (getFirstCollision(collidesWith, l)) {
  3830. l.y++;
  3831. }
  3832. }
  3833. }
  3834. return layout;
  3835. }
  3836. /**
  3837. * Get a layout item by ID. Used so we can override later on if necessary.
  3838. *
  3839. * @param {Array} layout Layout array.
  3840. * @param {String} id ID
  3841. * @return {LayoutItem} Item at ID.
  3842. */
  3843. function getLayoutItem(layout
  3844. /*: Layout*/
  3845. , id
  3846. /*: string*/
  3847. )
  3848. /*: ?LayoutItem*/
  3849. {
  3850. for (var i = 0, len = layout.length; i < len; i++) {
  3851. if (layout[i].i === id) return layout[i];
  3852. }
  3853. }
  3854. /**
  3855. * Returns the first item this layout collides with.
  3856. * It doesn't appear to matter which order we approach this from, although
  3857. * perhaps that is the wrong thing to do.
  3858. *
  3859. * @param {Object} layoutItem Layout item.
  3860. * @return {Object|undefined} A colliding layout item, or undefined.
  3861. */
  3862. function getFirstCollision(layout
  3863. /*: Layout*/
  3864. , layoutItem
  3865. /*: LayoutItem*/
  3866. )
  3867. /*: ?LayoutItem*/
  3868. {
  3869. for (var i = 0, len = layout.length; i < len; i++) {
  3870. if (collides(layout[i], layoutItem)) return layout[i];
  3871. }
  3872. }
  3873. function getAllCollisions(layout
  3874. /*: Layout*/
  3875. , layoutItem
  3876. /*: LayoutItem*/
  3877. )
  3878. /*: Array<LayoutItem>*/
  3879. {
  3880. return layout.filter(function (l) {
  3881. return collides(l, layoutItem);
  3882. });
  3883. }
  3884. /**
  3885. * Get all static elements.
  3886. * @param {Array} layout Array of layout objects.
  3887. * @return {Array} Array of static layout items..
  3888. */
  3889. function getStatics(layout
  3890. /*: Layout*/
  3891. )
  3892. /*: Array<LayoutItem>*/
  3893. {
  3894. //return [];
  3895. return layout.filter(function (l) {
  3896. return l.static;
  3897. });
  3898. }
  3899. /**
  3900. * Move an element. Responsible for doing cascading movements of other elements.
  3901. *
  3902. * @param {Array} layout Full layout to modify.
  3903. * @param {LayoutItem} l element to move.
  3904. * @param {Number} [x] X position in grid units.
  3905. * @param {Number} [y] Y position in grid units.
  3906. * @param {Boolean} [isUserAction] If true, designates that the item we're moving is
  3907. * being dragged/resized by th euser.
  3908. */
  3909. function moveElement(layout
  3910. /*: Layout*/
  3911. , l
  3912. /*: LayoutItem*/
  3913. , x
  3914. /*: Number*/
  3915. , y
  3916. /*: Number*/
  3917. , isUserAction
  3918. /*: Boolean*/
  3919. )
  3920. /*: Layout*/
  3921. {
  3922. if (l.static) return layout; // Short-circuit if nothing to do.
  3923. //if (l.y === y && l.x === x) return layout;
  3924. var movingUp = y && l.y > y; // This is quite a bit faster than extending the object
  3925. if (typeof x === 'number') l.x = x;
  3926. if (typeof y === 'number') l.y = y;
  3927. l.moved = true; // If this collides with anything, move it.
  3928. // When doing this comparison, we have to sort the items we compare with
  3929. // to ensure, in the case of multiple collisions, that we're getting the
  3930. // nearest collision.
  3931. var sorted = sortLayoutItemsByRowCol(layout);
  3932. if (movingUp) sorted = sorted.reverse();
  3933. var collisions = getAllCollisions(sorted, l); // Move each item that collides away from this element.
  3934. for (var i = 0, len = collisions.length; i < len; i++) {
  3935. var collision = collisions[i]; // console.log('resolving collision between', l.i, 'at', l.y, 'and', collision.i, 'at', collision.y);
  3936. // Short circuit so we can't infinite loop
  3937. if (collision.moved) continue; // This makes it feel a bit more precise by waiting to swap for just a bit when moving up.
  3938. if (l.y > collision.y && l.y - collision.y > collision.h / 4) continue; // Don't move static items - we have to move *this* element away
  3939. if (collision.static) {
  3940. layout = moveElementAwayFromCollision(layout, collision, l, isUserAction);
  3941. } else {
  3942. layout = moveElementAwayFromCollision(layout, l, collision, isUserAction);
  3943. }
  3944. }
  3945. return layout;
  3946. }
  3947. /**
  3948. * This is where the magic needs to happen - given a collision, move an element away from the collision.
  3949. * We attempt to move it up if there's room, otherwise it goes below.
  3950. *
  3951. * @param {Array} layout Full layout to modify.
  3952. * @param {LayoutItem} collidesWith Layout item we're colliding with.
  3953. * @param {LayoutItem} itemToMove Layout item we're moving.
  3954. * @param {Boolean} [isUserAction] If true, designates that the item we're moving is being dragged/resized
  3955. * by the user.
  3956. */
  3957. function moveElementAwayFromCollision(layout
  3958. /*: Layout*/
  3959. , collidesWith
  3960. /*: LayoutItem*/
  3961. , itemToMove
  3962. /*: LayoutItem*/
  3963. , isUserAction
  3964. /*: ?boolean*/
  3965. )
  3966. /*: Layout*/
  3967. {
  3968. // If there is enough space above the collision to put this element, move it there.
  3969. // We only do this on the main collision as this can get funky in cascades and cause
  3970. // unwanted swapping behavior.
  3971. if (isUserAction) {
  3972. // Make a mock item so we don't modify the item here, only modify in moveElement.
  3973. var fakeItem
  3974. /*: LayoutItem*/
  3975. = {
  3976. x: itemToMove.x,
  3977. y: itemToMove.y,
  3978. w: itemToMove.w,
  3979. h: itemToMove.h,
  3980. i: '-1'
  3981. };
  3982. fakeItem.y = Math.max(collidesWith.y - itemToMove.h, 0);
  3983. if (!getFirstCollision(layout, fakeItem)) {
  3984. return moveElement(layout, itemToMove, undefined, fakeItem.y);
  3985. }
  3986. } // Previously this was optimized to move below the collision directly, but this can cause problems
  3987. // with cascading moves, as an item may actually leapflog a collision and cause a reversal in order.
  3988. return moveElement(layout, itemToMove, undefined, itemToMove.y + 1);
  3989. }
  3990. /**
  3991. * Helper to convert a number to a percentage string.
  3992. *
  3993. * @param {Number} num Any number
  3994. * @return {String} That number as a percentage.
  3995. */
  3996. function perc(num
  3997. /*: number*/
  3998. )
  3999. /*: string*/
  4000. {
  4001. return num * 100 + '%';
  4002. }
  4003. function setTransform(top, left, width, height)
  4004. /*: Object*/
  4005. {
  4006. // Replace unitless items with px
  4007. var translate = "translate3d(" + left + "px," + top + "px, 0)";
  4008. return {
  4009. transform: translate,
  4010. WebkitTransform: translate,
  4011. MozTransform: translate,
  4012. msTransform: translate,
  4013. OTransform: translate,
  4014. width: width + "px",
  4015. height: height + "px",
  4016. position: 'absolute'
  4017. };
  4018. }
  4019. /**
  4020. * Just like the setTransform method, but instead it will return a negative value of right.
  4021. *
  4022. * @param top
  4023. * @param right
  4024. * @param width
  4025. * @param height
  4026. * @returns {{transform: string, WebkitTransform: string, MozTransform: string, msTransform: string, OTransform: string, width: string, height: string, position: string}}
  4027. */
  4028. function setTransformRtl(top, right, width, height)
  4029. /*: Object*/
  4030. {
  4031. // Replace unitless items with px
  4032. var translate = "translate3d(" + right * -1 + "px," + top + "px, 0)";
  4033. return {
  4034. transform: translate,
  4035. WebkitTransform: translate,
  4036. MozTransform: translate,
  4037. msTransform: translate,
  4038. OTransform: translate,
  4039. width: width + "px",
  4040. height: height + "px",
  4041. position: 'absolute'
  4042. };
  4043. }
  4044. function setTopLeft(top, left, width, height)
  4045. /*: Object*/
  4046. {
  4047. return {
  4048. top: top + "px",
  4049. left: left + "px",
  4050. width: width + "px",
  4051. height: height + "px",
  4052. position: 'absolute'
  4053. };
  4054. }
  4055. /**
  4056. * Just like the setTopLeft method, but instead, it will return a right property instead of left.
  4057. *
  4058. * @param top
  4059. * @param right
  4060. * @param width
  4061. * @param height
  4062. * @returns {{top: string, right: string, width: string, height: string, position: string}}
  4063. */
  4064. function setTopRight(top, right, width, height)
  4065. /*: Object*/
  4066. {
  4067. return {
  4068. top: top + "px",
  4069. right: right + "px",
  4070. width: width + "px",
  4071. height: height + "px",
  4072. position: 'absolute'
  4073. };
  4074. }
  4075. /**
  4076. * Get layout items sorted from top left to right and down.
  4077. *
  4078. * @return {Array} Array of layout objects.
  4079. * @return {Array} Layout, sorted static items first.
  4080. */
  4081. function sortLayoutItemsByRowCol(layout
  4082. /*: Layout*/
  4083. )
  4084. /*: Layout*/
  4085. {
  4086. return [].concat(layout).sort(function (a, b) {
  4087. if (a.y > b.y || a.y === b.y && a.x > b.x) {
  4088. return 1;
  4089. }
  4090. return -1;
  4091. });
  4092. }
  4093. /**
  4094. * Generate a layout using the initialLayout and children as a template.
  4095. * Missing entries will be added, extraneous ones will be truncated.
  4096. *
  4097. * @param {Array} initialLayout Layout passed in through props.
  4098. * @param {String} breakpoint Current responsive breakpoint.
  4099. * @param {Boolean} verticalCompact Whether or not to compact the layout vertically.
  4100. * @return {Array} Working layout.
  4101. */
  4102. /*
  4103. export function synchronizeLayoutWithChildren(initialLayout: Layout, children: Array<React.Element>|React.Element,
  4104. cols: number, verticalCompact: boolean): Layout {
  4105. // ensure 'children' is always an array
  4106. if (!Array.isArray(children)) {
  4107. children = [children];
  4108. }
  4109. initialLayout = initialLayout || [];
  4110. // Generate one layout item per child.
  4111. let layout: Layout = [];
  4112. for (let i = 0, len = children.length; i < len; i++) {
  4113. let newItem;
  4114. const child = children[i];
  4115. // Don't overwrite if it already exists.
  4116. const exists = getLayoutItem(initialLayout, child.key || "1" /!* FIXME satisfies Flow *!/);
  4117. if (exists) {
  4118. newItem = exists;
  4119. } else {
  4120. const g = child.props._grid;
  4121. // Hey, this item has a _grid property, use it.
  4122. if (g) {
  4123. if (!isProduction) {
  4124. validateLayout([g], 'ReactGridLayout.children');
  4125. }
  4126. // Validated; add it to the layout. Bottom 'y' possible is the bottom of the layout.
  4127. // This allows you to do nice stuff like specify {y: Infinity}
  4128. if (verticalCompact) {
  4129. newItem = cloneLayoutItem({...g, y: Math.min(bottom(layout), g.y), i: child.key});
  4130. } else {
  4131. newItem = cloneLayoutItem({...g, y: g.y, i: child.key});
  4132. }
  4133. }
  4134. // Nothing provided: ensure this is added to the bottom
  4135. else {
  4136. newItem = cloneLayoutItem({w: 1, h: 1, x: 0, y: bottom(layout), i: child.key || "1"});
  4137. }
  4138. }
  4139. layout[i] = newItem;
  4140. }
  4141. // Correct the layout.
  4142. layout = correctBounds(layout, {cols: cols});
  4143. layout = compact(layout, verticalCompact);
  4144. return layout;
  4145. }
  4146. */
  4147. /**
  4148. * Validate a layout. Throws errors.
  4149. *
  4150. * @param {Array} layout Array of layout items.
  4151. * @param {String} [contextName] Context name for errors.
  4152. * @throw {Error} Validation error.
  4153. */
  4154. function validateLayout(layout
  4155. /*: Layout*/
  4156. , contextName
  4157. /*: string*/
  4158. )
  4159. /*: void*/
  4160. {
  4161. contextName = contextName || "Layout";
  4162. var subProps = ['x', 'y', 'w', 'h'];
  4163. if (!is_array_default()(layout)) throw new Error(contextName + " must be an array!");
  4164. for (var i = 0, len = layout.length; i < len; i++) {
  4165. var item = layout[i];
  4166. for (var j = 0; j < subProps.length; j++) {
  4167. if (typeof item[subProps[j]] !== 'number') {
  4168. throw new Error('VueGridLayout: ' + contextName + '[' + i + '].' + subProps[j] + ' must be a number!');
  4169. }
  4170. }
  4171. if (item.i && typeof item.i !== 'string') {// number is also ok, so comment the error
  4172. // TODO confirm if commenting the line below doesn't cause unexpected problems
  4173. // throw new Error('VueGridLayout: ' + contextName + '[' + i + '].i must be a string!');
  4174. }
  4175. if (item.static !== undefined && typeof item.static !== 'boolean') {
  4176. throw new Error('VueGridLayout: ' + contextName + '[' + i + '].static must be a boolean!');
  4177. }
  4178. }
  4179. } // Flow can't really figure this out, so we just use Object
  4180. function autoBindHandlers(el
  4181. /*: Object*/
  4182. , fns
  4183. /*: Array<string>*/
  4184. )
  4185. /*: void*/
  4186. {
  4187. fns.forEach(function (key) {
  4188. return el[key] = el[key].bind(el);
  4189. });
  4190. }
  4191. /**
  4192. * Convert a JS object to CSS string. Similar to React's output of CSS.
  4193. * @param obj
  4194. * @returns {string}
  4195. */
  4196. function createMarkup(obj) {
  4197. var keys = keys_default()(obj);
  4198. if (!keys.length) return '';
  4199. var i,
  4200. len = keys.length;
  4201. var result = '';
  4202. for (i = 0; i < len; i++) {
  4203. var key = keys[i];
  4204. var val = obj[key];
  4205. result += hyphenate(key) + ':' + addPx(key, val) + ';';
  4206. }
  4207. return result;
  4208. }
  4209. /* The following list is defined in React's core */
  4210. var IS_UNITLESS = {
  4211. animationIterationCount: true,
  4212. boxFlex: true,
  4213. boxFlexGroup: true,
  4214. boxOrdinalGroup: true,
  4215. columnCount: true,
  4216. flex: true,
  4217. flexGrow: true,
  4218. flexPositive: true,
  4219. flexShrink: true,
  4220. flexNegative: true,
  4221. flexOrder: true,
  4222. gridRow: true,
  4223. gridColumn: true,
  4224. fontWeight: true,
  4225. lineClamp: true,
  4226. lineHeight: true,
  4227. opacity: true,
  4228. order: true,
  4229. orphans: true,
  4230. tabSize: true,
  4231. widows: true,
  4232. zIndex: true,
  4233. zoom: true,
  4234. // SVG-related properties
  4235. fillOpacity: true,
  4236. stopOpacity: true,
  4237. strokeDashoffset: true,
  4238. strokeOpacity: true,
  4239. strokeWidth: true
  4240. };
  4241. /**
  4242. * Will add px to the end of style values which are Numbers.
  4243. * @param name
  4244. * @param value
  4245. * @returns {*}
  4246. */
  4247. function addPx(name, value) {
  4248. if (typeof value === 'number' && !IS_UNITLESS[name]) {
  4249. return value + 'px';
  4250. } else {
  4251. return value;
  4252. }
  4253. }
  4254. /**
  4255. * Hyphenate a camelCase string.
  4256. *
  4257. * @param {String} str
  4258. * @return {String}
  4259. */
  4260. var hyphenateRE = /([a-z\d])([A-Z])/g;
  4261. function hyphenate(str) {
  4262. return str.replace(hyphenateRE, '$1-$2').toLowerCase();
  4263. }
  4264. function findItemInArray(array, property, value) {
  4265. for (var i = 0; i < array.length; i++) {
  4266. if (array[i][property] == value) return true;
  4267. }
  4268. return false;
  4269. }
  4270. function findAndRemove(array, property, value) {
  4271. array.forEach(function (result, index) {
  4272. if (result[property] === value) {
  4273. //Remove from array
  4274. array.splice(index, 1);
  4275. }
  4276. });
  4277. }
  4278. // CONCATENATED MODULE: ./src/helpers/draggableUtils.js
  4279. // Get {x, y} positions from event.
  4280. function getControlPosition(e) {
  4281. return offsetXYFromParentOf(e);
  4282. } // Get from offsetParent
  4283. function offsetXYFromParentOf(evt) {
  4284. var offsetParent = evt.target.offsetParent || document.body;
  4285. var offsetParentRect = evt.offsetParent === document.body ? {
  4286. left: 0,
  4287. top: 0
  4288. } : offsetParent.getBoundingClientRect();
  4289. var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;
  4290. var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;
  4291. /*const x = Math.round(evt.clientX + offsetParent.scrollLeft - offsetParentRect.left);
  4292. const y = Math.round(evt.clientY + offsetParent.scrollTop - offsetParentRect.top);*/
  4293. return {
  4294. x: x,
  4295. y: y
  4296. };
  4297. } // Create an data object exposed by <DraggableCore>'s events
  4298. function createCoreData(lastX, lastY, x, y) {
  4299. // State changes are often (but not always!) async. We want the latest value.
  4300. var isStart = !isNum(lastX);
  4301. if (isStart) {
  4302. // If this is our first move, use the x and y as last coords.
  4303. return {
  4304. deltaX: 0,
  4305. deltaY: 0,
  4306. lastX: x,
  4307. lastY: y,
  4308. x: x,
  4309. y: y
  4310. };
  4311. } else {
  4312. // Otherwise calculate proper values.
  4313. return {
  4314. deltaX: x - lastX,
  4315. deltaY: y - lastY,
  4316. lastX: lastX,
  4317. lastY: lastY,
  4318. x: x,
  4319. y: y
  4320. };
  4321. }
  4322. }
  4323. function isNum(num) {
  4324. return typeof num === 'number' && !isNaN(num);
  4325. }
  4326. // CONCATENATED MODULE: ./src/helpers/DOM.js
  4327. var currentDir
  4328. /*: "ltr" | "rtl" | "auto"*/
  4329. = "auto"; // let currentDir = "auto";
  4330. function hasDocument() {
  4331. return typeof document !== "undefined";
  4332. }
  4333. function hasWindow() {
  4334. return typeof window !== "undefined";
  4335. }
  4336. function getDocumentDir() {
  4337. if (!hasDocument()) {
  4338. return currentDir;
  4339. }
  4340. var direction = typeof document.dir !== "undefined" ? document.dir : document.getElementsByTagName("html")[0].getAttribute("dir");
  4341. return direction;
  4342. }
  4343. function setDocumentDir(dir
  4344. /*: "ltr" | "rtl" | "auto"*/
  4345. ) {
  4346. // export function setDocumentDir(dir){
  4347. if (!hasDocument) {
  4348. currentDir = dir;
  4349. return;
  4350. }
  4351. var html = document.getElementsByTagName("html")[0];
  4352. html.setAttribute("dir", dir);
  4353. }
  4354. function addWindowEventListener(event
  4355. /*:string*/
  4356. , callback
  4357. /*: () => mixed*/
  4358. ) {
  4359. if (!hasWindow) {
  4360. callback();
  4361. return;
  4362. }
  4363. window.addEventListener(event, callback);
  4364. }
  4365. function removeWindowEventListener(event
  4366. /*:string*/
  4367. , callback
  4368. /*: () => mixed*/
  4369. ) {
  4370. if (!hasWindow) {
  4371. return;
  4372. }
  4373. window.removeEventListener(event, callback);
  4374. }
  4375. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GridItem.vue?vue&type=script&lang=js&
  4376. //
  4377. //
  4378. //
  4379. //
  4380. //
  4381. //
  4382. //
  4383. //
  4384. //
  4385. //
  4386. //
  4387. //
  4388. //
  4389. //
  4390. //
  4391. //
  4392. //
  4393. //
  4394. //
  4395. //
  4396. //
  4397. //
  4398. //
  4399. //
  4400. //
  4401. //
  4402. //
  4403. //
  4404. //
  4405. //
  4406. //
  4407. //
  4408. //
  4409. //
  4410. //
  4411. //
  4412. //
  4413. //
  4414. //
  4415. //
  4416. //
  4417. //
  4418. //
  4419. //
  4420. //
  4421. //
  4422. //
  4423. //
  4424. //
  4425. //
  4426. //
  4427. //
  4428. //
  4429. //
  4430. //
  4431. //
  4432. //
  4433. //
  4434. //
  4435. //
  4436. //
  4437. //
  4438. //
  4439. //
  4440. //
  4441. //
  4442. //
  4443. //
  4444. //
  4445. //
  4446. //
  4447. //
  4448. //
  4449. //
  4450. //
  4451. //
  4452. //
  4453. //
  4454. //
  4455. //
  4456. //
  4457. //
  4458. //
  4459. //
  4460. //
  4461. //
  4462. //
  4463. // var eventBus = require('./eventBus');
  4464. var interact = __webpack_require__("fb3a");
  4465. /* harmony default export */ var GridItemvue_type_script_lang_js_ = ({
  4466. name: "GridItem",
  4467. props: {
  4468. /*cols: {
  4469. type: Number,
  4470. required: true
  4471. },*/
  4472. /*containerWidth: {
  4473. type: Number,
  4474. required: true
  4475. },
  4476. rowHeight: {
  4477. type: Number,
  4478. required: true
  4479. },
  4480. margin: {
  4481. type: Array,
  4482. required: true
  4483. },
  4484. maxRows: {
  4485. type: Number,
  4486. required: true
  4487. },*/
  4488. isDraggable: {
  4489. type: Boolean,
  4490. required: false,
  4491. default: null
  4492. },
  4493. isResizable: {
  4494. type: Boolean,
  4495. required: false,
  4496. default: null
  4497. },
  4498. /*useCssTransforms: {
  4499. type: Boolean,
  4500. required: true
  4501. },
  4502. */
  4503. static: {
  4504. type: Boolean,
  4505. required: false,
  4506. default: false
  4507. },
  4508. minH: {
  4509. type: Number,
  4510. required: false,
  4511. default: 1
  4512. },
  4513. minW: {
  4514. type: Number,
  4515. required: false,
  4516. default: 1
  4517. },
  4518. maxH: {
  4519. type: Number,
  4520. required: false,
  4521. default: Infinity
  4522. },
  4523. maxW: {
  4524. type: Number,
  4525. required: false,
  4526. default: Infinity
  4527. },
  4528. x: {
  4529. type: Number,
  4530. required: true
  4531. },
  4532. y: {
  4533. type: Number,
  4534. required: true
  4535. },
  4536. w: {
  4537. type: Number,
  4538. required: true
  4539. },
  4540. h: {
  4541. type: Number,
  4542. required: true
  4543. },
  4544. i: {
  4545. required: true
  4546. },
  4547. dragIgnoreFrom: {
  4548. type: String,
  4549. required: false,
  4550. default: 'a, button'
  4551. },
  4552. dragAllowFrom: {
  4553. type: String,
  4554. required: false,
  4555. default: null
  4556. },
  4557. resizeIgnoreFrom: {
  4558. type: String,
  4559. required: false,
  4560. default: 'a, button'
  4561. }
  4562. },
  4563. inject: ["eventBus"],
  4564. data: function data() {
  4565. return {
  4566. cols: 1,
  4567. containerWidth: 100,
  4568. rowHeight: 30,
  4569. margin: [10, 10],
  4570. maxRows: Infinity,
  4571. draggable: null,
  4572. resizable: null,
  4573. useCssTransforms: true,
  4574. isDragging: false,
  4575. dragging: null,
  4576. isResizing: false,
  4577. resizing: null,
  4578. lastX: NaN,
  4579. lastY: NaN,
  4580. lastW: NaN,
  4581. lastH: NaN,
  4582. style: {},
  4583. rtl: false,
  4584. dragEventSet: false,
  4585. resizeEventSet: false,
  4586. previousW: null,
  4587. previousH: null,
  4588. previousX: null,
  4589. previousY: null,
  4590. innerX: this.x,
  4591. innerY: this.y,
  4592. innerW: this.w,
  4593. innerH: this.h
  4594. };
  4595. },
  4596. created: function created() {
  4597. var _this = this;
  4598. var self = this; // Accessible refernces of functions for removing in beforeDestroy
  4599. self.updateWidthHandler = function (width) {
  4600. self.updateWidth(width);
  4601. };
  4602. self.compactHandler = function (layout) {
  4603. self.compact(layout);
  4604. };
  4605. self.setDraggableHandler = function (isDraggable) {
  4606. if (self.isDraggable === null) {
  4607. self.draggable = isDraggable;
  4608. }
  4609. };
  4610. self.setResizableHandler = function (isResizable) {
  4611. if (self.isResizable === null) {
  4612. self.resizable = isResizable;
  4613. }
  4614. };
  4615. self.setRowHeightHandler = function (rowHeight) {
  4616. self.rowHeight = rowHeight;
  4617. };
  4618. self.directionchangeHandler = function () {
  4619. _this.rtl = getDocumentDir() === 'rtl';
  4620. _this.compact();
  4621. };
  4622. self.setColNum = function (colNum) {
  4623. self.cols = parse_int_default()(colNum);
  4624. };
  4625. this.eventBus.$on('updateWidth', self.updateWidthHandler);
  4626. this.eventBus.$on('compact', self.compactHandler);
  4627. this.eventBus.$on('setDraggable', self.setDraggableHandler);
  4628. this.eventBus.$on('setResizable', self.setResizableHandler);
  4629. this.eventBus.$on('setRowHeight', self.setRowHeightHandler);
  4630. this.eventBus.$on('directionchange', self.directionchangeHandler);
  4631. this.eventBus.$on('setColNum', self.setColNum);
  4632. this.rtl = getDocumentDir() === 'rtl';
  4633. },
  4634. beforeDestroy: function beforeDestroy() {
  4635. var self = this; //Remove listeners
  4636. this.eventBus.$off('updateWidth', self.updateWidthHandler);
  4637. this.eventBus.$off('compact', self.compactHandler);
  4638. this.eventBus.$off('setDraggable', self.setDraggableHandler);
  4639. this.eventBus.$off('setResizable', self.setResizableHandler);
  4640. this.eventBus.$off('setRowHeight', self.setRowHeightHandler);
  4641. this.eventBus.$off('directionchange', self.directionchangeHandler);
  4642. this.eventBus.$off('setColNum', self.setColNum);
  4643. this.interactObj.unset(); // destroy interact intance
  4644. },
  4645. mounted: function mounted() {
  4646. this.cols = this.$parent.colNum;
  4647. this.rowHeight = this.$parent.rowHeight;
  4648. this.containerWidth = this.$parent.width !== null ? this.$parent.width : 100;
  4649. this.margin = this.$parent.margin !== undefined ? this.$parent.margin : [10, 10];
  4650. this.maxRows = this.$parent.maxRows;
  4651. if (this.isDraggable === null) {
  4652. this.draggable = this.$parent.isDraggable;
  4653. } else {
  4654. this.draggable = this.isDraggable;
  4655. }
  4656. if (this.isResizable === null) {
  4657. this.resizable = this.$parent.isResizable;
  4658. } else {
  4659. this.resizable = this.isResizable;
  4660. }
  4661. this.useCssTransforms = this.$parent.useCssTransforms;
  4662. this.createStyle();
  4663. },
  4664. watch: {
  4665. isDraggable: function isDraggable() {
  4666. this.draggable = this.isDraggable;
  4667. },
  4668. static: function _static() {
  4669. this.tryMakeDraggable();
  4670. this.tryMakeResizable();
  4671. },
  4672. draggable: function draggable() {
  4673. this.tryMakeDraggable();
  4674. },
  4675. isResizable: function isResizable() {
  4676. this.resizable = this.isResizable;
  4677. },
  4678. resizable: function resizable() {
  4679. this.tryMakeResizable();
  4680. },
  4681. rowHeight: function rowHeight() {
  4682. this.createStyle();
  4683. },
  4684. cols: function cols() {
  4685. this.tryMakeResizable();
  4686. this.createStyle();
  4687. },
  4688. containerWidth: function containerWidth() {
  4689. this.tryMakeResizable();
  4690. this.createStyle();
  4691. },
  4692. x: function x(newVal) {
  4693. this.innerX = newVal;
  4694. this.createStyle();
  4695. },
  4696. y: function y(newVal) {
  4697. this.innerY = newVal;
  4698. this.createStyle();
  4699. },
  4700. h: function h(newVal) {
  4701. this.innerH = newVal;
  4702. this.createStyle();
  4703. },
  4704. w: function w(newVal) {
  4705. this.innerW = newVal;
  4706. this.createStyle();
  4707. },
  4708. renderRtl: function renderRtl() {
  4709. // console.log("### renderRtl");
  4710. this.tryMakeResizable();
  4711. this.createStyle();
  4712. }
  4713. },
  4714. computed: {
  4715. resizableAndNotStatic: function resizableAndNotStatic() {
  4716. return this.resizable && !this.static;
  4717. },
  4718. isAndroid: function isAndroid() {
  4719. return navigator.userAgent.toLowerCase().indexOf("android") !== -1;
  4720. },
  4721. renderRtl: function renderRtl() {
  4722. return this.$parent.isMirrored ? !this.rtl : this.rtl;
  4723. },
  4724. resizableHandleClass: function resizableHandleClass() {
  4725. if (this.renderRtl) {
  4726. return 'vue-resizable-handle vue-rtl-resizable-handle';
  4727. } else {
  4728. return 'vue-resizable-handle';
  4729. }
  4730. }
  4731. },
  4732. methods: {
  4733. createStyle: function createStyle() {
  4734. if (this.x + this.w > this.cols) {
  4735. this.innerX = 0;
  4736. this.innerW = this.w > this.cols ? this.cols : this.w;
  4737. } else {
  4738. this.innerX = this.x;
  4739. this.innerW = this.w;
  4740. }
  4741. var pos = this.calcPosition(this.innerX, this.innerY, this.innerW, this.innerH);
  4742. if (this.isDragging) {
  4743. pos.top = this.dragging.top; // Add rtl support
  4744. if (this.renderRtl) {
  4745. pos.right = this.dragging.left;
  4746. } else {
  4747. pos.left = this.dragging.left;
  4748. }
  4749. }
  4750. if (this.isResizing) {
  4751. pos.width = this.resizing.width;
  4752. pos.height = this.resizing.height;
  4753. }
  4754. var style; // CSS Transforms support (default)
  4755. if (this.useCssTransforms) {
  4756. // Add rtl support
  4757. if (this.renderRtl) {
  4758. style = setTransformRtl(pos.top, pos.right, pos.width, pos.height);
  4759. } else {
  4760. style = setTransform(pos.top, pos.left, pos.width, pos.height);
  4761. }
  4762. } else {
  4763. // top,left (slow)
  4764. // Add rtl support
  4765. if (this.renderRtl) {
  4766. style = setTopRight(pos.top, pos.right, pos.width, pos.height);
  4767. } else {
  4768. style = setTopLeft(pos.top, pos.left, pos.width, pos.height);
  4769. }
  4770. }
  4771. this.style = style;
  4772. },
  4773. handleResize: function handleResize(event) {
  4774. if (this.static) return;
  4775. var position = getControlPosition(event); // Get the current drag point from the event. This is used as the offset.
  4776. if (position == null) return; // not possible but satisfies flow
  4777. var x = position.x,
  4778. y = position.y;
  4779. var newSize = {
  4780. width: 0,
  4781. height: 0
  4782. };
  4783. var pos;
  4784. switch (event.type) {
  4785. case "resizestart":
  4786. {
  4787. this.previousW = this.innerW;
  4788. this.previousH = this.innerH;
  4789. pos = this.calcPosition(this.innerX, this.innerY, this.innerW, this.innerH);
  4790. newSize.width = pos.width;
  4791. newSize.height = pos.height;
  4792. this.resizing = newSize;
  4793. this.isResizing = true;
  4794. break;
  4795. }
  4796. case "resizemove":
  4797. {
  4798. // console.log("### resize => " + event.type + ", lastW=" + this.lastW + ", lastH=" + this.lastH);
  4799. var coreEvent = createCoreData(this.lastW, this.lastH, x, y);
  4800. if (this.renderRtl) {
  4801. newSize.width = this.resizing.width - coreEvent.deltaX;
  4802. } else {
  4803. newSize.width = this.resizing.width + coreEvent.deltaX;
  4804. }
  4805. newSize.height = this.resizing.height + coreEvent.deltaY; ///console.log("### resize => " + event.type + ", deltaX=" + coreEvent.deltaX + ", deltaY=" + coreEvent.deltaY);
  4806. this.resizing = newSize;
  4807. break;
  4808. }
  4809. case "resizeend":
  4810. {
  4811. //console.log("### resize end => x=" +this.innerX + " y=" + this.innerY + " w=" + this.innerW + " h=" + this.innerH);
  4812. pos = this.calcPosition(this.innerX, this.innerY, this.innerW, this.innerH);
  4813. newSize.width = pos.width;
  4814. newSize.height = pos.height; // console.log("### resize end => " + JSON.stringify(newSize));
  4815. this.resizing = null;
  4816. this.isResizing = false;
  4817. break;
  4818. }
  4819. } // Get new WH
  4820. pos = this.calcWH(newSize.height, newSize.width);
  4821. if (pos.w < this.minW) {
  4822. pos.w = this.minW;
  4823. }
  4824. if (pos.w > this.maxW) {
  4825. pos.w = this.maxW;
  4826. }
  4827. if (pos.h < this.minH) {
  4828. pos.h = this.minH;
  4829. }
  4830. if (pos.h > this.maxH) {
  4831. pos.h = this.maxH;
  4832. }
  4833. if (pos.h < 1) {
  4834. pos.h = 1;
  4835. }
  4836. if (pos.w < 1) {
  4837. pos.w = 1;
  4838. }
  4839. this.lastW = x;
  4840. this.lastH = y;
  4841. if (this.innerW !== pos.w || this.innerH !== pos.h) {
  4842. this.$emit("resize", this.i, pos.h, pos.w, newSize.height, newSize.width);
  4843. }
  4844. if (event.type === "resizeend" && (this.previousW !== this.innerW || this.previousH !== this.innerH)) {
  4845. this.$emit("resized", this.i, pos.h, pos.w, newSize.height, newSize.width);
  4846. }
  4847. this.eventBus.$emit("resizeEvent", event.type, this.i, this.innerX, this.innerY, pos.h, pos.w);
  4848. },
  4849. handleDrag: function handleDrag(event) {
  4850. if (this.static) return;
  4851. if (this.isResizing) return;
  4852. var position = getControlPosition(event); // Get the current drag point from the event. This is used as the offset.
  4853. if (position === null) return; // not possible but satisfies flow
  4854. var x = position.x,
  4855. y = position.y; // let shouldUpdate = false;
  4856. var newPosition = {
  4857. top: 0,
  4858. left: 0
  4859. };
  4860. switch (event.type) {
  4861. case "dragstart":
  4862. {
  4863. this.previousX = this.innerX;
  4864. this.previousY = this.innerY;
  4865. var parentRect = event.target.offsetParent.getBoundingClientRect();
  4866. var clientRect = event.target.getBoundingClientRect();
  4867. if (this.renderRtl) {
  4868. newPosition.left = (clientRect.right - parentRect.right) * -1;
  4869. } else {
  4870. newPosition.left = clientRect.left - parentRect.left;
  4871. }
  4872. newPosition.top = clientRect.top - parentRect.top;
  4873. this.dragging = newPosition;
  4874. this.isDragging = true;
  4875. break;
  4876. }
  4877. case "dragend":
  4878. {
  4879. if (!this.isDragging) return;
  4880. var _parentRect = event.target.offsetParent.getBoundingClientRect();
  4881. var _clientRect = event.target.getBoundingClientRect(); // Add rtl support
  4882. if (this.renderRtl) {
  4883. newPosition.left = (_clientRect.right - _parentRect.right) * -1;
  4884. } else {
  4885. newPosition.left = _clientRect.left - _parentRect.left;
  4886. }
  4887. newPosition.top = _clientRect.top - _parentRect.top; // console.log("### drag end => " + JSON.stringify(newPosition));
  4888. // console.log("### DROP: " + JSON.stringify(newPosition));
  4889. this.dragging = null;
  4890. this.isDragging = false; // shouldUpdate = true;
  4891. break;
  4892. }
  4893. case "dragmove":
  4894. {
  4895. var coreEvent = createCoreData(this.lastX, this.lastY, x, y); // Add rtl support
  4896. if (this.renderRtl) {
  4897. newPosition.left = this.dragging.left - coreEvent.deltaX;
  4898. } else {
  4899. newPosition.left = this.dragging.left + coreEvent.deltaX;
  4900. }
  4901. newPosition.top = this.dragging.top + coreEvent.deltaY; // console.log("### drag => " + event.type + ", x=" + x + ", y=" + y);
  4902. // console.log("### drag => " + event.type + ", deltaX=" + coreEvent.deltaX + ", deltaY=" + coreEvent.deltaY);
  4903. // console.log("### drag end => " + JSON.stringify(newPosition));
  4904. this.dragging = newPosition;
  4905. break;
  4906. }
  4907. } // Get new XY
  4908. var pos;
  4909. if (this.renderRtl) {
  4910. pos = this.calcXY(newPosition.top, newPosition.left);
  4911. } else {
  4912. pos = this.calcXY(newPosition.top, newPosition.left);
  4913. }
  4914. this.lastX = x;
  4915. this.lastY = y;
  4916. if (this.innerX !== pos.x || this.innerY !== pos.y) {
  4917. this.$emit("move", this.i, pos.x, pos.y);
  4918. }
  4919. if (event.type === "dragend" && (this.previousX !== this.innerX || this.previousY !== this.innerY)) {
  4920. this.$emit("moved", this.i, pos.x, pos.y);
  4921. }
  4922. this.eventBus.$emit("dragEvent", event.type, this.i, pos.x, pos.y, this.innerH, this.innerW);
  4923. },
  4924. calcPosition: function calcPosition(x, y, w, h) {
  4925. var colWidth = this.calcColWidth(); // add rtl support
  4926. var out;
  4927. if (this.renderRtl) {
  4928. out = {
  4929. right: Math.round(colWidth * x + (x + 1) * this.margin[0]),
  4930. top: Math.round(this.rowHeight * y + (y + 1) * this.margin[1]),
  4931. // 0 * Infinity === NaN, which causes problems with resize constriants;
  4932. // Fix this if it occurs.
  4933. // Note we do it here rather than later because Math.round(Infinity) causes deopt
  4934. width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * this.margin[0]),
  4935. height: h === Infinity ? h : Math.round(this.rowHeight * h + Math.max(0, h - 1) * this.margin[1])
  4936. };
  4937. } else {
  4938. out = {
  4939. left: Math.round(colWidth * x + (x + 1) * this.margin[0]),
  4940. top: Math.round(this.rowHeight * y + (y + 1) * this.margin[1]),
  4941. // 0 * Infinity === NaN, which causes problems with resize constriants;
  4942. // Fix this if it occurs.
  4943. // Note we do it here rather than later because Math.round(Infinity) causes deopt
  4944. width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * this.margin[0]),
  4945. height: h === Infinity ? h : Math.round(this.rowHeight * h + Math.max(0, h - 1) * this.margin[1])
  4946. };
  4947. }
  4948. return out;
  4949. },
  4950. /**
  4951. * Translate x and y coordinates from pixels to grid units.
  4952. * @param {Number} top Top position (relative to parent) in pixels.
  4953. * @param {Number} left Left position (relative to parent) in pixels.
  4954. * @return {Object} x and y in grid units.
  4955. */
  4956. // TODO check if this function needs change in order to support rtl.
  4957. calcXY: function calcXY(top, left) {
  4958. var colWidth = this.calcColWidth(); // left = colWidth * x + margin * (x + 1)
  4959. // l = cx + m(x+1)
  4960. // l = cx + mx + m
  4961. // l - m = cx + mx
  4962. // l - m = x(c + m)
  4963. // (l - m) / (c + m) = x
  4964. // x = (left - margin) / (coldWidth + margin)
  4965. var x = Math.round((left - this.margin[0]) / (colWidth + this.margin[0]));
  4966. var y = Math.round((top - this.margin[1]) / (this.rowHeight + this.margin[1])); // Capping
  4967. x = Math.max(Math.min(x, this.cols - this.innerW), 0);
  4968. y = Math.max(Math.min(y, this.maxRows - this.innerH), 0);
  4969. return {
  4970. x: x,
  4971. y: y
  4972. };
  4973. },
  4974. // Helper for generating column width
  4975. calcColWidth: function calcColWidth() {
  4976. var colWidth = (this.containerWidth - this.margin[0] * (this.cols + 1)) / this.cols; // console.log("### COLS=" + this.cols + " COL WIDTH=" + colWidth + " MARGIN " + this.margin[0]);
  4977. return colWidth;
  4978. },
  4979. /**
  4980. * Given a height and width in pixel values, calculate grid units.
  4981. * @param {Number} height Height in pixels.
  4982. * @param {Number} width Width in pixels.
  4983. * @return {Object} w, h as grid units.
  4984. */
  4985. calcWH: function calcWH(height, width) {
  4986. var colWidth = this.calcColWidth(); // width = colWidth * w - (margin * (w - 1))
  4987. // ...
  4988. // w = (width + margin) / (colWidth + margin)
  4989. var w = Math.round((width + this.margin[0]) / (colWidth + this.margin[0]));
  4990. var h = Math.round((height + this.margin[1]) / (this.rowHeight + this.margin[1])); // Capping
  4991. w = Math.max(Math.min(w, this.cols - this.innerX), 0);
  4992. h = Math.max(Math.min(h, this.maxRows - this.innerY), 0);
  4993. return {
  4994. w: w,
  4995. h: h
  4996. };
  4997. },
  4998. updateWidth: function updateWidth(width, colNum) {
  4999. this.containerWidth = width;
  5000. if (colNum !== undefined && colNum !== null) {
  5001. this.cols = colNum;
  5002. }
  5003. },
  5004. compact: function compact() {
  5005. this.createStyle();
  5006. },
  5007. tryMakeDraggable: function tryMakeDraggable() {
  5008. var self = this;
  5009. if (this.interactObj === null || this.interactObj === undefined) {
  5010. this.interactObj = interact(this.$refs.item);
  5011. }
  5012. if (this.draggable && !this.static) {
  5013. var opts = {
  5014. ignoreFrom: this.dragIgnoreFrom,
  5015. allowFrom: this.dragAllowFrom
  5016. };
  5017. this.interactObj.draggable(opts);
  5018. /*this.interactObj.draggable({allowFrom: '.vue-draggable-handle'});*/
  5019. if (!this.dragEventSet) {
  5020. this.dragEventSet = true;
  5021. this.interactObj.on('dragstart dragmove dragend', function (event) {
  5022. self.handleDrag(event);
  5023. });
  5024. }
  5025. } else {
  5026. this.interactObj.draggable({
  5027. enabled: false
  5028. });
  5029. }
  5030. },
  5031. tryMakeResizable: function tryMakeResizable() {
  5032. var self = this;
  5033. if (this.interactObj === null || this.interactObj === undefined) {
  5034. this.interactObj = interact(this.$refs.item);
  5035. }
  5036. if (this.resizable && !this.static) {
  5037. var maximum = this.calcPosition(0, 0, this.maxW, this.maxH);
  5038. var minimum = this.calcPosition(0, 0, this.minW, this.minH); // console.log("### MAX " + JSON.stringify(maximum));
  5039. // console.log("### MIN " + JSON.stringify(minimum));
  5040. var opts = {
  5041. preserveAspectRatio: true,
  5042. // allowFrom: "." + this.resizableHandleClass,
  5043. edges: {
  5044. left: false,
  5045. right: "." + this.resizableHandleClass,
  5046. bottom: "." + this.resizableHandleClass,
  5047. top: false
  5048. },
  5049. ignoreFrom: this.resizeIgnoreFrom,
  5050. restrictSize: {
  5051. min: {
  5052. height: minimum.height,
  5053. width: minimum.width
  5054. },
  5055. max: {
  5056. height: maximum.height,
  5057. width: maximum.width
  5058. }
  5059. }
  5060. };
  5061. this.interactObj.resizable(opts);
  5062. if (!this.resizeEventSet) {
  5063. this.resizeEventSet = true;
  5064. this.interactObj.on('resizestart resizemove resizeend', function (event) {
  5065. self.handleResize(event);
  5066. });
  5067. }
  5068. } else {
  5069. this.interactObj.resizable({
  5070. enabled: false
  5071. });
  5072. }
  5073. },
  5074. autoSize: function autoSize() {
  5075. // ok here we want to calculate if a resize is needed
  5076. this.previousW = this.innerW;
  5077. this.previousH = this.innerH;
  5078. var newSize = this.$slots.default[0].elm.getBoundingClientRect();
  5079. var pos = this.calcWH(newSize.height, newSize.width);
  5080. if (pos.w < this.minW) {
  5081. pos.w = this.minW;
  5082. }
  5083. if (pos.w > this.maxW) {
  5084. pos.w = this.maxW;
  5085. }
  5086. if (pos.h < this.minH) {
  5087. pos.h = this.minH;
  5088. }
  5089. if (pos.h > this.maxH) {
  5090. pos.h = this.maxH;
  5091. }
  5092. if (pos.h < 1) {
  5093. pos.h = 1;
  5094. }
  5095. if (pos.w < 1) {
  5096. pos.w = 1;
  5097. } // this.lastW = x; // basicly, this is copied from resizehandler, but shouldn't be needed
  5098. // this.lastH = y;
  5099. if (this.innerW !== pos.w || this.innerH !== pos.h) {
  5100. this.$emit("resize", this.i, pos.h, pos.w, newSize.height, newSize.width);
  5101. }
  5102. if (this.previousW !== pos.w || this.previousH !== pos.h) {
  5103. this.$emit("resized", this.i, pos.h, pos.w, newSize.height, newSize.width);
  5104. this.eventBus.$emit("resizeEvent", "resizeend", this.i, this.innerX, this.innerY, pos.h, pos.w);
  5105. }
  5106. }
  5107. }
  5108. });
  5109. // CONCATENATED MODULE: ./src/components/GridItem.vue?vue&type=script&lang=js&
  5110. /* harmony default export */ var components_GridItemvue_type_script_lang_js_ = (GridItemvue_type_script_lang_js_);
  5111. // EXTERNAL MODULE: ./src/components/GridItem.vue?vue&type=style&index=0&lang=css&
  5112. var GridItemvue_type_style_index_0_lang_css_ = __webpack_require__("5ed4");
  5113. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  5114. /* globals __VUE_SSR_CONTEXT__ */
  5115. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  5116. // This module is a runtime utility for cleaner component module output and will
  5117. // be included in the final webpack user bundle.
  5118. function normalizeComponent (
  5119. scriptExports,
  5120. render,
  5121. staticRenderFns,
  5122. functionalTemplate,
  5123. injectStyles,
  5124. scopeId,
  5125. moduleIdentifier, /* server only */
  5126. shadowMode /* vue-cli only */
  5127. ) {
  5128. // Vue.extend constructor export interop
  5129. var options = typeof scriptExports === 'function'
  5130. ? scriptExports.options
  5131. : scriptExports
  5132. // render functions
  5133. if (render) {
  5134. options.render = render
  5135. options.staticRenderFns = staticRenderFns
  5136. options._compiled = true
  5137. }
  5138. // functional template
  5139. if (functionalTemplate) {
  5140. options.functional = true
  5141. }
  5142. // scopedId
  5143. if (scopeId) {
  5144. options._scopeId = 'data-v-' + scopeId
  5145. }
  5146. var hook
  5147. if (moduleIdentifier) { // server build
  5148. hook = function (context) {
  5149. // 2.3 injection
  5150. context =
  5151. context || // cached call
  5152. (this.$vnode && this.$vnode.ssrContext) || // stateful
  5153. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  5154. // 2.2 with runInNewContext: true
  5155. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  5156. context = __VUE_SSR_CONTEXT__
  5157. }
  5158. // inject component styles
  5159. if (injectStyles) {
  5160. injectStyles.call(this, context)
  5161. }
  5162. // register component module identifier for async chunk inferrence
  5163. if (context && context._registeredComponents) {
  5164. context._registeredComponents.add(moduleIdentifier)
  5165. }
  5166. }
  5167. // used by ssr in case component is cached and beforeCreate
  5168. // never gets called
  5169. options._ssrRegister = hook
  5170. } else if (injectStyles) {
  5171. hook = shadowMode
  5172. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  5173. : injectStyles
  5174. }
  5175. if (hook) {
  5176. if (options.functional) {
  5177. // for template-only hot-reload because in that case the render fn doesn't
  5178. // go through the normalizer
  5179. options._injectStyles = hook
  5180. // register for functioal component in vue file
  5181. var originalRender = options.render
  5182. options.render = function renderWithStyleInjection (h, context) {
  5183. hook.call(context)
  5184. return originalRender(h, context)
  5185. }
  5186. } else {
  5187. // inject component registration as beforeCreate hook
  5188. var existing = options.beforeCreate
  5189. options.beforeCreate = existing
  5190. ? [].concat(existing, hook)
  5191. : [hook]
  5192. }
  5193. }
  5194. return {
  5195. exports: scriptExports,
  5196. options: options
  5197. }
  5198. }
  5199. // CONCATENATED MODULE: ./src/components/GridItem.vue
  5200. /* normalize component */
  5201. var component = normalizeComponent(
  5202. components_GridItemvue_type_script_lang_js_,
  5203. render,
  5204. staticRenderFns,
  5205. false,
  5206. null,
  5207. null,
  5208. null
  5209. )
  5210. /* harmony default export */ var GridItem = (component.exports);
  5211. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3028f95f-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GridLayout.vue?vue&type=template&id=16f9e7c6&
  5212. var GridLayoutvue_type_template_id_16f9e7c6_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"item",staticClass:"vue-grid-layout",style:(_vm.mergedStyle)},[_vm._t("default"),_c('grid-item',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDragging),expression:"isDragging"}],staticClass:"vue-grid-placeholder",attrs:{"x":_vm.placeholder.x,"y":_vm.placeholder.y,"w":_vm.placeholder.w,"h":_vm.placeholder.h,"i":_vm.placeholder.i}})],2)}
  5213. var GridLayoutvue_type_template_id_16f9e7c6_staticRenderFns = []
  5214. // CONCATENATED MODULE: ./src/components/GridLayout.vue?vue&type=template&id=16f9e7c6&
  5215. // CONCATENATED MODULE: ./src/helpers/responsiveUtils.js
  5216. // @flow
  5217. /*:: import type {Layout} from './utils';*/
  5218. /*:: export type ResponsiveLayout = {lg?: Layout, md?: Layout, sm?: Layout, xs?: Layout, xxs?: Layout};*/
  5219. /*:: type Breakpoint = string;*/
  5220. /**
  5221. * Given a width, find the highest breakpoint that matches is valid for it (width > breakpoint).
  5222. *
  5223. * @param {Object} breakpoints Breakpoints object (e.g. {lg: 1200, md: 960, ...})
  5224. * @param {Number} width Screen width.
  5225. * @return {String} Highest breakpoint that is less than width.
  5226. */
  5227. /*:: type Breakpoints = {lg?: number, md?: number, sm?: number, xs?: number, xxs?: number};*/
  5228. function getBreakpointFromWidth(breakpoints
  5229. /*: Breakpoints*/
  5230. , width
  5231. /*: number*/
  5232. )
  5233. /*: Breakpoint*/
  5234. {
  5235. var sorted = sortBreakpoints(breakpoints);
  5236. var matching = sorted[0];
  5237. for (var i = 1, len = sorted.length; i < len; i++) {
  5238. var breakpointName = sorted[i];
  5239. if (width > breakpoints[breakpointName]) matching = breakpointName;
  5240. }
  5241. return matching;
  5242. }
  5243. /**
  5244. * Given a breakpoint, get the # of cols set for it.
  5245. * @param {String} breakpoint Breakpoint name.
  5246. * @param {Object} cols Map of breakpoints to cols.
  5247. * @return {Number} Number of cols.
  5248. */
  5249. function getColsFromBreakpoint(breakpoint
  5250. /*: Breakpoint*/
  5251. , cols
  5252. /*: Breakpoints*/
  5253. )
  5254. /*: number*/
  5255. {
  5256. if (!cols[breakpoint]) {
  5257. throw new Error("ResponsiveGridLayout: `cols` entry for breakpoint " + breakpoint + " is missing!");
  5258. }
  5259. return cols[breakpoint];
  5260. }
  5261. /**
  5262. * Given existing layouts and a new breakpoint, find or generate a new layout.
  5263. *
  5264. * This finds the layout above the new one and generates from it, if it exists.
  5265. *
  5266. * @param {Array} orgLayout Original layout.
  5267. * @param {Object} layouts Existing layouts.
  5268. * @param {Array} breakpoints All breakpoints.
  5269. * @param {String} breakpoint New breakpoint.
  5270. * @param {String} breakpoint Last breakpoint (for fallback).
  5271. * @param {Number} cols Column count at new breakpoint.
  5272. * @param {Boolean} verticalCompact Whether or not to compact the layout
  5273. * vertically.
  5274. * @return {Array} New layout.
  5275. */
  5276. function findOrGenerateResponsiveLayout(orgLayout
  5277. /*: Layout*/
  5278. , layouts
  5279. /*: ResponsiveLayout*/
  5280. , breakpoints
  5281. /*: Breakpoints*/
  5282. , breakpoint
  5283. /*: Breakpoint*/
  5284. , lastBreakpoint
  5285. /*: Breakpoint*/
  5286. , cols
  5287. /*: number*/
  5288. , verticalCompact
  5289. /*: boolean*/
  5290. )
  5291. /*: Layout*/
  5292. {
  5293. // If it already exists, just return it.
  5294. if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]); // Find or generate the next layout
  5295. var layout = orgLayout;
  5296. var breakpointsSorted = sortBreakpoints(breakpoints);
  5297. var breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));
  5298. for (var i = 0, len = breakpointsAbove.length; i < len; i++) {
  5299. var b = breakpointsAbove[i];
  5300. if (layouts[b]) {
  5301. layout = layouts[b];
  5302. break;
  5303. }
  5304. }
  5305. layout = cloneLayout(layout || []); // clone layout so we don't modify existing items
  5306. return compact(correctBounds(layout, {
  5307. cols: cols
  5308. }), verticalCompact);
  5309. }
  5310. function generateResponsiveLayout(layout
  5311. /*: Layout*/
  5312. , breakpoints
  5313. /*: Breakpoints*/
  5314. , breakpoint
  5315. /*: Breakpoint*/
  5316. , lastBreakpoint
  5317. /*: Breakpoint*/
  5318. , cols
  5319. /*: number*/
  5320. , verticalCompact
  5321. /*: boolean*/
  5322. )
  5323. /*: Layout*/
  5324. {
  5325. // If it already exists, just return it.
  5326. /*if (layouts[breakpoint]) return cloneLayout(layouts[breakpoint]);
  5327. // Find or generate the next layout
  5328. let layout = layouts[lastBreakpoint];*/
  5329. /*const breakpointsSorted = sortBreakpoints(breakpoints);
  5330. const breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));
  5331. for (let i = 0, len = breakpointsAbove.length; i < len; i++) {
  5332. const b = breakpointsAbove[i];
  5333. if (layouts[b]) {
  5334. layout = layouts[b];
  5335. break;
  5336. }
  5337. }*/
  5338. layout = cloneLayout(layout || []); // clone layout so we don't modify existing items
  5339. return compact(correctBounds(layout, {
  5340. cols: cols
  5341. }), verticalCompact);
  5342. }
  5343. /**
  5344. * Given breakpoints, return an array of breakpoints sorted by width. This is usually
  5345. * e.g. ['xxs', 'xs', 'sm', ...]
  5346. *
  5347. * @param {Object} breakpoints Key/value pair of breakpoint names to widths.
  5348. * @return {Array} Sorted breakpoints.
  5349. */
  5350. function sortBreakpoints(breakpoints
  5351. /*: Breakpoints*/
  5352. )
  5353. /*: Array<Breakpoint>*/
  5354. {
  5355. var keys
  5356. /*: Array<string>*/
  5357. = keys_default()(breakpoints);
  5358. return keys.sort(function (a, b) {
  5359. return breakpoints[a] - breakpoints[b];
  5360. });
  5361. }
  5362. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/GridLayout.vue?vue&type=script&lang=js&
  5363. //
  5364. //
  5365. //
  5366. //
  5367. //
  5368. //
  5369. //
  5370. //
  5371. //
  5372. //
  5373. //
  5374. //
  5375. //
  5376. //
  5377. //
  5378. //
  5379. //
  5380. //
  5381. var elementResizeDetectorMaker = __webpack_require__("eec4");
  5382. //var eventBus = require('./eventBus');
  5383. /* harmony default export */ var GridLayoutvue_type_script_lang_js_ = ({
  5384. name: "GridLayout",
  5385. provide: function provide() {
  5386. return {
  5387. eventBus: null
  5388. };
  5389. },
  5390. components: {
  5391. GridItem: GridItem
  5392. },
  5393. props: {
  5394. // If true, the container height swells and contracts to fit contents
  5395. autoSize: {
  5396. type: Boolean,
  5397. default: true
  5398. },
  5399. colNum: {
  5400. type: Number,
  5401. default: 12
  5402. },
  5403. rowHeight: {
  5404. type: Number,
  5405. default: 150
  5406. },
  5407. maxRows: {
  5408. type: Number,
  5409. default: Infinity
  5410. },
  5411. margin: {
  5412. type: Array,
  5413. default: function _default() {
  5414. return [10, 10];
  5415. }
  5416. },
  5417. isDraggable: {
  5418. type: Boolean,
  5419. default: true
  5420. },
  5421. isResizable: {
  5422. type: Boolean,
  5423. default: true
  5424. },
  5425. isMirrored: {
  5426. type: Boolean,
  5427. default: false
  5428. },
  5429. useCssTransforms: {
  5430. type: Boolean,
  5431. default: true
  5432. },
  5433. verticalCompact: {
  5434. type: Boolean,
  5435. default: true
  5436. },
  5437. layout: {
  5438. type: Array,
  5439. required: true
  5440. },
  5441. responsive: {
  5442. type: Boolean,
  5443. default: false
  5444. },
  5445. breakpoints: {
  5446. type: Object,
  5447. default: function _default() {
  5448. return {
  5449. lg: 1200,
  5450. md: 996,
  5451. sm: 768,
  5452. xs: 480,
  5453. xxs: 0
  5454. };
  5455. }
  5456. },
  5457. cols: {
  5458. type: Object,
  5459. default: function _default() {
  5460. return {
  5461. lg: 12,
  5462. md: 10,
  5463. sm: 6,
  5464. xs: 4,
  5465. xxs: 2
  5466. };
  5467. }
  5468. }
  5469. },
  5470. data: function data() {
  5471. return {
  5472. width: null,
  5473. mergedStyle: {},
  5474. lastLayoutLength: 0,
  5475. isDragging: false,
  5476. placeholder: {
  5477. x: 0,
  5478. y: 0,
  5479. w: 0,
  5480. h: 0,
  5481. i: -1
  5482. },
  5483. layouts: {},
  5484. // array to store all layouts from different breakpoints
  5485. lastBreakpoint: null,
  5486. // store last active breakpoint
  5487. originalLayout: null // store original Layout
  5488. };
  5489. },
  5490. created: function created() {
  5491. var self = this; // Accessible refernces of functions for removing in beforeDestroy
  5492. self.resizeEventHandler = function (eventType, i, x, y, h, w) {
  5493. self.resizeEvent(eventType, i, x, y, h, w);
  5494. };
  5495. self.dragEventHandler = function (eventType, i, x, y, h, w) {
  5496. self.dragEvent(eventType, i, x, y, h, w);
  5497. };
  5498. self._provided.eventBus = new external_commonjs_vue_commonjs2_vue_root_Vue_default.a();
  5499. self.eventBus = self._provided.eventBus;
  5500. self.eventBus.$on('resizeEvent', self.resizeEventHandler);
  5501. self.eventBus.$on('dragEvent', self.dragEventHandler);
  5502. self.$emit('layout-created', self.layout);
  5503. },
  5504. beforeDestroy: function beforeDestroy() {
  5505. //Remove listeners
  5506. this.eventBus.$off('resizeEvent', this.resizeEventHandler);
  5507. this.eventBus.$off('dragEvent', this.dragEventHandler);
  5508. this.eventBus.$destroy();
  5509. removeWindowEventListener("resize", this.onWindowResize);
  5510. this.erd.uninstall(this.$refs.item);
  5511. },
  5512. beforeMount: function beforeMount() {
  5513. this.$emit('layout-before-mount', this.layout);
  5514. },
  5515. mounted: function mounted() {
  5516. this.$emit('layout-mounted', this.layout);
  5517. this.$nextTick(function () {
  5518. validateLayout(this.layout);
  5519. this.originalLayout = this.layout;
  5520. var self = this;
  5521. this.$nextTick(function () {
  5522. if (self.width === null) {
  5523. self.onWindowResize();
  5524. self.initResponsiveFeatures(); //self.width = self.$el.offsetWidth;
  5525. addWindowEventListener('resize', self.onWindowResize);
  5526. }
  5527. compact(self.layout, self.verticalCompact);
  5528. self.updateHeight();
  5529. self.$nextTick(function () {
  5530. this.erd = elementResizeDetectorMaker({
  5531. strategy: "scroll" //<- For ultra performance.
  5532. });
  5533. this.erd.listenTo(self.$refs.item, function () {
  5534. self.onWindowResize();
  5535. });
  5536. });
  5537. self.$emit('layout-ready', self.layout);
  5538. });
  5539. });
  5540. },
  5541. watch: {
  5542. width: function width() {
  5543. this.$nextTick(function () {
  5544. //this.$broadcast("updateWidth", this.width);
  5545. this.eventBus.$emit("updateWidth", this.width);
  5546. this.updateHeight();
  5547. });
  5548. },
  5549. layout: function layout() {
  5550. this.layoutUpdate();
  5551. },
  5552. colNum: function colNum(val) {
  5553. this.eventBus.$emit("setColNum", val);
  5554. },
  5555. rowHeight: function rowHeight() {
  5556. this.eventBus.$emit("setRowHeight", this.rowHeight);
  5557. },
  5558. isDraggable: function isDraggable() {
  5559. this.eventBus.$emit("setDraggable", this.isDraggable);
  5560. },
  5561. isResizable: function isResizable() {
  5562. this.eventBus.$emit("setResizable", this.isResizable);
  5563. },
  5564. responsive: function responsive() {
  5565. if (!this.responsive) {
  5566. this.$emit('update:layout', this.originalLayout);
  5567. this.eventBus.$emit("setColNum", this.colNum);
  5568. }
  5569. this.onWindowResize();
  5570. }
  5571. },
  5572. methods: {
  5573. layoutUpdate: function layoutUpdate() {
  5574. if (this.layout !== undefined && this.originalLayout !== null) {
  5575. if (this.layout.length !== this.originalLayout.length) {
  5576. // console.log("### LAYOUT UPDATE!", this.layout.length, this.originalLayout.length);
  5577. var diff = this.findDifference(this.layout, this.originalLayout);
  5578. if (diff.length > 0) {
  5579. // console.log(diff);
  5580. if (this.layout.length > this.originalLayout.length) {
  5581. this.originalLayout = this.originalLayout.concat(diff);
  5582. } else {
  5583. this.originalLayout = this.originalLayout.filter(function (obj) {
  5584. return !diff.some(function (obj2) {
  5585. return obj.i === obj2.i;
  5586. });
  5587. });
  5588. }
  5589. }
  5590. this.lastLayoutLength = this.layout.length;
  5591. this.initResponsiveFeatures();
  5592. }
  5593. compact(this.layout, this.verticalCompact);
  5594. this.eventBus.$emit("updateWidth", this.width);
  5595. this.updateHeight();
  5596. }
  5597. },
  5598. updateHeight: function updateHeight() {
  5599. this.mergedStyle = {
  5600. height: this.containerHeight()
  5601. };
  5602. },
  5603. onWindowResize: function onWindowResize() {
  5604. if (this.$refs !== null && this.$refs.item !== null && this.$refs.item !== undefined) {
  5605. this.width = this.$refs.item.offsetWidth;
  5606. }
  5607. this.eventBus.$emit("resizeEvent");
  5608. },
  5609. containerHeight: function containerHeight() {
  5610. if (!this.autoSize) return;
  5611. return bottom(this.layout) * (this.rowHeight + this.margin[1]) + this.margin[1] + 'px';
  5612. },
  5613. dragEvent: function dragEvent(eventName, id, x, y, h, w) {
  5614. //console.log(eventName + " id=" + id + ", x=" + x + ", y=" + y);
  5615. var l = getLayoutItem(this.layout, id); //GetLayoutItem sometimes returns null object
  5616. if (l === undefined || l === null) {
  5617. l = {
  5618. x: 0,
  5619. y: 0
  5620. };
  5621. }
  5622. if (eventName === "dragmove" || eventName === "dragstart") {
  5623. this.placeholder.i = id;
  5624. this.placeholder.x = l.x;
  5625. this.placeholder.y = l.y;
  5626. this.placeholder.w = w;
  5627. this.placeholder.h = h;
  5628. this.$nextTick(function () {
  5629. this.isDragging = true;
  5630. }); //this.$broadcast("updateWidth", this.width);
  5631. this.eventBus.$emit("updateWidth", this.width);
  5632. } else {
  5633. this.$nextTick(function () {
  5634. this.isDragging = false;
  5635. });
  5636. } // set layout element coordinates to dragged position
  5637. l.x = x;
  5638. l.y = y; // Move the element to the dragged location.
  5639. this.layout = moveElement(this.layout, l, x, y, true);
  5640. compact(this.layout, this.verticalCompact); // needed because vue can't detect changes on array element properties
  5641. this.eventBus.$emit("compact");
  5642. this.updateHeight();
  5643. if (eventName === 'dragend') this.$emit('layout-updated', this.layout);
  5644. },
  5645. resizeEvent: function resizeEvent(eventName, id, x, y, h, w) {
  5646. if (eventName === "resizestart" || eventName === "resizemove") {
  5647. this.placeholder.i = id;
  5648. this.placeholder.x = x;
  5649. this.placeholder.y = y;
  5650. this.placeholder.w = w;
  5651. this.placeholder.h = h;
  5652. this.$nextTick(function () {
  5653. this.isDragging = true;
  5654. }); //this.$broadcast("updateWidth", this.width);
  5655. this.eventBus.$emit("updateWidth", this.width);
  5656. } else {
  5657. this.$nextTick(function () {
  5658. this.isDragging = false;
  5659. });
  5660. }
  5661. var l = getLayoutItem(this.layout, id); //GetLayoutItem sometimes return null object
  5662. if (l === undefined || l === null) {
  5663. l = {
  5664. h: 0,
  5665. w: 0
  5666. };
  5667. }
  5668. l.h = h;
  5669. l.w = w;
  5670. if (this.responsive) this.responsiveGridLayout();
  5671. compact(this.layout, this.verticalCompact);
  5672. this.eventBus.$emit("compact");
  5673. this.updateHeight();
  5674. if (eventName === 'resizeend') this.$emit('layout-updated', this.layout);
  5675. },
  5676. // finds or generates new layouts for set breakpoints
  5677. responsiveGridLayout: function responsiveGridLayout() {
  5678. var newBreakpoint = getBreakpointFromWidth(this.breakpoints, this.width);
  5679. var newCols = getColsFromBreakpoint(newBreakpoint, this.cols); // save actual layout in layouts
  5680. if (this.lastBreakpoint != null && !this.layouts[this.lastBreakpoint]) this.layouts[this.lastBreakpoint] = cloneLayout(this.layout); // Find or generate a new layout.
  5681. var layout = findOrGenerateResponsiveLayout(this.originalLayout, this.layouts, this.breakpoints, newBreakpoint, this.lastBreakpoint, newCols, this.verticalCompact); // Store the new layout.
  5682. this.layouts[newBreakpoint] = layout; // new prop sync
  5683. this.$emit('update:layout', layout);
  5684. this.lastBreakpoint = newBreakpoint;
  5685. this.eventBus.$emit("setColNum", getColsFromBreakpoint(newBreakpoint, this.cols));
  5686. },
  5687. // clear all responsive layouts
  5688. initResponsiveFeatures: function initResponsiveFeatures() {
  5689. // clear layouts
  5690. this.layouts = {};
  5691. },
  5692. // find difference in layouts
  5693. findDifference: function findDifference(layout, originalLayout) {
  5694. //Find values that are in result1 but not in result2
  5695. var uniqueResultOne = layout.filter(function (obj) {
  5696. return !originalLayout.some(function (obj2) {
  5697. return obj.i === obj2.i;
  5698. });
  5699. }); //Find values that are in result2 but not in result1
  5700. var uniqueResultTwo = originalLayout.filter(function (obj) {
  5701. return !layout.some(function (obj2) {
  5702. return obj.i === obj2.i;
  5703. });
  5704. }); //Combine the two arrays of unique entries#
  5705. return uniqueResultOne.concat(uniqueResultTwo);
  5706. }
  5707. }
  5708. });
  5709. // CONCATENATED MODULE: ./src/components/GridLayout.vue?vue&type=script&lang=js&
  5710. /* harmony default export */ var components_GridLayoutvue_type_script_lang_js_ = (GridLayoutvue_type_script_lang_js_);
  5711. // EXTERNAL MODULE: ./src/components/GridLayout.vue?vue&type=style&index=0&lang=css&
  5712. var GridLayoutvue_type_style_index_0_lang_css_ = __webpack_require__("e279");
  5713. // CONCATENATED MODULE: ./src/components/GridLayout.vue
  5714. /* normalize component */
  5715. var GridLayout_component = normalizeComponent(
  5716. components_GridLayoutvue_type_script_lang_js_,
  5717. GridLayoutvue_type_template_id_16f9e7c6_render,
  5718. GridLayoutvue_type_template_id_16f9e7c6_staticRenderFns,
  5719. false,
  5720. null,
  5721. null,
  5722. null
  5723. )
  5724. /* harmony default export */ var GridLayout = (GridLayout_component.exports);
  5725. // CONCATENATED MODULE: ./src/components/index.js
  5726. // import ResponsiveGridLayout from './ResponsiveGridLayout.vue';
  5727. var VueGridLayout = {
  5728. // ResponsiveGridLayout,
  5729. GridLayout: GridLayout,
  5730. GridItem: GridItem // module.exports = VueGridLayout;
  5731. };
  5732. keys_default()(VueGridLayout).forEach(function (name) {
  5733. external_commonjs_vue_commonjs2_vue_root_Vue_default.a.component(name, VueGridLayout[name]);
  5734. });
  5735. /* harmony default export */ var components = (VueGridLayout);
  5736. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  5737. /* concated harmony reexport GridLayout */__webpack_require__.d(__webpack_exports__, "GridLayout", function() { return GridLayout; });
  5738. /* concated harmony reexport GridItem */__webpack_require__.d(__webpack_exports__, "GridItem", function() { return GridItem; });
  5739. /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components);
  5740. /***/ }),
  5741. /***/ "fb3a":
  5742. /***/ (function(module, exports, __webpack_require__) {
  5743. var require;var require;/**
  5744. * interact.js v1.3.4
  5745. *
  5746. * Copyright (c) 2012-2018 Taye Adeyemi <dev@taye.me>
  5747. * Released under the MIT License.
  5748. * https://raw.github.com/taye/interact.js/master/LICENSE
  5749. */
  5750. (function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  5751. 'use strict';
  5752. /*
  5753. * In a (windowless) server environment this file exports a factory function
  5754. * that takes the window to use.
  5755. *
  5756. * var interact = require('interact.js')(windowObject);
  5757. *
  5758. * See https://github.com/taye/interact.js/issues/187
  5759. */
  5760. if (typeof window === 'undefined') {
  5761. module.exports = function (window) {
  5762. require('./src/utils/window').init(window);
  5763. return require('./src/index');
  5764. };
  5765. } else {
  5766. module.exports = require('./src/index');
  5767. }
  5768. },{"./src/index":19,"./src/utils/window":52}],2:[function(require,module,exports){
  5769. 'use strict';
  5770. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5771. var extend = require('./utils/extend.js');
  5772. function fireUntilImmediateStopped(event, listeners) {
  5773. for (var _i = 0; _i < listeners.length; _i++) {
  5774. var _ref;
  5775. _ref = listeners[_i];
  5776. var listener = _ref;
  5777. if (event.immediatePropagationStopped) {
  5778. break;
  5779. }
  5780. listener(event);
  5781. }
  5782. }
  5783. var Eventable = function () {
  5784. function Eventable(options) {
  5785. _classCallCheck(this, Eventable);
  5786. this.options = extend({}, options || {});
  5787. }
  5788. Eventable.prototype.fire = function fire(event) {
  5789. var listeners = void 0;
  5790. var onEvent = 'on' + event.type;
  5791. var global = this.global;
  5792. // Interactable#on() listeners
  5793. if (listeners = this[event.type]) {
  5794. fireUntilImmediateStopped(event, listeners);
  5795. }
  5796. // interactable.onevent listener
  5797. if (this[onEvent]) {
  5798. this[onEvent](event);
  5799. }
  5800. // interact.on() listeners
  5801. if (!event.propagationStopped && global && (listeners = global[event.type])) {
  5802. fireUntilImmediateStopped(event, listeners);
  5803. }
  5804. };
  5805. Eventable.prototype.on = function on(eventType, listener) {
  5806. // if this type of event was never bound
  5807. if (this[eventType]) {
  5808. this[eventType].push(listener);
  5809. } else {
  5810. this[eventType] = [listener];
  5811. }
  5812. };
  5813. Eventable.prototype.off = function off(eventType, listener) {
  5814. // if it is an action event type
  5815. var eventList = this[eventType];
  5816. var index = eventList ? eventList.indexOf(listener) : -1;
  5817. if (index !== -1) {
  5818. eventList.splice(index, 1);
  5819. }
  5820. if (eventList && eventList.length === 0 || !listener) {
  5821. this[eventType] = undefined;
  5822. }
  5823. };
  5824. return Eventable;
  5825. }();
  5826. module.exports = Eventable;
  5827. },{"./utils/extend.js":41}],3:[function(require,module,exports){
  5828. 'use strict';
  5829. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5830. var extend = require('./utils/extend');
  5831. var getOriginXY = require('./utils/getOriginXY');
  5832. var defaults = require('./defaultOptions');
  5833. var signals = require('./utils/Signals').new();
  5834. var InteractEvent = function () {
  5835. /** */
  5836. function InteractEvent(interaction, event, action, phase, element, related) {
  5837. var preEnd = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  5838. _classCallCheck(this, InteractEvent);
  5839. var target = interaction.target;
  5840. var deltaSource = (target && target.options || defaults).deltaSource;
  5841. var origin = getOriginXY(target, element, action);
  5842. var starting = phase === 'start';
  5843. var ending = phase === 'end';
  5844. var coords = starting ? interaction.startCoords : interaction.curCoords;
  5845. var prevEvent = interaction.prevEvent;
  5846. element = element || interaction.element;
  5847. var page = extend({}, coords.page);
  5848. var client = extend({}, coords.client);
  5849. page.x -= origin.x;
  5850. page.y -= origin.y;
  5851. client.x -= origin.x;
  5852. client.y -= origin.y;
  5853. this.ctrlKey = event.ctrlKey;
  5854. this.altKey = event.altKey;
  5855. this.shiftKey = event.shiftKey;
  5856. this.metaKey = event.metaKey;
  5857. this.button = event.button;
  5858. this.buttons = event.buttons;
  5859. this.target = element;
  5860. this.currentTarget = element;
  5861. this.relatedTarget = related || null;
  5862. this.preEnd = preEnd;
  5863. this.type = action + (phase || '');
  5864. this.interaction = interaction;
  5865. this.interactable = target;
  5866. this.t0 = starting ? interaction.downTimes[interaction.downTimes.length - 1] : prevEvent.t0;
  5867. var signalArg = {
  5868. interaction: interaction,
  5869. event: event,
  5870. action: action,
  5871. phase: phase,
  5872. element: element,
  5873. related: related,
  5874. page: page,
  5875. client: client,
  5876. coords: coords,
  5877. starting: starting,
  5878. ending: ending,
  5879. deltaSource: deltaSource,
  5880. iEvent: this
  5881. };
  5882. signals.fire('set-xy', signalArg);
  5883. if (ending) {
  5884. // use previous coords when ending
  5885. this.pageX = prevEvent.pageX;
  5886. this.pageY = prevEvent.pageY;
  5887. this.clientX = prevEvent.clientX;
  5888. this.clientY = prevEvent.clientY;
  5889. } else {
  5890. this.pageX = page.x;
  5891. this.pageY = page.y;
  5892. this.clientX = client.x;
  5893. this.clientY = client.y;
  5894. }
  5895. this.x0 = interaction.startCoords.page.x - origin.x;
  5896. this.y0 = interaction.startCoords.page.y - origin.y;
  5897. this.clientX0 = interaction.startCoords.client.x - origin.x;
  5898. this.clientY0 = interaction.startCoords.client.y - origin.y;
  5899. signals.fire('set-delta', signalArg);
  5900. this.timeStamp = coords.timeStamp;
  5901. this.dt = interaction.pointerDelta.timeStamp;
  5902. this.duration = this.timeStamp - this.t0;
  5903. // speed and velocity in pixels per second
  5904. this.speed = interaction.pointerDelta[deltaSource].speed;
  5905. this.velocityX = interaction.pointerDelta[deltaSource].vx;
  5906. this.velocityY = interaction.pointerDelta[deltaSource].vy;
  5907. this.swipe = ending || phase === 'inertiastart' ? this.getSwipe() : null;
  5908. signals.fire('new', signalArg);
  5909. }
  5910. InteractEvent.prototype.getSwipe = function getSwipe() {
  5911. var interaction = this.interaction;
  5912. if (interaction.prevEvent.speed < 600 || this.timeStamp - interaction.prevEvent.timeStamp > 150) {
  5913. return null;
  5914. }
  5915. var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI;
  5916. var overlap = 22.5;
  5917. if (angle < 0) {
  5918. angle += 360;
  5919. }
  5920. var left = 135 - overlap <= angle && angle < 225 + overlap;
  5921. var up = 225 - overlap <= angle && angle < 315 + overlap;
  5922. var right = !left && (315 - overlap <= angle || angle < 45 + overlap);
  5923. var down = !up && 45 - overlap <= angle && angle < 135 + overlap;
  5924. return {
  5925. up: up,
  5926. down: down,
  5927. left: left,
  5928. right: right,
  5929. angle: angle,
  5930. speed: interaction.prevEvent.speed,
  5931. velocity: {
  5932. x: interaction.prevEvent.velocityX,
  5933. y: interaction.prevEvent.velocityY
  5934. }
  5935. };
  5936. };
  5937. InteractEvent.prototype.preventDefault = function preventDefault() {};
  5938. /** */
  5939. InteractEvent.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
  5940. this.immediatePropagationStopped = this.propagationStopped = true;
  5941. };
  5942. /** */
  5943. InteractEvent.prototype.stopPropagation = function stopPropagation() {
  5944. this.propagationStopped = true;
  5945. };
  5946. return InteractEvent;
  5947. }();
  5948. signals.on('set-delta', function (_ref) {
  5949. var iEvent = _ref.iEvent,
  5950. interaction = _ref.interaction,
  5951. starting = _ref.starting,
  5952. deltaSource = _ref.deltaSource;
  5953. var prevEvent = starting ? iEvent : interaction.prevEvent;
  5954. if (deltaSource === 'client') {
  5955. iEvent.dx = iEvent.clientX - prevEvent.clientX;
  5956. iEvent.dy = iEvent.clientY - prevEvent.clientY;
  5957. } else {
  5958. iEvent.dx = iEvent.pageX - prevEvent.pageX;
  5959. iEvent.dy = iEvent.pageY - prevEvent.pageY;
  5960. }
  5961. });
  5962. InteractEvent.signals = signals;
  5963. module.exports = InteractEvent;
  5964. },{"./defaultOptions":18,"./utils/Signals":34,"./utils/extend":41,"./utils/getOriginXY":42}],4:[function(require,module,exports){
  5965. 'use strict';
  5966. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5967. var clone = require('./utils/clone');
  5968. var is = require('./utils/is');
  5969. var events = require('./utils/events');
  5970. var extend = require('./utils/extend');
  5971. var actions = require('./actions/base');
  5972. var scope = require('./scope');
  5973. var Eventable = require('./Eventable');
  5974. var defaults = require('./defaultOptions');
  5975. var signals = require('./utils/Signals').new();
  5976. var _require = require('./utils/domUtils'),
  5977. getElementRect = _require.getElementRect,
  5978. nodeContains = _require.nodeContains,
  5979. trySelector = _require.trySelector,
  5980. matchesSelector = _require.matchesSelector;
  5981. var _require2 = require('./utils/window'),
  5982. getWindow = _require2.getWindow;
  5983. var _require3 = require('./utils/arr'),
  5984. contains = _require3.contains;
  5985. var _require4 = require('./utils/browser'),
  5986. wheelEvent = _require4.wheelEvent;
  5987. // all set interactables
  5988. scope.interactables = [];
  5989. var Interactable = function () {
  5990. /** */
  5991. function Interactable(target, options) {
  5992. _classCallCheck(this, Interactable);
  5993. options = options || {};
  5994. this.target = target;
  5995. this.events = new Eventable();
  5996. this._context = options.context || scope.document;
  5997. this._win = getWindow(trySelector(target) ? this._context : target);
  5998. this._doc = this._win.document;
  5999. signals.fire('new', {
  6000. target: target,
  6001. options: options,
  6002. interactable: this,
  6003. win: this._win
  6004. });
  6005. scope.addDocument(this._doc, this._win);
  6006. scope.interactables.push(this);
  6007. this.set(options);
  6008. }
  6009. Interactable.prototype.setOnEvents = function setOnEvents(action, phases) {
  6010. var onAction = 'on' + action;
  6011. if (is.function(phases.onstart)) {
  6012. this.events[onAction + 'start'] = phases.onstart;
  6013. }
  6014. if (is.function(phases.onmove)) {
  6015. this.events[onAction + 'move'] = phases.onmove;
  6016. }
  6017. if (is.function(phases.onend)) {
  6018. this.events[onAction + 'end'] = phases.onend;
  6019. }
  6020. if (is.function(phases.oninertiastart)) {
  6021. this.events[onAction + 'inertiastart'] = phases.oninertiastart;
  6022. }
  6023. return this;
  6024. };
  6025. Interactable.prototype.setPerAction = function setPerAction(action, options) {
  6026. // for all the default per-action options
  6027. for (var option in options) {
  6028. // if this option exists for this action
  6029. if (option in defaults[action]) {
  6030. // if the option in the options arg is an object value
  6031. if (is.object(options[option])) {
  6032. // duplicate the object and merge
  6033. this.options[action][option] = clone(this.options[action][option] || {});
  6034. extend(this.options[action][option], options[option]);
  6035. if (is.object(defaults.perAction[option]) && 'enabled' in defaults.perAction[option]) {
  6036. this.options[action][option].enabled = options[option].enabled === false ? false : true;
  6037. }
  6038. } else if (is.bool(options[option]) && is.object(defaults.perAction[option])) {
  6039. this.options[action][option].enabled = options[option];
  6040. } else if (options[option] !== undefined) {
  6041. // or if it's not undefined, do a plain assignment
  6042. this.options[action][option] = options[option];
  6043. }
  6044. }
  6045. }
  6046. };
  6047. /**
  6048. * The default function to get an Interactables bounding rect. Can be
  6049. * overridden using {@link Interactable.rectChecker}.
  6050. *
  6051. * @param {Element} [element] The element to measure.
  6052. * @return {object} The object's bounding rectangle.
  6053. */
  6054. Interactable.prototype.getRect = function getRect(element) {
  6055. element = element || this.target;
  6056. if (is.string(this.target) && !is.element(element)) {
  6057. element = this._context.querySelector(this.target);
  6058. }
  6059. return getElementRect(element);
  6060. };
  6061. /**
  6062. * Returns or sets the function used to calculate the interactable's
  6063. * element's rectangle
  6064. *
  6065. * @param {function} [checker] A function which returns this Interactable's
  6066. * bounding rectangle. See {@link Interactable.getRect}
  6067. * @return {function | object} The checker function or this Interactable
  6068. */
  6069. Interactable.prototype.rectChecker = function rectChecker(checker) {
  6070. if (is.function(checker)) {
  6071. this.getRect = checker;
  6072. return this;
  6073. }
  6074. if (checker === null) {
  6075. delete this.options.getRect;
  6076. return this;
  6077. }
  6078. return this.getRect;
  6079. };
  6080. Interactable.prototype._backCompatOption = function _backCompatOption(optionName, newValue) {
  6081. if (trySelector(newValue) || is.object(newValue)) {
  6082. this.options[optionName] = newValue;
  6083. for (var _i = 0; _i < actions.names.length; _i++) {
  6084. var _ref;
  6085. _ref = actions.names[_i];
  6086. var action = _ref;
  6087. this.options[action][optionName] = newValue;
  6088. }
  6089. return this;
  6090. }
  6091. return this.options[optionName];
  6092. };
  6093. /**
  6094. * Gets or sets the origin of the Interactable's element. The x and y
  6095. * of the origin will be subtracted from action event coordinates.
  6096. *
  6097. * @param {Element | object | string} [origin] An HTML or SVG Element whose
  6098. * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'
  6099. * or any CSS selector
  6100. *
  6101. * @return {object} The current origin or this Interactable
  6102. */
  6103. Interactable.prototype.origin = function origin(newValue) {
  6104. return this._backCompatOption('origin', newValue);
  6105. };
  6106. /**
  6107. * Returns or sets the mouse coordinate types used to calculate the
  6108. * movement of the pointer.
  6109. *
  6110. * @param {string} [newValue] Use 'client' if you will be scrolling while
  6111. * interacting; Use 'page' if you want autoScroll to work
  6112. * @return {string | object} The current deltaSource or this Interactable
  6113. */
  6114. Interactable.prototype.deltaSource = function deltaSource(newValue) {
  6115. if (newValue === 'page' || newValue === 'client') {
  6116. this.options.deltaSource = newValue;
  6117. return this;
  6118. }
  6119. return this.options.deltaSource;
  6120. };
  6121. /**
  6122. * Gets the selector context Node of the Interactable. The default is
  6123. * `window.document`.
  6124. *
  6125. * @return {Node} The context Node of this Interactable
  6126. */
  6127. Interactable.prototype.context = function context() {
  6128. return this._context;
  6129. };
  6130. Interactable.prototype.inContext = function inContext(element) {
  6131. return this._context === element.ownerDocument || nodeContains(this._context, element);
  6132. };
  6133. /**
  6134. * Calls listeners for the given InteractEvent type bound globally
  6135. * and directly to this Interactable
  6136. *
  6137. * @param {InteractEvent} iEvent The InteractEvent object to be fired on this
  6138. * Interactable
  6139. * @return {Interactable} this Interactable
  6140. */
  6141. Interactable.prototype.fire = function fire(iEvent) {
  6142. this.events.fire(iEvent);
  6143. return this;
  6144. };
  6145. Interactable.prototype._onOffMultiple = function _onOffMultiple(method, eventType, listener, options) {
  6146. if (is.string(eventType) && eventType.search(' ') !== -1) {
  6147. eventType = eventType.trim().split(/ +/);
  6148. }
  6149. if (is.array(eventType)) {
  6150. for (var _i2 = 0; _i2 < eventType.length; _i2++) {
  6151. var _ref2;
  6152. _ref2 = eventType[_i2];
  6153. var type = _ref2;
  6154. this[method](type, listener, options);
  6155. }
  6156. return true;
  6157. }
  6158. if (is.object(eventType)) {
  6159. for (var prop in eventType) {
  6160. this[method](prop, eventType[prop], listener);
  6161. }
  6162. return true;
  6163. }
  6164. };
  6165. /**
  6166. * Binds a listener for an InteractEvent, pointerEvent or DOM event.
  6167. *
  6168. * @param {string | array | object} eventType The types of events to listen
  6169. * for
  6170. * @param {function} listener The function event (s)
  6171. * @param {object | boolean} [options] options object or useCapture flag
  6172. * for addEventListener
  6173. * @return {object} This Interactable
  6174. */
  6175. Interactable.prototype.on = function on(eventType, listener, options) {
  6176. if (this._onOffMultiple('on', eventType, listener, options)) {
  6177. return this;
  6178. }
  6179. if (eventType === 'wheel') {
  6180. eventType = wheelEvent;
  6181. }
  6182. if (contains(Interactable.eventTypes, eventType)) {
  6183. this.events.on(eventType, listener);
  6184. }
  6185. // delegated event for selector
  6186. else if (is.string(this.target)) {
  6187. events.addDelegate(this.target, this._context, eventType, listener, options);
  6188. } else {
  6189. events.add(this.target, eventType, listener, options);
  6190. }
  6191. return this;
  6192. };
  6193. /**
  6194. * Removes an InteractEvent, pointerEvent or DOM event listener
  6195. *
  6196. * @param {string | array | object} eventType The types of events that were
  6197. * listened for
  6198. * @param {function} listener The listener function to be removed
  6199. * @param {object | boolean} [options] options object or useCapture flag for
  6200. * removeEventListener
  6201. * @return {object} This Interactable
  6202. */
  6203. Interactable.prototype.off = function off(eventType, listener, options) {
  6204. if (this._onOffMultiple('off', eventType, listener, options)) {
  6205. return this;
  6206. }
  6207. if (eventType === 'wheel') {
  6208. eventType = wheelEvent;
  6209. }
  6210. // if it is an action event type
  6211. if (contains(Interactable.eventTypes, eventType)) {
  6212. this.events.off(eventType, listener);
  6213. }
  6214. // delegated event
  6215. else if (is.string(this.target)) {
  6216. events.removeDelegate(this.target, this._context, eventType, listener, options);
  6217. }
  6218. // remove listener from this Interatable's element
  6219. else {
  6220. events.remove(this.target, eventType, listener, options);
  6221. }
  6222. return this;
  6223. };
  6224. /**
  6225. * Reset the options of this Interactable
  6226. *
  6227. * @param {object} options The new settings to apply
  6228. * @return {object} This Interactable
  6229. */
  6230. Interactable.prototype.set = function set(options) {
  6231. if (!is.object(options)) {
  6232. options = {};
  6233. }
  6234. this.options = clone(defaults.base);
  6235. var perActions = clone(defaults.perAction);
  6236. for (var actionName in actions.methodDict) {
  6237. var methodName = actions.methodDict[actionName];
  6238. this.options[actionName] = clone(defaults[actionName]);
  6239. this.setPerAction(actionName, perActions);
  6240. this[methodName](options[actionName]);
  6241. }
  6242. for (var _i3 = 0; _i3 < Interactable.settingsMethods.length; _i3++) {
  6243. var _ref3;
  6244. _ref3 = Interactable.settingsMethods[_i3];
  6245. var setting = _ref3;
  6246. this.options[setting] = defaults.base[setting];
  6247. if (setting in options) {
  6248. this[setting](options[setting]);
  6249. }
  6250. }
  6251. signals.fire('set', {
  6252. options: options,
  6253. interactable: this
  6254. });
  6255. return this;
  6256. };
  6257. /**
  6258. * Remove this interactable from the list of interactables and remove it's
  6259. * action capabilities and event listeners
  6260. *
  6261. * @return {interact}
  6262. */
  6263. Interactable.prototype.unset = function unset() {
  6264. events.remove(this.target, 'all');
  6265. if (is.string(this.target)) {
  6266. // remove delegated events
  6267. for (var type in events.delegatedEvents) {
  6268. var delegated = events.delegatedEvents[type];
  6269. if (delegated.selectors[0] === this.target && delegated.contexts[0] === this._context) {
  6270. delegated.selectors.splice(0, 1);
  6271. delegated.contexts.splice(0, 1);
  6272. delegated.listeners.splice(0, 1);
  6273. // remove the arrays if they are empty
  6274. if (!delegated.selectors.length) {
  6275. delegated[type] = null;
  6276. }
  6277. }
  6278. events.remove(this._context, type, events.delegateListener);
  6279. events.remove(this._context, type, events.delegateUseCapture, true);
  6280. }
  6281. } else {
  6282. events.remove(this, 'all');
  6283. }
  6284. signals.fire('unset', { interactable: this });
  6285. scope.interactables.splice(scope.interactables.indexOf(this), 1);
  6286. // Stop related interactions when an Interactable is unset
  6287. for (var _i4 = 0; _i4 < (scope.interactions || []).length; _i4++) {
  6288. var _ref4;
  6289. _ref4 = (scope.interactions || [])[_i4];
  6290. var interaction = _ref4;
  6291. if (interaction.target === this && interaction.interacting() && !interaction._ending) {
  6292. interaction.stop();
  6293. }
  6294. }
  6295. return scope.interact;
  6296. };
  6297. return Interactable;
  6298. }();
  6299. scope.interactables.indexOfElement = function indexOfElement(target, context) {
  6300. context = context || scope.document;
  6301. for (var i = 0; i < this.length; i++) {
  6302. var interactable = this[i];
  6303. if (interactable.target === target && interactable._context === context) {
  6304. return i;
  6305. }
  6306. }
  6307. return -1;
  6308. };
  6309. scope.interactables.get = function interactableGet(element, options, dontCheckInContext) {
  6310. var ret = this[this.indexOfElement(element, options && options.context)];
  6311. return ret && (is.string(element) || dontCheckInContext || ret.inContext(element)) ? ret : null;
  6312. };
  6313. scope.interactables.forEachMatch = function (element, callback) {
  6314. for (var _i5 = 0; _i5 < this.length; _i5++) {
  6315. var _ref5;
  6316. _ref5 = this[_i5];
  6317. var interactable = _ref5;
  6318. var ret = void 0;
  6319. if ((is.string(interactable.target)
  6320. // target is a selector and the element matches
  6321. ? is.element(element) && matchesSelector(element, interactable.target) :
  6322. // target is the element
  6323. element === interactable.target) &&
  6324. // the element is in context
  6325. interactable.inContext(element)) {
  6326. ret = callback(interactable);
  6327. }
  6328. if (ret !== undefined) {
  6329. return ret;
  6330. }
  6331. }
  6332. };
  6333. // all interact.js eventTypes
  6334. Interactable.eventTypes = scope.eventTypes = [];
  6335. Interactable.signals = signals;
  6336. Interactable.settingsMethods = ['deltaSource', 'origin', 'preventDefault', 'rectChecker'];
  6337. module.exports = Interactable;
  6338. },{"./Eventable":2,"./actions/base":6,"./defaultOptions":18,"./scope":33,"./utils/Signals":34,"./utils/arr":35,"./utils/browser":36,"./utils/clone":37,"./utils/domUtils":39,"./utils/events":40,"./utils/extend":41,"./utils/is":46,"./utils/window":52}],5:[function(require,module,exports){
  6339. 'use strict';
  6340. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6341. var scope = require('./scope');
  6342. var utils = require('./utils');
  6343. var events = require('./utils/events');
  6344. var browser = require('./utils/browser');
  6345. var domObjects = require('./utils/domObjects');
  6346. var finder = require('./utils/interactionFinder');
  6347. var signals = require('./utils/Signals').new();
  6348. var listeners = {};
  6349. var methodNames = ['pointerDown', 'pointerMove', 'pointerUp', 'updatePointer', 'removePointer'];
  6350. // for ignoring browser's simulated mouse events
  6351. var prevTouchTime = 0;
  6352. // all active and idle interactions
  6353. scope.interactions = [];
  6354. var Interaction = function () {
  6355. /** */
  6356. function Interaction(_ref) {
  6357. var pointerType = _ref.pointerType;
  6358. _classCallCheck(this, Interaction);
  6359. this.target = null; // current interactable being interacted with
  6360. this.element = null; // the target element of the interactable
  6361. this.prepared = { // action that's ready to be fired on next move event
  6362. name: null,
  6363. axis: null,
  6364. edges: null
  6365. };
  6366. // keep track of added pointers
  6367. this.pointers = [];
  6368. this.pointerIds = [];
  6369. this.downTargets = [];
  6370. this.downTimes = [];
  6371. // Previous native pointer move event coordinates
  6372. this.prevCoords = {
  6373. page: { x: 0, y: 0 },
  6374. client: { x: 0, y: 0 },
  6375. timeStamp: 0
  6376. };
  6377. // current native pointer move event coordinates
  6378. this.curCoords = {
  6379. page: { x: 0, y: 0 },
  6380. client: { x: 0, y: 0 },
  6381. timeStamp: 0
  6382. };
  6383. // Starting InteractEvent pointer coordinates
  6384. this.startCoords = {
  6385. page: { x: 0, y: 0 },
  6386. client: { x: 0, y: 0 },
  6387. timeStamp: 0
  6388. };
  6389. // Change in coordinates and time of the pointer
  6390. this.pointerDelta = {
  6391. page: { x: 0, y: 0, vx: 0, vy: 0, speed: 0 },
  6392. client: { x: 0, y: 0, vx: 0, vy: 0, speed: 0 },
  6393. timeStamp: 0
  6394. };
  6395. this.downEvent = null; // pointerdown/mousedown/touchstart event
  6396. this.downPointer = {};
  6397. this._eventTarget = null;
  6398. this._curEventTarget = null;
  6399. this.prevEvent = null; // previous action event
  6400. this.pointerIsDown = false;
  6401. this.pointerWasMoved = false;
  6402. this._interacting = false;
  6403. this._ending = false;
  6404. this.pointerType = pointerType;
  6405. signals.fire('new', this);
  6406. scope.interactions.push(this);
  6407. }
  6408. Interaction.prototype.pointerDown = function pointerDown(pointer, event, eventTarget) {
  6409. var pointerIndex = this.updatePointer(pointer, event, true);
  6410. signals.fire('down', {
  6411. pointer: pointer,
  6412. event: event,
  6413. eventTarget: eventTarget,
  6414. pointerIndex: pointerIndex,
  6415. interaction: this
  6416. });
  6417. };
  6418. /**
  6419. * ```js
  6420. * interact(target)
  6421. * .draggable({
  6422. * // disable the default drag start by down->move
  6423. * manualStart: true
  6424. * })
  6425. * // start dragging after the user holds the pointer down
  6426. * .on('hold', function (event) {
  6427. * var interaction = event.interaction;
  6428. *
  6429. * if (!interaction.interacting()) {
  6430. * interaction.start({ name: 'drag' },
  6431. * event.interactable,
  6432. * event.currentTarget);
  6433. * }
  6434. * });
  6435. * ```
  6436. *
  6437. * Start an action with the given Interactable and Element as tartgets. The
  6438. * action must be enabled for the target Interactable and an appropriate
  6439. * number of pointers must be held down - 1 for drag/resize, 2 for gesture.
  6440. *
  6441. * Use it with `interactable.<action>able({ manualStart: false })` to always
  6442. * [start actions manually](https://github.com/taye/interact.js/issues/114)
  6443. *
  6444. * @param {object} action The action to be performed - drag, resize, etc.
  6445. * @param {Interactable} target The Interactable to target
  6446. * @param {Element} element The DOM Element to target
  6447. * @return {object} interact
  6448. */
  6449. Interaction.prototype.start = function start(action, target, element) {
  6450. if (this.interacting() || !this.pointerIsDown || this.pointerIds.length < (action.name === 'gesture' ? 2 : 1)) {
  6451. return;
  6452. }
  6453. // if this interaction had been removed after stopping
  6454. // add it back
  6455. if (scope.interactions.indexOf(this) === -1) {
  6456. scope.interactions.push(this);
  6457. }
  6458. utils.copyAction(this.prepared, action);
  6459. this.target = target;
  6460. this.element = element;
  6461. signals.fire('action-start', {
  6462. interaction: this,
  6463. event: this.downEvent
  6464. });
  6465. };
  6466. Interaction.prototype.pointerMove = function pointerMove(pointer, event, eventTarget) {
  6467. if (!this.simulation) {
  6468. this.updatePointer(pointer);
  6469. utils.setCoords(this.curCoords, this.pointers);
  6470. }
  6471. var duplicateMove = this.curCoords.page.x === this.prevCoords.page.x && this.curCoords.page.y === this.prevCoords.page.y && this.curCoords.client.x === this.prevCoords.client.x && this.curCoords.client.y === this.prevCoords.client.y;
  6472. var dx = void 0;
  6473. var dy = void 0;
  6474. // register movement greater than pointerMoveTolerance
  6475. if (this.pointerIsDown && !this.pointerWasMoved) {
  6476. dx = this.curCoords.client.x - this.startCoords.client.x;
  6477. dy = this.curCoords.client.y - this.startCoords.client.y;
  6478. this.pointerWasMoved = utils.hypot(dx, dy) > Interaction.pointerMoveTolerance;
  6479. }
  6480. var signalArg = {
  6481. pointer: pointer,
  6482. pointerIndex: this.getPointerIndex(pointer),
  6483. event: event,
  6484. eventTarget: eventTarget,
  6485. dx: dx,
  6486. dy: dy,
  6487. duplicate: duplicateMove,
  6488. interaction: this,
  6489. interactingBeforeMove: this.interacting()
  6490. };
  6491. if (!duplicateMove) {
  6492. // set pointer coordinate, time changes and speeds
  6493. utils.setCoordDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
  6494. }
  6495. signals.fire('move', signalArg);
  6496. if (!duplicateMove) {
  6497. // if interacting, fire an 'action-move' signal etc
  6498. if (this.interacting()) {
  6499. this.doMove(signalArg);
  6500. }
  6501. if (this.pointerWasMoved) {
  6502. utils.copyCoords(this.prevCoords, this.curCoords);
  6503. }
  6504. }
  6505. };
  6506. /**
  6507. * ```js
  6508. * interact(target)
  6509. * .draggable(true)
  6510. * .on('dragmove', function (event) {
  6511. * if (someCondition) {
  6512. * // change the snap settings
  6513. * event.interactable.draggable({ snap: { targets: [] }});
  6514. * // fire another move event with re-calculated snap
  6515. * event.interaction.doMove();
  6516. * }
  6517. * });
  6518. * ```
  6519. *
  6520. * Force a move of the current action at the same coordinates. Useful if
  6521. * snap/restrict has been changed and you want a movement with the new
  6522. * settings.
  6523. */
  6524. Interaction.prototype.doMove = function doMove(signalArg) {
  6525. signalArg = utils.extend({
  6526. pointer: this.pointers[0],
  6527. event: this.prevEvent,
  6528. eventTarget: this._eventTarget,
  6529. interaction: this
  6530. }, signalArg || {});
  6531. signals.fire('before-action-move', signalArg);
  6532. if (!this._dontFireMove) {
  6533. signals.fire('action-move', signalArg);
  6534. }
  6535. this._dontFireMove = false;
  6536. };
  6537. // End interact move events and stop auto-scroll unless simulation is running
  6538. Interaction.prototype.pointerUp = function pointerUp(pointer, event, eventTarget, curEventTarget) {
  6539. var pointerIndex = this.getPointerIndex(pointer);
  6540. signals.fire(/cancel$/i.test(event.type) ? 'cancel' : 'up', {
  6541. pointer: pointer,
  6542. pointerIndex: pointerIndex,
  6543. event: event,
  6544. eventTarget: eventTarget,
  6545. curEventTarget: curEventTarget,
  6546. interaction: this
  6547. });
  6548. if (!this.simulation) {
  6549. this.end(event);
  6550. }
  6551. this.pointerIsDown = false;
  6552. this.removePointer(pointer, event);
  6553. };
  6554. /**
  6555. * ```js
  6556. * interact(target)
  6557. * .draggable(true)
  6558. * .on('move', function (event) {
  6559. * if (event.pageX > 1000) {
  6560. * // end the current action
  6561. * event.interaction.end();
  6562. * // stop all further listeners from being called
  6563. * event.stopImmediatePropagation();
  6564. * }
  6565. * });
  6566. * ```
  6567. *
  6568. * Stop the current action and fire an end event. Inertial movement does
  6569. * not happen.
  6570. *
  6571. * @param {PointerEvent} [event]
  6572. */
  6573. Interaction.prototype.end = function end(event) {
  6574. this._ending = true;
  6575. event = event || this.prevEvent;
  6576. if (this.interacting()) {
  6577. signals.fire('action-end', {
  6578. event: event,
  6579. interaction: this
  6580. });
  6581. }
  6582. this.stop();
  6583. this._ending = false;
  6584. };
  6585. Interaction.prototype.currentAction = function currentAction() {
  6586. return this._interacting ? this.prepared.name : null;
  6587. };
  6588. Interaction.prototype.interacting = function interacting() {
  6589. return this._interacting;
  6590. };
  6591. /** */
  6592. Interaction.prototype.stop = function stop() {
  6593. signals.fire('stop', { interaction: this });
  6594. if (this._interacting) {
  6595. signals.fire('stop-active', { interaction: this });
  6596. signals.fire('stop-' + this.prepared.name, { interaction: this });
  6597. }
  6598. this.target = this.element = null;
  6599. this._interacting = false;
  6600. this.prepared.name = this.prevEvent = null;
  6601. };
  6602. Interaction.prototype.getPointerIndex = function getPointerIndex(pointer) {
  6603. // mouse and pen interactions may have only one pointer
  6604. if (this.pointerType === 'mouse' || this.pointerType === 'pen') {
  6605. return 0;
  6606. }
  6607. return this.pointerIds.indexOf(utils.getPointerId(pointer));
  6608. };
  6609. Interaction.prototype.updatePointer = function updatePointer(pointer, event) {
  6610. var down = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : event && /(down|start)$/i.test(event.type);
  6611. var id = utils.getPointerId(pointer);
  6612. var index = this.getPointerIndex(pointer);
  6613. if (index === -1) {
  6614. index = this.pointerIds.length;
  6615. this.pointerIds[index] = id;
  6616. }
  6617. if (down) {
  6618. signals.fire('update-pointer-down', {
  6619. pointer: pointer,
  6620. event: event,
  6621. down: down,
  6622. pointerId: id,
  6623. pointerIndex: index,
  6624. interaction: this
  6625. });
  6626. }
  6627. this.pointers[index] = pointer;
  6628. return index;
  6629. };
  6630. Interaction.prototype.removePointer = function removePointer(pointer, event) {
  6631. var index = this.getPointerIndex(pointer);
  6632. if (index === -1) {
  6633. return;
  6634. }
  6635. signals.fire('remove-pointer', {
  6636. pointer: pointer,
  6637. event: event,
  6638. pointerIndex: index,
  6639. interaction: this
  6640. });
  6641. this.pointers.splice(index, 1);
  6642. this.pointerIds.splice(index, 1);
  6643. this.downTargets.splice(index, 1);
  6644. this.downTimes.splice(index, 1);
  6645. };
  6646. Interaction.prototype._updateEventTargets = function _updateEventTargets(target, currentTarget) {
  6647. this._eventTarget = target;
  6648. this._curEventTarget = currentTarget;
  6649. };
  6650. return Interaction;
  6651. }();
  6652. for (var _i = 0; _i < methodNames.length; _i++) {
  6653. var method = methodNames[_i];
  6654. listeners[method] = doOnInteractions(method);
  6655. }
  6656. function doOnInteractions(method) {
  6657. return function (event) {
  6658. var pointerType = utils.getPointerType(event);
  6659. var _utils$getEventTarget = utils.getEventTargets(event),
  6660. eventTarget = _utils$getEventTarget[0],
  6661. curEventTarget = _utils$getEventTarget[1];
  6662. var matches = []; // [ [pointer, interaction], ...]
  6663. if (browser.supportsTouch && /touch/.test(event.type)) {
  6664. prevTouchTime = new Date().getTime();
  6665. for (var _i2 = 0; _i2 < event.changedTouches.length; _i2++) {
  6666. var _ref2;
  6667. _ref2 = event.changedTouches[_i2];
  6668. var changedTouch = _ref2;
  6669. var pointer = changedTouch;
  6670. var interaction = finder.search(pointer, event.type, eventTarget);
  6671. matches.push([pointer, interaction || new Interaction({ pointerType: pointerType })]);
  6672. }
  6673. } else {
  6674. var invalidPointer = false;
  6675. if (!browser.supportsPointerEvent && /mouse/.test(event.type)) {
  6676. // ignore mouse events while touch interactions are active
  6677. for (var i = 0; i < scope.interactions.length && !invalidPointer; i++) {
  6678. invalidPointer = scope.interactions[i].pointerType !== 'mouse' && scope.interactions[i].pointerIsDown;
  6679. }
  6680. // try to ignore mouse events that are simulated by the browser
  6681. // after a touch event
  6682. invalidPointer = invalidPointer || new Date().getTime() - prevTouchTime < 500
  6683. // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated
  6684. || event.timeStamp === 0;
  6685. }
  6686. if (!invalidPointer) {
  6687. var _interaction = finder.search(event, event.type, eventTarget);
  6688. if (!_interaction) {
  6689. _interaction = new Interaction({ pointerType: pointerType });
  6690. }
  6691. matches.push([event, _interaction]);
  6692. }
  6693. }
  6694. for (var _i3 = 0; _i3 < matches.length; _i3++) {
  6695. var _ref3 = matches[_i3];
  6696. var _pointer = _ref3[0];
  6697. var _interaction2 = _ref3[1];
  6698. _interaction2._updateEventTargets(eventTarget, curEventTarget);
  6699. _interaction2[method](_pointer, event, eventTarget, curEventTarget);
  6700. }
  6701. };
  6702. }
  6703. function endAll(event) {
  6704. for (var _i4 = 0; _i4 < scope.interactions.length; _i4++) {
  6705. var _ref4;
  6706. _ref4 = scope.interactions[_i4];
  6707. var interaction = _ref4;
  6708. interaction.end(event);
  6709. signals.fire('endall', { event: event, interaction: interaction });
  6710. }
  6711. }
  6712. var docEvents = {/* 'eventType': listenerFunc */};
  6713. var pEventTypes = browser.pEventTypes;
  6714. if (domObjects.PointerEvent) {
  6715. docEvents[pEventTypes.down] = listeners.pointerDown;
  6716. docEvents[pEventTypes.move] = listeners.pointerMove;
  6717. docEvents[pEventTypes.up] = listeners.pointerUp;
  6718. docEvents[pEventTypes.cancel] = listeners.pointerUp;
  6719. } else {
  6720. docEvents.mousedown = listeners.pointerDown;
  6721. docEvents.mousemove = listeners.pointerMove;
  6722. docEvents.mouseup = listeners.pointerUp;
  6723. docEvents.touchstart = listeners.pointerDown;
  6724. docEvents.touchmove = listeners.pointerMove;
  6725. docEvents.touchend = listeners.pointerUp;
  6726. docEvents.touchcancel = listeners.pointerUp;
  6727. }
  6728. docEvents.blur = endAll;
  6729. function onDocSignal(_ref5, signalName) {
  6730. var doc = _ref5.doc;
  6731. var eventMethod = signalName.indexOf('add') === 0 ? events.add : events.remove;
  6732. // delegate event listener
  6733. for (var eventType in scope.delegatedEvents) {
  6734. eventMethod(doc, eventType, events.delegateListener);
  6735. eventMethod(doc, eventType, events.delegateUseCapture, true);
  6736. }
  6737. for (var _eventType in docEvents) {
  6738. eventMethod(doc, _eventType, docEvents[_eventType], browser.isIOS ? { passive: false } : undefined);
  6739. }
  6740. }
  6741. signals.on('update-pointer-down', function (_ref6) {
  6742. var interaction = _ref6.interaction,
  6743. pointer = _ref6.pointer,
  6744. pointerId = _ref6.pointerId,
  6745. pointerIndex = _ref6.pointerIndex,
  6746. event = _ref6.event,
  6747. eventTarget = _ref6.eventTarget,
  6748. down = _ref6.down;
  6749. interaction.pointerIds[pointerIndex] = pointerId;
  6750. interaction.pointers[pointerIndex] = pointer;
  6751. if (down) {
  6752. interaction.pointerIsDown = true;
  6753. }
  6754. if (!interaction.interacting()) {
  6755. utils.setCoords(interaction.startCoords, interaction.pointers);
  6756. utils.copyCoords(interaction.curCoords, interaction.startCoords);
  6757. utils.copyCoords(interaction.prevCoords, interaction.startCoords);
  6758. interaction.downEvent = event;
  6759. interaction.downTimes[pointerIndex] = interaction.curCoords.timeStamp;
  6760. interaction.downTargets[pointerIndex] = eventTarget || event && utils.getEventTargets(event)[0];
  6761. interaction.pointerWasMoved = false;
  6762. utils.pointerExtend(interaction.downPointer, pointer);
  6763. }
  6764. });
  6765. scope.signals.on('add-document', onDocSignal);
  6766. scope.signals.on('remove-document', onDocSignal);
  6767. Interaction.pointerMoveTolerance = 1;
  6768. Interaction.doOnInteractions = doOnInteractions;
  6769. Interaction.endAll = endAll;
  6770. Interaction.signals = signals;
  6771. Interaction.docEvents = docEvents;
  6772. scope.endAllInteractions = endAll;
  6773. module.exports = Interaction;
  6774. },{"./scope":33,"./utils":44,"./utils/Signals":34,"./utils/browser":36,"./utils/domObjects":38,"./utils/events":40,"./utils/interactionFinder":45}],6:[function(require,module,exports){
  6775. 'use strict';
  6776. var Interaction = require('../Interaction');
  6777. var InteractEvent = require('../InteractEvent');
  6778. var actions = {
  6779. firePrepared: firePrepared,
  6780. names: [],
  6781. methodDict: {}
  6782. };
  6783. Interaction.signals.on('action-start', function (_ref) {
  6784. var interaction = _ref.interaction,
  6785. event = _ref.event;
  6786. interaction._interacting = true;
  6787. firePrepared(interaction, event, 'start');
  6788. });
  6789. Interaction.signals.on('action-move', function (_ref2) {
  6790. var interaction = _ref2.interaction,
  6791. event = _ref2.event,
  6792. preEnd = _ref2.preEnd;
  6793. firePrepared(interaction, event, 'move', preEnd);
  6794. // if the action was ended in a listener
  6795. if (!interaction.interacting()) {
  6796. return false;
  6797. }
  6798. });
  6799. Interaction.signals.on('action-end', function (_ref3) {
  6800. var interaction = _ref3.interaction,
  6801. event = _ref3.event;
  6802. firePrepared(interaction, event, 'end');
  6803. });
  6804. function firePrepared(interaction, event, phase, preEnd) {
  6805. var actionName = interaction.prepared.name;
  6806. var newEvent = new InteractEvent(interaction, event, actionName, phase, interaction.element, null, preEnd);
  6807. interaction.target.fire(newEvent);
  6808. interaction.prevEvent = newEvent;
  6809. }
  6810. module.exports = actions;
  6811. },{"../InteractEvent":3,"../Interaction":5}],7:[function(require,module,exports){
  6812. 'use strict';
  6813. var actions = require('./base');
  6814. var utils = require('../utils');
  6815. var InteractEvent = require('../InteractEvent');
  6816. /** @lends Interactable */
  6817. var Interactable = require('../Interactable');
  6818. var Interaction = require('../Interaction');
  6819. var defaultOptions = require('../defaultOptions');
  6820. var drag = {
  6821. defaults: {
  6822. enabled: false,
  6823. mouseButtons: null,
  6824. origin: null,
  6825. snap: null,
  6826. restrict: null,
  6827. inertia: null,
  6828. autoScroll: null,
  6829. startAxis: 'xy',
  6830. lockAxis: 'xy'
  6831. },
  6832. checker: function checker(pointer, event, interactable) {
  6833. var dragOptions = interactable.options.drag;
  6834. return dragOptions.enabled ? { name: 'drag', axis: dragOptions.lockAxis === 'start' ? dragOptions.startAxis : dragOptions.lockAxis } : null;
  6835. },
  6836. getCursor: function getCursor() {
  6837. return 'move';
  6838. }
  6839. };
  6840. Interaction.signals.on('before-action-move', function (_ref) {
  6841. var interaction = _ref.interaction;
  6842. if (interaction.prepared.name !== 'drag') {
  6843. return;
  6844. }
  6845. var axis = interaction.prepared.axis;
  6846. if (axis === 'x') {
  6847. interaction.curCoords.page.y = interaction.startCoords.page.y;
  6848. interaction.curCoords.client.y = interaction.startCoords.client.y;
  6849. interaction.pointerDelta.page.speed = Math.abs(interaction.pointerDelta.page.vx);
  6850. interaction.pointerDelta.client.speed = Math.abs(interaction.pointerDelta.client.vx);
  6851. interaction.pointerDelta.client.vy = 0;
  6852. interaction.pointerDelta.page.vy = 0;
  6853. } else if (axis === 'y') {
  6854. interaction.curCoords.page.x = interaction.startCoords.page.x;
  6855. interaction.curCoords.client.x = interaction.startCoords.client.x;
  6856. interaction.pointerDelta.page.speed = Math.abs(interaction.pointerDelta.page.vy);
  6857. interaction.pointerDelta.client.speed = Math.abs(interaction.pointerDelta.client.vy);
  6858. interaction.pointerDelta.client.vx = 0;
  6859. interaction.pointerDelta.page.vx = 0;
  6860. }
  6861. });
  6862. // dragmove
  6863. InteractEvent.signals.on('new', function (_ref2) {
  6864. var iEvent = _ref2.iEvent,
  6865. interaction = _ref2.interaction;
  6866. if (iEvent.type !== 'dragmove') {
  6867. return;
  6868. }
  6869. var axis = interaction.prepared.axis;
  6870. if (axis === 'x') {
  6871. iEvent.pageY = interaction.startCoords.page.y;
  6872. iEvent.clientY = interaction.startCoords.client.y;
  6873. iEvent.dy = 0;
  6874. } else if (axis === 'y') {
  6875. iEvent.pageX = interaction.startCoords.page.x;
  6876. iEvent.clientX = interaction.startCoords.client.x;
  6877. iEvent.dx = 0;
  6878. }
  6879. });
  6880. /**
  6881. * ```js
  6882. * interact(element).draggable({
  6883. * onstart: function (event) {},
  6884. * onmove : function (event) {},
  6885. * onend : function (event) {},
  6886. *
  6887. * // the axis in which the first movement must be
  6888. * // for the drag sequence to start
  6889. * // 'xy' by default - any direction
  6890. * startAxis: 'x' || 'y' || 'xy',
  6891. *
  6892. * // 'xy' by default - don't restrict to one axis (move in any direction)
  6893. * // 'x' or 'y' to restrict movement to either axis
  6894. * // 'start' to restrict movement to the axis the drag started in
  6895. * lockAxis: 'x' || 'y' || 'xy' || 'start',
  6896. *
  6897. * // max number of drags that can happen concurrently
  6898. * // with elements of this Interactable. Infinity by default
  6899. * max: Infinity,
  6900. *
  6901. * // max number of drags that can target the same element+Interactable
  6902. * // 1 by default
  6903. * maxPerElement: 2
  6904. * });
  6905. *
  6906. * var isDraggable = interact('element').draggable(); // true
  6907. * ```
  6908. *
  6909. * Get or set whether drag actions can be performed on the target
  6910. *
  6911. * @param {boolean | object} [options] true/false or An object with event
  6912. * listeners to be fired on drag events (object makes the Interactable
  6913. * draggable)
  6914. * @return {boolean | Interactable} boolean indicating if this can be the
  6915. * target of drag events, or this Interctable
  6916. */
  6917. Interactable.prototype.draggable = function (options) {
  6918. if (utils.is.object(options)) {
  6919. this.options.drag.enabled = options.enabled === false ? false : true;
  6920. this.setPerAction('drag', options);
  6921. this.setOnEvents('drag', options);
  6922. if (/^(xy|x|y|start)$/.test(options.lockAxis)) {
  6923. this.options.drag.lockAxis = options.lockAxis;
  6924. }
  6925. if (/^(xy|x|y)$/.test(options.startAxis)) {
  6926. this.options.drag.startAxis = options.startAxis;
  6927. }
  6928. return this;
  6929. }
  6930. if (utils.is.bool(options)) {
  6931. this.options.drag.enabled = options;
  6932. if (!options) {
  6933. this.ondragstart = this.ondragstart = this.ondragend = null;
  6934. }
  6935. return this;
  6936. }
  6937. return this.options.drag;
  6938. };
  6939. actions.drag = drag;
  6940. actions.names.push('drag');
  6941. utils.merge(Interactable.eventTypes, ['dragstart', 'dragmove', 'draginertiastart', 'draginertiaresume', 'dragend']);
  6942. actions.methodDict.drag = 'draggable';
  6943. defaultOptions.drag = drag.defaults;
  6944. module.exports = drag;
  6945. },{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../utils":44,"./base":6}],8:[function(require,module,exports){
  6946. 'use strict';
  6947. var actions = require('./base');
  6948. var utils = require('../utils');
  6949. var scope = require('../scope');
  6950. /** @lends module:interact */
  6951. var interact = require('../interact');
  6952. var InteractEvent = require('../InteractEvent');
  6953. /** @lends Interactable */
  6954. var Interactable = require('../Interactable');
  6955. var Interaction = require('../Interaction');
  6956. var defaultOptions = require('../defaultOptions');
  6957. var drop = {
  6958. defaults: {
  6959. enabled: false,
  6960. accept: null,
  6961. overlap: 'pointer'
  6962. }
  6963. };
  6964. var dynamicDrop = false;
  6965. Interaction.signals.on('action-start', function (_ref) {
  6966. var interaction = _ref.interaction,
  6967. event = _ref.event;
  6968. if (interaction.prepared.name !== 'drag') {
  6969. return;
  6970. }
  6971. // reset active dropzones
  6972. interaction.activeDrops.dropzones = [];
  6973. interaction.activeDrops.elements = [];
  6974. interaction.activeDrops.rects = [];
  6975. interaction.dropEvents = null;
  6976. if (!interaction.dynamicDrop) {
  6977. setActiveDrops(interaction.activeDrops, interaction.element);
  6978. }
  6979. var dragEvent = interaction.prevEvent;
  6980. var dropEvents = getDropEvents(interaction, event, dragEvent);
  6981. if (dropEvents.activate) {
  6982. fireActiveDrops(interaction.activeDrops, dropEvents.activate);
  6983. }
  6984. });
  6985. InteractEvent.signals.on('new', function (_ref2) {
  6986. var interaction = _ref2.interaction,
  6987. iEvent = _ref2.iEvent,
  6988. event = _ref2.event;
  6989. if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') {
  6990. return;
  6991. }
  6992. var draggableElement = interaction.element;
  6993. var dragEvent = iEvent;
  6994. var dropResult = getDrop(dragEvent, event, draggableElement);
  6995. interaction.dropTarget = dropResult.dropzone;
  6996. interaction.dropElement = dropResult.element;
  6997. interaction.dropEvents = getDropEvents(interaction, event, dragEvent);
  6998. });
  6999. Interaction.signals.on('action-move', function (_ref3) {
  7000. var interaction = _ref3.interaction;
  7001. if (interaction.prepared.name !== 'drag') {
  7002. return;
  7003. }
  7004. fireDropEvents(interaction, interaction.dropEvents);
  7005. });
  7006. Interaction.signals.on('action-end', function (_ref4) {
  7007. var interaction = _ref4.interaction;
  7008. if (interaction.prepared.name === 'drag') {
  7009. fireDropEvents(interaction, interaction.dropEvents);
  7010. }
  7011. });
  7012. Interaction.signals.on('stop-drag', function (_ref5) {
  7013. var interaction = _ref5.interaction;
  7014. interaction.activeDrops = {
  7015. dropzones: null,
  7016. elements: null,
  7017. rects: null
  7018. };
  7019. interaction.dropEvents = null;
  7020. });
  7021. function collectDrops(activeDrops, element) {
  7022. var drops = [];
  7023. var elements = [];
  7024. // collect all dropzones and their elements which qualify for a drop
  7025. for (var _i = 0; _i < scope.interactables.length; _i++) {
  7026. var _ref6;
  7027. _ref6 = scope.interactables[_i];
  7028. var current = _ref6;
  7029. if (!current.options.drop.enabled) {
  7030. continue;
  7031. }
  7032. var accept = current.options.drop.accept;
  7033. // test the draggable element against the dropzone's accept setting
  7034. if (utils.is.element(accept) && accept !== element || utils.is.string(accept) && !utils.matchesSelector(element, accept)) {
  7035. continue;
  7036. }
  7037. // query for new elements if necessary
  7038. var dropElements = utils.is.string(current.target) ? current._context.querySelectorAll(current.target) : [current.target];
  7039. for (var _i2 = 0; _i2 < dropElements.length; _i2++) {
  7040. var _ref7;
  7041. _ref7 = dropElements[_i2];
  7042. var currentElement = _ref7;
  7043. if (currentElement !== element) {
  7044. drops.push(current);
  7045. elements.push(currentElement);
  7046. }
  7047. }
  7048. }
  7049. return {
  7050. elements: elements,
  7051. dropzones: drops
  7052. };
  7053. }
  7054. function fireActiveDrops(activeDrops, event) {
  7055. var prevElement = void 0;
  7056. // loop through all active dropzones and trigger event
  7057. for (var i = 0; i < activeDrops.dropzones.length; i++) {
  7058. var current = activeDrops.dropzones[i];
  7059. var currentElement = activeDrops.elements[i];
  7060. // prevent trigger of duplicate events on same element
  7061. if (currentElement !== prevElement) {
  7062. // set current element as event target
  7063. event.target = currentElement;
  7064. current.fire(event);
  7065. }
  7066. prevElement = currentElement;
  7067. }
  7068. }
  7069. // Collect a new set of possible drops and save them in activeDrops.
  7070. // setActiveDrops should always be called when a drag has just started or a
  7071. // drag event happens while dynamicDrop is true
  7072. function setActiveDrops(activeDrops, dragElement) {
  7073. // get dropzones and their elements that could receive the draggable
  7074. var possibleDrops = collectDrops(activeDrops, dragElement);
  7075. activeDrops.dropzones = possibleDrops.dropzones;
  7076. activeDrops.elements = possibleDrops.elements;
  7077. activeDrops.rects = [];
  7078. for (var i = 0; i < activeDrops.dropzones.length; i++) {
  7079. activeDrops.rects[i] = activeDrops.dropzones[i].getRect(activeDrops.elements[i]);
  7080. }
  7081. }
  7082. function getDrop(dragEvent, event, dragElement) {
  7083. var interaction = dragEvent.interaction;
  7084. var validDrops = [];
  7085. if (dynamicDrop) {
  7086. setActiveDrops(interaction.activeDrops, dragElement);
  7087. }
  7088. // collect all dropzones and their elements which qualify for a drop
  7089. for (var j = 0; j < interaction.activeDrops.dropzones.length; j++) {
  7090. var current = interaction.activeDrops.dropzones[j];
  7091. var currentElement = interaction.activeDrops.elements[j];
  7092. var rect = interaction.activeDrops.rects[j];
  7093. validDrops.push(current.dropCheck(dragEvent, event, interaction.target, dragElement, currentElement, rect) ? currentElement : null);
  7094. }
  7095. // get the most appropriate dropzone based on DOM depth and order
  7096. var dropIndex = utils.indexOfDeepestElement(validDrops);
  7097. return {
  7098. dropzone: interaction.activeDrops.dropzones[dropIndex] || null,
  7099. element: interaction.activeDrops.elements[dropIndex] || null
  7100. };
  7101. }
  7102. function getDropEvents(interaction, pointerEvent, dragEvent) {
  7103. var dropEvents = {
  7104. enter: null,
  7105. leave: null,
  7106. activate: null,
  7107. deactivate: null,
  7108. move: null,
  7109. drop: null
  7110. };
  7111. var tmpl = {
  7112. dragEvent: dragEvent,
  7113. interaction: interaction,
  7114. target: interaction.dropElement,
  7115. dropzone: interaction.dropTarget,
  7116. relatedTarget: dragEvent.target,
  7117. draggable: dragEvent.interactable,
  7118. timeStamp: dragEvent.timeStamp
  7119. };
  7120. if (interaction.dropElement !== interaction.prevDropElement) {
  7121. // if there was a prevDropTarget, create a dragleave event
  7122. if (interaction.prevDropTarget) {
  7123. dropEvents.leave = utils.extend({ type: 'dragleave' }, tmpl);
  7124. dragEvent.dragLeave = dropEvents.leave.target = interaction.prevDropElement;
  7125. dragEvent.prevDropzone = dropEvents.leave.dropzone = interaction.prevDropTarget;
  7126. }
  7127. // if the dropTarget is not null, create a dragenter event
  7128. if (interaction.dropTarget) {
  7129. dropEvents.enter = {
  7130. dragEvent: dragEvent,
  7131. interaction: interaction,
  7132. target: interaction.dropElement,
  7133. dropzone: interaction.dropTarget,
  7134. relatedTarget: dragEvent.target,
  7135. draggable: dragEvent.interactable,
  7136. timeStamp: dragEvent.timeStamp,
  7137. type: 'dragenter'
  7138. };
  7139. dragEvent.dragEnter = interaction.dropElement;
  7140. dragEvent.dropzone = interaction.dropTarget;
  7141. }
  7142. }
  7143. if (dragEvent.type === 'dragend' && interaction.dropTarget) {
  7144. dropEvents.drop = utils.extend({ type: 'drop' }, tmpl);
  7145. dragEvent.dropzone = interaction.dropTarget;
  7146. dragEvent.relatedTarget = interaction.dropElement;
  7147. }
  7148. if (dragEvent.type === 'dragstart') {
  7149. dropEvents.activate = utils.extend({ type: 'dropactivate' }, tmpl);
  7150. dropEvents.activate.target = null;
  7151. dropEvents.activate.dropzone = null;
  7152. }
  7153. if (dragEvent.type === 'dragend') {
  7154. dropEvents.deactivate = utils.extend({ type: 'dropdeactivate' }, tmpl);
  7155. dropEvents.deactivate.target = null;
  7156. dropEvents.deactivate.dropzone = null;
  7157. }
  7158. if (dragEvent.type === 'dragmove' && interaction.dropTarget) {
  7159. dropEvents.move = utils.extend({
  7160. dragmove: dragEvent,
  7161. type: 'dropmove'
  7162. }, tmpl);
  7163. dragEvent.dropzone = interaction.dropTarget;
  7164. }
  7165. return dropEvents;
  7166. }
  7167. function fireDropEvents(interaction, dropEvents) {
  7168. var activeDrops = interaction.activeDrops,
  7169. prevDropTarget = interaction.prevDropTarget,
  7170. dropTarget = interaction.dropTarget,
  7171. dropElement = interaction.dropElement;
  7172. if (dropEvents.leave) {
  7173. prevDropTarget.fire(dropEvents.leave);
  7174. }
  7175. if (dropEvents.move) {
  7176. dropTarget.fire(dropEvents.move);
  7177. }
  7178. if (dropEvents.enter) {
  7179. dropTarget.fire(dropEvents.enter);
  7180. }
  7181. if (dropEvents.drop) {
  7182. dropTarget.fire(dropEvents.drop);
  7183. }
  7184. if (dropEvents.deactivate) {
  7185. fireActiveDrops(activeDrops, dropEvents.deactivate);
  7186. }
  7187. interaction.prevDropTarget = dropTarget;
  7188. interaction.prevDropElement = dropElement;
  7189. }
  7190. /**
  7191. * ```js
  7192. * interact(target)
  7193. * .dropChecker(function(dragEvent, // related dragmove or dragend event
  7194. * event, // TouchEvent/PointerEvent/MouseEvent
  7195. * dropped, // bool result of the default checker
  7196. * dropzone, // dropzone Interactable
  7197. * dropElement, // dropzone elemnt
  7198. * draggable, // draggable Interactable
  7199. * draggableElement) {// draggable element
  7200. *
  7201. * return dropped && event.target.hasAttribute('allow-drop');
  7202. * }
  7203. * ```
  7204. *
  7205. * ```js
  7206. * interact('.drop').dropzone({
  7207. * accept: '.can-drop' || document.getElementById('single-drop'),
  7208. * overlap: 'pointer' || 'center' || zeroToOne
  7209. * }
  7210. * ```
  7211. *
  7212. * Returns or sets whether draggables can be dropped onto this target to
  7213. * trigger drop events
  7214. *
  7215. * Dropzones can receive the following events:
  7216. * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends
  7217. * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone
  7218. * - `dragmove` when a draggable that has entered the dropzone is moved
  7219. * - `drop` when a draggable is dropped into this dropzone
  7220. *
  7221. * Use the `accept` option to allow only elements that match the given CSS
  7222. * selector or element. The value can be:
  7223. *
  7224. * - **an Element** - only that element can be dropped into this dropzone.
  7225. * - **a string**, - the element being dragged must match it as a CSS selector.
  7226. * - **`null`** - accept options is cleared - it accepts any element.
  7227. *
  7228. * Use the `overlap` option to set how drops are checked for. The allowed
  7229. * values are:
  7230. *
  7231. * - `'pointer'`, the pointer must be over the dropzone (default)
  7232. * - `'center'`, the draggable element's center must be over the dropzone
  7233. * - a number from 0-1 which is the `(intersection area) / (draggable area)`.
  7234. * e.g. `0.5` for drop to happen when half of the area of the draggable is
  7235. * over the dropzone
  7236. *
  7237. * Use the `checker` option to specify a function to check if a dragged element
  7238. * is over this Interactable.
  7239. *
  7240. * @param {boolean | object | null} [options] The new options to be set.
  7241. * @return {boolean | Interactable} The current setting or this Interactable
  7242. */
  7243. Interactable.prototype.dropzone = function (options) {
  7244. if (utils.is.object(options)) {
  7245. this.options.drop.enabled = options.enabled === false ? false : true;
  7246. if (utils.is.function(options.ondrop)) {
  7247. this.events.ondrop = options.ondrop;
  7248. }
  7249. if (utils.is.function(options.ondropactivate)) {
  7250. this.events.ondropactivate = options.ondropactivate;
  7251. }
  7252. if (utils.is.function(options.ondropdeactivate)) {
  7253. this.events.ondropdeactivate = options.ondropdeactivate;
  7254. }
  7255. if (utils.is.function(options.ondragenter)) {
  7256. this.events.ondragenter = options.ondragenter;
  7257. }
  7258. if (utils.is.function(options.ondragleave)) {
  7259. this.events.ondragleave = options.ondragleave;
  7260. }
  7261. if (utils.is.function(options.ondropmove)) {
  7262. this.events.ondropmove = options.ondropmove;
  7263. }
  7264. if (/^(pointer|center)$/.test(options.overlap)) {
  7265. this.options.drop.overlap = options.overlap;
  7266. } else if (utils.is.number(options.overlap)) {
  7267. this.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0);
  7268. }
  7269. if ('accept' in options) {
  7270. this.options.drop.accept = options.accept;
  7271. }
  7272. if ('checker' in options) {
  7273. this.options.drop.checker = options.checker;
  7274. }
  7275. return this;
  7276. }
  7277. if (utils.is.bool(options)) {
  7278. this.options.drop.enabled = options;
  7279. if (!options) {
  7280. this.ondragenter = this.ondragleave = this.ondrop = this.ondropactivate = this.ondropdeactivate = null;
  7281. }
  7282. return this;
  7283. }
  7284. return this.options.drop;
  7285. };
  7286. Interactable.prototype.dropCheck = function (dragEvent, event, draggable, draggableElement, dropElement, rect) {
  7287. var dropped = false;
  7288. // if the dropzone has no rect (eg. display: none)
  7289. // call the custom dropChecker or just return false
  7290. if (!(rect = rect || this.getRect(dropElement))) {
  7291. return this.options.drop.checker ? this.options.drop.checker(dragEvent, event, dropped, this, dropElement, draggable, draggableElement) : false;
  7292. }
  7293. var dropOverlap = this.options.drop.overlap;
  7294. if (dropOverlap === 'pointer') {
  7295. var origin = utils.getOriginXY(draggable, draggableElement, 'drag');
  7296. var page = utils.getPageXY(dragEvent);
  7297. page.x += origin.x;
  7298. page.y += origin.y;
  7299. var horizontal = page.x > rect.left && page.x < rect.right;
  7300. var vertical = page.y > rect.top && page.y < rect.bottom;
  7301. dropped = horizontal && vertical;
  7302. }
  7303. var dragRect = draggable.getRect(draggableElement);
  7304. if (dragRect && dropOverlap === 'center') {
  7305. var cx = dragRect.left + dragRect.width / 2;
  7306. var cy = dragRect.top + dragRect.height / 2;
  7307. dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom;
  7308. }
  7309. if (dragRect && utils.is.number(dropOverlap)) {
  7310. var overlapArea = Math.max(0, Math.min(rect.right, dragRect.right) - Math.max(rect.left, dragRect.left)) * Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top, dragRect.top));
  7311. var overlapRatio = overlapArea / (dragRect.width * dragRect.height);
  7312. dropped = overlapRatio >= dropOverlap;
  7313. }
  7314. if (this.options.drop.checker) {
  7315. dropped = this.options.drop.checker(dragEvent, event, dropped, this, dropElement, draggable, draggableElement);
  7316. }
  7317. return dropped;
  7318. };
  7319. Interactable.signals.on('unset', function (_ref8) {
  7320. var interactable = _ref8.interactable;
  7321. interactable.dropzone(false);
  7322. });
  7323. Interactable.settingsMethods.push('dropChecker');
  7324. Interaction.signals.on('new', function (interaction) {
  7325. interaction.dropTarget = null; // the dropzone a drag target might be dropped into
  7326. interaction.dropElement = null; // the element at the time of checking
  7327. interaction.prevDropTarget = null; // the dropzone that was recently dragged away from
  7328. interaction.prevDropElement = null; // the element at the time of checking
  7329. interaction.dropEvents = null; // the dropEvents related to the current drag event
  7330. interaction.activeDrops = {
  7331. dropzones: [], // the dropzones that are mentioned below
  7332. elements: [], // elements of dropzones that accept the target draggable
  7333. rects: [] // the rects of the elements mentioned above
  7334. };
  7335. });
  7336. Interaction.signals.on('stop', function (_ref9) {
  7337. var interaction = _ref9.interaction;
  7338. interaction.dropTarget = interaction.dropElement = interaction.prevDropTarget = interaction.prevDropElement = null;
  7339. });
  7340. /**
  7341. * Returns or sets whether the dimensions of dropzone elements are calculated
  7342. * on every dragmove or only on dragstart for the default dropChecker
  7343. *
  7344. * @param {boolean} [newValue] True to check on each move. False to check only
  7345. * before start
  7346. * @return {boolean | interact} The current setting or interact
  7347. */
  7348. interact.dynamicDrop = function (newValue) {
  7349. if (utils.is.bool(newValue)) {
  7350. //if (dragging && dynamicDrop !== newValue && !newValue) {
  7351. //calcRects(dropzones);
  7352. //}
  7353. dynamicDrop = newValue;
  7354. return interact;
  7355. }
  7356. return dynamicDrop;
  7357. };
  7358. utils.merge(Interactable.eventTypes, ['dragenter', 'dragleave', 'dropactivate', 'dropdeactivate', 'dropmove', 'drop']);
  7359. actions.methodDict.drop = 'dropzone';
  7360. defaultOptions.drop = drop.defaults;
  7361. module.exports = drop;
  7362. },{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../interact":21,"../scope":33,"../utils":44,"./base":6}],9:[function(require,module,exports){
  7363. 'use strict';
  7364. var actions = require('./base');
  7365. var utils = require('../utils');
  7366. var InteractEvent = require('../InteractEvent');
  7367. var Interactable = require('../Interactable');
  7368. var Interaction = require('../Interaction');
  7369. var defaultOptions = require('../defaultOptions');
  7370. var gesture = {
  7371. defaults: {
  7372. enabled: false,
  7373. origin: null,
  7374. restrict: null
  7375. },
  7376. checker: function checker(pointer, event, interactable, element, interaction) {
  7377. if (interaction.pointerIds.length >= 2) {
  7378. return { name: 'gesture' };
  7379. }
  7380. return null;
  7381. },
  7382. getCursor: function getCursor() {
  7383. return '';
  7384. }
  7385. };
  7386. InteractEvent.signals.on('new', function (_ref) {
  7387. var iEvent = _ref.iEvent,
  7388. interaction = _ref.interaction;
  7389. if (iEvent.type !== 'gesturestart') {
  7390. return;
  7391. }
  7392. iEvent.ds = 0;
  7393. interaction.gesture.startDistance = interaction.gesture.prevDistance = iEvent.distance;
  7394. interaction.gesture.startAngle = interaction.gesture.prevAngle = iEvent.angle;
  7395. interaction.gesture.scale = 1;
  7396. });
  7397. InteractEvent.signals.on('new', function (_ref2) {
  7398. var iEvent = _ref2.iEvent,
  7399. interaction = _ref2.interaction;
  7400. if (iEvent.type !== 'gesturemove') {
  7401. return;
  7402. }
  7403. iEvent.ds = iEvent.scale - interaction.gesture.scale;
  7404. interaction.target.fire(iEvent);
  7405. interaction.gesture.prevAngle = iEvent.angle;
  7406. interaction.gesture.prevDistance = iEvent.distance;
  7407. if (iEvent.scale !== Infinity && iEvent.scale !== null && iEvent.scale !== undefined && !isNaN(iEvent.scale)) {
  7408. interaction.gesture.scale = iEvent.scale;
  7409. }
  7410. });
  7411. /**
  7412. * ```js
  7413. * interact(element).gesturable({
  7414. * onstart: function (event) {},
  7415. * onmove : function (event) {},
  7416. * onend : function (event) {},
  7417. *
  7418. * // limit multiple gestures.
  7419. * // See the explanation in {@link Interactable.draggable} example
  7420. * max: Infinity,
  7421. * maxPerElement: 1,
  7422. * });
  7423. *
  7424. * var isGestureable = interact(element).gesturable();
  7425. * ```
  7426. *
  7427. * Gets or sets whether multitouch gestures can be performed on the target
  7428. *
  7429. * @param {boolean | object} [options] true/false or An object with event
  7430. * listeners to be fired on gesture events (makes the Interactable gesturable)
  7431. * @return {boolean | Interactable} A boolean indicating if this can be the
  7432. * target of gesture events, or this Interactable
  7433. */
  7434. Interactable.prototype.gesturable = function (options) {
  7435. if (utils.is.object(options)) {
  7436. this.options.gesture.enabled = options.enabled === false ? false : true;
  7437. this.setPerAction('gesture', options);
  7438. this.setOnEvents('gesture', options);
  7439. return this;
  7440. }
  7441. if (utils.is.bool(options)) {
  7442. this.options.gesture.enabled = options;
  7443. if (!options) {
  7444. this.ongesturestart = this.ongesturestart = this.ongestureend = null;
  7445. }
  7446. return this;
  7447. }
  7448. return this.options.gesture;
  7449. };
  7450. InteractEvent.signals.on('set-delta', function (_ref3) {
  7451. var interaction = _ref3.interaction,
  7452. iEvent = _ref3.iEvent,
  7453. action = _ref3.action,
  7454. event = _ref3.event,
  7455. starting = _ref3.starting,
  7456. ending = _ref3.ending,
  7457. deltaSource = _ref3.deltaSource;
  7458. if (action !== 'gesture') {
  7459. return;
  7460. }
  7461. var pointers = interaction.pointers;
  7462. iEvent.touches = [pointers[0], pointers[1]];
  7463. if (starting) {
  7464. iEvent.distance = utils.touchDistance(pointers, deltaSource);
  7465. iEvent.box = utils.touchBBox(pointers);
  7466. iEvent.scale = 1;
  7467. iEvent.ds = 0;
  7468. iEvent.angle = utils.touchAngle(pointers, undefined, deltaSource);
  7469. iEvent.da = 0;
  7470. } else if (ending || event instanceof InteractEvent) {
  7471. iEvent.distance = interaction.prevEvent.distance;
  7472. iEvent.box = interaction.prevEvent.box;
  7473. iEvent.scale = interaction.prevEvent.scale;
  7474. iEvent.ds = iEvent.scale - 1;
  7475. iEvent.angle = interaction.prevEvent.angle;
  7476. iEvent.da = iEvent.angle - interaction.gesture.startAngle;
  7477. } else {
  7478. iEvent.distance = utils.touchDistance(pointers, deltaSource);
  7479. iEvent.box = utils.touchBBox(pointers);
  7480. iEvent.scale = iEvent.distance / interaction.gesture.startDistance;
  7481. iEvent.angle = utils.touchAngle(pointers, interaction.gesture.prevAngle, deltaSource);
  7482. iEvent.ds = iEvent.scale - interaction.gesture.prevScale;
  7483. iEvent.da = iEvent.angle - interaction.gesture.prevAngle;
  7484. }
  7485. });
  7486. Interaction.signals.on('new', function (interaction) {
  7487. interaction.gesture = {
  7488. start: { x: 0, y: 0 },
  7489. startDistance: 0, // distance between two touches of touchStart
  7490. prevDistance: 0,
  7491. distance: 0,
  7492. scale: 1, // gesture.distance / gesture.startDistance
  7493. startAngle: 0, // angle of line joining two touches
  7494. prevAngle: 0 // angle of the previous gesture event
  7495. };
  7496. });
  7497. actions.gesture = gesture;
  7498. actions.names.push('gesture');
  7499. utils.merge(Interactable.eventTypes, ['gesturestart', 'gesturemove', 'gestureend']);
  7500. actions.methodDict.gesture = 'gesturable';
  7501. defaultOptions.gesture = gesture.defaults;
  7502. module.exports = gesture;
  7503. },{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../utils":44,"./base":6}],10:[function(require,module,exports){
  7504. 'use strict';
  7505. var actions = require('./base');
  7506. var utils = require('../utils');
  7507. var browser = require('../utils/browser');
  7508. var InteractEvent = require('../InteractEvent');
  7509. /** @lends Interactable */
  7510. var Interactable = require('../Interactable');
  7511. var Interaction = require('../Interaction');
  7512. var defaultOptions = require('../defaultOptions');
  7513. // Less Precision with touch input
  7514. var defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10;
  7515. var resize = {
  7516. defaults: {
  7517. enabled: false,
  7518. mouseButtons: null,
  7519. origin: null,
  7520. snap: null,
  7521. restrict: null,
  7522. inertia: null,
  7523. autoScroll: null,
  7524. square: false,
  7525. preserveAspectRatio: false,
  7526. axis: 'xy',
  7527. // use default margin
  7528. margin: NaN,
  7529. // object with props left, right, top, bottom which are
  7530. // true/false values to resize when the pointer is over that edge,
  7531. // CSS selectors to match the handles for each direction
  7532. // or the Elements for each handle
  7533. edges: null,
  7534. // a value of 'none' will limit the resize rect to a minimum of 0x0
  7535. // 'negate' will alow the rect to have negative width/height
  7536. // 'reposition' will keep the width/height positive by swapping
  7537. // the top and bottom edges and/or swapping the left and right edges
  7538. invert: 'none'
  7539. },
  7540. checker: function checker(pointer, event, interactable, element, interaction, rect) {
  7541. if (!rect) {
  7542. return null;
  7543. }
  7544. var page = utils.extend({}, interaction.curCoords.page);
  7545. var options = interactable.options;
  7546. if (options.resize.enabled) {
  7547. var resizeOptions = options.resize;
  7548. var resizeEdges = { left: false, right: false, top: false, bottom: false };
  7549. // if using resize.edges
  7550. if (utils.is.object(resizeOptions.edges)) {
  7551. for (var edge in resizeEdges) {
  7552. resizeEdges[edge] = checkResizeEdge(edge, resizeOptions.edges[edge], page, interaction._eventTarget, element, rect, resizeOptions.margin || defaultMargin);
  7553. }
  7554. resizeEdges.left = resizeEdges.left && !resizeEdges.right;
  7555. resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
  7556. if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {
  7557. return {
  7558. name: 'resize',
  7559. edges: resizeEdges
  7560. };
  7561. }
  7562. } else {
  7563. var right = options.resize.axis !== 'y' && page.x > rect.right - defaultMargin;
  7564. var bottom = options.resize.axis !== 'x' && page.y > rect.bottom - defaultMargin;
  7565. if (right || bottom) {
  7566. return {
  7567. name: 'resize',
  7568. axes: (right ? 'x' : '') + (bottom ? 'y' : '')
  7569. };
  7570. }
  7571. }
  7572. }
  7573. return null;
  7574. },
  7575. cursors: browser.isIe9 ? {
  7576. x: 'e-resize',
  7577. y: 's-resize',
  7578. xy: 'se-resize',
  7579. top: 'n-resize',
  7580. left: 'w-resize',
  7581. bottom: 's-resize',
  7582. right: 'e-resize',
  7583. topleft: 'se-resize',
  7584. bottomright: 'se-resize',
  7585. topright: 'ne-resize',
  7586. bottomleft: 'ne-resize'
  7587. } : {
  7588. x: 'ew-resize',
  7589. y: 'ns-resize',
  7590. xy: 'nwse-resize',
  7591. top: 'ns-resize',
  7592. left: 'ew-resize',
  7593. bottom: 'ns-resize',
  7594. right: 'ew-resize',
  7595. topleft: 'nwse-resize',
  7596. bottomright: 'nwse-resize',
  7597. topright: 'nesw-resize',
  7598. bottomleft: 'nesw-resize'
  7599. },
  7600. getCursor: function getCursor(action) {
  7601. if (action.axis) {
  7602. return resize.cursors[action.name + action.axis];
  7603. } else if (action.edges) {
  7604. var cursorKey = '';
  7605. var edgeNames = ['top', 'bottom', 'left', 'right'];
  7606. for (var i = 0; i < 4; i++) {
  7607. if (action.edges[edgeNames[i]]) {
  7608. cursorKey += edgeNames[i];
  7609. }
  7610. }
  7611. return resize.cursors[cursorKey];
  7612. }
  7613. }
  7614. };
  7615. // resizestart
  7616. InteractEvent.signals.on('new', function (_ref) {
  7617. var iEvent = _ref.iEvent,
  7618. interaction = _ref.interaction;
  7619. if (iEvent.type !== 'resizestart' || !interaction.prepared.edges) {
  7620. return;
  7621. }
  7622. var startRect = interaction.target.getRect(interaction.element);
  7623. var resizeOptions = interaction.target.options.resize;
  7624. /*
  7625. * When using the `resizable.square` or `resizable.preserveAspectRatio` options, resizing from one edge
  7626. * will affect another. E.g. with `resizable.square`, resizing to make the right edge larger will make
  7627. * the bottom edge larger by the same amount. We call these 'linked' edges. Any linked edges will depend
  7628. * on the active edges and the edge being interacted with.
  7629. */
  7630. if (resizeOptions.square || resizeOptions.preserveAspectRatio) {
  7631. var linkedEdges = utils.extend({}, interaction.prepared.edges);
  7632. linkedEdges.top = linkedEdges.top || linkedEdges.left && !linkedEdges.bottom;
  7633. linkedEdges.left = linkedEdges.left || linkedEdges.top && !linkedEdges.right;
  7634. linkedEdges.bottom = linkedEdges.bottom || linkedEdges.right && !linkedEdges.top;
  7635. linkedEdges.right = linkedEdges.right || linkedEdges.bottom && !linkedEdges.left;
  7636. interaction.prepared._linkedEdges = linkedEdges;
  7637. } else {
  7638. interaction.prepared._linkedEdges = null;
  7639. }
  7640. // if using `resizable.preserveAspectRatio` option, record aspect ratio at the start of the resize
  7641. if (resizeOptions.preserveAspectRatio) {
  7642. interaction.resizeStartAspectRatio = startRect.width / startRect.height;
  7643. }
  7644. interaction.resizeRects = {
  7645. start: startRect,
  7646. current: utils.extend({}, startRect),
  7647. inverted: utils.extend({}, startRect),
  7648. previous: utils.extend({}, startRect),
  7649. delta: {
  7650. left: 0, right: 0, width: 0,
  7651. top: 0, bottom: 0, height: 0
  7652. }
  7653. };
  7654. iEvent.rect = interaction.resizeRects.inverted;
  7655. iEvent.deltaRect = interaction.resizeRects.delta;
  7656. });
  7657. // resizemove
  7658. InteractEvent.signals.on('new', function (_ref2) {
  7659. var iEvent = _ref2.iEvent,
  7660. phase = _ref2.phase,
  7661. interaction = _ref2.interaction;
  7662. if (phase !== 'move' || !interaction.prepared.edges) {
  7663. return;
  7664. }
  7665. var resizeOptions = interaction.target.options.resize;
  7666. var invert = resizeOptions.invert;
  7667. var invertible = invert === 'reposition' || invert === 'negate';
  7668. var edges = interaction.prepared.edges;
  7669. var start = interaction.resizeRects.start;
  7670. var current = interaction.resizeRects.current;
  7671. var inverted = interaction.resizeRects.inverted;
  7672. var delta = interaction.resizeRects.delta;
  7673. var previous = utils.extend(interaction.resizeRects.previous, inverted);
  7674. var originalEdges = edges;
  7675. var dx = iEvent.dx;
  7676. var dy = iEvent.dy;
  7677. if (resizeOptions.preserveAspectRatio || resizeOptions.square) {
  7678. // `resize.preserveAspectRatio` takes precedence over `resize.square`
  7679. var startAspectRatio = resizeOptions.preserveAspectRatio ? interaction.resizeStartAspectRatio : 1;
  7680. edges = interaction.prepared._linkedEdges;
  7681. if (originalEdges.left && originalEdges.bottom || originalEdges.right && originalEdges.top) {
  7682. dy = -dx / startAspectRatio;
  7683. } else if (originalEdges.left || originalEdges.right) {
  7684. dy = dx / startAspectRatio;
  7685. } else if (originalEdges.top || originalEdges.bottom) {
  7686. dx = dy * startAspectRatio;
  7687. }
  7688. }
  7689. // update the 'current' rect without modifications
  7690. if (edges.top) {
  7691. current.top += dy;
  7692. }
  7693. if (edges.bottom) {
  7694. current.bottom += dy;
  7695. }
  7696. if (edges.left) {
  7697. current.left += dx;
  7698. }
  7699. if (edges.right) {
  7700. current.right += dx;
  7701. }
  7702. if (invertible) {
  7703. // if invertible, copy the current rect
  7704. utils.extend(inverted, current);
  7705. if (invert === 'reposition') {
  7706. // swap edge values if necessary to keep width/height positive
  7707. var swap = void 0;
  7708. if (inverted.top > inverted.bottom) {
  7709. swap = inverted.top;
  7710. inverted.top = inverted.bottom;
  7711. inverted.bottom = swap;
  7712. }
  7713. if (inverted.left > inverted.right) {
  7714. swap = inverted.left;
  7715. inverted.left = inverted.right;
  7716. inverted.right = swap;
  7717. }
  7718. }
  7719. } else {
  7720. // if not invertible, restrict to minimum of 0x0 rect
  7721. inverted.top = Math.min(current.top, start.bottom);
  7722. inverted.bottom = Math.max(current.bottom, start.top);
  7723. inverted.left = Math.min(current.left, start.right);
  7724. inverted.right = Math.max(current.right, start.left);
  7725. }
  7726. inverted.width = inverted.right - inverted.left;
  7727. inverted.height = inverted.bottom - inverted.top;
  7728. for (var edge in inverted) {
  7729. delta[edge] = inverted[edge] - previous[edge];
  7730. }
  7731. iEvent.edges = interaction.prepared.edges;
  7732. iEvent.rect = inverted;
  7733. iEvent.deltaRect = delta;
  7734. });
  7735. /**
  7736. * ```js
  7737. * interact(element).resizable({
  7738. * onstart: function (event) {},
  7739. * onmove : function (event) {},
  7740. * onend : function (event) {},
  7741. *
  7742. * edges: {
  7743. * top : true, // Use pointer coords to check for resize.
  7744. * left : false, // Disable resizing from left edge.
  7745. * bottom: '.resize-s',// Resize if pointer target matches selector
  7746. * right : handleEl // Resize if pointer target is the given Element
  7747. * },
  7748. *
  7749. * // Width and height can be adjusted independently. When `true`, width and
  7750. * // height are adjusted at a 1:1 ratio.
  7751. * square: false,
  7752. *
  7753. * // Width and height can be adjusted independently. When `true`, width and
  7754. * // height maintain the aspect ratio they had when resizing started.
  7755. * preserveAspectRatio: false,
  7756. *
  7757. * // a value of 'none' will limit the resize rect to a minimum of 0x0
  7758. * // 'negate' will allow the rect to have negative width/height
  7759. * // 'reposition' will keep the width/height positive by swapping
  7760. * // the top and bottom edges and/or swapping the left and right edges
  7761. * invert: 'none' || 'negate' || 'reposition'
  7762. *
  7763. * // limit multiple resizes.
  7764. * // See the explanation in the {@link Interactable.draggable} example
  7765. * max: Infinity,
  7766. * maxPerElement: 1,
  7767. * });
  7768. *
  7769. * var isResizeable = interact(element).resizable();
  7770. * ```
  7771. *
  7772. * Gets or sets whether resize actions can be performed on the target
  7773. *
  7774. * @param {boolean | object} [options] true/false or An object with event
  7775. * listeners to be fired on resize events (object makes the Interactable
  7776. * resizable)
  7777. * @return {boolean | Interactable} A boolean indicating if this can be the
  7778. * target of resize elements, or this Interactable
  7779. */
  7780. Interactable.prototype.resizable = function (options) {
  7781. if (utils.is.object(options)) {
  7782. this.options.resize.enabled = options.enabled === false ? false : true;
  7783. this.setPerAction('resize', options);
  7784. this.setOnEvents('resize', options);
  7785. if (/^x$|^y$|^xy$/.test(options.axis)) {
  7786. this.options.resize.axis = options.axis;
  7787. } else if (options.axis === null) {
  7788. this.options.resize.axis = defaultOptions.resize.axis;
  7789. }
  7790. if (utils.is.bool(options.preserveAspectRatio)) {
  7791. this.options.resize.preserveAspectRatio = options.preserveAspectRatio;
  7792. } else if (utils.is.bool(options.square)) {
  7793. this.options.resize.square = options.square;
  7794. }
  7795. return this;
  7796. }
  7797. if (utils.is.bool(options)) {
  7798. this.options.resize.enabled = options;
  7799. if (!options) {
  7800. this.onresizestart = this.onresizestart = this.onresizeend = null;
  7801. }
  7802. return this;
  7803. }
  7804. return this.options.resize;
  7805. };
  7806. function checkResizeEdge(name, value, page, element, interactableElement, rect, margin) {
  7807. // false, '', undefined, null
  7808. if (!value) {
  7809. return false;
  7810. }
  7811. // true value, use pointer coords and element rect
  7812. if (value === true) {
  7813. // if dimensions are negative, "switch" edges
  7814. var width = utils.is.number(rect.width) ? rect.width : rect.right - rect.left;
  7815. var height = utils.is.number(rect.height) ? rect.height : rect.bottom - rect.top;
  7816. if (width < 0) {
  7817. if (name === 'left') {
  7818. name = 'right';
  7819. } else if (name === 'right') {
  7820. name = 'left';
  7821. }
  7822. }
  7823. if (height < 0) {
  7824. if (name === 'top') {
  7825. name = 'bottom';
  7826. } else if (name === 'bottom') {
  7827. name = 'top';
  7828. }
  7829. }
  7830. if (name === 'left') {
  7831. return page.x < (width >= 0 ? rect.left : rect.right) + margin;
  7832. }
  7833. if (name === 'top') {
  7834. return page.y < (height >= 0 ? rect.top : rect.bottom) + margin;
  7835. }
  7836. if (name === 'right') {
  7837. return page.x > (width >= 0 ? rect.right : rect.left) - margin;
  7838. }
  7839. if (name === 'bottom') {
  7840. return page.y > (height >= 0 ? rect.bottom : rect.top) - margin;
  7841. }
  7842. }
  7843. // the remaining checks require an element
  7844. if (!utils.is.element(element)) {
  7845. return false;
  7846. }
  7847. return utils.is.element(value)
  7848. // the value is an element to use as a resize handle
  7849. ? value === element
  7850. // otherwise check if element matches value as selector
  7851. : utils.matchesUpTo(element, value, interactableElement);
  7852. }
  7853. Interaction.signals.on('new', function (interaction) {
  7854. interaction.resizeAxes = 'xy';
  7855. });
  7856. InteractEvent.signals.on('set-delta', function (_ref3) {
  7857. var interaction = _ref3.interaction,
  7858. iEvent = _ref3.iEvent,
  7859. action = _ref3.action;
  7860. if (action !== 'resize' || !interaction.resizeAxes) {
  7861. return;
  7862. }
  7863. var options = interaction.target.options;
  7864. if (options.resize.square) {
  7865. if (interaction.resizeAxes === 'y') {
  7866. iEvent.dx = iEvent.dy;
  7867. } else {
  7868. iEvent.dy = iEvent.dx;
  7869. }
  7870. iEvent.axes = 'xy';
  7871. } else {
  7872. iEvent.axes = interaction.resizeAxes;
  7873. if (interaction.resizeAxes === 'x') {
  7874. iEvent.dy = 0;
  7875. } else if (interaction.resizeAxes === 'y') {
  7876. iEvent.dx = 0;
  7877. }
  7878. }
  7879. });
  7880. actions.resize = resize;
  7881. actions.names.push('resize');
  7882. utils.merge(Interactable.eventTypes, ['resizestart', 'resizemove', 'resizeinertiastart', 'resizeinertiaresume', 'resizeend']);
  7883. actions.methodDict.resize = 'resizable';
  7884. defaultOptions.resize = resize.defaults;
  7885. module.exports = resize;
  7886. },{"../InteractEvent":3,"../Interactable":4,"../Interaction":5,"../defaultOptions":18,"../utils":44,"../utils/browser":36,"./base":6}],11:[function(require,module,exports){
  7887. 'use strict';
  7888. var raf = require('./utils/raf');
  7889. var getWindow = require('./utils/window').getWindow;
  7890. var is = require('./utils/is');
  7891. var domUtils = require('./utils/domUtils');
  7892. var Interaction = require('./Interaction');
  7893. var defaultOptions = require('./defaultOptions');
  7894. var autoScroll = {
  7895. defaults: {
  7896. enabled: false,
  7897. container: null, // the item that is scrolled (Window or HTMLElement)
  7898. margin: 60,
  7899. speed: 300 // the scroll speed in pixels per second
  7900. },
  7901. interaction: null,
  7902. i: null, // the handle returned by window.setInterval
  7903. x: 0, y: 0, // Direction each pulse is to scroll in
  7904. isScrolling: false,
  7905. prevTime: 0,
  7906. start: function start(interaction) {
  7907. autoScroll.isScrolling = true;
  7908. raf.cancel(autoScroll.i);
  7909. autoScroll.interaction = interaction;
  7910. autoScroll.prevTime = new Date().getTime();
  7911. autoScroll.i = raf.request(autoScroll.scroll);
  7912. },
  7913. stop: function stop() {
  7914. autoScroll.isScrolling = false;
  7915. raf.cancel(autoScroll.i);
  7916. },
  7917. // scroll the window by the values in scroll.x/y
  7918. scroll: function scroll() {
  7919. var options = autoScroll.interaction.target.options[autoScroll.interaction.prepared.name].autoScroll;
  7920. var container = options.container || getWindow(autoScroll.interaction.element);
  7921. var now = new Date().getTime();
  7922. // change in time in seconds
  7923. var dt = (now - autoScroll.prevTime) / 1000;
  7924. // displacement
  7925. var s = options.speed * dt;
  7926. if (s >= 1) {
  7927. if (is.window(container)) {
  7928. container.scrollBy(autoScroll.x * s, autoScroll.y * s);
  7929. } else if (container) {
  7930. container.scrollLeft += autoScroll.x * s;
  7931. container.scrollTop += autoScroll.y * s;
  7932. }
  7933. autoScroll.prevTime = now;
  7934. }
  7935. if (autoScroll.isScrolling) {
  7936. raf.cancel(autoScroll.i);
  7937. autoScroll.i = raf.request(autoScroll.scroll);
  7938. }
  7939. },
  7940. check: function check(interactable, actionName) {
  7941. var options = interactable.options;
  7942. return options[actionName].autoScroll && options[actionName].autoScroll.enabled;
  7943. },
  7944. onInteractionMove: function onInteractionMove(_ref) {
  7945. var interaction = _ref.interaction,
  7946. pointer = _ref.pointer;
  7947. if (!(interaction.interacting() && autoScroll.check(interaction.target, interaction.prepared.name))) {
  7948. return;
  7949. }
  7950. if (interaction.simulation) {
  7951. autoScroll.x = autoScroll.y = 0;
  7952. return;
  7953. }
  7954. var top = void 0;
  7955. var right = void 0;
  7956. var bottom = void 0;
  7957. var left = void 0;
  7958. var options = interaction.target.options[interaction.prepared.name].autoScroll;
  7959. var container = options.container || getWindow(interaction.element);
  7960. if (is.window(container)) {
  7961. left = pointer.clientX < autoScroll.margin;
  7962. top = pointer.clientY < autoScroll.margin;
  7963. right = pointer.clientX > container.innerWidth - autoScroll.margin;
  7964. bottom = pointer.clientY > container.innerHeight - autoScroll.margin;
  7965. } else {
  7966. var rect = domUtils.getElementClientRect(container);
  7967. left = pointer.clientX < rect.left + autoScroll.margin;
  7968. top = pointer.clientY < rect.top + autoScroll.margin;
  7969. right = pointer.clientX > rect.right - autoScroll.margin;
  7970. bottom = pointer.clientY > rect.bottom - autoScroll.margin;
  7971. }
  7972. autoScroll.x = right ? 1 : left ? -1 : 0;
  7973. autoScroll.y = bottom ? 1 : top ? -1 : 0;
  7974. if (!autoScroll.isScrolling) {
  7975. // set the autoScroll properties to those of the target
  7976. autoScroll.margin = options.margin;
  7977. autoScroll.speed = options.speed;
  7978. autoScroll.start(interaction);
  7979. }
  7980. }
  7981. };
  7982. Interaction.signals.on('stop-active', function () {
  7983. autoScroll.stop();
  7984. });
  7985. Interaction.signals.on('action-move', autoScroll.onInteractionMove);
  7986. defaultOptions.perAction.autoScroll = autoScroll.defaults;
  7987. module.exports = autoScroll;
  7988. },{"./Interaction":5,"./defaultOptions":18,"./utils/domUtils":39,"./utils/is":46,"./utils/raf":50,"./utils/window":52}],12:[function(require,module,exports){
  7989. 'use strict';
  7990. /** @lends Interactable */
  7991. var Interactable = require('../Interactable');
  7992. var actions = require('../actions/base');
  7993. var is = require('../utils/is');
  7994. var domUtils = require('../utils/domUtils');
  7995. var _require = require('../utils'),
  7996. warnOnce = _require.warnOnce;
  7997. Interactable.prototype.getAction = function (pointer, event, interaction, element) {
  7998. var action = this.defaultActionChecker(pointer, event, interaction, element);
  7999. if (this.options.actionChecker) {
  8000. return this.options.actionChecker(pointer, event, action, this, element, interaction);
  8001. }
  8002. return action;
  8003. };
  8004. /**
  8005. * ```js
  8006. * interact(element, { ignoreFrom: document.getElementById('no-action') });
  8007. * // or
  8008. * interact(element).ignoreFrom('input, textarea, a');
  8009. * ```
  8010. * @deprecated
  8011. * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any
  8012. * of it's parents match the given CSS selector or Element, no
  8013. * drag/resize/gesture is started.
  8014. *
  8015. * Don't use this method. Instead set the `ignoreFrom` option for each action
  8016. * or for `pointerEvents`
  8017. *
  8018. * @example
  8019. * interact(targett)
  8020. * .draggable({
  8021. * ignoreFrom: 'input, textarea, a[href]'',
  8022. * })
  8023. * .pointerEvents({
  8024. * ignoreFrom: '[no-pointer]',
  8025. * });
  8026. *
  8027. * @param {string | Element | null} [newValue] a CSS selector string, an
  8028. * Element or `null` to not ignore any elements
  8029. * @return {string | Element | object} The current ignoreFrom value or this
  8030. * Interactable
  8031. */
  8032. Interactable.prototype.ignoreFrom = warnOnce(function (newValue) {
  8033. return this._backCompatOption('ignoreFrom', newValue);
  8034. }, 'Interactable.ignoreForm() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).');
  8035. /**
  8036. * ```js
  8037. *
  8038. * @deprecated
  8039. * A drag/resize/gesture is started only If the target of the `mousedown`,
  8040. * `pointerdown` or `touchstart` event or any of it's parents match the given
  8041. * CSS selector or Element.
  8042. *
  8043. * Don't use this method. Instead set the `allowFrom` option for each action
  8044. * or for `pointerEvents`
  8045. *
  8046. * @example
  8047. * interact(targett)
  8048. * .resizable({
  8049. * allowFrom: '.resize-handle',
  8050. * .pointerEvents({
  8051. * allowFrom: '.handle',,
  8052. * });
  8053. *
  8054. * @param {string | Element | null} [newValue] a CSS selector string, an
  8055. * Element or `null` to allow from any element
  8056. * @return {string | Element | object} The current allowFrom value or this
  8057. * Interactable
  8058. */
  8059. Interactable.prototype.allowFrom = warnOnce(function (newValue) {
  8060. return this._backCompatOption('allowFrom', newValue);
  8061. }, 'Interactable.allowForm() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).');
  8062. Interactable.prototype.testIgnore = function (ignoreFrom, interactableElement, element) {
  8063. if (!ignoreFrom || !is.element(element)) {
  8064. return false;
  8065. }
  8066. if (is.string(ignoreFrom)) {
  8067. return domUtils.matchesUpTo(element, ignoreFrom, interactableElement);
  8068. } else if (is.element(ignoreFrom)) {
  8069. return domUtils.nodeContains(ignoreFrom, element);
  8070. }
  8071. return false;
  8072. };
  8073. Interactable.prototype.testAllow = function (allowFrom, interactableElement, element) {
  8074. if (!allowFrom) {
  8075. return true;
  8076. }
  8077. if (!is.element(element)) {
  8078. return false;
  8079. }
  8080. if (is.string(allowFrom)) {
  8081. return domUtils.matchesUpTo(element, allowFrom, interactableElement);
  8082. } else if (is.element(allowFrom)) {
  8083. return domUtils.nodeContains(allowFrom, element);
  8084. }
  8085. return false;
  8086. };
  8087. Interactable.prototype.testIgnoreAllow = function (options, interactableElement, eventTarget) {
  8088. return !this.testIgnore(options.ignoreFrom, interactableElement, eventTarget) && this.testAllow(options.allowFrom, interactableElement, eventTarget);
  8089. };
  8090. /**
  8091. * ```js
  8092. * interact('.resize-drag')
  8093. * .resizable(true)
  8094. * .draggable(true)
  8095. * .actionChecker(function (pointer, event, action, interactable, element, interaction) {
  8096. *
  8097. * if (interact.matchesSelector(event.target, '.drag-handle') {
  8098. * // force drag with handle target
  8099. * action.name = drag;
  8100. * }
  8101. * else {
  8102. * // resize from the top and right edges
  8103. * action.name = 'resize';
  8104. * action.edges = { top: true, right: true };
  8105. * }
  8106. *
  8107. * return action;
  8108. * });
  8109. * ```
  8110. *
  8111. * Gets or sets the function used to check action to be performed on
  8112. * pointerDown
  8113. *
  8114. * @param {function | null} [checker] A function which takes a pointer event,
  8115. * defaultAction string, interactable, element and interaction as parameters
  8116. * and returns an object with name property 'drag' 'resize' or 'gesture' and
  8117. * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right
  8118. * props.
  8119. * @return {Function | Interactable} The checker function or this Interactable
  8120. */
  8121. Interactable.prototype.actionChecker = function (checker) {
  8122. if (is.function(checker)) {
  8123. this.options.actionChecker = checker;
  8124. return this;
  8125. }
  8126. if (checker === null) {
  8127. delete this.options.actionChecker;
  8128. return this;
  8129. }
  8130. return this.options.actionChecker;
  8131. };
  8132. /**
  8133. * Returns or sets whether the the cursor should be changed depending on the
  8134. * action that would be performed if the mouse were pressed and dragged.
  8135. *
  8136. * @param {boolean} [newValue]
  8137. * @return {boolean | Interactable} The current setting or this Interactable
  8138. */
  8139. Interactable.prototype.styleCursor = function (newValue) {
  8140. if (is.bool(newValue)) {
  8141. this.options.styleCursor = newValue;
  8142. return this;
  8143. }
  8144. if (newValue === null) {
  8145. delete this.options.styleCursor;
  8146. return this;
  8147. }
  8148. return this.options.styleCursor;
  8149. };
  8150. Interactable.prototype.defaultActionChecker = function (pointer, event, interaction, element) {
  8151. var rect = this.getRect(element);
  8152. var buttons = event.buttons || {
  8153. 0: 1,
  8154. 1: 4,
  8155. 3: 8,
  8156. 4: 16
  8157. }[event.button];
  8158. var action = null;
  8159. for (var _i = 0; _i < actions.names.length; _i++) {
  8160. var _ref;
  8161. _ref = actions.names[_i];
  8162. var actionName = _ref;
  8163. // check mouseButton setting if the pointer is down
  8164. if (interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & this.options[actionName].mouseButtons) === 0) {
  8165. continue;
  8166. }
  8167. action = actions[actionName].checker(pointer, event, this, element, interaction, rect);
  8168. if (action) {
  8169. return action;
  8170. }
  8171. }
  8172. };
  8173. },{"../Interactable":4,"../actions/base":6,"../utils":44,"../utils/domUtils":39,"../utils/is":46}],13:[function(require,module,exports){
  8174. 'use strict';
  8175. var interact = require('../interact');
  8176. var Interactable = require('../Interactable');
  8177. var Interaction = require('../Interaction');
  8178. var actions = require('../actions/base');
  8179. var defaultOptions = require('../defaultOptions');
  8180. var scope = require('../scope');
  8181. var utils = require('../utils');
  8182. var signals = require('../utils/Signals').new();
  8183. require('./InteractableMethods');
  8184. var autoStart = {
  8185. signals: signals,
  8186. withinInteractionLimit: withinInteractionLimit,
  8187. // Allow this many interactions to happen simultaneously
  8188. maxInteractions: Infinity,
  8189. defaults: {
  8190. perAction: {
  8191. manualStart: false,
  8192. max: Infinity,
  8193. maxPerElement: 1,
  8194. allowFrom: null,
  8195. ignoreFrom: null,
  8196. // only allow left button by default
  8197. // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value
  8198. mouseButtons: 1
  8199. }
  8200. },
  8201. setActionDefaults: function setActionDefaults(action) {
  8202. utils.extend(action.defaults, autoStart.defaults.perAction);
  8203. },
  8204. validateAction: validateAction
  8205. };
  8206. // set cursor style on mousedown
  8207. Interaction.signals.on('down', function (_ref) {
  8208. var interaction = _ref.interaction,
  8209. pointer = _ref.pointer,
  8210. event = _ref.event,
  8211. eventTarget = _ref.eventTarget;
  8212. if (interaction.interacting()) {
  8213. return;
  8214. }
  8215. var actionInfo = getActionInfo(interaction, pointer, event, eventTarget);
  8216. prepare(interaction, actionInfo);
  8217. });
  8218. // set cursor style on mousemove
  8219. Interaction.signals.on('move', function (_ref2) {
  8220. var interaction = _ref2.interaction,
  8221. pointer = _ref2.pointer,
  8222. event = _ref2.event,
  8223. eventTarget = _ref2.eventTarget;
  8224. if (interaction.pointerType !== 'mouse' || interaction.pointerIsDown || interaction.interacting()) {
  8225. return;
  8226. }
  8227. var actionInfo = getActionInfo(interaction, pointer, event, eventTarget);
  8228. prepare(interaction, actionInfo);
  8229. });
  8230. Interaction.signals.on('move', function (arg) {
  8231. var interaction = arg.interaction,
  8232. event = arg.event;
  8233. if (!interaction.pointerIsDown || interaction.interacting() || !interaction.pointerWasMoved || !interaction.prepared.name) {
  8234. return;
  8235. }
  8236. signals.fire('before-start', arg);
  8237. var target = interaction.target;
  8238. if (interaction.prepared.name && target) {
  8239. // check manualStart and interaction limit
  8240. if (target.options[interaction.prepared.name].manualStart || !withinInteractionLimit(target, interaction.element, interaction.prepared)) {
  8241. interaction.stop(event);
  8242. } else {
  8243. interaction.start(interaction.prepared, target, interaction.element);
  8244. }
  8245. }
  8246. });
  8247. // Check if the current target supports the action.
  8248. // If so, return the validated action. Otherwise, return null
  8249. function validateAction(action, interactable, element, eventTarget) {
  8250. if (utils.is.object(action) && interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) && interactable.options[action.name].enabled && withinInteractionLimit(interactable, element, action)) {
  8251. return action;
  8252. }
  8253. return null;
  8254. }
  8255. function validateSelector(interaction, pointer, event, matches, matchElements, eventTarget) {
  8256. for (var i = 0, len = matches.length; i < len; i++) {
  8257. var match = matches[i];
  8258. var matchElement = matchElements[i];
  8259. var action = validateAction(match.getAction(pointer, event, interaction, matchElement), match, matchElement, eventTarget);
  8260. if (action) {
  8261. return {
  8262. action: action,
  8263. target: match,
  8264. element: matchElement
  8265. };
  8266. }
  8267. }
  8268. return {};
  8269. }
  8270. function getActionInfo(interaction, pointer, event, eventTarget) {
  8271. var matches = [];
  8272. var matchElements = [];
  8273. var element = eventTarget;
  8274. function pushMatches(interactable) {
  8275. matches.push(interactable);
  8276. matchElements.push(element);
  8277. }
  8278. while (utils.is.element(element)) {
  8279. matches = [];
  8280. matchElements = [];
  8281. scope.interactables.forEachMatch(element, pushMatches);
  8282. var actionInfo = validateSelector(interaction, pointer, event, matches, matchElements, eventTarget);
  8283. if (actionInfo.action && !actionInfo.target.options[actionInfo.action.name].manualStart) {
  8284. return actionInfo;
  8285. }
  8286. element = utils.parentNode(element);
  8287. }
  8288. return {};
  8289. }
  8290. function prepare(interaction, _ref3) {
  8291. var action = _ref3.action,
  8292. target = _ref3.target,
  8293. element = _ref3.element;
  8294. action = action || {};
  8295. if (interaction.target && interaction.target.options.styleCursor) {
  8296. interaction.target._doc.documentElement.style.cursor = '';
  8297. }
  8298. interaction.target = target;
  8299. interaction.element = element;
  8300. utils.copyAction(interaction.prepared, action);
  8301. if (target && target.options.styleCursor) {
  8302. var cursor = action ? actions[action.name].getCursor(action) : '';
  8303. interaction.target._doc.documentElement.style.cursor = cursor;
  8304. }
  8305. signals.fire('prepared', { interaction: interaction });
  8306. }
  8307. Interaction.signals.on('stop', function (_ref4) {
  8308. var interaction = _ref4.interaction;
  8309. var target = interaction.target;
  8310. if (target && target.options.styleCursor) {
  8311. target._doc.documentElement.style.cursor = '';
  8312. }
  8313. });
  8314. function withinInteractionLimit(interactable, element, action) {
  8315. var options = interactable.options;
  8316. var maxActions = options[action.name].max;
  8317. var maxPerElement = options[action.name].maxPerElement;
  8318. var activeInteractions = 0;
  8319. var targetCount = 0;
  8320. var targetElementCount = 0;
  8321. // no actions if any of these values == 0
  8322. if (!(maxActions && maxPerElement && autoStart.maxInteractions)) {
  8323. return;
  8324. }
  8325. for (var _i = 0; _i < scope.interactions.length; _i++) {
  8326. var _ref5;
  8327. _ref5 = scope.interactions[_i];
  8328. var interaction = _ref5;
  8329. var otherAction = interaction.prepared.name;
  8330. if (!interaction.interacting()) {
  8331. continue;
  8332. }
  8333. activeInteractions++;
  8334. if (activeInteractions >= autoStart.maxInteractions) {
  8335. return false;
  8336. }
  8337. if (interaction.target !== interactable) {
  8338. continue;
  8339. }
  8340. targetCount += otherAction === action.name | 0;
  8341. if (targetCount >= maxActions) {
  8342. return false;
  8343. }
  8344. if (interaction.element === element) {
  8345. targetElementCount++;
  8346. if (otherAction !== action.name || targetElementCount >= maxPerElement) {
  8347. return false;
  8348. }
  8349. }
  8350. }
  8351. return autoStart.maxInteractions > 0;
  8352. }
  8353. /**
  8354. * Returns or sets the maximum number of concurrent interactions allowed. By
  8355. * default only 1 interaction is allowed at a time (for backwards
  8356. * compatibility). To allow multiple interactions on the same Interactables and
  8357. * elements, you need to enable it in the draggable, resizable and gesturable
  8358. * `'max'` and `'maxPerElement'` options.
  8359. *
  8360. * @alias module:interact.maxInteractions
  8361. *
  8362. * @param {number} [newValue] Any number. newValue <= 0 means no interactions.
  8363. */
  8364. interact.maxInteractions = function (newValue) {
  8365. if (utils.is.number(newValue)) {
  8366. autoStart.maxInteractions = newValue;
  8367. return interact;
  8368. }
  8369. return autoStart.maxInteractions;
  8370. };
  8371. Interactable.settingsMethods.push('styleCursor');
  8372. Interactable.settingsMethods.push('actionChecker');
  8373. Interactable.settingsMethods.push('ignoreFrom');
  8374. Interactable.settingsMethods.push('allowFrom');
  8375. defaultOptions.base.actionChecker = null;
  8376. defaultOptions.base.styleCursor = true;
  8377. utils.extend(defaultOptions.perAction, autoStart.defaults.perAction);
  8378. module.exports = autoStart;
  8379. },{"../Interactable":4,"../Interaction":5,"../actions/base":6,"../defaultOptions":18,"../interact":21,"../scope":33,"../utils":44,"../utils/Signals":34,"./InteractableMethods":12}],14:[function(require,module,exports){
  8380. 'use strict';
  8381. var autoStart = require('./base');
  8382. var scope = require('../scope');
  8383. var is = require('../utils/is');
  8384. var _require = require('../utils/domUtils'),
  8385. parentNode = _require.parentNode;
  8386. autoStart.setActionDefaults(require('../actions/drag'));
  8387. autoStart.signals.on('before-start', function (_ref) {
  8388. var interaction = _ref.interaction,
  8389. eventTarget = _ref.eventTarget,
  8390. dx = _ref.dx,
  8391. dy = _ref.dy;
  8392. if (interaction.prepared.name !== 'drag') {
  8393. return;
  8394. }
  8395. // check if a drag is in the correct axis
  8396. var absX = Math.abs(dx);
  8397. var absY = Math.abs(dy);
  8398. var targetOptions = interaction.target.options.drag;
  8399. var startAxis = targetOptions.startAxis;
  8400. var currentAxis = absX > absY ? 'x' : absX < absY ? 'y' : 'xy';
  8401. interaction.prepared.axis = targetOptions.lockAxis === 'start' ? currentAxis[0] // always lock to one axis even if currentAxis === 'xy'
  8402. : targetOptions.lockAxis;
  8403. // if the movement isn't in the startAxis of the interactable
  8404. if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) {
  8405. // cancel the prepared action
  8406. interaction.prepared.name = null;
  8407. // then try to get a drag from another ineractable
  8408. var element = eventTarget;
  8409. var getDraggable = function getDraggable(interactable) {
  8410. if (interactable === interaction.target) {
  8411. return;
  8412. }
  8413. var options = interaction.target.options.drag;
  8414. if (!options.manualStart && interactable.testIgnoreAllow(options, element, eventTarget)) {
  8415. var action = interactable.getAction(interaction.downPointer, interaction.downEvent, interaction, element);
  8416. if (action && action.name === 'drag' && checkStartAxis(currentAxis, interactable) && autoStart.validateAction(action, interactable, element, eventTarget)) {
  8417. return interactable;
  8418. }
  8419. }
  8420. };
  8421. // check all interactables
  8422. while (is.element(element)) {
  8423. var interactable = scope.interactables.forEachMatch(element, getDraggable);
  8424. if (interactable) {
  8425. interaction.prepared.name = 'drag';
  8426. interaction.target = interactable;
  8427. interaction.element = element;
  8428. break;
  8429. }
  8430. element = parentNode(element);
  8431. }
  8432. }
  8433. });
  8434. function checkStartAxis(startAxis, interactable) {
  8435. if (!interactable) {
  8436. return false;
  8437. }
  8438. var thisAxis = interactable.options.drag.startAxis;
  8439. return startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis;
  8440. }
  8441. },{"../actions/drag":7,"../scope":33,"../utils/domUtils":39,"../utils/is":46,"./base":13}],15:[function(require,module,exports){
  8442. 'use strict';
  8443. require('./base').setActionDefaults(require('../actions/gesture'));
  8444. },{"../actions/gesture":9,"./base":13}],16:[function(require,module,exports){
  8445. 'use strict';
  8446. var autoStart = require('./base');
  8447. var Interaction = require('../Interaction');
  8448. autoStart.defaults.perAction.hold = 0;
  8449. autoStart.defaults.perAction.delay = 0;
  8450. Interaction.signals.on('new', function (interaction) {
  8451. interaction.autoStartHoldTimer = null;
  8452. });
  8453. autoStart.signals.on('prepared', function (_ref) {
  8454. var interaction = _ref.interaction;
  8455. var hold = getHoldDuration(interaction);
  8456. if (hold > 0) {
  8457. interaction.autoStartHoldTimer = setTimeout(function () {
  8458. interaction.start(interaction.prepared, interaction.target, interaction.element);
  8459. }, hold);
  8460. }
  8461. });
  8462. Interaction.signals.on('move', function (_ref2) {
  8463. var interaction = _ref2.interaction,
  8464. duplicate = _ref2.duplicate;
  8465. if (interaction.pointerWasMoved && !duplicate) {
  8466. clearTimeout(interaction.autoStartHoldTimer);
  8467. }
  8468. });
  8469. // prevent regular down->move autoStart
  8470. autoStart.signals.on('before-start', function (_ref3) {
  8471. var interaction = _ref3.interaction;
  8472. var hold = getHoldDuration(interaction);
  8473. if (hold > 0) {
  8474. interaction.prepared.name = null;
  8475. }
  8476. });
  8477. function getHoldDuration(interaction) {
  8478. var actionName = interaction.prepared && interaction.prepared.name;
  8479. if (!actionName) {
  8480. return null;
  8481. }
  8482. var options = interaction.target.options;
  8483. return options[actionName].hold || options[actionName].delay;
  8484. }
  8485. module.exports = {
  8486. getHoldDuration: getHoldDuration
  8487. };
  8488. },{"../Interaction":5,"./base":13}],17:[function(require,module,exports){
  8489. 'use strict';
  8490. require('./base').setActionDefaults(require('../actions/resize'));
  8491. },{"../actions/resize":10,"./base":13}],18:[function(require,module,exports){
  8492. 'use strict';
  8493. module.exports = {
  8494. base: {
  8495. accept: null,
  8496. preventDefault: 'auto',
  8497. deltaSource: 'page'
  8498. },
  8499. perAction: {
  8500. origin: { x: 0, y: 0 },
  8501. inertia: {
  8502. enabled: false,
  8503. resistance: 10, // the lambda in exponential decay
  8504. minSpeed: 100, // target speed must be above this for inertia to start
  8505. endSpeed: 10, // the speed at which inertia is slow enough to stop
  8506. allowResume: true, // allow resuming an action in inertia phase
  8507. smoothEndDuration: 300 // animate to snap/restrict endOnly if there's no inertia
  8508. }
  8509. }
  8510. };
  8511. },{}],19:[function(require,module,exports){
  8512. 'use strict';
  8513. /* browser entry point */
  8514. // inertia
  8515. require('./inertia');
  8516. // modifiers
  8517. require('./modifiers/snap');
  8518. require('./modifiers/restrict');
  8519. // pointerEvents
  8520. require('./pointerEvents/base');
  8521. require('./pointerEvents/holdRepeat');
  8522. require('./pointerEvents/interactableTargets');
  8523. // autoStart hold
  8524. require('./autoStart/hold');
  8525. // actions
  8526. require('./actions/gesture');
  8527. require('./actions/resize');
  8528. require('./actions/drag');
  8529. require('./actions/drop');
  8530. // load these modifiers after resize is loaded
  8531. require('./modifiers/snapSize');
  8532. require('./modifiers/restrictEdges');
  8533. require('./modifiers/restrictSize');
  8534. // autoStart actions
  8535. require('./autoStart/gesture');
  8536. require('./autoStart/resize');
  8537. require('./autoStart/drag');
  8538. // Interactable preventDefault setting
  8539. require('./interactablePreventDefault.js');
  8540. // autoScroll
  8541. require('./autoScroll');
  8542. // export interact
  8543. module.exports = require('./interact');
  8544. },{"./actions/drag":7,"./actions/drop":8,"./actions/gesture":9,"./actions/resize":10,"./autoScroll":11,"./autoStart/drag":14,"./autoStart/gesture":15,"./autoStart/hold":16,"./autoStart/resize":17,"./inertia":20,"./interact":21,"./interactablePreventDefault.js":22,"./modifiers/restrict":24,"./modifiers/restrictEdges":25,"./modifiers/restrictSize":26,"./modifiers/snap":27,"./modifiers/snapSize":28,"./pointerEvents/base":30,"./pointerEvents/holdRepeat":31,"./pointerEvents/interactableTargets":32}],20:[function(require,module,exports){
  8545. 'use strict';
  8546. var InteractEvent = require('./InteractEvent');
  8547. var Interaction = require('./Interaction');
  8548. var modifiers = require('./modifiers/base');
  8549. var utils = require('./utils');
  8550. var animationFrame = require('./utils/raf');
  8551. Interaction.signals.on('new', function (interaction) {
  8552. interaction.inertiaStatus = {
  8553. active: false,
  8554. smoothEnd: false,
  8555. allowResume: false,
  8556. startEvent: null,
  8557. upCoords: {},
  8558. xe: 0, ye: 0,
  8559. sx: 0, sy: 0,
  8560. t0: 0,
  8561. vx0: 0, vys: 0,
  8562. duration: 0,
  8563. lambda_v0: 0,
  8564. one_ve_v0: 0,
  8565. i: null
  8566. };
  8567. interaction.boundInertiaFrame = function () {
  8568. return inertiaFrame.apply(interaction);
  8569. };
  8570. interaction.boundSmoothEndFrame = function () {
  8571. return smoothEndFrame.apply(interaction);
  8572. };
  8573. });
  8574. Interaction.signals.on('down', function (_ref) {
  8575. var interaction = _ref.interaction,
  8576. event = _ref.event,
  8577. pointer = _ref.pointer,
  8578. eventTarget = _ref.eventTarget;
  8579. var status = interaction.inertiaStatus;
  8580. // Check if the down event hits the current inertia target
  8581. if (status.active) {
  8582. var element = eventTarget;
  8583. // climb up the DOM tree from the event target
  8584. while (utils.is.element(element)) {
  8585. // if interaction element is the current inertia target element
  8586. if (element === interaction.element) {
  8587. // stop inertia
  8588. animationFrame.cancel(status.i);
  8589. status.active = false;
  8590. interaction.simulation = null;
  8591. // update pointers to the down event's coordinates
  8592. interaction.updatePointer(pointer);
  8593. utils.setCoords(interaction.curCoords, interaction.pointers);
  8594. // fire appropriate signals
  8595. var signalArg = { interaction: interaction };
  8596. Interaction.signals.fire('before-action-move', signalArg);
  8597. Interaction.signals.fire('action-resume', signalArg);
  8598. // fire a reume event
  8599. var resumeEvent = new InteractEvent(interaction, event, interaction.prepared.name, 'inertiaresume', interaction.element);
  8600. interaction.target.fire(resumeEvent);
  8601. interaction.prevEvent = resumeEvent;
  8602. modifiers.resetStatuses(interaction.modifierStatuses);
  8603. utils.copyCoords(interaction.prevCoords, interaction.curCoords);
  8604. break;
  8605. }
  8606. element = utils.parentNode(element);
  8607. }
  8608. }
  8609. });
  8610. Interaction.signals.on('up', function (_ref2) {
  8611. var interaction = _ref2.interaction,
  8612. event = _ref2.event;
  8613. var status = interaction.inertiaStatus;
  8614. if (!interaction.interacting() || status.active) {
  8615. return;
  8616. }
  8617. var target = interaction.target;
  8618. var options = target && target.options;
  8619. var inertiaOptions = options && interaction.prepared.name && options[interaction.prepared.name].inertia;
  8620. var now = new Date().getTime();
  8621. var statuses = {};
  8622. var page = utils.extend({}, interaction.curCoords.page);
  8623. var pointerSpeed = interaction.pointerDelta.client.speed;
  8624. var smoothEnd = false;
  8625. var modifierResult = void 0;
  8626. // check if inertia should be started
  8627. var inertiaPossible = inertiaOptions && inertiaOptions.enabled && interaction.prepared.name !== 'gesture' && event !== status.startEvent;
  8628. var inertia = inertiaPossible && now - interaction.curCoords.timeStamp < 50 && pointerSpeed > inertiaOptions.minSpeed && pointerSpeed > inertiaOptions.endSpeed;
  8629. var modifierArg = {
  8630. interaction: interaction,
  8631. pageCoords: page,
  8632. statuses: statuses,
  8633. preEnd: true,
  8634. requireEndOnly: true
  8635. };
  8636. // smoothEnd
  8637. if (inertiaPossible && !inertia) {
  8638. modifiers.resetStatuses(statuses);
  8639. modifierResult = modifiers.setAll(modifierArg);
  8640. if (modifierResult.shouldMove && modifierResult.locked) {
  8641. smoothEnd = true;
  8642. }
  8643. }
  8644. if (!(inertia || smoothEnd)) {
  8645. return;
  8646. }
  8647. utils.copyCoords(status.upCoords, interaction.curCoords);
  8648. interaction.pointers[0] = status.startEvent = new InteractEvent(interaction, event, interaction.prepared.name, 'inertiastart', interaction.element);
  8649. status.t0 = now;
  8650. status.active = true;
  8651. status.allowResume = inertiaOptions.allowResume;
  8652. interaction.simulation = status;
  8653. target.fire(status.startEvent);
  8654. if (inertia) {
  8655. status.vx0 = interaction.pointerDelta.client.vx;
  8656. status.vy0 = interaction.pointerDelta.client.vy;
  8657. status.v0 = pointerSpeed;
  8658. calcInertia(interaction, status);
  8659. utils.extend(page, interaction.curCoords.page);
  8660. page.x += status.xe;
  8661. page.y += status.ye;
  8662. modifiers.resetStatuses(statuses);
  8663. modifierResult = modifiers.setAll(modifierArg);
  8664. status.modifiedXe += modifierResult.dx;
  8665. status.modifiedYe += modifierResult.dy;
  8666. status.i = animationFrame.request(interaction.boundInertiaFrame);
  8667. } else {
  8668. status.smoothEnd = true;
  8669. status.xe = modifierResult.dx;
  8670. status.ye = modifierResult.dy;
  8671. status.sx = status.sy = 0;
  8672. status.i = animationFrame.request(interaction.boundSmoothEndFrame);
  8673. }
  8674. });
  8675. Interaction.signals.on('stop-active', function (_ref3) {
  8676. var interaction = _ref3.interaction;
  8677. var status = interaction.inertiaStatus;
  8678. if (status.active) {
  8679. animationFrame.cancel(status.i);
  8680. status.active = false;
  8681. interaction.simulation = null;
  8682. }
  8683. });
  8684. function calcInertia(interaction, status) {
  8685. var inertiaOptions = interaction.target.options[interaction.prepared.name].inertia;
  8686. var lambda = inertiaOptions.resistance;
  8687. var inertiaDur = -Math.log(inertiaOptions.endSpeed / status.v0) / lambda;
  8688. status.x0 = interaction.prevEvent.pageX;
  8689. status.y0 = interaction.prevEvent.pageY;
  8690. status.t0 = status.startEvent.timeStamp / 1000;
  8691. status.sx = status.sy = 0;
  8692. status.modifiedXe = status.xe = (status.vx0 - inertiaDur) / lambda;
  8693. status.modifiedYe = status.ye = (status.vy0 - inertiaDur) / lambda;
  8694. status.te = inertiaDur;
  8695. status.lambda_v0 = lambda / status.v0;
  8696. status.one_ve_v0 = 1 - inertiaOptions.endSpeed / status.v0;
  8697. }
  8698. function inertiaFrame() {
  8699. updateInertiaCoords(this);
  8700. utils.setCoordDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
  8701. var status = this.inertiaStatus;
  8702. var options = this.target.options[this.prepared.name].inertia;
  8703. var lambda = options.resistance;
  8704. var t = new Date().getTime() / 1000 - status.t0;
  8705. if (t < status.te) {
  8706. var progress = 1 - (Math.exp(-lambda * t) - status.lambda_v0) / status.one_ve_v0;
  8707. if (status.modifiedXe === status.xe && status.modifiedYe === status.ye) {
  8708. status.sx = status.xe * progress;
  8709. status.sy = status.ye * progress;
  8710. } else {
  8711. var quadPoint = utils.getQuadraticCurvePoint(0, 0, status.xe, status.ye, status.modifiedXe, status.modifiedYe, progress);
  8712. status.sx = quadPoint.x;
  8713. status.sy = quadPoint.y;
  8714. }
  8715. this.doMove();
  8716. status.i = animationFrame.request(this.boundInertiaFrame);
  8717. } else {
  8718. status.sx = status.modifiedXe;
  8719. status.sy = status.modifiedYe;
  8720. this.doMove();
  8721. this.end(status.startEvent);
  8722. status.active = false;
  8723. this.simulation = null;
  8724. }
  8725. utils.copyCoords(this.prevCoords, this.curCoords);
  8726. }
  8727. function smoothEndFrame() {
  8728. updateInertiaCoords(this);
  8729. var status = this.inertiaStatus;
  8730. var t = new Date().getTime() - status.t0;
  8731. var duration = this.target.options[this.prepared.name].inertia.smoothEndDuration;
  8732. if (t < duration) {
  8733. status.sx = utils.easeOutQuad(t, 0, status.xe, duration);
  8734. status.sy = utils.easeOutQuad(t, 0, status.ye, duration);
  8735. this.pointerMove(status.startEvent, status.startEvent);
  8736. status.i = animationFrame.request(this.boundSmoothEndFrame);
  8737. } else {
  8738. status.sx = status.xe;
  8739. status.sy = status.ye;
  8740. this.pointerMove(status.startEvent, status.startEvent);
  8741. this.end(status.startEvent);
  8742. status.smoothEnd = status.active = false;
  8743. this.simulation = null;
  8744. }
  8745. }
  8746. function updateInertiaCoords(interaction) {
  8747. var status = interaction.inertiaStatus;
  8748. // return if inertia isn't running
  8749. if (!status.active) {
  8750. return;
  8751. }
  8752. var pageUp = status.upCoords.page;
  8753. var clientUp = status.upCoords.client;
  8754. utils.setCoords(interaction.curCoords, [{
  8755. pageX: pageUp.x + status.sx,
  8756. pageY: pageUp.y + status.sy,
  8757. clientX: clientUp.x + status.sx,
  8758. clientY: clientUp.y + status.sy
  8759. }]);
  8760. }
  8761. },{"./InteractEvent":3,"./Interaction":5,"./modifiers/base":23,"./utils":44,"./utils/raf":50}],21:[function(require,module,exports){
  8762. 'use strict';
  8763. /** @module interact */
  8764. var browser = require('./utils/browser');
  8765. var events = require('./utils/events');
  8766. var utils = require('./utils');
  8767. var scope = require('./scope');
  8768. var Interactable = require('./Interactable');
  8769. var Interaction = require('./Interaction');
  8770. var globalEvents = {};
  8771. /**
  8772. * ```js
  8773. * interact('#draggable').draggable(true);
  8774. *
  8775. * var rectables = interact('rect');
  8776. * rectables
  8777. * .gesturable(true)
  8778. * .on('gesturemove', function (event) {
  8779. * // ...
  8780. * });
  8781. * ```
  8782. *
  8783. * The methods of this variable can be used to set elements as interactables
  8784. * and also to change various default settings.
  8785. *
  8786. * Calling it as a function and passing an element or a valid CSS selector
  8787. * string returns an Interactable object which has various methods to configure
  8788. * it.
  8789. *
  8790. * @global
  8791. *
  8792. * @param {Element | string} element The HTML or SVG Element to interact with
  8793. * or CSS selector
  8794. * @return {Interactable}
  8795. */
  8796. function interact(element, options) {
  8797. var interactable = scope.interactables.get(element, options);
  8798. if (!interactable) {
  8799. interactable = new Interactable(element, options);
  8800. interactable.events.global = globalEvents;
  8801. }
  8802. return interactable;
  8803. }
  8804. /**
  8805. * Check if an element or selector has been set with the {@link interact}
  8806. * function
  8807. *
  8808. * @alias module:interact.isSet
  8809. *
  8810. * @param {Element} element The Element being searched for
  8811. * @return {boolean} Indicates if the element or CSS selector was previously
  8812. * passed to interact
  8813. */
  8814. interact.isSet = function (element, options) {
  8815. return scope.interactables.indexOfElement(element, options && options.context) !== -1;
  8816. };
  8817. /**
  8818. * Add a global listener for an InteractEvent or adds a DOM event to `document`
  8819. *
  8820. * @alias module:interact.on
  8821. *
  8822. * @param {string | array | object} type The types of events to listen for
  8823. * @param {function} listener The function event (s)
  8824. * @param {object | boolean} [options] object or useCapture flag for
  8825. * addEventListener
  8826. * @return {object} interact
  8827. */
  8828. interact.on = function (type, listener, options) {
  8829. if (utils.is.string(type) && type.search(' ') !== -1) {
  8830. type = type.trim().split(/ +/);
  8831. }
  8832. if (utils.is.array(type)) {
  8833. for (var _i = 0; _i < type.length; _i++) {
  8834. var _ref;
  8835. _ref = type[_i];
  8836. var eventType = _ref;
  8837. interact.on(eventType, listener, options);
  8838. }
  8839. return interact;
  8840. }
  8841. if (utils.is.object(type)) {
  8842. for (var prop in type) {
  8843. interact.on(prop, type[prop], listener);
  8844. }
  8845. return interact;
  8846. }
  8847. // if it is an InteractEvent type, add listener to globalEvents
  8848. if (utils.contains(Interactable.eventTypes, type)) {
  8849. // if this type of event was never bound
  8850. if (!globalEvents[type]) {
  8851. globalEvents[type] = [listener];
  8852. } else {
  8853. globalEvents[type].push(listener);
  8854. }
  8855. }
  8856. // If non InteractEvent type, addEventListener to document
  8857. else {
  8858. events.add(scope.document, type, listener, { options: options });
  8859. }
  8860. return interact;
  8861. };
  8862. /**
  8863. * Removes a global InteractEvent listener or DOM event from `document`
  8864. *
  8865. * @alias module:interact.off
  8866. *
  8867. * @param {string | array | object} type The types of events that were listened
  8868. * for
  8869. * @param {function} listener The listener function to be removed
  8870. * @param {object | boolean} options [options] object or useCapture flag for
  8871. * removeEventListener
  8872. * @return {object} interact
  8873. */
  8874. interact.off = function (type, listener, options) {
  8875. if (utils.is.string(type) && type.search(' ') !== -1) {
  8876. type = type.trim().split(/ +/);
  8877. }
  8878. if (utils.is.array(type)) {
  8879. for (var _i2 = 0; _i2 < type.length; _i2++) {
  8880. var _ref2;
  8881. _ref2 = type[_i2];
  8882. var eventType = _ref2;
  8883. interact.off(eventType, listener, options);
  8884. }
  8885. return interact;
  8886. }
  8887. if (utils.is.object(type)) {
  8888. for (var prop in type) {
  8889. interact.off(prop, type[prop], listener);
  8890. }
  8891. return interact;
  8892. }
  8893. if (!utils.contains(Interactable.eventTypes, type)) {
  8894. events.remove(scope.document, type, listener, options);
  8895. } else {
  8896. var index = void 0;
  8897. if (type in globalEvents && (index = globalEvents[type].indexOf(listener)) !== -1) {
  8898. globalEvents[type].splice(index, 1);
  8899. }
  8900. }
  8901. return interact;
  8902. };
  8903. /**
  8904. * Returns an object which exposes internal data
  8905. * @alias module:interact.debug
  8906. *
  8907. * @return {object} An object with properties that outline the current state
  8908. * and expose internal functions and variables
  8909. */
  8910. interact.debug = function () {
  8911. return scope;
  8912. };
  8913. // expose the functions used to calculate multi-touch properties
  8914. interact.getPointerAverage = utils.pointerAverage;
  8915. interact.getTouchBBox = utils.touchBBox;
  8916. interact.getTouchDistance = utils.touchDistance;
  8917. interact.getTouchAngle = utils.touchAngle;
  8918. interact.getElementRect = utils.getElementRect;
  8919. interact.getElementClientRect = utils.getElementClientRect;
  8920. interact.matchesSelector = utils.matchesSelector;
  8921. interact.closest = utils.closest;
  8922. /**
  8923. * @alias module:interact.supportsTouch
  8924. *
  8925. * @return {boolean} Whether or not the browser supports touch input
  8926. */
  8927. interact.supportsTouch = function () {
  8928. return browser.supportsTouch;
  8929. };
  8930. /**
  8931. * @alias module:interact.supportsPointerEvent
  8932. *
  8933. * @return {boolean} Whether or not the browser supports PointerEvents
  8934. */
  8935. interact.supportsPointerEvent = function () {
  8936. return browser.supportsPointerEvent;
  8937. };
  8938. /**
  8939. * Cancels all interactions (end events are not fired)
  8940. *
  8941. * @alias module:interact.stop
  8942. *
  8943. * @param {Event} event An event on which to call preventDefault()
  8944. * @return {object} interact
  8945. */
  8946. interact.stop = function (event) {
  8947. for (var i = scope.interactions.length - 1; i >= 0; i--) {
  8948. scope.interactions[i].stop(event);
  8949. }
  8950. return interact;
  8951. };
  8952. /**
  8953. * Returns or sets the distance the pointer must be moved before an action
  8954. * sequence occurs. This also affects tolerance for tap events.
  8955. *
  8956. * @alias module:interact.pointerMoveTolerance
  8957. *
  8958. * @param {number} [newValue] The movement from the start position must be greater than this value
  8959. * @return {interact | number}
  8960. */
  8961. interact.pointerMoveTolerance = function (newValue) {
  8962. if (utils.is.number(newValue)) {
  8963. Interaction.pointerMoveTolerance = newValue;
  8964. return interact;
  8965. }
  8966. return Interaction.pointerMoveTolerance;
  8967. };
  8968. interact.addDocument = scope.addDocument;
  8969. interact.removeDocument = scope.removeDocument;
  8970. scope.interact = interact;
  8971. module.exports = interact;
  8972. },{"./Interactable":4,"./Interaction":5,"./scope":33,"./utils":44,"./utils/browser":36,"./utils/events":40}],22:[function(require,module,exports){
  8973. 'use strict';
  8974. var Interactable = require('./Interactable');
  8975. var Interaction = require('./Interaction');
  8976. var scope = require('./scope');
  8977. var is = require('./utils/is');
  8978. var events = require('./utils/events');
  8979. var browser = require('./utils/browser');
  8980. var _require = require('./utils/domUtils'),
  8981. nodeContains = _require.nodeContains,
  8982. matchesSelector = _require.matchesSelector;
  8983. /**
  8984. * Returns or sets whether to prevent the browser's default behaviour in
  8985. * response to pointer events. Can be set to:
  8986. * - `'always'` to always prevent
  8987. * - `'never'` to never prevent
  8988. * - `'auto'` to let interact.js try to determine what would be best
  8989. *
  8990. * @param {string} [newValue] `true`, `false` or `'auto'`
  8991. * @return {string | Interactable} The current setting or this Interactable
  8992. */
  8993. Interactable.prototype.preventDefault = function (newValue) {
  8994. if (/^(always|never|auto)$/.test(newValue)) {
  8995. this.options.preventDefault = newValue;
  8996. return this;
  8997. }
  8998. if (is.bool(newValue)) {
  8999. this.options.preventDefault = newValue ? 'always' : 'never';
  9000. return this;
  9001. }
  9002. return this.options.preventDefault;
  9003. };
  9004. Interactable.prototype.checkAndPreventDefault = function (event) {
  9005. var setting = this.options.preventDefault;
  9006. if (setting === 'never') {
  9007. return;
  9008. }
  9009. if (setting === 'always') {
  9010. event.preventDefault();
  9011. return;
  9012. }
  9013. // setting === 'auto'
  9014. // don't preventDefault of touch{start,move} events if the browser supports passive
  9015. // events listeners. CSS touch-action and user-selecct should be used instead
  9016. if (events.supportsPassive && /^touch(start|move)$/.test(event.type) && !browser.isIOS) {
  9017. return;
  9018. }
  9019. // don't preventDefault of pointerdown events
  9020. if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {
  9021. return;
  9022. }
  9023. // don't preventDefault on editable elements
  9024. if (is.element(event.target) && matchesSelector(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) {
  9025. return;
  9026. }
  9027. event.preventDefault();
  9028. };
  9029. function onInteractionEvent(_ref) {
  9030. var interaction = _ref.interaction,
  9031. event = _ref.event;
  9032. if (interaction.target) {
  9033. interaction.target.checkAndPreventDefault(event);
  9034. }
  9035. }
  9036. var _arr = ['down', 'move', 'up', 'cancel'];
  9037. for (var _i = 0; _i < _arr.length; _i++) {
  9038. var eventSignal = _arr[_i];
  9039. Interaction.signals.on(eventSignal, onInteractionEvent);
  9040. }
  9041. // prevent native HTML5 drag on interact.js target elements
  9042. Interaction.docEvents.dragstart = function preventNativeDrag(event) {
  9043. for (var _i2 = 0; _i2 < scope.interactions.length; _i2++) {
  9044. var _ref2;
  9045. _ref2 = scope.interactions[_i2];
  9046. var interaction = _ref2;
  9047. if (interaction.element && (interaction.element === event.target || nodeContains(interaction.element, event.target))) {
  9048. interaction.target.checkAndPreventDefault(event);
  9049. return;
  9050. }
  9051. }
  9052. };
  9053. },{"./Interactable":4,"./Interaction":5,"./scope":33,"./utils/browser":36,"./utils/domUtils":39,"./utils/events":40,"./utils/is":46}],23:[function(require,module,exports){
  9054. 'use strict';
  9055. var InteractEvent = require('../InteractEvent');
  9056. var Interaction = require('../Interaction');
  9057. var extend = require('../utils/extend');
  9058. var modifiers = {
  9059. names: [],
  9060. setOffsets: function setOffsets(arg) {
  9061. var interaction = arg.interaction,
  9062. page = arg.pageCoords;
  9063. var target = interaction.target,
  9064. element = interaction.element,
  9065. startOffset = interaction.startOffset;
  9066. var rect = target.getRect(element);
  9067. if (rect) {
  9068. startOffset.left = page.x - rect.left;
  9069. startOffset.top = page.y - rect.top;
  9070. startOffset.right = rect.right - page.x;
  9071. startOffset.bottom = rect.bottom - page.y;
  9072. if (!('width' in rect)) {
  9073. rect.width = rect.right - rect.left;
  9074. }
  9075. if (!('height' in rect)) {
  9076. rect.height = rect.bottom - rect.top;
  9077. }
  9078. } else {
  9079. startOffset.left = startOffset.top = startOffset.right = startOffset.bottom = 0;
  9080. }
  9081. arg.rect = rect;
  9082. arg.interactable = target;
  9083. arg.element = element;
  9084. for (var _i = 0; _i < modifiers.names.length; _i++) {
  9085. var _ref;
  9086. _ref = modifiers.names[_i];
  9087. var modifierName = _ref;
  9088. arg.options = target.options[interaction.prepared.name][modifierName];
  9089. if (!arg.options) {
  9090. continue;
  9091. }
  9092. interaction.modifierOffsets[modifierName] = modifiers[modifierName].setOffset(arg);
  9093. }
  9094. },
  9095. setAll: function setAll(arg) {
  9096. var interaction = arg.interaction,
  9097. statuses = arg.statuses,
  9098. preEnd = arg.preEnd,
  9099. requireEndOnly = arg.requireEndOnly;
  9100. var result = {
  9101. dx: 0,
  9102. dy: 0,
  9103. changed: false,
  9104. locked: false,
  9105. shouldMove: true
  9106. };
  9107. arg.modifiedCoords = extend({}, arg.pageCoords);
  9108. for (var _i2 = 0; _i2 < modifiers.names.length; _i2++) {
  9109. var _ref2;
  9110. _ref2 = modifiers.names[_i2];
  9111. var modifierName = _ref2;
  9112. var modifier = modifiers[modifierName];
  9113. var options = interaction.target.options[interaction.prepared.name][modifierName];
  9114. if (!shouldDo(options, preEnd, requireEndOnly)) {
  9115. continue;
  9116. }
  9117. arg.status = arg.status = statuses[modifierName];
  9118. arg.options = options;
  9119. arg.offset = arg.interaction.modifierOffsets[modifierName];
  9120. modifier.set(arg);
  9121. if (arg.status.locked) {
  9122. arg.modifiedCoords.x += arg.status.dx;
  9123. arg.modifiedCoords.y += arg.status.dy;
  9124. result.dx += arg.status.dx;
  9125. result.dy += arg.status.dy;
  9126. result.locked = true;
  9127. }
  9128. }
  9129. // a move should be fired if:
  9130. // - there are no modifiers enabled,
  9131. // - no modifiers are "locked" i.e. have changed the pointer's coordinates, or
  9132. // - the locked coords have changed since the last pointer move
  9133. result.shouldMove = !arg.status || !result.locked || arg.status.changed;
  9134. return result;
  9135. },
  9136. resetStatuses: function resetStatuses(statuses) {
  9137. for (var _i3 = 0; _i3 < modifiers.names.length; _i3++) {
  9138. var _ref3;
  9139. _ref3 = modifiers.names[_i3];
  9140. var modifierName = _ref3;
  9141. var status = statuses[modifierName] || {};
  9142. status.dx = status.dy = 0;
  9143. status.modifiedX = status.modifiedY = NaN;
  9144. status.locked = false;
  9145. status.changed = true;
  9146. statuses[modifierName] = status;
  9147. }
  9148. return statuses;
  9149. },
  9150. start: function start(_ref4, signalName) {
  9151. var interaction = _ref4.interaction;
  9152. var arg = {
  9153. interaction: interaction,
  9154. pageCoords: (signalName === 'action-resume' ? interaction.curCoords : interaction.startCoords).page,
  9155. startOffset: interaction.startOffset,
  9156. statuses: interaction.modifierStatuses,
  9157. preEnd: false,
  9158. requireEndOnly: false
  9159. };
  9160. modifiers.setOffsets(arg);
  9161. modifiers.resetStatuses(arg.statuses);
  9162. arg.pageCoords = extend({}, interaction.startCoords.page);
  9163. interaction.modifierResult = modifiers.setAll(arg);
  9164. },
  9165. beforeMove: function beforeMove(_ref5) {
  9166. var interaction = _ref5.interaction,
  9167. preEnd = _ref5.preEnd,
  9168. interactingBeforeMove = _ref5.interactingBeforeMove;
  9169. var modifierResult = modifiers.setAll({
  9170. interaction: interaction,
  9171. preEnd: preEnd,
  9172. pageCoords: interaction.curCoords.page,
  9173. statuses: interaction.modifierStatuses,
  9174. requireEndOnly: false
  9175. });
  9176. // don't fire an action move if a modifier would keep the event in the same
  9177. // cordinates as before
  9178. if (!modifierResult.shouldMove && interactingBeforeMove) {
  9179. interaction._dontFireMove = true;
  9180. }
  9181. interaction.modifierResult = modifierResult;
  9182. },
  9183. end: function end(_ref6) {
  9184. var interaction = _ref6.interaction,
  9185. event = _ref6.event;
  9186. for (var _i4 = 0; _i4 < modifiers.names.length; _i4++) {
  9187. var _ref7;
  9188. _ref7 = modifiers.names[_i4];
  9189. var modifierName = _ref7;
  9190. var options = interaction.target.options[interaction.prepared.name][modifierName];
  9191. // if the endOnly option is true for any modifier
  9192. if (shouldDo(options, true, true)) {
  9193. // fire a move event at the modified coordinates
  9194. interaction.doMove({ event: event, preEnd: true });
  9195. break;
  9196. }
  9197. }
  9198. },
  9199. setXY: function setXY(arg) {
  9200. var iEvent = arg.iEvent,
  9201. interaction = arg.interaction;
  9202. var modifierArg = extend({}, arg);
  9203. for (var i = 0; i < modifiers.names.length; i++) {
  9204. var modifierName = modifiers.names[i];
  9205. modifierArg.options = interaction.target.options[interaction.prepared.name][modifierName];
  9206. if (!modifierArg.options) {
  9207. continue;
  9208. }
  9209. var modifier = modifiers[modifierName];
  9210. modifierArg.status = interaction.modifierStatuses[modifierName];
  9211. iEvent[modifierName] = modifier.modifyCoords(modifierArg);
  9212. }
  9213. }
  9214. };
  9215. Interaction.signals.on('new', function (interaction) {
  9216. interaction.startOffset = { left: 0, right: 0, top: 0, bottom: 0 };
  9217. interaction.modifierOffsets = {};
  9218. interaction.modifierStatuses = modifiers.resetStatuses({});
  9219. interaction.modifierResult = null;
  9220. });
  9221. Interaction.signals.on('action-start', modifiers.start);
  9222. Interaction.signals.on('action-resume', modifiers.start);
  9223. Interaction.signals.on('before-action-move', modifiers.beforeMove);
  9224. Interaction.signals.on('action-end', modifiers.end);
  9225. InteractEvent.signals.on('set-xy', modifiers.setXY);
  9226. function shouldDo(options, preEnd, requireEndOnly) {
  9227. return options && options.enabled && (preEnd || !options.endOnly) && (!requireEndOnly || options.endOnly);
  9228. }
  9229. module.exports = modifiers;
  9230. },{"../InteractEvent":3,"../Interaction":5,"../utils/extend":41}],24:[function(require,module,exports){
  9231. 'use strict';
  9232. var modifiers = require('./base');
  9233. var utils = require('../utils');
  9234. var defaultOptions = require('../defaultOptions');
  9235. var restrict = {
  9236. defaults: {
  9237. enabled: false,
  9238. endOnly: false,
  9239. restriction: null,
  9240. elementRect: null
  9241. },
  9242. setOffset: function setOffset(_ref) {
  9243. var rect = _ref.rect,
  9244. startOffset = _ref.startOffset,
  9245. options = _ref.options;
  9246. var elementRect = options && options.elementRect;
  9247. var offset = {};
  9248. if (rect && elementRect) {
  9249. offset.left = startOffset.left - rect.width * elementRect.left;
  9250. offset.top = startOffset.top - rect.height * elementRect.top;
  9251. offset.right = startOffset.right - rect.width * (1 - elementRect.right);
  9252. offset.bottom = startOffset.bottom - rect.height * (1 - elementRect.bottom);
  9253. } else {
  9254. offset.left = offset.top = offset.right = offset.bottom = 0;
  9255. }
  9256. return offset;
  9257. },
  9258. set: function set(_ref2) {
  9259. var modifiedCoords = _ref2.modifiedCoords,
  9260. interaction = _ref2.interaction,
  9261. status = _ref2.status,
  9262. options = _ref2.options;
  9263. if (!options) {
  9264. return status;
  9265. }
  9266. var page = status.useStatusXY ? { x: status.x, y: status.y } : utils.extend({}, modifiedCoords);
  9267. var restriction = getRestrictionRect(options.restriction, interaction, page);
  9268. if (!restriction) {
  9269. return status;
  9270. }
  9271. status.dx = 0;
  9272. status.dy = 0;
  9273. status.locked = false;
  9274. var rect = restriction;
  9275. var modifiedX = page.x;
  9276. var modifiedY = page.y;
  9277. var offset = interaction.modifierOffsets.restrict;
  9278. // object is assumed to have
  9279. // x, y, width, height or
  9280. // left, top, right, bottom
  9281. if ('x' in restriction && 'y' in restriction) {
  9282. modifiedX = Math.max(Math.min(rect.x + rect.width - offset.right, page.x), rect.x + offset.left);
  9283. modifiedY = Math.max(Math.min(rect.y + rect.height - offset.bottom, page.y), rect.y + offset.top);
  9284. } else {
  9285. modifiedX = Math.max(Math.min(rect.right - offset.right, page.x), rect.left + offset.left);
  9286. modifiedY = Math.max(Math.min(rect.bottom - offset.bottom, page.y), rect.top + offset.top);
  9287. }
  9288. status.dx = modifiedX - page.x;
  9289. status.dy = modifiedY - page.y;
  9290. status.changed = status.modifiedX !== modifiedX || status.modifiedY !== modifiedY;
  9291. status.locked = !!(status.dx || status.dy);
  9292. status.modifiedX = modifiedX;
  9293. status.modifiedY = modifiedY;
  9294. },
  9295. modifyCoords: function modifyCoords(_ref3) {
  9296. var page = _ref3.page,
  9297. client = _ref3.client,
  9298. status = _ref3.status,
  9299. phase = _ref3.phase,
  9300. options = _ref3.options;
  9301. var elementRect = options && options.elementRect;
  9302. if (options && options.enabled && !(phase === 'start' && elementRect && status.locked)) {
  9303. if (status.locked) {
  9304. page.x += status.dx;
  9305. page.y += status.dy;
  9306. client.x += status.dx;
  9307. client.y += status.dy;
  9308. return {
  9309. dx: status.dx,
  9310. dy: status.dy
  9311. };
  9312. }
  9313. }
  9314. },
  9315. getRestrictionRect: getRestrictionRect
  9316. };
  9317. function getRestrictionRect(value, interaction, page) {
  9318. if (utils.is.function(value)) {
  9319. return utils.resolveRectLike(value, interaction.target, interaction.element, [page.x, page.y, interaction]);
  9320. } else {
  9321. return utils.resolveRectLike(value, interaction.target, interaction.element);
  9322. }
  9323. }
  9324. modifiers.restrict = restrict;
  9325. modifiers.names.push('restrict');
  9326. defaultOptions.perAction.restrict = restrict.defaults;
  9327. module.exports = restrict;
  9328. },{"../defaultOptions":18,"../utils":44,"./base":23}],25:[function(require,module,exports){
  9329. 'use strict';
  9330. // This module adds the options.resize.restrictEdges setting which sets min and
  9331. // max for the top, left, bottom and right edges of the target being resized.
  9332. //
  9333. // interact(target).resize({
  9334. // edges: { top: true, left: true },
  9335. // restrictEdges: {
  9336. // inner: { top: 200, left: 200, right: 400, bottom: 400 },
  9337. // outer: { top: 0, left: 0, right: 600, bottom: 600 },
  9338. // },
  9339. // });
  9340. var modifiers = require('./base');
  9341. var utils = require('../utils');
  9342. var rectUtils = require('../utils/rect');
  9343. var defaultOptions = require('../defaultOptions');
  9344. var resize = require('../actions/resize');
  9345. var _require = require('./restrict'),
  9346. getRestrictionRect = _require.getRestrictionRect;
  9347. var noInner = { top: +Infinity, left: +Infinity, bottom: -Infinity, right: -Infinity };
  9348. var noOuter = { top: -Infinity, left: -Infinity, bottom: +Infinity, right: +Infinity };
  9349. var restrictEdges = {
  9350. defaults: {
  9351. enabled: false,
  9352. endOnly: false,
  9353. min: null,
  9354. max: null,
  9355. offset: null
  9356. },
  9357. setOffset: function setOffset(_ref) {
  9358. var interaction = _ref.interaction,
  9359. startOffset = _ref.startOffset,
  9360. options = _ref.options;
  9361. if (!options) {
  9362. return utils.extend({}, startOffset);
  9363. }
  9364. var offset = getRestrictionRect(options.offset, interaction, interaction.startCoords.page);
  9365. if (offset) {
  9366. return {
  9367. top: startOffset.top + offset.y,
  9368. left: startOffset.left + offset.x,
  9369. bottom: startOffset.bottom + offset.y,
  9370. right: startOffset.right + offset.x
  9371. };
  9372. }
  9373. return startOffset;
  9374. },
  9375. set: function set(_ref2) {
  9376. var modifiedCoords = _ref2.modifiedCoords,
  9377. interaction = _ref2.interaction,
  9378. status = _ref2.status,
  9379. offset = _ref2.offset,
  9380. options = _ref2.options;
  9381. var edges = interaction.prepared.linkedEdges || interaction.prepared.edges;
  9382. if (!interaction.interacting() || !edges) {
  9383. return;
  9384. }
  9385. var page = status.useStatusXY ? { x: status.x, y: status.y } : utils.extend({}, modifiedCoords);
  9386. var inner = rectUtils.xywhToTlbr(getRestrictionRect(options.inner, interaction, page)) || noInner;
  9387. var outer = rectUtils.xywhToTlbr(getRestrictionRect(options.outer, interaction, page)) || noOuter;
  9388. var modifiedX = page.x;
  9389. var modifiedY = page.y;
  9390. status.dx = 0;
  9391. status.dy = 0;
  9392. status.locked = false;
  9393. if (edges.top) {
  9394. modifiedY = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top);
  9395. } else if (edges.bottom) {
  9396. modifiedY = Math.max(Math.min(outer.bottom - offset.bottom, page.y), inner.bottom - offset.bottom);
  9397. }
  9398. if (edges.left) {
  9399. modifiedX = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left);
  9400. } else if (edges.right) {
  9401. modifiedX = Math.max(Math.min(outer.right - offset.right, page.x), inner.right - offset.right);
  9402. }
  9403. status.dx = modifiedX - page.x;
  9404. status.dy = modifiedY - page.y;
  9405. status.changed = status.modifiedX !== modifiedX || status.modifiedY !== modifiedY;
  9406. status.locked = !!(status.dx || status.dy);
  9407. status.modifiedX = modifiedX;
  9408. status.modifiedY = modifiedY;
  9409. },
  9410. modifyCoords: function modifyCoords(_ref3) {
  9411. var page = _ref3.page,
  9412. client = _ref3.client,
  9413. status = _ref3.status,
  9414. phase = _ref3.phase,
  9415. options = _ref3.options;
  9416. if (options && options.enabled && !(phase === 'start' && status.locked)) {
  9417. if (status.locked) {
  9418. page.x += status.dx;
  9419. page.y += status.dy;
  9420. client.x += status.dx;
  9421. client.y += status.dy;
  9422. return {
  9423. dx: status.dx,
  9424. dy: status.dy
  9425. };
  9426. }
  9427. }
  9428. },
  9429. noInner: noInner,
  9430. noOuter: noOuter,
  9431. getRestrictionRect: getRestrictionRect
  9432. };
  9433. modifiers.restrictEdges = restrictEdges;
  9434. modifiers.names.push('restrictEdges');
  9435. defaultOptions.perAction.restrictEdges = restrictEdges.defaults;
  9436. resize.defaults.restrictEdges = restrictEdges.defaults;
  9437. module.exports = restrictEdges;
  9438. },{"../actions/resize":10,"../defaultOptions":18,"../utils":44,"../utils/rect":51,"./base":23,"./restrict":24}],26:[function(require,module,exports){
  9439. 'use strict';
  9440. // This module adds the options.resize.restrictSize setting which sets min and
  9441. // max width and height for the target being resized.
  9442. //
  9443. // interact(target).resize({
  9444. // edges: { top: true, left: true },
  9445. // restrictSize: {
  9446. // min: { width: -600, height: -600 },
  9447. // max: { width: 600, height: 600 },
  9448. // },
  9449. // });
  9450. var modifiers = require('./base');
  9451. var restrictEdges = require('./restrictEdges');
  9452. var utils = require('../utils');
  9453. var rectUtils = require('../utils/rect');
  9454. var defaultOptions = require('../defaultOptions');
  9455. var resize = require('../actions/resize');
  9456. var noMin = { width: -Infinity, height: -Infinity };
  9457. var noMax = { width: +Infinity, height: +Infinity };
  9458. var restrictSize = {
  9459. defaults: {
  9460. enabled: false,
  9461. endOnly: false,
  9462. min: null,
  9463. max: null
  9464. },
  9465. setOffset: function setOffset(_ref) {
  9466. var interaction = _ref.interaction;
  9467. return interaction.startOffset;
  9468. },
  9469. set: function set(arg) {
  9470. var interaction = arg.interaction,
  9471. options = arg.options;
  9472. var edges = interaction.prepared.linkedEdges || interaction.prepared.edges;
  9473. if (!interaction.interacting() || !edges) {
  9474. return;
  9475. }
  9476. var rect = rectUtils.xywhToTlbr(interaction.resizeRects.inverted);
  9477. var minSize = rectUtils.tlbrToXywh(restrictEdges.getRestrictionRect(options.min, interaction)) || noMin;
  9478. var maxSize = rectUtils.tlbrToXywh(restrictEdges.getRestrictionRect(options.max, interaction)) || noMax;
  9479. arg.options = {
  9480. enabled: options.enabled,
  9481. endOnly: options.endOnly,
  9482. inner: utils.extend({}, restrictEdges.noInner),
  9483. outer: utils.extend({}, restrictEdges.noOuter)
  9484. };
  9485. if (edges.top) {
  9486. arg.options.inner.top = rect.bottom - minSize.height;
  9487. arg.options.outer.top = rect.bottom - maxSize.height;
  9488. } else if (edges.bottom) {
  9489. arg.options.inner.bottom = rect.top + minSize.height;
  9490. arg.options.outer.bottom = rect.top + maxSize.height;
  9491. }
  9492. if (edges.left) {
  9493. arg.options.inner.left = rect.right - minSize.width;
  9494. arg.options.outer.left = rect.right - maxSize.width;
  9495. } else if (edges.right) {
  9496. arg.options.inner.right = rect.left + minSize.width;
  9497. arg.options.outer.right = rect.left + maxSize.width;
  9498. }
  9499. restrictEdges.set(arg);
  9500. },
  9501. modifyCoords: restrictEdges.modifyCoords
  9502. };
  9503. modifiers.restrictSize = restrictSize;
  9504. modifiers.names.push('restrictSize');
  9505. defaultOptions.perAction.restrictSize = restrictSize.defaults;
  9506. resize.defaults.restrictSize = restrictSize.defaults;
  9507. module.exports = restrictSize;
  9508. },{"../actions/resize":10,"../defaultOptions":18,"../utils":44,"../utils/rect":51,"./base":23,"./restrictEdges":25}],27:[function(require,module,exports){
  9509. 'use strict';
  9510. var modifiers = require('./base');
  9511. var interact = require('../interact');
  9512. var utils = require('../utils');
  9513. var defaultOptions = require('../defaultOptions');
  9514. var snap = {
  9515. defaults: {
  9516. enabled: false,
  9517. endOnly: false,
  9518. range: Infinity,
  9519. targets: null,
  9520. offsets: null,
  9521. relativePoints: null
  9522. },
  9523. setOffset: function setOffset(_ref) {
  9524. var interaction = _ref.interaction,
  9525. interactable = _ref.interactable,
  9526. element = _ref.element,
  9527. rect = _ref.rect,
  9528. startOffset = _ref.startOffset,
  9529. options = _ref.options;
  9530. var offsets = [];
  9531. var optionsOrigin = utils.rectToXY(utils.resolveRectLike(options.origin));
  9532. var origin = optionsOrigin || utils.getOriginXY(interactable, element, interaction.prepared.name);
  9533. options = options || interactable.options[interaction.prepared.name].snap || {};
  9534. var snapOffset = void 0;
  9535. if (options.offset === 'startCoords') {
  9536. snapOffset = {
  9537. x: interaction.startCoords.page.x - origin.x,
  9538. y: interaction.startCoords.page.y - origin.y
  9539. };
  9540. } else {
  9541. var offsetRect = utils.resolveRectLike(options.offset, interactable, element, [interaction]);
  9542. snapOffset = utils.rectToXY(offsetRect) || { x: 0, y: 0 };
  9543. }
  9544. if (rect && options.relativePoints && options.relativePoints.length) {
  9545. for (var _i = 0; _i < options.relativePoints.length; _i++) {
  9546. var _ref3;
  9547. _ref3 = options.relativePoints[_i];
  9548. var _ref2 = _ref3;
  9549. var relativeX = _ref2.x;
  9550. var relativeY = _ref2.y;
  9551. offsets.push({
  9552. x: startOffset.left - rect.width * relativeX + snapOffset.x,
  9553. y: startOffset.top - rect.height * relativeY + snapOffset.y
  9554. });
  9555. }
  9556. } else {
  9557. offsets.push(snapOffset);
  9558. }
  9559. return offsets;
  9560. },
  9561. set: function set(_ref4) {
  9562. var interaction = _ref4.interaction,
  9563. modifiedCoords = _ref4.modifiedCoords,
  9564. status = _ref4.status,
  9565. options = _ref4.options,
  9566. offsets = _ref4.offset;
  9567. var targets = [];
  9568. var target = void 0;
  9569. var page = void 0;
  9570. var i = void 0;
  9571. if (status.useStatusXY) {
  9572. page = { x: status.x, y: status.y };
  9573. } else {
  9574. var origin = utils.getOriginXY(interaction.target, interaction.element, interaction.prepared.name);
  9575. page = utils.extend({}, modifiedCoords);
  9576. page.x -= origin.x;
  9577. page.y -= origin.y;
  9578. }
  9579. status.realX = page.x;
  9580. status.realY = page.y;
  9581. var len = options.targets ? options.targets.length : 0;
  9582. for (var _i2 = 0; _i2 < offsets.length; _i2++) {
  9583. var _ref6;
  9584. _ref6 = offsets[_i2];
  9585. var _ref5 = _ref6;
  9586. var offsetX = _ref5.x;
  9587. var offsetY = _ref5.y;
  9588. var relativeX = page.x - offsetX;
  9589. var relativeY = page.y - offsetY;
  9590. for (var _i3 = 0; _i3 < (options.targets || []).length; _i3++) {
  9591. var _ref7;
  9592. _ref7 = (options.targets || [])[_i3];
  9593. var snapTarget = _ref7;
  9594. if (utils.is.function(snapTarget)) {
  9595. target = snapTarget(relativeX, relativeY, interaction);
  9596. } else {
  9597. target = snapTarget;
  9598. }
  9599. if (!target) {
  9600. continue;
  9601. }
  9602. targets.push({
  9603. x: utils.is.number(target.x) ? target.x + offsetX : relativeX,
  9604. y: utils.is.number(target.y) ? target.y + offsetY : relativeY,
  9605. range: utils.is.number(target.range) ? target.range : options.range
  9606. });
  9607. }
  9608. }
  9609. var closest = {
  9610. target: null,
  9611. inRange: false,
  9612. distance: 0,
  9613. range: 0,
  9614. dx: 0,
  9615. dy: 0
  9616. };
  9617. for (i = 0, len = targets.length; i < len; i++) {
  9618. target = targets[i];
  9619. var range = target.range;
  9620. var dx = target.x - page.x;
  9621. var dy = target.y - page.y;
  9622. var distance = utils.hypot(dx, dy);
  9623. var inRange = distance <= range;
  9624. // Infinite targets count as being out of range
  9625. // compared to non infinite ones that are in range
  9626. if (range === Infinity && closest.inRange && closest.range !== Infinity) {
  9627. inRange = false;
  9628. }
  9629. if (!closest.target || (inRange
  9630. // is the closest target in range?
  9631. ? closest.inRange && range !== Infinity
  9632. // the pointer is relatively deeper in this target
  9633. ? distance / range < closest.distance / closest.range
  9634. // this target has Infinite range and the closest doesn't
  9635. : range === Infinity && closest.range !== Infinity ||
  9636. // OR this target is closer that the previous closest
  9637. distance < closest.distance :
  9638. // The other is not in range and the pointer is closer to this target
  9639. !closest.inRange && distance < closest.distance)) {
  9640. closest.target = target;
  9641. closest.distance = distance;
  9642. closest.range = range;
  9643. closest.inRange = inRange;
  9644. closest.dx = dx;
  9645. closest.dy = dy;
  9646. status.range = range;
  9647. }
  9648. }
  9649. var snapChanged = void 0;
  9650. if (closest.target) {
  9651. snapChanged = status.modifiedX !== closest.target.x || status.modifiedY !== closest.target.y;
  9652. status.modifiedX = closest.target.x;
  9653. status.modifiedY = closest.target.y;
  9654. } else {
  9655. snapChanged = true;
  9656. status.modifiedX = NaN;
  9657. status.modifiedY = NaN;
  9658. }
  9659. status.dx = closest.dx;
  9660. status.dy = closest.dy;
  9661. status.changed = snapChanged || closest.inRange && !status.locked;
  9662. status.locked = closest.inRange;
  9663. },
  9664. modifyCoords: function modifyCoords(_ref8) {
  9665. var page = _ref8.page,
  9666. client = _ref8.client,
  9667. status = _ref8.status,
  9668. phase = _ref8.phase,
  9669. options = _ref8.options;
  9670. var relativePoints = options && options.relativePoints;
  9671. if (options && options.enabled && !(phase === 'start' && relativePoints && relativePoints.length)) {
  9672. if (status.locked) {
  9673. page.x += status.dx;
  9674. page.y += status.dy;
  9675. client.x += status.dx;
  9676. client.y += status.dy;
  9677. }
  9678. return {
  9679. range: status.range,
  9680. locked: status.locked,
  9681. x: status.modifiedX,
  9682. y: status.modifiedY,
  9683. realX: status.realX,
  9684. realY: status.realY,
  9685. dx: status.dx,
  9686. dy: status.dy
  9687. };
  9688. }
  9689. }
  9690. };
  9691. interact.createSnapGrid = function (grid) {
  9692. return function (x, y) {
  9693. var limits = grid.limits || {
  9694. left: -Infinity,
  9695. right: Infinity,
  9696. top: -Infinity,
  9697. bottom: Infinity
  9698. };
  9699. var offsetX = 0;
  9700. var offsetY = 0;
  9701. if (utils.is.object(grid.offset)) {
  9702. offsetX = grid.offset.x;
  9703. offsetY = grid.offset.y;
  9704. }
  9705. var gridx = Math.round((x - offsetX) / grid.x);
  9706. var gridy = Math.round((y - offsetY) / grid.y);
  9707. var newX = Math.max(limits.left, Math.min(limits.right, gridx * grid.x + offsetX));
  9708. var newY = Math.max(limits.top, Math.min(limits.bottom, gridy * grid.y + offsetY));
  9709. return {
  9710. x: newX,
  9711. y: newY,
  9712. range: grid.range
  9713. };
  9714. };
  9715. };
  9716. modifiers.snap = snap;
  9717. modifiers.names.push('snap');
  9718. defaultOptions.perAction.snap = snap.defaults;
  9719. module.exports = snap;
  9720. },{"../defaultOptions":18,"../interact":21,"../utils":44,"./base":23}],28:[function(require,module,exports){
  9721. 'use strict';
  9722. // This module allows snapping of the size of targets during resize
  9723. // interactions.
  9724. var modifiers = require('./base');
  9725. var snap = require('./snap');
  9726. var defaultOptions = require('../defaultOptions');
  9727. var resize = require('../actions/resize');
  9728. var utils = require('../utils/');
  9729. var snapSize = {
  9730. defaults: {
  9731. enabled: false,
  9732. endOnly: false,
  9733. range: Infinity,
  9734. targets: null,
  9735. offsets: null
  9736. },
  9737. setOffset: function setOffset(arg) {
  9738. var interaction = arg.interaction,
  9739. options = arg.options;
  9740. var edges = interaction.prepared.edges;
  9741. if (!edges) {
  9742. return;
  9743. }
  9744. arg.options = {
  9745. relativePoints: [{
  9746. x: edges.left ? 0 : 1,
  9747. y: edges.top ? 0 : 1
  9748. }],
  9749. origin: { x: 0, y: 0 },
  9750. offset: 'self',
  9751. range: options.range
  9752. };
  9753. var offsets = snap.setOffset(arg);
  9754. arg.options = options;
  9755. return offsets;
  9756. },
  9757. set: function set(arg) {
  9758. var interaction = arg.interaction,
  9759. options = arg.options,
  9760. offset = arg.offset,
  9761. modifiedCoords = arg.modifiedCoords;
  9762. var page = utils.extend({}, modifiedCoords);
  9763. var relativeX = page.x - offset[0].x;
  9764. var relativeY = page.y - offset[0].y;
  9765. arg.options = utils.extend({}, options);
  9766. arg.options.targets = [];
  9767. for (var _i = 0; _i < (options.targets || []).length; _i++) {
  9768. var _ref;
  9769. _ref = (options.targets || [])[_i];
  9770. var snapTarget = _ref;
  9771. var target = void 0;
  9772. if (utils.is.function(snapTarget)) {
  9773. target = snapTarget(relativeX, relativeY, interaction);
  9774. } else {
  9775. target = snapTarget;
  9776. }
  9777. if (!target) {
  9778. continue;
  9779. }
  9780. if ('width' in target && 'height' in target) {
  9781. target.x = target.width;
  9782. target.y = target.height;
  9783. }
  9784. arg.options.targets.push(target);
  9785. }
  9786. snap.set(arg);
  9787. },
  9788. modifyCoords: function modifyCoords(arg) {
  9789. var options = arg.options;
  9790. arg.options = utils.extend({}, options);
  9791. arg.options.enabled = options.enabled;
  9792. arg.options.relativePoints = [null];
  9793. snap.modifyCoords(arg);
  9794. }
  9795. };
  9796. modifiers.snapSize = snapSize;
  9797. modifiers.names.push('snapSize');
  9798. defaultOptions.perAction.snapSize = snapSize.defaults;
  9799. resize.defaults.snapSize = snapSize.defaults;
  9800. module.exports = snapSize;
  9801. },{"../actions/resize":10,"../defaultOptions":18,"../utils/":44,"./base":23,"./snap":27}],29:[function(require,module,exports){
  9802. 'use strict';
  9803. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9804. var pointerUtils = require('../utils/pointerUtils');
  9805. module.exports = function () {
  9806. /** */
  9807. function PointerEvent(type, pointer, event, eventTarget, interaction) {
  9808. _classCallCheck(this, PointerEvent);
  9809. pointerUtils.pointerExtend(this, event);
  9810. if (event !== pointer) {
  9811. pointerUtils.pointerExtend(this, pointer);
  9812. }
  9813. this.interaction = interaction;
  9814. this.timeStamp = new Date().getTime();
  9815. this.originalEvent = event;
  9816. this.type = type;
  9817. this.pointerId = pointerUtils.getPointerId(pointer);
  9818. this.pointerType = pointerUtils.getPointerType(pointer);
  9819. this.target = eventTarget;
  9820. this.currentTarget = null;
  9821. if (type === 'tap') {
  9822. var pointerIndex = interaction.getPointerIndex(pointer);
  9823. this.dt = this.timeStamp - interaction.downTimes[pointerIndex];
  9824. var interval = this.timeStamp - interaction.tapTime;
  9825. this.double = !!(interaction.prevTap && interaction.prevTap.type !== 'doubletap' && interaction.prevTap.target === this.target && interval < 500);
  9826. } else if (type === 'doubletap') {
  9827. this.dt = pointer.timeStamp - interaction.tapTime;
  9828. }
  9829. }
  9830. PointerEvent.prototype.subtractOrigin = function subtractOrigin(_ref) {
  9831. var originX = _ref.x,
  9832. originY = _ref.y;
  9833. this.pageX -= originX;
  9834. this.pageY -= originY;
  9835. this.clientX -= originX;
  9836. this.clientY -= originY;
  9837. return this;
  9838. };
  9839. PointerEvent.prototype.addOrigin = function addOrigin(_ref2) {
  9840. var originX = _ref2.x,
  9841. originY = _ref2.y;
  9842. this.pageX += originX;
  9843. this.pageY += originY;
  9844. this.clientX += originX;
  9845. this.clientY += originY;
  9846. return this;
  9847. };
  9848. /** */
  9849. PointerEvent.prototype.preventDefault = function preventDefault() {
  9850. this.originalEvent.preventDefault();
  9851. };
  9852. /** */
  9853. PointerEvent.prototype.stopPropagation = function stopPropagation() {
  9854. this.propagationStopped = true;
  9855. };
  9856. /** */
  9857. PointerEvent.prototype.stopImmediatePropagation = function stopImmediatePropagation() {
  9858. this.immediatePropagationStopped = this.propagationStopped = true;
  9859. };
  9860. return PointerEvent;
  9861. }();
  9862. },{"../utils/pointerUtils":49}],30:[function(require,module,exports){
  9863. 'use strict';
  9864. var PointerEvent = require('./PointerEvent');
  9865. var Interaction = require('../Interaction');
  9866. var utils = require('../utils');
  9867. var defaults = require('../defaultOptions');
  9868. var signals = require('../utils/Signals').new();
  9869. var simpleSignals = ['down', 'up', 'cancel'];
  9870. var simpleEvents = ['down', 'up', 'cancel'];
  9871. var pointerEvents = {
  9872. PointerEvent: PointerEvent,
  9873. fire: fire,
  9874. collectEventTargets: collectEventTargets,
  9875. signals: signals,
  9876. defaults: {
  9877. holdDuration: 600,
  9878. ignoreFrom: null,
  9879. allowFrom: null,
  9880. origin: { x: 0, y: 0 }
  9881. },
  9882. types: ['down', 'move', 'up', 'cancel', 'tap', 'doubletap', 'hold']
  9883. };
  9884. function fire(arg) {
  9885. var interaction = arg.interaction,
  9886. pointer = arg.pointer,
  9887. event = arg.event,
  9888. eventTarget = arg.eventTarget,
  9889. _arg$type = arg.type,
  9890. type = _arg$type === undefined ? arg.pointerEvent.type : _arg$type,
  9891. _arg$targets = arg.targets,
  9892. targets = _arg$targets === undefined ? collectEventTargets(arg) : _arg$targets,
  9893. _arg$pointerEvent = arg.pointerEvent,
  9894. pointerEvent = _arg$pointerEvent === undefined ? new PointerEvent(type, pointer, event, eventTarget, interaction) : _arg$pointerEvent;
  9895. var signalArg = {
  9896. interaction: interaction,
  9897. pointer: pointer,
  9898. event: event,
  9899. eventTarget: eventTarget,
  9900. targets: targets,
  9901. type: type,
  9902. pointerEvent: pointerEvent
  9903. };
  9904. for (var i = 0; i < targets.length; i++) {
  9905. var target = targets[i];
  9906. for (var prop in target.props || {}) {
  9907. pointerEvent[prop] = target.props[prop];
  9908. }
  9909. var origin = utils.getOriginXY(target.eventable, target.element);
  9910. pointerEvent.subtractOrigin(origin);
  9911. pointerEvent.eventable = target.eventable;
  9912. pointerEvent.currentTarget = target.element;
  9913. target.eventable.fire(pointerEvent);
  9914. pointerEvent.addOrigin(origin);
  9915. if (pointerEvent.immediatePropagationStopped || pointerEvent.propagationStopped && i + 1 < targets.length && targets[i + 1].element !== pointerEvent.currentTarget) {
  9916. break;
  9917. }
  9918. }
  9919. signals.fire('fired', signalArg);
  9920. if (type === 'tap') {
  9921. // if pointerEvent should make a double tap, create and fire a doubletap
  9922. // PointerEvent and use that as the prevTap
  9923. var prevTap = pointerEvent.double ? fire({
  9924. interaction: interaction, pointer: pointer, event: event, eventTarget: eventTarget,
  9925. type: 'doubletap'
  9926. }) : pointerEvent;
  9927. interaction.prevTap = prevTap;
  9928. interaction.tapTime = prevTap.timeStamp;
  9929. }
  9930. return pointerEvent;
  9931. }
  9932. function collectEventTargets(_ref) {
  9933. var interaction = _ref.interaction,
  9934. pointer = _ref.pointer,
  9935. event = _ref.event,
  9936. eventTarget = _ref.eventTarget,
  9937. type = _ref.type;
  9938. var pointerIndex = interaction.getPointerIndex(pointer);
  9939. // do not fire a tap event if the pointer was moved before being lifted
  9940. if (type === 'tap' && (interaction.pointerWasMoved
  9941. // or if the pointerup target is different to the pointerdown target
  9942. || !(interaction.downTargets[pointerIndex] && interaction.downTargets[pointerIndex] === eventTarget))) {
  9943. return [];
  9944. }
  9945. var path = utils.getPath(eventTarget);
  9946. var signalArg = {
  9947. interaction: interaction,
  9948. pointer: pointer,
  9949. event: event,
  9950. eventTarget: eventTarget,
  9951. type: type,
  9952. path: path,
  9953. targets: [],
  9954. element: null
  9955. };
  9956. for (var _i = 0; _i < path.length; _i++) {
  9957. var _ref2;
  9958. _ref2 = path[_i];
  9959. var element = _ref2;
  9960. signalArg.element = element;
  9961. signals.fire('collect-targets', signalArg);
  9962. }
  9963. if (type === 'hold') {
  9964. signalArg.targets = signalArg.targets.filter(function (target) {
  9965. return target.eventable.options.holdDuration === interaction.holdTimers[pointerIndex].duration;
  9966. });
  9967. }
  9968. return signalArg.targets;
  9969. }
  9970. Interaction.signals.on('update-pointer-down', function (_ref3) {
  9971. var interaction = _ref3.interaction,
  9972. pointerIndex = _ref3.pointerIndex;
  9973. interaction.holdTimers[pointerIndex] = { duration: Infinity, timeout: null };
  9974. });
  9975. Interaction.signals.on('remove-pointer', function (_ref4) {
  9976. var interaction = _ref4.interaction,
  9977. pointerIndex = _ref4.pointerIndex;
  9978. interaction.holdTimers.splice(pointerIndex, 1);
  9979. });
  9980. Interaction.signals.on('move', function (_ref5) {
  9981. var interaction = _ref5.interaction,
  9982. pointer = _ref5.pointer,
  9983. event = _ref5.event,
  9984. eventTarget = _ref5.eventTarget,
  9985. duplicateMove = _ref5.duplicateMove;
  9986. var pointerIndex = interaction.getPointerIndex(pointer);
  9987. if (!duplicateMove && (!interaction.pointerIsDown || interaction.pointerWasMoved)) {
  9988. if (interaction.pointerIsDown) {
  9989. clearTimeout(interaction.holdTimers[pointerIndex].timeout);
  9990. }
  9991. fire({
  9992. interaction: interaction, pointer: pointer, event: event, eventTarget: eventTarget,
  9993. type: 'move'
  9994. });
  9995. }
  9996. });
  9997. Interaction.signals.on('down', function (_ref6) {
  9998. var interaction = _ref6.interaction,
  9999. pointer = _ref6.pointer,
  10000. event = _ref6.event,
  10001. eventTarget = _ref6.eventTarget,
  10002. pointerIndex = _ref6.pointerIndex;
  10003. var timer = interaction.holdTimers[pointerIndex];
  10004. var path = utils.getPath(eventTarget);
  10005. var signalArg = {
  10006. interaction: interaction,
  10007. pointer: pointer,
  10008. event: event,
  10009. eventTarget: eventTarget,
  10010. type: 'hold',
  10011. targets: [],
  10012. path: path,
  10013. element: null
  10014. };
  10015. for (var _i2 = 0; _i2 < path.length; _i2++) {
  10016. var _ref7;
  10017. _ref7 = path[_i2];
  10018. var element = _ref7;
  10019. signalArg.element = element;
  10020. signals.fire('collect-targets', signalArg);
  10021. }
  10022. if (!signalArg.targets.length) {
  10023. return;
  10024. }
  10025. var minDuration = Infinity;
  10026. for (var _i3 = 0; _i3 < signalArg.targets.length; _i3++) {
  10027. var _ref8;
  10028. _ref8 = signalArg.targets[_i3];
  10029. var target = _ref8;
  10030. var holdDuration = target.eventable.options.holdDuration;
  10031. if (holdDuration < minDuration) {
  10032. minDuration = holdDuration;
  10033. }
  10034. }
  10035. timer.duration = minDuration;
  10036. timer.timeout = setTimeout(function () {
  10037. fire({
  10038. interaction: interaction,
  10039. eventTarget: eventTarget,
  10040. pointer: pointer,
  10041. event: event,
  10042. type: 'hold'
  10043. });
  10044. }, minDuration);
  10045. });
  10046. Interaction.signals.on('up', function (_ref9) {
  10047. var interaction = _ref9.interaction,
  10048. pointer = _ref9.pointer,
  10049. event = _ref9.event,
  10050. eventTarget = _ref9.eventTarget;
  10051. if (!interaction.pointerWasMoved) {
  10052. fire({ interaction: interaction, eventTarget: eventTarget, pointer: pointer, event: event, type: 'tap' });
  10053. }
  10054. });
  10055. var _arr = ['up', 'cancel'];
  10056. for (var _i4 = 0; _i4 < _arr.length; _i4++) {
  10057. var signalName = _arr[_i4];
  10058. Interaction.signals.on(signalName, function (_ref11) {
  10059. var interaction = _ref11.interaction,
  10060. pointerIndex = _ref11.pointerIndex;
  10061. if (interaction.holdTimers[pointerIndex]) {
  10062. clearTimeout(interaction.holdTimers[pointerIndex].timeout);
  10063. }
  10064. });
  10065. }
  10066. function createSignalListener(type) {
  10067. return function (_ref10) {
  10068. var interaction = _ref10.interaction,
  10069. pointer = _ref10.pointer,
  10070. event = _ref10.event,
  10071. eventTarget = _ref10.eventTarget;
  10072. fire({ interaction: interaction, eventTarget: eventTarget, pointer: pointer, event: event, type: type });
  10073. };
  10074. }
  10075. for (var i = 0; i < simpleSignals.length; i++) {
  10076. Interaction.signals.on(simpleSignals[i], createSignalListener(simpleEvents[i]));
  10077. }
  10078. Interaction.signals.on('new', function (interaction) {
  10079. interaction.prevTap = null; // the most recent tap event on this interaction
  10080. interaction.tapTime = 0; // time of the most recent tap event
  10081. interaction.holdTimers = []; // [{ duration, timeout }]
  10082. });
  10083. defaults.pointerEvents = pointerEvents.defaults;
  10084. module.exports = pointerEvents;
  10085. },{"../Interaction":5,"../defaultOptions":18,"../utils":44,"../utils/Signals":34,"./PointerEvent":29}],31:[function(require,module,exports){
  10086. 'use strict';
  10087. var pointerEvents = require('./base');
  10088. var Interaction = require('../Interaction');
  10089. pointerEvents.signals.on('new', onNew);
  10090. pointerEvents.signals.on('fired', onFired);
  10091. var _arr = ['move', 'up', 'cancel', 'endall'];
  10092. for (var _i = 0; _i < _arr.length; _i++) {
  10093. var signal = _arr[_i];
  10094. Interaction.signals.on(signal, endHoldRepeat);
  10095. }
  10096. function onNew(_ref) {
  10097. var pointerEvent = _ref.pointerEvent;
  10098. if (pointerEvent.type !== 'hold') {
  10099. return;
  10100. }
  10101. pointerEvent.count = (pointerEvent.count || 0) + 1;
  10102. }
  10103. function onFired(_ref2) {
  10104. var interaction = _ref2.interaction,
  10105. pointerEvent = _ref2.pointerEvent,
  10106. eventTarget = _ref2.eventTarget,
  10107. targets = _ref2.targets;
  10108. if (pointerEvent.type !== 'hold' || !targets.length) {
  10109. return;
  10110. }
  10111. // get the repeat interval from the first eventable
  10112. var interval = targets[0].eventable.options.holdRepeatInterval;
  10113. // don't repeat if the interval is 0 or less
  10114. if (interval <= 0) {
  10115. return;
  10116. }
  10117. // set a timeout to fire the holdrepeat event
  10118. interaction.holdIntervalHandle = setTimeout(function () {
  10119. pointerEvents.fire({
  10120. interaction: interaction,
  10121. eventTarget: eventTarget,
  10122. type: 'hold',
  10123. pointer: pointerEvent,
  10124. event: pointerEvent
  10125. });
  10126. }, interval);
  10127. }
  10128. function endHoldRepeat(_ref3) {
  10129. var interaction = _ref3.interaction;
  10130. // set the interaction's holdStopTime property
  10131. // to stop further holdRepeat events
  10132. if (interaction.holdIntervalHandle) {
  10133. clearInterval(interaction.holdIntervalHandle);
  10134. interaction.holdIntervalHandle = null;
  10135. }
  10136. }
  10137. // don't repeat by default
  10138. pointerEvents.defaults.holdRepeatInterval = 0;
  10139. pointerEvents.types.push('holdrepeat');
  10140. module.exports = {
  10141. onNew: onNew,
  10142. onFired: onFired,
  10143. endHoldRepeat: endHoldRepeat
  10144. };
  10145. },{"../Interaction":5,"./base":30}],32:[function(require,module,exports){
  10146. 'use strict';
  10147. var pointerEvents = require('./base');
  10148. var Interactable = require('../Interactable');
  10149. var is = require('../utils/is');
  10150. var scope = require('../scope');
  10151. var extend = require('../utils/extend');
  10152. var _require = require('../utils/arr'),
  10153. merge = _require.merge;
  10154. pointerEvents.signals.on('collect-targets', function (_ref) {
  10155. var targets = _ref.targets,
  10156. element = _ref.element,
  10157. type = _ref.type,
  10158. eventTarget = _ref.eventTarget;
  10159. scope.interactables.forEachMatch(element, function (interactable) {
  10160. var eventable = interactable.events;
  10161. var options = eventable.options;
  10162. if (eventable[type] && is.element(element) && interactable.testIgnoreAllow(options, element, eventTarget)) {
  10163. targets.push({
  10164. element: element,
  10165. eventable: eventable,
  10166. props: { interactable: interactable }
  10167. });
  10168. }
  10169. });
  10170. });
  10171. Interactable.signals.on('new', function (_ref2) {
  10172. var interactable = _ref2.interactable;
  10173. interactable.events.getRect = function (element) {
  10174. return interactable.getRect(element);
  10175. };
  10176. });
  10177. Interactable.signals.on('set', function (_ref3) {
  10178. var interactable = _ref3.interactable,
  10179. options = _ref3.options;
  10180. extend(interactable.events.options, pointerEvents.defaults);
  10181. extend(interactable.events.options, options);
  10182. });
  10183. merge(Interactable.eventTypes, pointerEvents.types);
  10184. Interactable.prototype.pointerEvents = function (options) {
  10185. extend(this.events.options, options);
  10186. return this;
  10187. };
  10188. var __backCompatOption = Interactable.prototype._backCompatOption;
  10189. Interactable.prototype._backCompatOption = function (optionName, newValue) {
  10190. var ret = __backCompatOption.call(this, optionName, newValue);
  10191. if (ret === this) {
  10192. this.events.options[optionName] = newValue;
  10193. }
  10194. return ret;
  10195. };
  10196. Interactable.settingsMethods.push('pointerEvents');
  10197. },{"../Interactable":4,"../scope":33,"../utils/arr":35,"../utils/extend":41,"../utils/is":46,"./base":30}],33:[function(require,module,exports){
  10198. 'use strict';
  10199. var utils = require('./utils');
  10200. var events = require('./utils/events');
  10201. var signals = require('./utils/Signals').new();
  10202. var _require = require('./utils/window'),
  10203. getWindow = _require.getWindow;
  10204. var scope = {
  10205. signals: signals,
  10206. events: events,
  10207. utils: utils,
  10208. // main document
  10209. document: require('./utils/domObjects').document,
  10210. // all documents being listened to
  10211. documents: [],
  10212. addDocument: function addDocument(doc, win) {
  10213. // do nothing if document is already known
  10214. if (utils.contains(scope.documents, doc)) {
  10215. return false;
  10216. }
  10217. win = win || getWindow(doc);
  10218. scope.documents.push(doc);
  10219. events.documents.push(doc);
  10220. // don't add an unload event for the main document
  10221. // so that the page may be cached in browser history
  10222. if (doc !== scope.document) {
  10223. events.add(win, 'unload', scope.onWindowUnload);
  10224. }
  10225. signals.fire('add-document', { doc: doc, win: win });
  10226. },
  10227. removeDocument: function removeDocument(doc, win) {
  10228. var index = scope.documents.indexOf(doc);
  10229. win = win || getWindow(doc);
  10230. events.remove(win, 'unload', scope.onWindowUnload);
  10231. scope.documents.splice(index, 1);
  10232. events.documents.splice(index, 1);
  10233. signals.fire('remove-document', { win: win, doc: doc });
  10234. },
  10235. onWindowUnload: function onWindowUnload() {
  10236. scope.removeDocument(this.document, this);
  10237. }
  10238. };
  10239. module.exports = scope;
  10240. },{"./utils":44,"./utils/Signals":34,"./utils/domObjects":38,"./utils/events":40,"./utils/window":52}],34:[function(require,module,exports){
  10241. "use strict";
  10242. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10243. var Signals = function () {
  10244. function Signals() {
  10245. _classCallCheck(this, Signals);
  10246. this.listeners = {
  10247. // signalName: [listeners],
  10248. };
  10249. }
  10250. Signals.prototype.on = function on(name, listener) {
  10251. if (!this.listeners[name]) {
  10252. this.listeners[name] = [listener];
  10253. return;
  10254. }
  10255. this.listeners[name].push(listener);
  10256. };
  10257. Signals.prototype.off = function off(name, listener) {
  10258. if (!this.listeners[name]) {
  10259. return;
  10260. }
  10261. var index = this.listeners[name].indexOf(listener);
  10262. if (index !== -1) {
  10263. this.listeners[name].splice(index, 1);
  10264. }
  10265. };
  10266. Signals.prototype.fire = function fire(name, arg) {
  10267. var targetListeners = this.listeners[name];
  10268. if (!targetListeners) {
  10269. return;
  10270. }
  10271. for (var _i = 0; _i < targetListeners.length; _i++) {
  10272. var _ref;
  10273. _ref = targetListeners[_i];
  10274. var listener = _ref;
  10275. if (listener(arg, name) === false) {
  10276. return;
  10277. }
  10278. }
  10279. };
  10280. return Signals;
  10281. }();
  10282. Signals.new = function () {
  10283. return new Signals();
  10284. };
  10285. module.exports = Signals;
  10286. },{}],35:[function(require,module,exports){
  10287. "use strict";
  10288. function contains(array, target) {
  10289. return array.indexOf(target) !== -1;
  10290. }
  10291. function merge(target, source) {
  10292. for (var _i = 0; _i < source.length; _i++) {
  10293. var _ref;
  10294. _ref = source[_i];
  10295. var item = _ref;
  10296. target.push(item);
  10297. }
  10298. return target;
  10299. }
  10300. module.exports = {
  10301. contains: contains,
  10302. merge: merge
  10303. };
  10304. },{}],36:[function(require,module,exports){
  10305. 'use strict';
  10306. var _require = require('./window'),
  10307. window = _require.window;
  10308. var is = require('./is');
  10309. var domObjects = require('./domObjects');
  10310. var Element = domObjects.Element;
  10311. var navigator = window.navigator;
  10312. var browser = {
  10313. // Does the browser support touch input?
  10314. supportsTouch: !!('ontouchstart' in window || is.function(window.DocumentTouch) && domObjects.document instanceof window.DocumentTouch),
  10315. // Does the browser support PointerEvents
  10316. supportsPointerEvent: !!domObjects.PointerEvent,
  10317. isIOS: /iP(hone|od|ad)/.test(navigator.platform),
  10318. // scrolling doesn't change the result of getClientRects on iOS 7
  10319. isIOS7: /iP(hone|od|ad)/.test(navigator.platform) && /OS 7[^\d]/.test(navigator.appVersion),
  10320. isIe9: /MSIE 9/.test(navigator.userAgent),
  10321. // prefix matchesSelector
  10322. prefixedMatchesSelector: 'matches' in Element.prototype ? 'matches' : 'webkitMatchesSelector' in Element.prototype ? 'webkitMatchesSelector' : 'mozMatchesSelector' in Element.prototype ? 'mozMatchesSelector' : 'oMatchesSelector' in Element.prototype ? 'oMatchesSelector' : 'msMatchesSelector',
  10323. pEventTypes: domObjects.PointerEvent ? domObjects.PointerEvent === window.MSPointerEvent ? {
  10324. up: 'MSPointerUp',
  10325. down: 'MSPointerDown',
  10326. over: 'mouseover',
  10327. out: 'mouseout',
  10328. move: 'MSPointerMove',
  10329. cancel: 'MSPointerCancel'
  10330. } : {
  10331. up: 'pointerup',
  10332. down: 'pointerdown',
  10333. over: 'pointerover',
  10334. out: 'pointerout',
  10335. move: 'pointermove',
  10336. cancel: 'pointercancel'
  10337. } : null,
  10338. // because Webkit and Opera still use 'mousewheel' event type
  10339. wheelEvent: 'onmousewheel' in domObjects.document ? 'mousewheel' : 'wheel'
  10340. };
  10341. // Opera Mobile must be handled differently
  10342. browser.isOperaMobile = navigator.appName === 'Opera' && browser.supportsTouch && navigator.userAgent.match('Presto');
  10343. module.exports = browser;
  10344. },{"./domObjects":38,"./is":46,"./window":52}],37:[function(require,module,exports){
  10345. 'use strict';
  10346. var is = require('./is');
  10347. module.exports = function clone(source) {
  10348. var dest = {};
  10349. for (var prop in source) {
  10350. if (is.plainObject(source[prop])) {
  10351. dest[prop] = clone(source[prop]);
  10352. } else {
  10353. dest[prop] = source[prop];
  10354. }
  10355. }
  10356. return dest;
  10357. };
  10358. },{"./is":46}],38:[function(require,module,exports){
  10359. 'use strict';
  10360. var domObjects = {};
  10361. var win = require('./window').window;
  10362. function blank() {}
  10363. domObjects.document = win.document;
  10364. domObjects.DocumentFragment = win.DocumentFragment || blank;
  10365. domObjects.SVGElement = win.SVGElement || blank;
  10366. domObjects.SVGSVGElement = win.SVGSVGElement || blank;
  10367. domObjects.SVGElementInstance = win.SVGElementInstance || blank;
  10368. domObjects.Element = win.Element || blank;
  10369. domObjects.HTMLElement = win.HTMLElement || domObjects.Element;
  10370. domObjects.Event = win.Event;
  10371. domObjects.Touch = win.Touch || blank;
  10372. domObjects.PointerEvent = win.PointerEvent || win.MSPointerEvent;
  10373. module.exports = domObjects;
  10374. },{"./window":52}],39:[function(require,module,exports){
  10375. 'use strict';
  10376. var win = require('./window');
  10377. var browser = require('./browser');
  10378. var is = require('./is');
  10379. var domObjects = require('./domObjects');
  10380. var domUtils = {
  10381. nodeContains: function nodeContains(parent, child) {
  10382. while (child) {
  10383. if (child === parent) {
  10384. return true;
  10385. }
  10386. child = child.parentNode;
  10387. }
  10388. return false;
  10389. },
  10390. closest: function closest(element, selector) {
  10391. while (is.element(element)) {
  10392. if (domUtils.matchesSelector(element, selector)) {
  10393. return element;
  10394. }
  10395. element = domUtils.parentNode(element);
  10396. }
  10397. return null;
  10398. },
  10399. parentNode: function parentNode(node) {
  10400. var parent = node.parentNode;
  10401. if (is.docFrag(parent)) {
  10402. // skip past #shado-root fragments
  10403. while ((parent = parent.host) && is.docFrag(parent)) {
  10404. continue;
  10405. }
  10406. return parent;
  10407. }
  10408. return parent;
  10409. },
  10410. matchesSelector: function matchesSelector(element, selector) {
  10411. // remove /deep/ from selectors if shadowDOM polyfill is used
  10412. if (win.window !== win.realWindow) {
  10413. selector = selector.replace(/\/deep\//g, ' ');
  10414. }
  10415. return element[browser.prefixedMatchesSelector](selector);
  10416. },
  10417. // Test for the element that's "above" all other qualifiers
  10418. indexOfDeepestElement: function indexOfDeepestElement(elements) {
  10419. var deepestZoneParents = [];
  10420. var dropzoneParents = [];
  10421. var dropzone = void 0;
  10422. var deepestZone = elements[0];
  10423. var index = deepestZone ? 0 : -1;
  10424. var parent = void 0;
  10425. var child = void 0;
  10426. var i = void 0;
  10427. var n = void 0;
  10428. for (i = 1; i < elements.length; i++) {
  10429. dropzone = elements[i];
  10430. // an element might belong to multiple selector dropzones
  10431. if (!dropzone || dropzone === deepestZone) {
  10432. continue;
  10433. }
  10434. if (!deepestZone) {
  10435. deepestZone = dropzone;
  10436. index = i;
  10437. continue;
  10438. }
  10439. // check if the deepest or current are document.documentElement or document.rootElement
  10440. // - if the current dropzone is, do nothing and continue
  10441. if (dropzone.parentNode === dropzone.ownerDocument) {
  10442. continue;
  10443. }
  10444. // - if deepest is, update with the current dropzone and continue to next
  10445. else if (deepestZone.parentNode === dropzone.ownerDocument) {
  10446. deepestZone = dropzone;
  10447. index = i;
  10448. continue;
  10449. }
  10450. if (!deepestZoneParents.length) {
  10451. parent = deepestZone;
  10452. while (parent.parentNode && parent.parentNode !== parent.ownerDocument) {
  10453. deepestZoneParents.unshift(parent);
  10454. parent = parent.parentNode;
  10455. }
  10456. }
  10457. // if this element is an svg element and the current deepest is
  10458. // an HTMLElement
  10459. if (deepestZone instanceof domObjects.HTMLElement && dropzone instanceof domObjects.SVGElement && !(dropzone instanceof domObjects.SVGSVGElement)) {
  10460. if (dropzone === deepestZone.parentNode) {
  10461. continue;
  10462. }
  10463. parent = dropzone.ownerSVGElement;
  10464. } else {
  10465. parent = dropzone;
  10466. }
  10467. dropzoneParents = [];
  10468. while (parent.parentNode !== parent.ownerDocument) {
  10469. dropzoneParents.unshift(parent);
  10470. parent = parent.parentNode;
  10471. }
  10472. n = 0;
  10473. // get (position of last common ancestor) + 1
  10474. while (dropzoneParents[n] && dropzoneParents[n] === deepestZoneParents[n]) {
  10475. n++;
  10476. }
  10477. var parents = [dropzoneParents[n - 1], dropzoneParents[n], deepestZoneParents[n]];
  10478. child = parents[0].lastChild;
  10479. while (child) {
  10480. if (child === parents[1]) {
  10481. deepestZone = dropzone;
  10482. index = i;
  10483. deepestZoneParents = [];
  10484. break;
  10485. } else if (child === parents[2]) {
  10486. break;
  10487. }
  10488. child = child.previousSibling;
  10489. }
  10490. }
  10491. return index;
  10492. },
  10493. matchesUpTo: function matchesUpTo(element, selector, limit) {
  10494. while (is.element(element)) {
  10495. if (domUtils.matchesSelector(element, selector)) {
  10496. return true;
  10497. }
  10498. element = domUtils.parentNode(element);
  10499. if (element === limit) {
  10500. return domUtils.matchesSelector(element, selector);
  10501. }
  10502. }
  10503. return false;
  10504. },
  10505. getActualElement: function getActualElement(element) {
  10506. return element instanceof domObjects.SVGElementInstance ? element.correspondingUseElement : element;
  10507. },
  10508. getScrollXY: function getScrollXY(relevantWindow) {
  10509. relevantWindow = relevantWindow || win.window;
  10510. return {
  10511. x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,
  10512. y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop
  10513. };
  10514. },
  10515. getElementClientRect: function getElementClientRect(element) {
  10516. var clientRect = element instanceof domObjects.SVGElement ? element.getBoundingClientRect() : element.getClientRects()[0];
  10517. return clientRect && {
  10518. left: clientRect.left,
  10519. right: clientRect.right,
  10520. top: clientRect.top,
  10521. bottom: clientRect.bottom,
  10522. width: clientRect.width || clientRect.right - clientRect.left,
  10523. height: clientRect.height || clientRect.bottom - clientRect.top
  10524. };
  10525. },
  10526. getElementRect: function getElementRect(element) {
  10527. var clientRect = domUtils.getElementClientRect(element);
  10528. if (!browser.isIOS7 && clientRect) {
  10529. var scroll = domUtils.getScrollXY(win.getWindow(element));
  10530. clientRect.left += scroll.x;
  10531. clientRect.right += scroll.x;
  10532. clientRect.top += scroll.y;
  10533. clientRect.bottom += scroll.y;
  10534. }
  10535. return clientRect;
  10536. },
  10537. getPath: function getPath(element) {
  10538. var path = [];
  10539. while (element) {
  10540. path.push(element);
  10541. element = domUtils.parentNode(element);
  10542. }
  10543. return path;
  10544. },
  10545. trySelector: function trySelector(value) {
  10546. if (!is.string(value)) {
  10547. return false;
  10548. }
  10549. // an exception will be raised if it is invalid
  10550. domObjects.document.querySelector(value);
  10551. return true;
  10552. }
  10553. };
  10554. module.exports = domUtils;
  10555. },{"./browser":36,"./domObjects":38,"./is":46,"./window":52}],40:[function(require,module,exports){
  10556. 'use strict';
  10557. var is = require('./is');
  10558. var domUtils = require('./domUtils');
  10559. var pointerUtils = require('./pointerUtils');
  10560. var pExtend = require('./pointerExtend');
  10561. var _require = require('./window'),
  10562. window = _require.window;
  10563. var _require2 = require('./arr'),
  10564. contains = _require2.contains;
  10565. var elements = [];
  10566. var targets = [];
  10567. // {
  10568. // type: {
  10569. // selectors: ['selector', ...],
  10570. // contexts : [document, ...],
  10571. // listeners: [[listener, capture, passive], ...]
  10572. // }
  10573. // }
  10574. var delegatedEvents = {};
  10575. var documents = [];
  10576. var supportsOptions = function () {
  10577. var supported = false;
  10578. window.document.createElement('div').addEventListener('test', null, {
  10579. get capture() {
  10580. supported = true;
  10581. }
  10582. });
  10583. return supported;
  10584. }();
  10585. function add(element, type, listener, optionalArg) {
  10586. var options = getOptions(optionalArg);
  10587. var elementIndex = elements.indexOf(element);
  10588. var target = targets[elementIndex];
  10589. if (!target) {
  10590. target = {
  10591. events: {},
  10592. typeCount: 0
  10593. };
  10594. elementIndex = elements.push(element) - 1;
  10595. targets.push(target);
  10596. }
  10597. if (!target.events[type]) {
  10598. target.events[type] = [];
  10599. target.typeCount++;
  10600. }
  10601. if (!contains(target.events[type], listener)) {
  10602. element.addEventListener(type, listener, supportsOptions ? options : !!options.capture);
  10603. target.events[type].push(listener);
  10604. }
  10605. }
  10606. function remove(element, type, listener, optionalArg) {
  10607. var options = getOptions(optionalArg);
  10608. var elementIndex = elements.indexOf(element);
  10609. var target = targets[elementIndex];
  10610. if (!target || !target.events) {
  10611. return;
  10612. }
  10613. if (type === 'all') {
  10614. for (type in target.events) {
  10615. if (target.events.hasOwnProperty(type)) {
  10616. remove(element, type, 'all');
  10617. }
  10618. }
  10619. return;
  10620. }
  10621. if (target.events[type]) {
  10622. var len = target.events[type].length;
  10623. if (listener === 'all') {
  10624. for (var i = 0; i < len; i++) {
  10625. remove(element, type, target.events[type][i], options);
  10626. }
  10627. return;
  10628. } else {
  10629. for (var _i = 0; _i < len; _i++) {
  10630. if (target.events[type][_i] === listener) {
  10631. element.removeEventListener('on' + type, listener, supportsOptions ? options : !!options.capture);
  10632. target.events[type].splice(_i, 1);
  10633. break;
  10634. }
  10635. }
  10636. }
  10637. if (target.events[type] && target.events[type].length === 0) {
  10638. target.events[type] = null;
  10639. target.typeCount--;
  10640. }
  10641. }
  10642. if (!target.typeCount) {
  10643. targets.splice(elementIndex, 1);
  10644. elements.splice(elementIndex, 1);
  10645. }
  10646. }
  10647. function addDelegate(selector, context, type, listener, optionalArg) {
  10648. var options = getOptions(optionalArg);
  10649. if (!delegatedEvents[type]) {
  10650. delegatedEvents[type] = {
  10651. selectors: [],
  10652. contexts: [],
  10653. listeners: []
  10654. };
  10655. // add delegate listener functions
  10656. for (var _i2 = 0; _i2 < documents.length; _i2++) {
  10657. var doc = documents[_i2];
  10658. add(doc, type, delegateListener);
  10659. add(doc, type, delegateUseCapture, true);
  10660. }
  10661. }
  10662. var delegated = delegatedEvents[type];
  10663. var index = void 0;
  10664. for (index = delegated.selectors.length - 1; index >= 0; index--) {
  10665. if (delegated.selectors[index] === selector && delegated.contexts[index] === context) {
  10666. break;
  10667. }
  10668. }
  10669. if (index === -1) {
  10670. index = delegated.selectors.length;
  10671. delegated.selectors.push(selector);
  10672. delegated.contexts.push(context);
  10673. delegated.listeners.push([]);
  10674. }
  10675. // keep listener and capture and passive flags
  10676. delegated.listeners[index].push([listener, !!options.capture, options.passive]);
  10677. }
  10678. function removeDelegate(selector, context, type, listener, optionalArg) {
  10679. var options = getOptions(optionalArg);
  10680. var delegated = delegatedEvents[type];
  10681. var matchFound = false;
  10682. var index = void 0;
  10683. if (!delegated) {
  10684. return;
  10685. }
  10686. // count from last index of delegated to 0
  10687. for (index = delegated.selectors.length - 1; index >= 0; index--) {
  10688. // look for matching selector and context Node
  10689. if (delegated.selectors[index] === selector && delegated.contexts[index] === context) {
  10690. var listeners = delegated.listeners[index];
  10691. // each item of the listeners array is an array: [function, capture, passive]
  10692. for (var i = listeners.length - 1; i >= 0; i--) {
  10693. var _listeners$i = listeners[i],
  10694. fn = _listeners$i[0],
  10695. capture = _listeners$i[1],
  10696. passive = _listeners$i[2];
  10697. // check if the listener functions and capture and passive flags match
  10698. if (fn === listener && capture === !!options.capture && passive === options.passive) {
  10699. // remove the listener from the array of listeners
  10700. listeners.splice(i, 1);
  10701. // if all listeners for this interactable have been removed
  10702. // remove the interactable from the delegated arrays
  10703. if (!listeners.length) {
  10704. delegated.selectors.splice(index, 1);
  10705. delegated.contexts.splice(index, 1);
  10706. delegated.listeners.splice(index, 1);
  10707. // remove delegate function from context
  10708. remove(context, type, delegateListener);
  10709. remove(context, type, delegateUseCapture, true);
  10710. // remove the arrays if they are empty
  10711. if (!delegated.selectors.length) {
  10712. delegatedEvents[type] = null;
  10713. }
  10714. }
  10715. // only remove one listener
  10716. matchFound = true;
  10717. break;
  10718. }
  10719. }
  10720. if (matchFound) {
  10721. break;
  10722. }
  10723. }
  10724. }
  10725. }
  10726. // bound to the interactable context when a DOM event
  10727. // listener is added to a selector interactable
  10728. function delegateListener(event, optionalArg) {
  10729. var options = getOptions(optionalArg);
  10730. var fakeEvent = {};
  10731. var delegated = delegatedEvents[event.type];
  10732. var _pointerUtils$getEven = pointerUtils.getEventTargets(event),
  10733. eventTarget = _pointerUtils$getEven[0];
  10734. var element = eventTarget;
  10735. // duplicate the event so that currentTarget can be changed
  10736. pExtend(fakeEvent, event);
  10737. fakeEvent.originalEvent = event;
  10738. fakeEvent.preventDefault = preventOriginalDefault;
  10739. // climb up document tree looking for selector matches
  10740. while (is.element(element)) {
  10741. for (var i = 0; i < delegated.selectors.length; i++) {
  10742. var selector = delegated.selectors[i];
  10743. var context = delegated.contexts[i];
  10744. if (domUtils.matchesSelector(element, selector) && domUtils.nodeContains(context, eventTarget) && domUtils.nodeContains(context, element)) {
  10745. var listeners = delegated.listeners[i];
  10746. fakeEvent.currentTarget = element;
  10747. for (var j = 0; j < listeners.length; j++) {
  10748. var _listeners$j = listeners[j],
  10749. fn = _listeners$j[0],
  10750. capture = _listeners$j[1],
  10751. passive = _listeners$j[2];
  10752. if (capture === !!options.capture && passive === options.passive) {
  10753. fn(fakeEvent);
  10754. }
  10755. }
  10756. }
  10757. }
  10758. element = domUtils.parentNode(element);
  10759. }
  10760. }
  10761. function delegateUseCapture(event) {
  10762. return delegateListener.call(this, event, true);
  10763. }
  10764. function preventOriginalDefault() {
  10765. this.originalEvent.preventDefault();
  10766. }
  10767. function getOptions(param) {
  10768. return is.object(param) ? param : { capture: param };
  10769. }
  10770. module.exports = {
  10771. add: add,
  10772. remove: remove,
  10773. addDelegate: addDelegate,
  10774. removeDelegate: removeDelegate,
  10775. delegateListener: delegateListener,
  10776. delegateUseCapture: delegateUseCapture,
  10777. delegatedEvents: delegatedEvents,
  10778. documents: documents,
  10779. supportsOptions: supportsOptions,
  10780. _elements: elements,
  10781. _targets: targets
  10782. };
  10783. },{"./arr":35,"./domUtils":39,"./is":46,"./pointerExtend":48,"./pointerUtils":49,"./window":52}],41:[function(require,module,exports){
  10784. "use strict";
  10785. module.exports = function extend(dest, source) {
  10786. for (var prop in source) {
  10787. dest[prop] = source[prop];
  10788. }
  10789. return dest;
  10790. };
  10791. },{}],42:[function(require,module,exports){
  10792. 'use strict';
  10793. var _require = require('./rect'),
  10794. resolveRectLike = _require.resolveRectLike,
  10795. rectToXY = _require.rectToXY;
  10796. module.exports = function (target, element, action) {
  10797. var actionOptions = target.options[action];
  10798. var actionOrigin = actionOptions && actionOptions.origin;
  10799. var origin = actionOrigin || target.options.origin;
  10800. var originRect = resolveRectLike(origin, target, element, [target && element]);
  10801. return rectToXY(originRect) || { x: 0, y: 0 };
  10802. };
  10803. },{"./rect":51}],43:[function(require,module,exports){
  10804. "use strict";
  10805. module.exports = function (x, y) {
  10806. return Math.sqrt(x * x + y * y);
  10807. };
  10808. },{}],44:[function(require,module,exports){
  10809. 'use strict';
  10810. var extend = require('./extend');
  10811. var win = require('./window');
  10812. var utils = {
  10813. warnOnce: function warnOnce(method, message) {
  10814. var warned = false;
  10815. return function () {
  10816. if (!warned) {
  10817. win.window.console.warn(message);
  10818. warned = true;
  10819. }
  10820. return method.apply(this, arguments);
  10821. };
  10822. },
  10823. // http://stackoverflow.com/a/5634528/2280888
  10824. _getQBezierValue: function _getQBezierValue(t, p1, p2, p3) {
  10825. var iT = 1 - t;
  10826. return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
  10827. },
  10828. getQuadraticCurvePoint: function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) {
  10829. return {
  10830. x: utils._getQBezierValue(position, startX, cpX, endX),
  10831. y: utils._getQBezierValue(position, startY, cpY, endY)
  10832. };
  10833. },
  10834. // http://gizma.com/easing/
  10835. easeOutQuad: function easeOutQuad(t, b, c, d) {
  10836. t /= d;
  10837. return -c * t * (t - 2) + b;
  10838. },
  10839. copyAction: function copyAction(dest, src) {
  10840. dest.name = src.name;
  10841. dest.axis = src.axis;
  10842. dest.edges = src.edges;
  10843. return dest;
  10844. },
  10845. is: require('./is'),
  10846. extend: extend,
  10847. hypot: require('./hypot'),
  10848. getOriginXY: require('./getOriginXY')
  10849. };
  10850. extend(utils, require('./arr'));
  10851. extend(utils, require('./domUtils'));
  10852. extend(utils, require('./pointerUtils'));
  10853. extend(utils, require('./rect'));
  10854. module.exports = utils;
  10855. },{"./arr":35,"./domUtils":39,"./extend":41,"./getOriginXY":42,"./hypot":43,"./is":46,"./pointerUtils":49,"./rect":51,"./window":52}],45:[function(require,module,exports){
  10856. 'use strict';
  10857. var scope = require('../scope');
  10858. var utils = require('./index');
  10859. var finder = {
  10860. methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'],
  10861. search: function search(pointer, eventType, eventTarget) {
  10862. var pointerType = utils.getPointerType(pointer);
  10863. var pointerId = utils.getPointerId(pointer);
  10864. var details = { pointer: pointer, pointerId: pointerId, pointerType: pointerType, eventType: eventType, eventTarget: eventTarget };
  10865. for (var _i = 0; _i < finder.methodOrder.length; _i++) {
  10866. var _ref;
  10867. _ref = finder.methodOrder[_i];
  10868. var method = _ref;
  10869. var interaction = finder[method](details);
  10870. if (interaction) {
  10871. return interaction;
  10872. }
  10873. }
  10874. },
  10875. // try to resume simulation with a new pointer
  10876. simulationResume: function simulationResume(_ref2) {
  10877. var pointerType = _ref2.pointerType,
  10878. eventType = _ref2.eventType,
  10879. eventTarget = _ref2.eventTarget;
  10880. if (!/down|start/i.test(eventType)) {
  10881. return null;
  10882. }
  10883. for (var _i2 = 0; _i2 < scope.interactions.length; _i2++) {
  10884. var _ref3;
  10885. _ref3 = scope.interactions[_i2];
  10886. var interaction = _ref3;
  10887. var element = eventTarget;
  10888. if (interaction.simulation && interaction.simulation.allowResume && interaction.pointerType === pointerType) {
  10889. while (element) {
  10890. // if the element is the interaction element
  10891. if (element === interaction.element) {
  10892. return interaction;
  10893. }
  10894. element = utils.parentNode(element);
  10895. }
  10896. }
  10897. }
  10898. return null;
  10899. },
  10900. // if it's a mouse or pen interaction
  10901. mouseOrPen: function mouseOrPen(_ref4) {
  10902. var pointerId = _ref4.pointerId,
  10903. pointerType = _ref4.pointerType,
  10904. eventType = _ref4.eventType;
  10905. if (pointerType !== 'mouse' && pointerType !== 'pen') {
  10906. return null;
  10907. }
  10908. var firstNonActive = void 0;
  10909. for (var _i3 = 0; _i3 < scope.interactions.length; _i3++) {
  10910. var _ref5;
  10911. _ref5 = scope.interactions[_i3];
  10912. var interaction = _ref5;
  10913. if (interaction.pointerType === pointerType) {
  10914. // if it's a down event, skip interactions with running simulations
  10915. if (interaction.simulation && !utils.contains(interaction.pointerIds, pointerId)) {
  10916. continue;
  10917. }
  10918. // if the interaction is active, return it immediately
  10919. if (interaction.interacting()) {
  10920. return interaction;
  10921. }
  10922. // otherwise save it and look for another active interaction
  10923. else if (!firstNonActive) {
  10924. firstNonActive = interaction;
  10925. }
  10926. }
  10927. }
  10928. // if no active mouse interaction was found use the first inactive mouse
  10929. // interaction
  10930. if (firstNonActive) {
  10931. return firstNonActive;
  10932. }
  10933. // find any mouse or pen interaction.
  10934. // ignore the interaction if the eventType is a *down, and a simulation
  10935. // is active
  10936. for (var _i4 = 0; _i4 < scope.interactions.length; _i4++) {
  10937. var _ref6;
  10938. _ref6 = scope.interactions[_i4];
  10939. var _interaction = _ref6;
  10940. if (_interaction.pointerType === pointerType && !(/down/i.test(eventType) && _interaction.simulation)) {
  10941. return _interaction;
  10942. }
  10943. }
  10944. return null;
  10945. },
  10946. // get interaction that has this pointer
  10947. hasPointer: function hasPointer(_ref7) {
  10948. var pointerId = _ref7.pointerId;
  10949. for (var _i5 = 0; _i5 < scope.interactions.length; _i5++) {
  10950. var _ref8;
  10951. _ref8 = scope.interactions[_i5];
  10952. var interaction = _ref8;
  10953. if (utils.contains(interaction.pointerIds, pointerId)) {
  10954. return interaction;
  10955. }
  10956. }
  10957. },
  10958. // get first idle interaction with a matching pointerType
  10959. idle: function idle(_ref9) {
  10960. var pointerType = _ref9.pointerType;
  10961. for (var _i6 = 0; _i6 < scope.interactions.length; _i6++) {
  10962. var _ref10;
  10963. _ref10 = scope.interactions[_i6];
  10964. var interaction = _ref10;
  10965. // if there's already a pointer held down
  10966. if (interaction.pointerIds.length === 1) {
  10967. var target = interaction.target;
  10968. // don't add this pointer if there is a target interactable and it
  10969. // isn't gesturable
  10970. if (target && !target.options.gesture.enabled) {
  10971. continue;
  10972. }
  10973. }
  10974. // maximum of 2 pointers per interaction
  10975. else if (interaction.pointerIds.length >= 2) {
  10976. continue;
  10977. }
  10978. if (!interaction.interacting() && pointerType === interaction.pointerType) {
  10979. return interaction;
  10980. }
  10981. }
  10982. return null;
  10983. }
  10984. };
  10985. module.exports = finder;
  10986. },{"../scope":33,"./index":44}],46:[function(require,module,exports){
  10987. 'use strict';
  10988. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  10989. var win = require('./window');
  10990. var isWindow = require('./isWindow');
  10991. var is = {
  10992. array: function array() {},
  10993. window: function window(thing) {
  10994. return thing === win.window || isWindow(thing);
  10995. },
  10996. docFrag: function docFrag(thing) {
  10997. return is.object(thing) && thing.nodeType === 11;
  10998. },
  10999. object: function object(thing) {
  11000. return !!thing && (typeof thing === 'undefined' ? 'undefined' : _typeof(thing)) === 'object';
  11001. },
  11002. function: function _function(thing) {
  11003. return typeof thing === 'function';
  11004. },
  11005. number: function number(thing) {
  11006. return typeof thing === 'number';
  11007. },
  11008. bool: function bool(thing) {
  11009. return typeof thing === 'boolean';
  11010. },
  11011. string: function string(thing) {
  11012. return typeof thing === 'string';
  11013. },
  11014. element: function element(thing) {
  11015. if (!thing || (typeof thing === 'undefined' ? 'undefined' : _typeof(thing)) !== 'object') {
  11016. return false;
  11017. }
  11018. var _window = win.getWindow(thing) || win.window;
  11019. return (/object|function/.test(_typeof(_window.Element)) ? thing instanceof _window.Element //DOM2
  11020. : thing.nodeType === 1 && typeof thing.nodeName === 'string'
  11021. );
  11022. },
  11023. plainObject: function plainObject(thing) {
  11024. return is.object(thing) && thing.constructor.name === 'Object';
  11025. }
  11026. };
  11027. is.array = function (thing) {
  11028. return is.object(thing) && typeof thing.length !== 'undefined' && is.function(thing.splice);
  11029. };
  11030. module.exports = is;
  11031. },{"./isWindow":47,"./window":52}],47:[function(require,module,exports){
  11032. "use strict";
  11033. module.exports = function (thing) {
  11034. return !!(thing && thing.Window) && thing instanceof thing.Window;
  11035. };
  11036. },{}],48:[function(require,module,exports){
  11037. 'use strict';
  11038. function pointerExtend(dest, source) {
  11039. for (var prop in source) {
  11040. var prefixedPropREs = module.exports.prefixedPropREs;
  11041. var deprecated = false;
  11042. // skip deprecated prefixed properties
  11043. for (var vendor in prefixedPropREs) {
  11044. if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
  11045. deprecated = true;
  11046. break;
  11047. }
  11048. }
  11049. if (!deprecated && typeof source[prop] !== 'function') {
  11050. dest[prop] = source[prop];
  11051. }
  11052. }
  11053. return dest;
  11054. }
  11055. pointerExtend.prefixedPropREs = {
  11056. webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/
  11057. };
  11058. module.exports = pointerExtend;
  11059. },{}],49:[function(require,module,exports){
  11060. 'use strict';
  11061. var hypot = require('./hypot');
  11062. var browser = require('./browser');
  11063. var dom = require('./domObjects');
  11064. var domUtils = require('./domUtils');
  11065. var domObjects = require('./domObjects');
  11066. var is = require('./is');
  11067. var pointerExtend = require('./pointerExtend');
  11068. var pointerUtils = {
  11069. copyCoords: function copyCoords(dest, src) {
  11070. dest.page = dest.page || {};
  11071. dest.page.x = src.page.x;
  11072. dest.page.y = src.page.y;
  11073. dest.client = dest.client || {};
  11074. dest.client.x = src.client.x;
  11075. dest.client.y = src.client.y;
  11076. dest.timeStamp = src.timeStamp;
  11077. },
  11078. setCoordDeltas: function setCoordDeltas(targetObj, prev, cur) {
  11079. targetObj.page.x = cur.page.x - prev.page.x;
  11080. targetObj.page.y = cur.page.y - prev.page.y;
  11081. targetObj.client.x = cur.client.x - prev.client.x;
  11082. targetObj.client.y = cur.client.y - prev.client.y;
  11083. targetObj.timeStamp = cur.timeStamp - prev.timeStamp;
  11084. // set pointer velocity
  11085. var dt = Math.max(targetObj.timeStamp / 1000, 0.001);
  11086. targetObj.page.speed = hypot(targetObj.page.x, targetObj.page.y) / dt;
  11087. targetObj.page.vx = targetObj.page.x / dt;
  11088. targetObj.page.vy = targetObj.page.y / dt;
  11089. targetObj.client.speed = hypot(targetObj.client.x, targetObj.page.y) / dt;
  11090. targetObj.client.vx = targetObj.client.x / dt;
  11091. targetObj.client.vy = targetObj.client.y / dt;
  11092. },
  11093. isNativePointer: function isNativePointer(pointer) {
  11094. return pointer instanceof dom.Event || pointer instanceof dom.Touch;
  11095. },
  11096. // Get specified X/Y coords for mouse or event.touches[0]
  11097. getXY: function getXY(type, pointer, xy) {
  11098. xy = xy || {};
  11099. type = type || 'page';
  11100. xy.x = pointer[type + 'X'];
  11101. xy.y = pointer[type + 'Y'];
  11102. return xy;
  11103. },
  11104. getPageXY: function getPageXY(pointer, page) {
  11105. page = page || {};
  11106. // Opera Mobile handles the viewport and scrolling oddly
  11107. if (browser.isOperaMobile && pointerUtils.isNativePointer(pointer)) {
  11108. pointerUtils.getXY('screen', pointer, page);
  11109. page.x += window.scrollX;
  11110. page.y += window.scrollY;
  11111. } else {
  11112. pointerUtils.getXY('page', pointer, page);
  11113. }
  11114. return page;
  11115. },
  11116. getClientXY: function getClientXY(pointer, client) {
  11117. client = client || {};
  11118. if (browser.isOperaMobile && pointerUtils.isNativePointer(pointer)) {
  11119. // Opera Mobile handles the viewport and scrolling oddly
  11120. pointerUtils.getXY('screen', pointer, client);
  11121. } else {
  11122. pointerUtils.getXY('client', pointer, client);
  11123. }
  11124. return client;
  11125. },
  11126. getPointerId: function getPointerId(pointer) {
  11127. return is.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier;
  11128. },
  11129. setCoords: function setCoords(targetObj, pointers, timeStamp) {
  11130. var pointer = pointers.length > 1 ? pointerUtils.pointerAverage(pointers) : pointers[0];
  11131. var tmpXY = {};
  11132. pointerUtils.getPageXY(pointer, tmpXY);
  11133. targetObj.page.x = tmpXY.x;
  11134. targetObj.page.y = tmpXY.y;
  11135. pointerUtils.getClientXY(pointer, tmpXY);
  11136. targetObj.client.x = tmpXY.x;
  11137. targetObj.client.y = tmpXY.y;
  11138. targetObj.timeStamp = is.number(timeStamp) ? timeStamp : new Date().getTime();
  11139. },
  11140. pointerExtend: pointerExtend,
  11141. getTouchPair: function getTouchPair(event) {
  11142. var touches = [];
  11143. // array of touches is supplied
  11144. if (is.array(event)) {
  11145. touches[0] = event[0];
  11146. touches[1] = event[1];
  11147. }
  11148. // an event
  11149. else {
  11150. if (event.type === 'touchend') {
  11151. if (event.touches.length === 1) {
  11152. touches[0] = event.touches[0];
  11153. touches[1] = event.changedTouches[0];
  11154. } else if (event.touches.length === 0) {
  11155. touches[0] = event.changedTouches[0];
  11156. touches[1] = event.changedTouches[1];
  11157. }
  11158. } else {
  11159. touches[0] = event.touches[0];
  11160. touches[1] = event.touches[1];
  11161. }
  11162. }
  11163. return touches;
  11164. },
  11165. pointerAverage: function pointerAverage(pointers) {
  11166. var average = {
  11167. pageX: 0,
  11168. pageY: 0,
  11169. clientX: 0,
  11170. clientY: 0,
  11171. screenX: 0,
  11172. screenY: 0
  11173. };
  11174. for (var _i = 0; _i < pointers.length; _i++) {
  11175. var _ref;
  11176. _ref = pointers[_i];
  11177. var pointer = _ref;
  11178. for (var _prop in average) {
  11179. average[_prop] += pointer[_prop];
  11180. }
  11181. }
  11182. for (var prop in average) {
  11183. average[prop] /= pointers.length;
  11184. }
  11185. return average;
  11186. },
  11187. touchBBox: function touchBBox(event) {
  11188. if (!event.length && !(event.touches && event.touches.length > 1)) {
  11189. return;
  11190. }
  11191. var touches = pointerUtils.getTouchPair(event);
  11192. var minX = Math.min(touches[0].pageX, touches[1].pageX);
  11193. var minY = Math.min(touches[0].pageY, touches[1].pageY);
  11194. var maxX = Math.max(touches[0].pageX, touches[1].pageX);
  11195. var maxY = Math.max(touches[0].pageY, touches[1].pageY);
  11196. return {
  11197. x: minX,
  11198. y: minY,
  11199. left: minX,
  11200. top: minY,
  11201. width: maxX - minX,
  11202. height: maxY - minY
  11203. };
  11204. },
  11205. touchDistance: function touchDistance(event, deltaSource) {
  11206. var sourceX = deltaSource + 'X';
  11207. var sourceY = deltaSource + 'Y';
  11208. var touches = pointerUtils.getTouchPair(event);
  11209. var dx = touches[0][sourceX] - touches[1][sourceX];
  11210. var dy = touches[0][sourceY] - touches[1][sourceY];
  11211. return hypot(dx, dy);
  11212. },
  11213. touchAngle: function touchAngle(event, prevAngle, deltaSource) {
  11214. var sourceX = deltaSource + 'X';
  11215. var sourceY = deltaSource + 'Y';
  11216. var touches = pointerUtils.getTouchPair(event);
  11217. var dx = touches[1][sourceX] - touches[0][sourceX];
  11218. var dy = touches[1][sourceY] - touches[0][sourceY];
  11219. var angle = 180 * Math.atan2(dy, dx) / Math.PI;
  11220. return angle;
  11221. },
  11222. getPointerType: function getPointerType(pointer) {
  11223. return is.string(pointer.pointerType) ? pointer.pointerType : is.number(pointer.pointerType) ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType]
  11224. // if the PointerEvent API isn't available, then the "pointer" must
  11225. // be either a MouseEvent, TouchEvent, or Touch object
  11226. : /touch/.test(pointer.type) || pointer instanceof domObjects.Touch ? 'touch' : 'mouse';
  11227. },
  11228. // [ event.target, event.currentTarget ]
  11229. getEventTargets: function getEventTargets(event) {
  11230. var path = is.function(event.composedPath) ? event.composedPath() : event.path;
  11231. return [domUtils.getActualElement(path ? path[0] : event.target), domUtils.getActualElement(event.currentTarget)];
  11232. }
  11233. };
  11234. module.exports = pointerUtils;
  11235. },{"./browser":36,"./domObjects":38,"./domUtils":39,"./hypot":43,"./is":46,"./pointerExtend":48}],50:[function(require,module,exports){
  11236. 'use strict';
  11237. var _require = require('./window'),
  11238. window = _require.window;
  11239. var vendors = ['ms', 'moz', 'webkit', 'o'];
  11240. var lastTime = 0;
  11241. var request = void 0;
  11242. var cancel = void 0;
  11243. for (var x = 0; x < vendors.length && !window.requestAnimationFrame; x++) {
  11244. request = window[vendors[x] + 'RequestAnimationFrame'];
  11245. cancel = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
  11246. }
  11247. if (!request) {
  11248. request = function request(callback) {
  11249. var currTime = new Date().getTime();
  11250. var timeToCall = Math.max(0, 16 - (currTime - lastTime));
  11251. var id = setTimeout(function () {
  11252. callback(currTime + timeToCall);
  11253. }, timeToCall);
  11254. lastTime = currTime + timeToCall;
  11255. return id;
  11256. };
  11257. }
  11258. if (!cancel) {
  11259. cancel = function cancel(id) {
  11260. clearTimeout(id);
  11261. };
  11262. }
  11263. module.exports = {
  11264. request: request,
  11265. cancel: cancel
  11266. };
  11267. },{"./window":52}],51:[function(require,module,exports){
  11268. 'use strict';
  11269. var extend = require('./extend');
  11270. var is = require('./is');
  11271. var _require = require('./domUtils'),
  11272. closest = _require.closest,
  11273. parentNode = _require.parentNode,
  11274. getElementRect = _require.getElementRect;
  11275. var rectUtils = {
  11276. getStringOptionResult: function getStringOptionResult(value, interactable, element) {
  11277. if (!is.string(value)) {
  11278. return null;
  11279. }
  11280. if (value === 'parent') {
  11281. value = parentNode(element);
  11282. } else if (value === 'self') {
  11283. value = interactable.getRect(element);
  11284. } else {
  11285. value = closest(element, value);
  11286. }
  11287. return value;
  11288. },
  11289. resolveRectLike: function resolveRectLike(value, interactable, element, functionArgs) {
  11290. value = rectUtils.getStringOptionResult(value, interactable, element) || value;
  11291. if (is.function(value)) {
  11292. value = value.apply(null, functionArgs);
  11293. }
  11294. if (is.element(value)) {
  11295. value = getElementRect(value);
  11296. }
  11297. return value;
  11298. },
  11299. rectToXY: function rectToXY(rect) {
  11300. return rect && {
  11301. x: 'x' in rect ? rect.x : rect.left,
  11302. y: 'y' in rect ? rect.y : rect.top
  11303. };
  11304. },
  11305. xywhToTlbr: function xywhToTlbr(rect) {
  11306. if (rect && !('left' in rect && 'top' in rect)) {
  11307. rect = extend({}, rect);
  11308. rect.left = rect.x || 0;
  11309. rect.top = rect.y || 0;
  11310. rect.right = rect.right || rect.left + rect.width;
  11311. rect.bottom = rect.bottom || rect.top + rect.height;
  11312. }
  11313. return rect;
  11314. },
  11315. tlbrToXywh: function tlbrToXywh(rect) {
  11316. if (rect && !('x' in rect && 'y' in rect)) {
  11317. rect = extend({}, rect);
  11318. rect.x = rect.left || 0;
  11319. rect.top = rect.top || 0;
  11320. rect.width = rect.width || rect.right - rect.x;
  11321. rect.height = rect.height || rect.bottom - rect.y;
  11322. }
  11323. return rect;
  11324. }
  11325. };
  11326. module.exports = rectUtils;
  11327. },{"./domUtils":39,"./extend":41,"./is":46}],52:[function(require,module,exports){
  11328. 'use strict';
  11329. var win = module.exports;
  11330. var isWindow = require('./isWindow');
  11331. function init(window) {
  11332. // get wrapped window if using Shadow DOM polyfill
  11333. win.realWindow = window;
  11334. // create a TextNode
  11335. var el = window.document.createTextNode('');
  11336. // check if it's wrapped by a polyfill
  11337. if (el.ownerDocument !== window.document && typeof window.wrap === 'function' && window.wrap(el) === el) {
  11338. // use wrapped window
  11339. window = window.wrap(window);
  11340. }
  11341. win.window = window;
  11342. }
  11343. if (typeof window === 'undefined') {
  11344. win.window = undefined;
  11345. win.realWindow = undefined;
  11346. } else {
  11347. init(window);
  11348. }
  11349. win.getWindow = function getWindow(node) {
  11350. if (isWindow(node)) {
  11351. return node;
  11352. }
  11353. var rootNode = node.ownerDocument || node;
  11354. return rootNode.defaultView || rootNode.parentWindow || win.window;
  11355. };
  11356. win.init = init;
  11357. },{"./isWindow":47}]},{},[1])(1)
  11358. });
  11359. //# sourceMappingURL=interact.js.map
  11360. /***/ }),
  11361. /***/ "fdef":
  11362. /***/ (function(module, exports) {
  11363. module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  11364. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  11365. /***/ })
  11366. /******/ })["default"];
  11367. });
  11368. //# sourceMappingURL=vue-grid-layout.umd.js.map