4c6017de06055fbc061bad8bafa39d4cd9449ac0037db317d533fa7128972ec051ff39ac927fa031ad6919ebe8e18e0bfe1703da78e25373417b645d3cb010 417 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114
  1. var Walkontable =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // identity function for calling harmony imports with the correct context
  38. /******/ __webpack_require__.i = function(value) { return value; };
  39. /******/
  40. /******/ // define getter function for harmony exports
  41. /******/ __webpack_require__.d = function(exports, name, getter) {
  42. /******/ if(!__webpack_require__.o(exports, name)) {
  43. /******/ Object.defineProperty(exports, name, {
  44. /******/ configurable: false,
  45. /******/ enumerable: true,
  46. /******/ get: getter
  47. /******/ });
  48. /******/ }
  49. /******/ };
  50. /******/
  51. /******/ // getDefaultExport function for compatibility with non-harmony modules
  52. /******/ __webpack_require__.n = function(module) {
  53. /******/ var getter = module && module.__esModule ?
  54. /******/ function getDefault() { return module['default']; } :
  55. /******/ function getModuleExports() { return module; };
  56. /******/ __webpack_require__.d(getter, 'a', getter);
  57. /******/ return getter;
  58. /******/ };
  59. /******/
  60. /******/ // Object.prototype.hasOwnProperty.call
  61. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  62. /******/
  63. /******/ // __webpack_public_path__
  64. /******/ __webpack_require__.p = "";
  65. /******/
  66. /******/ // Load entry module and return exports
  67. /******/ return __webpack_require__(__webpack_require__.s = 147);
  68. /******/ })
  69. /************************************************************************/
  70. /******/ ([
  71. /* 0 */
  72. /***/ (function(module, exports, __webpack_require__) {
  73. var global = __webpack_require__(3)
  74. , core = __webpack_require__(26)
  75. , hide = __webpack_require__(15)
  76. , redefine = __webpack_require__(16)
  77. , ctx = __webpack_require__(12)
  78. , PROTOTYPE = 'prototype';
  79. var $export = function(type, name, source){
  80. var IS_FORCED = type & $export.F
  81. , IS_GLOBAL = type & $export.G
  82. , IS_STATIC = type & $export.S
  83. , IS_PROTO = type & $export.P
  84. , IS_BIND = type & $export.B
  85. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]
  86. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  87. , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})
  88. , key, own, out, exp;
  89. if(IS_GLOBAL)source = name;
  90. for(key in source){
  91. // contains in native
  92. own = !IS_FORCED && target && target[key] !== undefined;
  93. // export native or passed
  94. out = (own ? target : source)[key];
  95. // bind timers to global for call from export context
  96. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  97. // extend global
  98. if(target)redefine(target, key, out, type & $export.U);
  99. // export
  100. if(exports[key] != out)hide(exports, key, exp);
  101. if(IS_PROTO && expProto[key] != out)expProto[key] = out;
  102. }
  103. };
  104. global.core = core;
  105. // type bitmap
  106. $export.F = 1; // forced
  107. $export.G = 2; // global
  108. $export.S = 4; // static
  109. $export.P = 8; // proto
  110. $export.B = 16; // bind
  111. $export.W = 32; // wrap
  112. $export.U = 64; // safe
  113. $export.R = 128; // real proto method for `library`
  114. module.exports = $export;
  115. /***/ }),
  116. /* 1 */
  117. /***/ (function(module, exports, __webpack_require__) {
  118. var store = __webpack_require__(55)('wks')
  119. , uid = __webpack_require__(31)
  120. , Symbol = __webpack_require__(3).Symbol
  121. , USE_SYMBOL = typeof Symbol == 'function';
  122. var $exports = module.exports = function(name){
  123. return store[name] || (store[name] =
  124. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  125. };
  126. $exports.store = store;
  127. /***/ }),
  128. /* 2 */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. "use strict";
  131. exports.__esModule = true;
  132. exports.HTML_CHARACTERS = undefined;
  133. exports.getParent = getParent;
  134. exports.closest = closest;
  135. exports.closestDown = closestDown;
  136. exports.isChildOf = isChildOf;
  137. exports.isChildOfWebComponentTable = isChildOfWebComponentTable;
  138. exports.polymerWrap = polymerWrap;
  139. exports.polymerUnwrap = polymerUnwrap;
  140. exports.index = index;
  141. exports.overlayContainsElement = overlayContainsElement;
  142. exports.hasClass = hasClass;
  143. exports.addClass = addClass;
  144. exports.removeClass = removeClass;
  145. exports.removeTextNodes = removeTextNodes;
  146. exports.empty = empty;
  147. exports.fastInnerHTML = fastInnerHTML;
  148. exports.fastInnerText = fastInnerText;
  149. exports.isVisible = isVisible;
  150. exports.offset = offset;
  151. exports.getWindowScrollTop = getWindowScrollTop;
  152. exports.getWindowScrollLeft = getWindowScrollLeft;
  153. exports.getScrollTop = getScrollTop;
  154. exports.getScrollLeft = getScrollLeft;
  155. exports.getScrollableElement = getScrollableElement;
  156. exports.getTrimmingContainer = getTrimmingContainer;
  157. exports.getStyle = getStyle;
  158. exports.getComputedStyle = getComputedStyle;
  159. exports.outerWidth = outerWidth;
  160. exports.outerHeight = outerHeight;
  161. exports.innerHeight = innerHeight;
  162. exports.innerWidth = innerWidth;
  163. exports.addEvent = addEvent;
  164. exports.removeEvent = removeEvent;
  165. exports.getCaretPosition = getCaretPosition;
  166. exports.getSelectionEndPosition = getSelectionEndPosition;
  167. exports.getSelectionText = getSelectionText;
  168. exports.setCaretPosition = setCaretPosition;
  169. exports.getScrollbarWidth = getScrollbarWidth;
  170. exports.hasVerticalScrollbar = hasVerticalScrollbar;
  171. exports.hasHorizontalScrollbar = hasHorizontalScrollbar;
  172. exports.setOverlayPosition = setOverlayPosition;
  173. exports.getCssTransform = getCssTransform;
  174. exports.resetCssTransform = resetCssTransform;
  175. exports.isInput = isInput;
  176. exports.isOutsideInput = isOutsideInput;
  177. var _browser = __webpack_require__(32);
  178. var _feature = __webpack_require__(74);
  179. /**
  180. * Get the parent of the specified node in the DOM tree.
  181. *
  182. * @param {HTMLElement} element Element from which traversing is started.
  183. * @param {Number} [level=0] Traversing deep level.
  184. * @return {HTMLElement|null}
  185. */
  186. function getParent(element) {
  187. var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  188. var iteration = -1;
  189. var parent = null;
  190. while (element != null) {
  191. if (iteration === level) {
  192. parent = element;
  193. break;
  194. }
  195. if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  196. element = element.host;
  197. } else {
  198. iteration++;
  199. element = element.parentNode;
  200. }
  201. }
  202. return parent;
  203. }
  204. /**
  205. * Goes up the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.
  206. * This method goes up through web components.
  207. *
  208. * @param {HTMLElement} element Element from which traversing is started
  209. * @param {Array} nodes Array of elements or Array of elements name
  210. * @param {HTMLElement} [until]
  211. * @returns {HTMLElement|null}
  212. */
  213. function closest(element, nodes, until) {
  214. while (element != null && element !== until) {
  215. if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) {
  216. return element;
  217. }
  218. if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  219. element = element.host;
  220. } else {
  221. element = element.parentNode;
  222. }
  223. }
  224. return null;
  225. }
  226. /**
  227. * Goes "down" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.
  228. *
  229. * @param {HTMLElement} element Element from which traversing is started
  230. * @param {Array} nodes Array of elements or Array of elements name
  231. * @param {HTMLElement} [until]
  232. * @returns {HTMLElement|null}
  233. */
  234. function closestDown(element, nodes, until) {
  235. var matched = [];
  236. while (element) {
  237. element = closest(element, nodes, until);
  238. if (!element || until && !until.contains(element)) {
  239. break;
  240. }
  241. matched.push(element);
  242. if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  243. element = element.host;
  244. } else {
  245. element = element.parentNode;
  246. }
  247. }
  248. var length = matched.length;
  249. return length ? matched[length - 1] : null;
  250. }
  251. /**
  252. * Goes up the DOM tree and checks if element is child of another element.
  253. *
  254. * @param child Child element
  255. * @param {Object|String} parent Parent element OR selector of the parent element.
  256. * If string provided, function returns `true` for the first occurrence of element with that class.
  257. * @returns {Boolean}
  258. */
  259. function isChildOf(child, parent) {
  260. var node = child.parentNode;
  261. var queriedParents = [];
  262. if (typeof parent === 'string') {
  263. queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0);
  264. } else {
  265. queriedParents.push(parent);
  266. }
  267. while (node != null) {
  268. if (queriedParents.indexOf(node) > -1) {
  269. return true;
  270. }
  271. node = node.parentNode;
  272. }
  273. return false;
  274. }
  275. /**
  276. * Check if an element is part of `hot-table` web component.
  277. *
  278. * @param {Element} element
  279. * @returns {Boolean}
  280. */
  281. function isChildOfWebComponentTable(element) {
  282. var hotTableName = 'hot-table',
  283. result = false,
  284. parentNode;
  285. parentNode = polymerWrap(element);
  286. function isHotTable(element) {
  287. return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase();
  288. }
  289. while (parentNode != null) {
  290. if (isHotTable(parentNode)) {
  291. result = true;
  292. break;
  293. } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  294. result = isHotTable(parentNode.host);
  295. if (result) {
  296. break;
  297. }
  298. parentNode = parentNode.host;
  299. }
  300. parentNode = parentNode.parentNode;
  301. }
  302. return result;
  303. }
  304. /**
  305. * Wrap element into polymer/webcomponent container if exists
  306. *
  307. * @param element
  308. * @returns {*}
  309. */
  310. function polymerWrap(element) {
  311. /* global Polymer */
  312. return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element;
  313. }
  314. /**
  315. * Unwrap element from polymer/webcomponent container if exists
  316. *
  317. * @param element
  318. * @returns {*}
  319. */
  320. function polymerUnwrap(element) {
  321. /* global Polymer */
  322. return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element;
  323. }
  324. /**
  325. * Counts index of element within its parent
  326. * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true for Walkotnable
  327. * Otherwise would need to check for nodeType or use previousElementSibling
  328. *
  329. * @see http://jsperf.com/sibling-index/10
  330. * @param {Element} element
  331. * @return {Number}
  332. */
  333. function index(element) {
  334. var i = 0;
  335. if (element.previousSibling) {
  336. /* eslint-disable no-cond-assign */
  337. while (element = element.previousSibling) {
  338. ++i;
  339. }
  340. }
  341. return i;
  342. }
  343. /**
  344. * Check if the provided overlay contains the provided element
  345. *
  346. * @param {String} overlay
  347. * @param {HTMLElement} element
  348. * @returns {boolean}
  349. */
  350. function overlayContainsElement(overlayType, element) {
  351. var overlayElement = document.querySelector('.ht_clone_' + overlayType);
  352. return overlayElement ? overlayElement.contains(element) : null;
  353. }
  354. var classListSupport = !!document.documentElement.classList;
  355. var _hasClass, _addClass, _removeClass;
  356. function filterEmptyClassNames(classNames) {
  357. var len = 0,
  358. result = [];
  359. if (!classNames || !classNames.length) {
  360. return result;
  361. }
  362. while (classNames[len]) {
  363. result.push(classNames[len]);
  364. len++;
  365. }
  366. return result;
  367. }
  368. if (classListSupport) {
  369. var isSupportMultipleClassesArg = function () {
  370. var element = document.createElement('div');
  371. element.classList.add('test', 'test2');
  372. return element.classList.contains('test2');
  373. }();
  374. _hasClass = function _hasClass(element, className) {
  375. if (className === '') {
  376. return false;
  377. }
  378. return element.classList.contains(className);
  379. };
  380. _addClass = function _addClass(element, className) {
  381. var len = 0;
  382. if (typeof className === 'string') {
  383. className = className.split(' ');
  384. }
  385. className = filterEmptyClassNames(className);
  386. if (isSupportMultipleClassesArg) {
  387. element.classList.add.apply(element.classList, className);
  388. } else {
  389. while (className && className[len]) {
  390. element.classList.add(className[len]);
  391. len++;
  392. }
  393. }
  394. };
  395. _removeClass = function _removeClass(element, className) {
  396. var len = 0;
  397. if (typeof className === 'string') {
  398. className = className.split(' ');
  399. }
  400. className = filterEmptyClassNames(className);
  401. if (isSupportMultipleClassesArg) {
  402. element.classList.remove.apply(element.classList, className);
  403. } else {
  404. while (className && className[len]) {
  405. element.classList.remove(className[len]);
  406. len++;
  407. }
  408. }
  409. };
  410. } else {
  411. var createClassNameRegExp = function createClassNameRegExp(className) {
  412. return new RegExp('(\\s|^)' + className + '(\\s|$)');
  413. };
  414. _hasClass = function _hasClass(element, className) {
  415. // http://snipplr.com/view/3561/addclass-removeclass-hasclass/
  416. return !!element.className.match(createClassNameRegExp(className));
  417. };
  418. _addClass = function _addClass(element, className) {
  419. var len = 0,
  420. _className = element.className;
  421. if (typeof className === 'string') {
  422. className = className.split(' ');
  423. }
  424. if (_className === '') {
  425. _className = className.join(' ');
  426. } else {
  427. while (className && className[len]) {
  428. if (!createClassNameRegExp(className[len]).test(_className)) {
  429. _className += ' ' + className[len];
  430. }
  431. len++;
  432. }
  433. }
  434. element.className = _className;
  435. };
  436. _removeClass = function _removeClass(element, className) {
  437. var len = 0,
  438. _className = element.className;
  439. if (typeof className === 'string') {
  440. className = className.split(' ');
  441. }
  442. while (className && className[len]) {
  443. // String.prototype.trim is defined in polyfill.js
  444. _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();
  445. len++;
  446. }
  447. if (element.className !== _className) {
  448. element.className = _className;
  449. }
  450. };
  451. }
  452. /**
  453. * Checks if element has class name
  454. *
  455. * @param {HTMLElement} element
  456. * @param {String} className Class name to check
  457. * @returns {Boolean}
  458. */
  459. function hasClass(element, className) {
  460. return _hasClass(element, className);
  461. }
  462. /**
  463. * Add class name to an element
  464. *
  465. * @param {HTMLElement} element
  466. * @param {String|Array} className Class name as string or array of strings
  467. */
  468. function addClass(element, className) {
  469. return _addClass(element, className);
  470. }
  471. /**
  472. * Remove class name from an element
  473. *
  474. * @param {HTMLElement} element
  475. * @param {String|Array} className Class name as string or array of strings
  476. */
  477. function removeClass(element, className) {
  478. return _removeClass(element, className);
  479. }
  480. function removeTextNodes(element, parent) {
  481. if (element.nodeType === 3) {
  482. parent.removeChild(element); // bye text nodes!
  483. } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {
  484. var childs = element.childNodes;
  485. for (var i = childs.length - 1; i >= 0; i--) {
  486. removeTextNodes(childs[i], element);
  487. }
  488. }
  489. }
  490. /**
  491. * Remove childs function
  492. * WARNING - this doesn't unload events and data attached by jQuery
  493. * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9
  494. * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method
  495. *
  496. * @param element
  497. * @returns {void}
  498. */
  499. //
  500. function empty(element) {
  501. var child;
  502. /* eslint-disable no-cond-assign */
  503. while (child = element.lastChild) {
  504. element.removeChild(child);
  505. }
  506. }
  507. var HTML_CHARACTERS = exports.HTML_CHARACTERS = /(<(.*)>|&(.*);)/;
  508. /**
  509. * Insert content into element trying avoid innerHTML method.
  510. * @return {void}
  511. */
  512. function fastInnerHTML(element, content) {
  513. if (HTML_CHARACTERS.test(content)) {
  514. element.innerHTML = content;
  515. } else {
  516. fastInnerText(element, content);
  517. }
  518. }
  519. /**
  520. * Insert text content into element
  521. * @return {void}
  522. */
  523. var textContextSupport = !!document.createTextNode('test').textContent;
  524. function fastInnerText(element, content) {
  525. var child = element.firstChild;
  526. if (child && child.nodeType === 3 && child.nextSibling === null) {
  527. // fast lane - replace existing text node
  528. if (textContextSupport) {
  529. // http://jsperf.com/replace-text-vs-reuse
  530. child.textContent = content;
  531. } else {
  532. // http://jsperf.com/replace-text-vs-reuse
  533. child.data = content;
  534. }
  535. } else {
  536. // slow lane - empty element and insert a text node
  537. empty(element);
  538. element.appendChild(document.createTextNode(content));
  539. }
  540. }
  541. /**
  542. * Returns true if element is attached to the DOM and visible, false otherwise
  543. * @param elem
  544. * @returns {boolean}
  545. */
  546. function isVisible(elem) {
  547. var next = elem;
  548. while (polymerUnwrap(next) !== document.documentElement) {
  549. // until <html> reached
  550. if (next === null) {
  551. // parent detached from DOM
  552. return false;
  553. } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  554. if (next.host) {
  555. // this is Web Components Shadow DOM
  556. // see: http://w3c.github.io/webcomponents/spec/shadow/#encapsulation
  557. // according to spec, should be if (next.ownerDocument !== window.document), but that doesn't work yet
  558. if (next.host.impl) {
  559. // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features disabled
  560. return isVisible(next.host.impl);
  561. } else if (next.host) {
  562. // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled
  563. return isVisible(next.host);
  564. }
  565. throw new Error('Lost in Web Components world');
  566. } else {
  567. return false; // this is a node detached from document in IE8
  568. }
  569. } else if (next.style.display === 'none') {
  570. return false;
  571. }
  572. next = next.parentNode;
  573. }
  574. return true;
  575. }
  576. /**
  577. * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.
  578. *
  579. * @param {HTMLElement} elem
  580. * @return {Object} Returns object with `top` and `left` props
  581. */
  582. function offset(elem) {
  583. var offsetLeft, offsetTop, lastElem, docElem, box;
  584. docElem = document.documentElement;
  585. if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {
  586. // fixes problem with Firefox ignoring <caption> in TABLE offset (see also export outerHeight)
  587. // http://jsperf.com/offset-vs-getboundingclientrect/8
  588. box = elem.getBoundingClientRect();
  589. return {
  590. top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
  591. left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
  592. };
  593. }
  594. offsetLeft = elem.offsetLeft;
  595. offsetTop = elem.offsetTop;
  596. lastElem = elem;
  597. /* eslint-disable no-cond-assign */
  598. while (elem = elem.offsetParent) {
  599. // from my observation, document.body always has scrollLeft/scrollTop == 0
  600. if (elem === document.body) {
  601. break;
  602. }
  603. offsetLeft += elem.offsetLeft;
  604. offsetTop += elem.offsetTop;
  605. lastElem = elem;
  606. }
  607. // slow - http://jsperf.com/offset-vs-getboundingclientrect/6
  608. if (lastElem && lastElem.style.position === 'fixed') {
  609. // if(lastElem !== document.body) { //faster but does gives false positive in Firefox
  610. offsetLeft += window.pageXOffset || docElem.scrollLeft;
  611. offsetTop += window.pageYOffset || docElem.scrollTop;
  612. }
  613. return {
  614. left: offsetLeft,
  615. top: offsetTop
  616. };
  617. }
  618. /**
  619. * Returns the document's scrollTop property.
  620. *
  621. * @returns {Number}
  622. */
  623. function getWindowScrollTop() {
  624. var res = window.scrollY;
  625. if (res === void 0) {
  626. // IE8-11
  627. res = document.documentElement.scrollTop;
  628. }
  629. return res;
  630. }
  631. /**
  632. * Returns the document's scrollLeft property.
  633. *
  634. * @returns {Number}
  635. */
  636. function getWindowScrollLeft() {
  637. var res = window.scrollX;
  638. if (res === void 0) {
  639. // IE8-11
  640. res = document.documentElement.scrollLeft;
  641. }
  642. return res;
  643. }
  644. /**
  645. * Returns the provided element's scrollTop property.
  646. *
  647. * @param element
  648. * @returns {Number}
  649. */
  650. function getScrollTop(element) {
  651. if (element === window) {
  652. return getWindowScrollTop();
  653. }
  654. return element.scrollTop;
  655. }
  656. /**
  657. * Returns the provided element's scrollLeft property.
  658. *
  659. * @param element
  660. * @returns {Number}
  661. */
  662. function getScrollLeft(element) {
  663. if (element === window) {
  664. return getWindowScrollLeft();
  665. }
  666. return element.scrollLeft;
  667. }
  668. /**
  669. * Returns a DOM element responsible for scrolling of the provided element.
  670. *
  671. * @param {HTMLElement} element
  672. * @returns {HTMLElement} Element's scrollable parent
  673. */
  674. function getScrollableElement(element) {
  675. var el = element.parentNode,
  676. props = ['auto', 'scroll'],
  677. overflow,
  678. overflowX,
  679. overflowY,
  680. computedStyle = '',
  681. computedOverflow = '',
  682. computedOverflowY = '',
  683. computedOverflowX = '';
  684. while (el && el.style && document.body !== el) {
  685. overflow = el.style.overflow;
  686. overflowX = el.style.overflowX;
  687. overflowY = el.style.overflowY;
  688. if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') {
  689. return el;
  690. } else if (window.getComputedStyle) {
  691. computedStyle = window.getComputedStyle(el);
  692. computedOverflow = computedStyle.getPropertyValue('overflow');
  693. computedOverflowY = computedStyle.getPropertyValue('overflow-y');
  694. computedOverflowX = computedStyle.getPropertyValue('overflow-x');
  695. if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') {
  696. return el;
  697. }
  698. }
  699. if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) {
  700. return el;
  701. }
  702. if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) {
  703. return el;
  704. }
  705. el = el.parentNode;
  706. }
  707. return window;
  708. }
  709. /**
  710. * Returns a DOM element responsible for trimming the provided element.
  711. *
  712. * @param {HTMLElement} base Base element
  713. * @returns {HTMLElement} Base element's trimming parent
  714. */
  715. function getTrimmingContainer(base) {
  716. var el = base.parentNode;
  717. while (el && el.style && document.body !== el) {
  718. if (el.style.overflow !== 'visible' && el.style.overflow !== '') {
  719. return el;
  720. } else if (window.getComputedStyle) {
  721. var computedStyle = window.getComputedStyle(el);
  722. if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') {
  723. return el;
  724. }
  725. }
  726. el = el.parentNode;
  727. }
  728. return window;
  729. }
  730. /**
  731. * Returns a style property for the provided element. (Be it an inline or external style).
  732. *
  733. * @param {HTMLElement} element
  734. * @param {String} prop Wanted property
  735. * @returns {String|undefined} Element's style property
  736. */
  737. function getStyle(element, prop) {
  738. /* eslint-disable */
  739. if (!element) {
  740. return;
  741. } else if (element === window) {
  742. if (prop === 'width') {
  743. return window.innerWidth + 'px';
  744. } else if (prop === 'height') {
  745. return window.innerHeight + 'px';
  746. }
  747. return;
  748. }
  749. var styleProp = element.style[prop],
  750. computedStyle;
  751. if (styleProp !== '' && styleProp !== void 0) {
  752. return styleProp;
  753. } else {
  754. computedStyle = getComputedStyle(element);
  755. if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {
  756. return computedStyle[prop];
  757. }
  758. }
  759. }
  760. /**
  761. * Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).
  762. *
  763. * @param element
  764. * @returns {IEElementStyle|CssStyle} Elements computed style object
  765. */
  766. function getComputedStyle(element) {
  767. return element.currentStyle || document.defaultView.getComputedStyle(element);
  768. }
  769. /**
  770. * Returns the element's outer width.
  771. *
  772. * @param element
  773. * @returns {number} Element's outer width
  774. */
  775. function outerWidth(element) {
  776. return element.offsetWidth;
  777. }
  778. /**
  779. * Returns the element's outer height
  780. *
  781. * @param elem
  782. * @returns {number} Element's outer height
  783. */
  784. function outerHeight(elem) {
  785. if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {
  786. // fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight
  787. // jQuery (1.10.1) still has this unsolved
  788. // may be better to just switch to getBoundingClientRect
  789. // http://bililite.com/blog/2009/03/27/finding-the-size-of-a-table/
  790. // http://lists.w3.org/Archives/Public/www-style/2009Oct/0089.html
  791. // http://bugs.jquery.com/ticket/2196
  792. // http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140
  793. return elem.offsetHeight + elem.firstChild.offsetHeight;
  794. }
  795. return elem.offsetHeight;
  796. }
  797. /**
  798. * Returns the element's inner height.
  799. *
  800. * @param element
  801. * @returns {number} Element's inner height
  802. */
  803. function innerHeight(element) {
  804. return element.clientHeight || element.innerHeight;
  805. }
  806. /**
  807. * Returns the element's inner width.
  808. *
  809. * @param element
  810. * @returns {number} Element's inner width
  811. */
  812. function innerWidth(element) {
  813. return element.clientWidth || element.innerWidth;
  814. }
  815. function addEvent(element, event, callback) {
  816. if (window.addEventListener) {
  817. element.addEventListener(event, callback, false);
  818. } else {
  819. element.attachEvent('on' + event, callback);
  820. }
  821. }
  822. function removeEvent(element, event, callback) {
  823. if (window.removeEventListener) {
  824. element.removeEventListener(event, callback, false);
  825. } else {
  826. element.detachEvent('on' + event, callback);
  827. }
  828. }
  829. /**
  830. * Returns caret position in text input
  831. *
  832. * @author http://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea
  833. * @return {Number}
  834. */
  835. function getCaretPosition(el) {
  836. if (el.selectionStart) {
  837. return el.selectionStart;
  838. } else if (document.selection) {
  839. // IE8
  840. el.focus();
  841. var r = document.selection.createRange();
  842. if (r == null) {
  843. return 0;
  844. }
  845. var re = el.createTextRange();
  846. var rc = re.duplicate();
  847. re.moveToBookmark(r.getBookmark());
  848. rc.setEndPoint('EndToStart', re);
  849. return rc.text.length;
  850. }
  851. return 0;
  852. }
  853. /**
  854. * Returns end of the selection in text input
  855. *
  856. * @return {Number}
  857. */
  858. function getSelectionEndPosition(el) {
  859. if (el.selectionEnd) {
  860. return el.selectionEnd;
  861. } else if (document.selection) {
  862. // IE8
  863. var r = document.selection.createRange();
  864. if (r == null) {
  865. return 0;
  866. }
  867. var re = el.createTextRange();
  868. return re.text.indexOf(r.text) + r.text.length;
  869. }
  870. return 0;
  871. }
  872. /**
  873. * Returns text under selection.
  874. *
  875. * @returns {String}
  876. */
  877. function getSelectionText() {
  878. var text = '';
  879. if (window.getSelection) {
  880. text = window.getSelection().toString();
  881. } else if (document.selection && document.selection.type !== 'Control') {
  882. text = document.selection.createRange().text;
  883. }
  884. return text;
  885. }
  886. /**
  887. * Sets caret position in text input.
  888. *
  889. * @author http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/
  890. * @param {Element} element
  891. * @param {Number} pos
  892. * @param {Number} endPos
  893. */
  894. function setCaretPosition(element, pos, endPos) {
  895. if (endPos === void 0) {
  896. endPos = pos;
  897. }
  898. if (element.setSelectionRange) {
  899. element.focus();
  900. try {
  901. element.setSelectionRange(pos, endPos);
  902. } catch (err) {
  903. var elementParent = element.parentNode;
  904. var parentDisplayValue = elementParent.style.display;
  905. elementParent.style.display = 'block';
  906. element.setSelectionRange(pos, endPos);
  907. elementParent.style.display = parentDisplayValue;
  908. }
  909. } else if (element.createTextRange) {
  910. // IE8
  911. var range = element.createTextRange();
  912. range.collapse(true);
  913. range.moveEnd('character', endPos);
  914. range.moveStart('character', pos);
  915. range.select();
  916. }
  917. }
  918. var cachedScrollbarWidth;
  919. // http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes
  920. function walkontableCalculateScrollbarWidth() {
  921. var inner = document.createElement('div');
  922. inner.style.height = '200px';
  923. inner.style.width = '100%';
  924. var outer = document.createElement('div');
  925. outer.style.boxSizing = 'content-box';
  926. outer.style.height = '150px';
  927. outer.style.left = '0px';
  928. outer.style.overflow = 'hidden';
  929. outer.style.position = 'absolute';
  930. outer.style.top = '0px';
  931. outer.style.width = '200px';
  932. outer.style.visibility = 'hidden';
  933. outer.appendChild(inner);
  934. (document.body || document.documentElement).appendChild(outer);
  935. var w1 = inner.offsetWidth;
  936. outer.style.overflow = 'scroll';
  937. var w2 = inner.offsetWidth;
  938. if (w1 == w2) {
  939. w2 = outer.clientWidth;
  940. }
  941. (document.body || document.documentElement).removeChild(outer);
  942. return w1 - w2;
  943. }
  944. /**
  945. * Returns the computed width of the native browser scroll bar.
  946. *
  947. * @return {Number} width
  948. */
  949. function getScrollbarWidth() {
  950. if (cachedScrollbarWidth === void 0) {
  951. cachedScrollbarWidth = walkontableCalculateScrollbarWidth();
  952. }
  953. return cachedScrollbarWidth;
  954. }
  955. /**
  956. * Checks if the provided element has a vertical scrollbar.
  957. *
  958. * @param {HTMLElement} element
  959. * @returns {Boolean}
  960. */
  961. function hasVerticalScrollbar(element) {
  962. return element.offsetWidth !== element.clientWidth;
  963. }
  964. /**
  965. * Checks if the provided element has a vertical scrollbar.
  966. *
  967. * @param {HTMLElement} element
  968. * @returns {Boolean}
  969. */
  970. function hasHorizontalScrollbar(element) {
  971. return element.offsetHeight !== element.clientHeight;
  972. }
  973. /**
  974. * Sets overlay position depending on it's type and used browser
  975. */
  976. function setOverlayPosition(overlayElem, left, top) {
  977. if ((0, _browser.isIE8)() || (0, _browser.isIE9)()) {
  978. overlayElem.style.top = top;
  979. overlayElem.style.left = left;
  980. } else if ((0, _browser.isSafari)()) {
  981. overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)';
  982. } else {
  983. overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)';
  984. }
  985. }
  986. function getCssTransform(element) {
  987. var transform;
  988. if (element.style.transform && (transform = element.style.transform) !== '') {
  989. return ['transform', transform];
  990. } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {
  991. return ['-webkit-transform', transform];
  992. }
  993. return -1;
  994. }
  995. function resetCssTransform(element) {
  996. if (element.style.transform && element.style.transform !== '') {
  997. element.style.transform = '';
  998. } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') {
  999. element.style['-webkit-transform'] = '';
  1000. }
  1001. }
  1002. /**
  1003. * Determines if the given DOM element is an input field.
  1004. * Notice: By 'input' we mean input, textarea and select nodes
  1005. *
  1006. * @param {HTMLElement} element - DOM element
  1007. * @returns {Boolean}
  1008. */
  1009. function isInput(element) {
  1010. var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];
  1011. return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true');
  1012. }
  1013. /**
  1014. * Determines if the given DOM element is an input field placed OUTSIDE of HOT.
  1015. * Notice: By 'input' we mean input, textarea and select nodes
  1016. *
  1017. * @param {HTMLElement} element - DOM element
  1018. * @returns {Boolean}
  1019. */
  1020. function isOutsideInput(element) {
  1021. return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1;
  1022. }
  1023. /***/ }),
  1024. /* 3 */
  1025. /***/ (function(module, exports) {
  1026. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1027. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  1028. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  1029. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  1030. /***/ }),
  1031. /* 4 */
  1032. /***/ (function(module, exports) {
  1033. module.exports = function(it){
  1034. return typeof it === 'object' ? it !== null : typeof it === 'function';
  1035. };
  1036. /***/ }),
  1037. /* 5 */
  1038. /***/ (function(module, exports, __webpack_require__) {
  1039. var isObject = __webpack_require__(4);
  1040. module.exports = function(it){
  1041. if(!isObject(it))throw TypeError(it + ' is not an object!');
  1042. return it;
  1043. };
  1044. /***/ }),
  1045. /* 6 */
  1046. /***/ (function(module, exports, __webpack_require__) {
  1047. var anObject = __webpack_require__(5)
  1048. , IE8_DOM_DEFINE = __webpack_require__(82)
  1049. , toPrimitive = __webpack_require__(58)
  1050. , dP = Object.defineProperty;
  1051. exports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes){
  1052. anObject(O);
  1053. P = toPrimitive(P, true);
  1054. anObject(Attributes);
  1055. if(IE8_DOM_DEFINE)try {
  1056. return dP(O, P, Attributes);
  1057. } catch(e){ /* empty */ }
  1058. if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
  1059. if('value' in Attributes)O[P] = Attributes.value;
  1060. return O;
  1061. };
  1062. /***/ }),
  1063. /* 7 */
  1064. /***/ (function(module, exports, __webpack_require__) {
  1065. // Thank's IE8 for his funny defineProperty
  1066. module.exports = !__webpack_require__(14)(function(){
  1067. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  1068. });
  1069. /***/ }),
  1070. /* 8 */
  1071. /***/ (function(module, exports) {
  1072. var hasOwnProperty = {}.hasOwnProperty;
  1073. module.exports = function(it, key){
  1074. return hasOwnProperty.call(it, key);
  1075. };
  1076. /***/ }),
  1077. /* 9 */
  1078. /***/ (function(module, exports, __webpack_require__) {
  1079. // to indexed object, toObject with fallback for non-array-like ES3 strings
  1080. var IObject = __webpack_require__(49)
  1081. , defined = __webpack_require__(13);
  1082. module.exports = function(it){
  1083. return IObject(defined(it));
  1084. };
  1085. /***/ }),
  1086. /* 10 */
  1087. /***/ (function(module, exports, __webpack_require__) {
  1088. // 7.1.15 ToLength
  1089. var toInteger = __webpack_require__(42)
  1090. , min = Math.min;
  1091. module.exports = function(it){
  1092. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  1093. };
  1094. /***/ }),
  1095. /* 11 */
  1096. /***/ (function(module, exports, __webpack_require__) {
  1097. "use strict";
  1098. exports.__esModule = true;
  1099. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1100. var _element = __webpack_require__(2);
  1101. var _object = __webpack_require__(25);
  1102. var _array = __webpack_require__(24);
  1103. var _eventManager = __webpack_require__(23);
  1104. var _eventManager2 = _interopRequireDefault(_eventManager);
  1105. var _core = __webpack_require__(62);
  1106. var _core2 = _interopRequireDefault(_core);
  1107. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1108. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1109. var registeredOverlays = {};
  1110. /**
  1111. * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable
  1112. * and (optionally) implements behavior needed for native horizontal and vertical scrolling.
  1113. *
  1114. * @class Overlay
  1115. */
  1116. var Overlay = function () {
  1117. _createClass(Overlay, null, [{
  1118. key: 'registerOverlay',
  1119. /**
  1120. * Register overlay class.
  1121. *
  1122. * @param {String} type Overlay type, one of the CLONE_TYPES value
  1123. * @param {Overlay} overlayClass Overlay class extended from base overlay class {@link Overlay}
  1124. */
  1125. value: function registerOverlay(type, overlayClass) {
  1126. if (Overlay.CLONE_TYPES.indexOf(type) === -1) {
  1127. throw new Error('Unsupported overlay (' + type + ').');
  1128. }
  1129. registeredOverlays[type] = overlayClass;
  1130. }
  1131. /**
  1132. * Create new instance of overlay type.
  1133. *
  1134. * @param {String} type Overlay type, one of the CLONE_TYPES value
  1135. * @param {Walkontable} wot Walkontable instance
  1136. */
  1137. }, {
  1138. key: 'createOverlay',
  1139. value: function createOverlay(type, wot) {
  1140. return new registeredOverlays[type](wot);
  1141. }
  1142. /**
  1143. * Check if specified overlay was registered.
  1144. *
  1145. * @param {String} type Overlay type, one of the CLONE_TYPES value
  1146. * @returns {Boolean}
  1147. */
  1148. }, {
  1149. key: 'hasOverlay',
  1150. value: function hasOverlay(type) {
  1151. return registeredOverlays[type] !== void 0;
  1152. }
  1153. /**
  1154. * Checks if overlay object (`overlay`) is instance of overlay type (`type`).
  1155. *
  1156. * @param {Overlay} overlay Overlay object
  1157. * @param {String} type Overlay type, one of the CLONE_TYPES value
  1158. * @returns {Boolean}
  1159. */
  1160. }, {
  1161. key: 'isOverlayTypeOf',
  1162. value: function isOverlayTypeOf(overlay, type) {
  1163. if (!overlay || !registeredOverlays[type]) {
  1164. return false;
  1165. }
  1166. return overlay instanceof registeredOverlays[type];
  1167. }
  1168. /**
  1169. * @param {Walkontable} wotInstance
  1170. */
  1171. }, {
  1172. key: 'CLONE_TOP',
  1173. /**
  1174. * @type {String}
  1175. */
  1176. get: function get() {
  1177. return 'top';
  1178. }
  1179. /**
  1180. * @type {String}
  1181. */
  1182. }, {
  1183. key: 'CLONE_BOTTOM',
  1184. get: function get() {
  1185. return 'bottom';
  1186. }
  1187. /**
  1188. * @type {String}
  1189. */
  1190. }, {
  1191. key: 'CLONE_LEFT',
  1192. get: function get() {
  1193. return 'left';
  1194. }
  1195. /**
  1196. * @type {String}
  1197. */
  1198. }, {
  1199. key: 'CLONE_TOP_LEFT_CORNER',
  1200. get: function get() {
  1201. return 'top_left_corner';
  1202. }
  1203. /**
  1204. * @type {String}
  1205. */
  1206. }, {
  1207. key: 'CLONE_BOTTOM_LEFT_CORNER',
  1208. get: function get() {
  1209. return 'bottom_left_corner';
  1210. }
  1211. /**
  1212. * @type {String}
  1213. */
  1214. }, {
  1215. key: 'CLONE_DEBUG',
  1216. get: function get() {
  1217. return 'debug';
  1218. }
  1219. /**
  1220. * List of all availables clone types
  1221. *
  1222. * @type {Array}
  1223. */
  1224. }, {
  1225. key: 'CLONE_TYPES',
  1226. get: function get() {
  1227. return [Overlay.CLONE_TOP, Overlay.CLONE_BOTTOM, Overlay.CLONE_LEFT, Overlay.CLONE_TOP_LEFT_CORNER, Overlay.CLONE_BOTTOM_LEFT_CORNER, Overlay.CLONE_DEBUG];
  1228. }
  1229. }]);
  1230. function Overlay(wotInstance) {
  1231. _classCallCheck(this, Overlay);
  1232. (0, _object.defineGetter)(this, 'wot', wotInstance, {
  1233. writable: false
  1234. });
  1235. // legacy support, deprecated in the future
  1236. this.instance = this.wot;
  1237. this.type = '';
  1238. this.mainTableScrollableElement = null;
  1239. this.TABLE = this.wot.wtTable.TABLE;
  1240. this.hider = this.wot.wtTable.hider;
  1241. this.spreader = this.wot.wtTable.spreader;
  1242. this.holder = this.wot.wtTable.holder;
  1243. this.wtRootElement = this.wot.wtTable.wtRootElement;
  1244. this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
  1245. this.areElementSizesAdjusted = false;
  1246. this.updateStateOfRendering();
  1247. }
  1248. /**
  1249. * Update internal state of object with an information about the need of full rendering of the overlay.
  1250. *
  1251. * @returns {Boolean} Returns `true` if the state has changed since the last check.
  1252. */
  1253. _createClass(Overlay, [{
  1254. key: 'updateStateOfRendering',
  1255. value: function updateStateOfRendering() {
  1256. var previousState = this.needFullRender;
  1257. this.needFullRender = this.shouldBeRendered();
  1258. var changed = previousState !== this.needFullRender;
  1259. if (changed && !this.needFullRender) {
  1260. this.reset();
  1261. }
  1262. return changed;
  1263. }
  1264. /**
  1265. * Checks if overlay should be fully rendered
  1266. *
  1267. * @returns {Boolean}
  1268. */
  1269. }, {
  1270. key: 'shouldBeRendered',
  1271. value: function shouldBeRendered() {
  1272. return true;
  1273. }
  1274. /**
  1275. * Update the trimming container.
  1276. */
  1277. }, {
  1278. key: 'updateTrimmingContainer',
  1279. value: function updateTrimmingContainer() {
  1280. this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
  1281. }
  1282. /**
  1283. * Update the main scrollable element.
  1284. */
  1285. }, {
  1286. key: 'updateMainScrollableElement',
  1287. value: function updateMainScrollableElement() {
  1288. this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
  1289. }
  1290. /**
  1291. * Make a clone of table for overlay
  1292. *
  1293. * @param {String} direction Can be `Overlay.CLONE_TOP`, `Overlay.CLONE_LEFT`,
  1294. * `Overlay.CLONE_TOP_LEFT_CORNER`, `Overlay.CLONE_DEBUG`
  1295. * @returns {Walkontable}
  1296. */
  1297. }, {
  1298. key: 'makeClone',
  1299. value: function makeClone(direction) {
  1300. if (Overlay.CLONE_TYPES.indexOf(direction) === -1) {
  1301. throw new Error('Clone type "' + direction + '" is not supported.');
  1302. }
  1303. var clone = document.createElement('DIV');
  1304. var clonedTable = document.createElement('TABLE');
  1305. clone.className = 'ht_clone_' + direction + ' handsontable';
  1306. clone.style.position = 'absolute';
  1307. clone.style.top = 0;
  1308. clone.style.left = 0;
  1309. clone.style.overflow = 'hidden';
  1310. clonedTable.className = this.wot.wtTable.TABLE.className;
  1311. clone.appendChild(clonedTable);
  1312. this.type = direction;
  1313. this.wot.wtTable.wtRootElement.parentNode.appendChild(clone);
  1314. var preventOverflow = this.wot.getSetting('preventOverflow');
  1315. if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === Overlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === Overlay.CLONE_LEFT) {
  1316. this.mainTableScrollableElement = window;
  1317. } else {
  1318. this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
  1319. }
  1320. return new _core2.default({
  1321. cloneSource: this.wot,
  1322. cloneOverlay: this,
  1323. table: clonedTable
  1324. });
  1325. }
  1326. /**
  1327. * Refresh/Redraw overlay
  1328. *
  1329. * @param {Boolean} [fastDraw=false]
  1330. */
  1331. }, {
  1332. key: 'refresh',
  1333. value: function refresh() {
  1334. var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  1335. // When hot settings are changed we allow to refresh overlay once before blocking
  1336. var nextCycleRenderFlag = this.shouldBeRendered();
  1337. if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {
  1338. this.clone.draw(fastDraw);
  1339. }
  1340. this.needFullRender = nextCycleRenderFlag;
  1341. }
  1342. /**
  1343. * Reset overlay styles to initial values.
  1344. */
  1345. }, {
  1346. key: 'reset',
  1347. value: function reset() {
  1348. if (!this.clone) {
  1349. return;
  1350. }
  1351. var holder = this.clone.wtTable.holder;
  1352. var hider = this.clone.wtTable.hider;
  1353. var holderStyle = holder.style;
  1354. var hidderStyle = hider.style;
  1355. var rootStyle = holder.parentNode.style;
  1356. (0, _array.arrayEach)([holderStyle, hidderStyle, rootStyle], function (style) {
  1357. style.width = '';
  1358. style.height = '';
  1359. });
  1360. }
  1361. /**
  1362. * Destroy overlay instance
  1363. */
  1364. }, {
  1365. key: 'destroy',
  1366. value: function destroy() {
  1367. new _eventManager2.default(this.clone).destroy();
  1368. }
  1369. }]);
  1370. return Overlay;
  1371. }();
  1372. exports.default = Overlay;
  1373. /***/ }),
  1374. /* 12 */
  1375. /***/ (function(module, exports, __webpack_require__) {
  1376. // optional / simple context binding
  1377. var aFunction = __webpack_require__(44);
  1378. module.exports = function(fn, that, length){
  1379. aFunction(fn);
  1380. if(that === undefined)return fn;
  1381. switch(length){
  1382. case 1: return function(a){
  1383. return fn.call(that, a);
  1384. };
  1385. case 2: return function(a, b){
  1386. return fn.call(that, a, b);
  1387. };
  1388. case 3: return function(a, b, c){
  1389. return fn.call(that, a, b, c);
  1390. };
  1391. }
  1392. return function(/* ...args */){
  1393. return fn.apply(that, arguments);
  1394. };
  1395. };
  1396. /***/ }),
  1397. /* 13 */
  1398. /***/ (function(module, exports) {
  1399. // 7.2.1 RequireObjectCoercible(argument)
  1400. module.exports = function(it){
  1401. if(it == undefined)throw TypeError("Can't call method on " + it);
  1402. return it;
  1403. };
  1404. /***/ }),
  1405. /* 14 */
  1406. /***/ (function(module, exports) {
  1407. module.exports = function(exec){
  1408. try {
  1409. return !!exec();
  1410. } catch(e){
  1411. return true;
  1412. }
  1413. };
  1414. /***/ }),
  1415. /* 15 */
  1416. /***/ (function(module, exports, __webpack_require__) {
  1417. var dP = __webpack_require__(6)
  1418. , createDesc = __webpack_require__(20);
  1419. module.exports = __webpack_require__(7) ? function(object, key, value){
  1420. return dP.f(object, key, createDesc(1, value));
  1421. } : function(object, key, value){
  1422. object[key] = value;
  1423. return object;
  1424. };
  1425. /***/ }),
  1426. /* 16 */
  1427. /***/ (function(module, exports, __webpack_require__) {
  1428. var global = __webpack_require__(3)
  1429. , hide = __webpack_require__(15)
  1430. , has = __webpack_require__(8)
  1431. , SRC = __webpack_require__(31)('src')
  1432. , TO_STRING = 'toString'
  1433. , $toString = Function[TO_STRING]
  1434. , TPL = ('' + $toString).split(TO_STRING);
  1435. __webpack_require__(26).inspectSource = function(it){
  1436. return $toString.call(it);
  1437. };
  1438. (module.exports = function(O, key, val, safe){
  1439. var isFunction = typeof val == 'function';
  1440. if(isFunction)has(val, 'name') || hide(val, 'name', key);
  1441. if(O[key] === val)return;
  1442. if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  1443. if(O === global){
  1444. O[key] = val;
  1445. } else {
  1446. if(!safe){
  1447. delete O[key];
  1448. hide(O, key, val);
  1449. } else {
  1450. if(O[key])O[key] = val;
  1451. else hide(O, key, val);
  1452. }
  1453. }
  1454. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  1455. })(Function.prototype, TO_STRING, function toString(){
  1456. return typeof this == 'function' && this[SRC] || $toString.call(this);
  1457. });
  1458. /***/ }),
  1459. /* 17 */
  1460. /***/ (function(module, exports, __webpack_require__) {
  1461. // 22.1.3.31 Array.prototype[@@unscopables]
  1462. var UNSCOPABLES = __webpack_require__(1)('unscopables')
  1463. , ArrayProto = Array.prototype;
  1464. if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(15)(ArrayProto, UNSCOPABLES, {});
  1465. module.exports = function(key){
  1466. ArrayProto[UNSCOPABLES][key] = true;
  1467. };
  1468. /***/ }),
  1469. /* 18 */
  1470. /***/ (function(module, exports) {
  1471. var toString = {}.toString;
  1472. module.exports = function(it){
  1473. return toString.call(it).slice(8, -1);
  1474. };
  1475. /***/ }),
  1476. /* 19 */
  1477. /***/ (function(module, exports, __webpack_require__) {
  1478. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  1479. var $keys = __webpack_require__(91)
  1480. , enumBugKeys = __webpack_require__(47);
  1481. module.exports = Object.keys || function keys(O){
  1482. return $keys(O, enumBugKeys);
  1483. };
  1484. /***/ }),
  1485. /* 20 */
  1486. /***/ (function(module, exports) {
  1487. module.exports = function(bitmap, value){
  1488. return {
  1489. enumerable : !(bitmap & 1),
  1490. configurable: !(bitmap & 2),
  1491. writable : !(bitmap & 4),
  1492. value : value
  1493. };
  1494. };
  1495. /***/ }),
  1496. /* 21 */
  1497. /***/ (function(module, exports, __webpack_require__) {
  1498. // 7.1.13 ToObject(argument)
  1499. var defined = __webpack_require__(13);
  1500. module.exports = function(it){
  1501. return Object(defined(it));
  1502. };
  1503. /***/ }),
  1504. /* 22 */
  1505. /***/ (function(module, exports, __webpack_require__) {
  1506. "use strict";
  1507. exports.__esModule = true;
  1508. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1509. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1510. /**
  1511. * CellCoords holds cell coordinates (row, column) and few method to validate them and
  1512. * retrieve as an array or an object
  1513. *
  1514. * @class CellCoords
  1515. */
  1516. var CellCoords = function () {
  1517. /**
  1518. * @param {Number} row Row index
  1519. * @param {Number} col Column index
  1520. */
  1521. function CellCoords(row, col) {
  1522. _classCallCheck(this, CellCoords);
  1523. if (typeof row !== 'undefined' && typeof col !== 'undefined') {
  1524. this.row = row;
  1525. this.col = col;
  1526. } else {
  1527. this.row = null;
  1528. this.col = null;
  1529. }
  1530. }
  1531. /**
  1532. * Checks if given set of coordinates is valid in context of a given Walkontable instance
  1533. *
  1534. * @param {Walkontable} wotInstance
  1535. * @returns {Boolean}
  1536. */
  1537. _createClass(CellCoords, [{
  1538. key: 'isValid',
  1539. value: function isValid(wotInstance) {
  1540. // is it a valid cell index (0 or higher)
  1541. if (this.row < 0 || this.col < 0) {
  1542. return false;
  1543. }
  1544. // is selection within total rows and columns
  1545. if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) {
  1546. return false;
  1547. }
  1548. return true;
  1549. }
  1550. /**
  1551. * Checks if this cell coords are the same as cell coords given as a parameter
  1552. *
  1553. * @param {CellCoords} cellCoords
  1554. * @returns {Boolean}
  1555. */
  1556. }, {
  1557. key: 'isEqual',
  1558. value: function isEqual(cellCoords) {
  1559. if (cellCoords === this) {
  1560. return true;
  1561. }
  1562. return this.row === cellCoords.row && this.col === cellCoords.col;
  1563. }
  1564. /**
  1565. * Checks if tested coordinates are positioned in south-east from this cell coords
  1566. *
  1567. * @param {Object} testedCoords
  1568. * @returns {Boolean}
  1569. */
  1570. }, {
  1571. key: 'isSouthEastOf',
  1572. value: function isSouthEastOf(testedCoords) {
  1573. return this.row >= testedCoords.row && this.col >= testedCoords.col;
  1574. }
  1575. /**
  1576. * Checks if tested coordinates are positioned in north-east from this cell coords
  1577. *
  1578. * @param {Object} testedCoords
  1579. * @returns {Boolean}
  1580. */
  1581. }, {
  1582. key: 'isNorthWestOf',
  1583. value: function isNorthWestOf(testedCoords) {
  1584. return this.row <= testedCoords.row && this.col <= testedCoords.col;
  1585. }
  1586. /**
  1587. * Checks if tested coordinates are positioned in south-west from this cell coords
  1588. *
  1589. * @param {Object} testedCoords
  1590. * @returns {Boolean}
  1591. */
  1592. }, {
  1593. key: 'isSouthWestOf',
  1594. value: function isSouthWestOf(testedCoords) {
  1595. return this.row >= testedCoords.row && this.col <= testedCoords.col;
  1596. }
  1597. /**
  1598. * Checks if tested coordinates are positioned in north-east from this cell coords
  1599. *
  1600. * @param {Object} testedCoords
  1601. * @returns {Boolean}
  1602. */
  1603. }, {
  1604. key: 'isNorthEastOf',
  1605. value: function isNorthEastOf(testedCoords) {
  1606. return this.row <= testedCoords.row && this.col >= testedCoords.col;
  1607. }
  1608. }]);
  1609. return CellCoords;
  1610. }();
  1611. exports.default = CellCoords;
  1612. /***/ }),
  1613. /* 23 */
  1614. /***/ (function(module, exports, __webpack_require__) {
  1615. "use strict";
  1616. exports.__esModule = true;
  1617. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // import Core from './core';
  1618. exports.getListenersCounter = getListenersCounter;
  1619. var _element = __webpack_require__(2);
  1620. var _feature = __webpack_require__(74);
  1621. var _event = __webpack_require__(73);
  1622. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1623. /**
  1624. * Counter which tracks unregistered listeners (useful for detecting memory leaks).
  1625. *
  1626. * @type {Number}
  1627. */
  1628. var listenersCounter = 0;
  1629. /**
  1630. * Event DOM manager for internal use in Handsontable.
  1631. *
  1632. * @class EventManager
  1633. * @util
  1634. */
  1635. var EventManager = function () {
  1636. /**
  1637. * @param {Object} [context=null]
  1638. * @private
  1639. */
  1640. function EventManager() {
  1641. var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  1642. _classCallCheck(this, EventManager);
  1643. this.context = context || this;
  1644. if (!this.context.eventListeners) {
  1645. this.context.eventListeners = [];
  1646. }
  1647. }
  1648. /**
  1649. * Register specified listener (`eventName`) to the element.
  1650. *
  1651. * @param {Element} element Target element.
  1652. * @param {String} eventName Event name.
  1653. * @param {Function} callback Function which will be called after event occur.
  1654. * @returns {Function} Returns function which you can easily call to remove that event
  1655. */
  1656. _createClass(EventManager, [{
  1657. key: 'addEventListener',
  1658. value: function addEventListener(element, eventName, callback) {
  1659. var _this = this;
  1660. var context = this.context;
  1661. function callbackProxy(event) {
  1662. event = extendEvent(context, event);
  1663. callback.call(this, event);
  1664. }
  1665. this.context.eventListeners.push({
  1666. element: element,
  1667. event: eventName,
  1668. callback: callback,
  1669. callbackProxy: callbackProxy
  1670. });
  1671. if (window.addEventListener) {
  1672. element.addEventListener(eventName, callbackProxy, false);
  1673. } else {
  1674. element.attachEvent('on' + eventName, callbackProxy);
  1675. }
  1676. listenersCounter++;
  1677. return function () {
  1678. _this.removeEventListener(element, eventName, callback);
  1679. };
  1680. }
  1681. /**
  1682. * Remove the event listener previously registered.
  1683. *
  1684. * @param {Element} element Target element.
  1685. * @param {String} eventName Event name.
  1686. * @param {Function} callback Function to remove from the event target. It must be the same as during registration listener.
  1687. */
  1688. }, {
  1689. key: 'removeEventListener',
  1690. value: function removeEventListener(element, eventName, callback) {
  1691. var len = this.context.eventListeners.length;
  1692. var tmpEvent = void 0;
  1693. while (len--) {
  1694. tmpEvent = this.context.eventListeners[len];
  1695. if (tmpEvent.event == eventName && tmpEvent.element == element) {
  1696. if (callback && callback != tmpEvent.callback) {
  1697. /* eslint-disable no-continue */
  1698. continue;
  1699. }
  1700. this.context.eventListeners.splice(len, 1);
  1701. if (tmpEvent.element.removeEventListener) {
  1702. tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false);
  1703. } else {
  1704. tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy);
  1705. }
  1706. listenersCounter--;
  1707. }
  1708. }
  1709. }
  1710. /**
  1711. * Clear all previously registered events.
  1712. *
  1713. * @private
  1714. * @since 0.15.0-beta3
  1715. */
  1716. }, {
  1717. key: 'clearEvents',
  1718. value: function clearEvents() {
  1719. if (!this.context) {
  1720. return;
  1721. }
  1722. var len = this.context.eventListeners.length;
  1723. while (len--) {
  1724. var event = this.context.eventListeners[len];
  1725. if (event) {
  1726. this.removeEventListener(event.element, event.event, event.callback);
  1727. }
  1728. }
  1729. }
  1730. /**
  1731. * Clear all previously registered events.
  1732. */
  1733. }, {
  1734. key: 'clear',
  1735. value: function clear() {
  1736. this.clearEvents();
  1737. }
  1738. /**
  1739. * Destroy instance of EventManager.
  1740. */
  1741. }, {
  1742. key: 'destroy',
  1743. value: function destroy() {
  1744. this.clearEvents();
  1745. this.context = null;
  1746. }
  1747. /**
  1748. * Trigger event at the specified target element.
  1749. *
  1750. * @param {Element} element Target element.
  1751. * @param {String} eventName Event name.
  1752. */
  1753. }, {
  1754. key: 'fireEvent',
  1755. value: function fireEvent(element, eventName) {
  1756. var options = {
  1757. bubbles: true,
  1758. cancelable: eventName !== 'mousemove',
  1759. view: window,
  1760. detail: 0,
  1761. screenX: 0,
  1762. screenY: 0,
  1763. clientX: 1,
  1764. clientY: 1,
  1765. ctrlKey: false,
  1766. altKey: false,
  1767. shiftKey: false,
  1768. metaKey: false,
  1769. button: 0,
  1770. relatedTarget: undefined
  1771. };
  1772. var event;
  1773. if (document.createEvent) {
  1774. event = document.createEvent('MouseEvents');
  1775. event.initMouseEvent(eventName, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.button, options.relatedTarget || document.body.parentNode);
  1776. } else {
  1777. event = document.createEventObject();
  1778. }
  1779. if (element.dispatchEvent) {
  1780. element.dispatchEvent(event);
  1781. } else {
  1782. element.fireEvent('on' + eventName, event);
  1783. }
  1784. }
  1785. }]);
  1786. return EventManager;
  1787. }();
  1788. /**
  1789. * @param {Object} context
  1790. * @param {Event} event
  1791. * @private
  1792. * @returns {*}
  1793. */
  1794. function extendEvent(context, event) {
  1795. var componentName = 'HOT-TABLE';
  1796. var isHotTableSpotted = void 0;
  1797. var fromElement = void 0;
  1798. var realTarget = void 0;
  1799. var target = void 0;
  1800. var len = void 0;
  1801. var nativeStopImmediatePropagation = void 0;
  1802. event.isTargetWebComponent = false;
  1803. event.realTarget = event.target;
  1804. nativeStopImmediatePropagation = event.stopImmediatePropagation;
  1805. event.stopImmediatePropagation = function () {
  1806. nativeStopImmediatePropagation.apply(this);
  1807. (0, _event.stopImmediatePropagation)(this);
  1808. };
  1809. if (!EventManager.isHotTableEnv) {
  1810. return event;
  1811. }
  1812. event = (0, _element.polymerWrap)(event);
  1813. len = event.path ? event.path.length : 0;
  1814. while (len--) {
  1815. if (event.path[len].nodeName === componentName) {
  1816. isHotTableSpotted = true;
  1817. } else if (isHotTableSpotted && event.path[len].shadowRoot) {
  1818. target = event.path[len];
  1819. break;
  1820. }
  1821. if (len === 0 && !target) {
  1822. target = event.path[len];
  1823. }
  1824. }
  1825. if (!target) {
  1826. target = event.target;
  1827. }
  1828. event.isTargetWebComponent = true;
  1829. if ((0, _feature.isWebComponentSupportedNatively)()) {
  1830. event.realTarget = event.srcElement || event.toElement;
  1831. } else if (context instanceof Core || context instanceof Walkontable) {
  1832. // Polymer doesn't support `event.target` property properly we must emulate it ourselves
  1833. if (context instanceof Core) {
  1834. fromElement = context.view ? context.view.wt.wtTable.TABLE : null;
  1835. } else if (context instanceof Walkontable) {
  1836. // .wtHider
  1837. fromElement = context.wtTable.TABLE.parentNode.parentNode;
  1838. }
  1839. realTarget = (0, _element.closest)(event.target, [componentName], fromElement);
  1840. if (realTarget) {
  1841. event.realTarget = fromElement.querySelector(componentName) || event.target;
  1842. } else {
  1843. event.realTarget = event.target;
  1844. }
  1845. }
  1846. Object.defineProperty(event, 'target', {
  1847. get: function get() {
  1848. return (0, _element.polymerWrap)(target);
  1849. },
  1850. enumerable: true,
  1851. configurable: true
  1852. });
  1853. return event;
  1854. }
  1855. exports.default = EventManager;
  1856. function getListenersCounter() {
  1857. return listenersCounter;
  1858. };
  1859. /***/ }),
  1860. /* 24 */
  1861. /***/ (function(module, exports, __webpack_require__) {
  1862. "use strict";
  1863. exports.__esModule = true;
  1864. exports.to2dArray = to2dArray;
  1865. exports.extendArray = extendArray;
  1866. exports.pivot = pivot;
  1867. exports.arrayReduce = arrayReduce;
  1868. exports.arrayFilter = arrayFilter;
  1869. exports.arrayMap = arrayMap;
  1870. exports.arrayEach = arrayEach;
  1871. exports.arraySum = arraySum;
  1872. exports.arrayMax = arrayMax;
  1873. exports.arrayMin = arrayMin;
  1874. exports.arrayAvg = arrayAvg;
  1875. exports.arrayFlatten = arrayFlatten;
  1876. exports.arrayUnique = arrayUnique;
  1877. function to2dArray(arr) {
  1878. var i = 0,
  1879. ilen = arr.length;
  1880. while (i < ilen) {
  1881. arr[i] = [arr[i]];
  1882. i++;
  1883. }
  1884. }
  1885. function extendArray(arr, extension) {
  1886. var i = 0,
  1887. ilen = extension.length;
  1888. while (i < ilen) {
  1889. arr.push(extension[i]);
  1890. i++;
  1891. }
  1892. }
  1893. function pivot(arr) {
  1894. var pivotedArr = [];
  1895. if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) {
  1896. return pivotedArr;
  1897. }
  1898. var rowCount = arr.length;
  1899. var colCount = arr[0].length;
  1900. for (var i = 0; i < rowCount; i++) {
  1901. for (var j = 0; j < colCount; j++) {
  1902. if (!pivotedArr[j]) {
  1903. pivotedArr[j] = [];
  1904. }
  1905. pivotedArr[j][i] = arr[i][j];
  1906. }
  1907. }
  1908. return pivotedArr;
  1909. }
  1910. /**
  1911. * A specialized version of `.reduce` for arrays without support for callback
  1912. * shorthands and `this` binding.
  1913. *
  1914. * {@link https://github.com/lodash/lodash/blob/master/lodash.js}
  1915. *
  1916. * @param {Array} array The array to iterate over.
  1917. * @param {Function} iteratee The function invoked per iteration.
  1918. * @param {*} [accumulator] The initial value.
  1919. * @param {Boolean} [initFromArray] Specify using the first element of `array` as the initial value.
  1920. * @returns {*} Returns the accumulated value.
  1921. */
  1922. function arrayReduce(array, iteratee, accumulator, initFromArray) {
  1923. var index = -1,
  1924. length = array.length;
  1925. if (initFromArray && length) {
  1926. accumulator = array[++index];
  1927. }
  1928. while (++index < length) {
  1929. accumulator = iteratee(accumulator, array[index], index, array);
  1930. }
  1931. return accumulator;
  1932. }
  1933. /**
  1934. * A specialized version of `.filter` for arrays without support for callback
  1935. * shorthands and `this` binding.
  1936. *
  1937. * {@link https://github.com/lodash/lodash/blob/master/lodash.js}
  1938. *
  1939. * @param {Array} array The array to iterate over.
  1940. * @param {Function} predicate The function invoked per iteration.
  1941. * @returns {Array} Returns the new filtered array.
  1942. */
  1943. function arrayFilter(array, predicate) {
  1944. var index = -1,
  1945. length = array.length,
  1946. resIndex = -1,
  1947. result = [];
  1948. while (++index < length) {
  1949. var value = array[index];
  1950. if (predicate(value, index, array)) {
  1951. result[++resIndex] = value;
  1952. }
  1953. }
  1954. return result;
  1955. }
  1956. /**
  1957. * A specialized version of `.map` for arrays without support for callback
  1958. * shorthands and `this` binding.
  1959. *
  1960. * @param {Array} array The array to iterate over.
  1961. * @param {Function} iteratee The function invoked per iteration.
  1962. * @returns {Array} Returns the new filtered array.
  1963. */
  1964. function arrayMap(array, iteratee) {
  1965. var index = -1,
  1966. length = array.length,
  1967. resIndex = -1,
  1968. result = [];
  1969. while (++index < length) {
  1970. var value = array[index];
  1971. result[++resIndex] = iteratee(value, index, array);
  1972. }
  1973. return result;
  1974. }
  1975. /**
  1976. * A specialized version of `.forEach` for arrays without support for callback
  1977. * shorthands and `this` binding.
  1978. *
  1979. * {@link https://github.com/lodash/lodash/blob/master/lodash.js}
  1980. *
  1981. * @param {Array} array The array to iterate over.
  1982. * @param {Function} iteratee The function invoked per iteration.
  1983. * @returns {Array} Returns `array`.
  1984. */
  1985. function arrayEach(array, iteratee) {
  1986. var index = -1,
  1987. length = array.length;
  1988. while (++index < length) {
  1989. if (iteratee(array[index], index, array) === false) {
  1990. break;
  1991. }
  1992. }
  1993. return array;
  1994. }
  1995. /**
  1996. * Calculate sum value for each item of the array.
  1997. *
  1998. * @param {Array} array The array to process.
  1999. * @returns {Number} Returns calculated sum value.
  2000. */
  2001. function arraySum(array) {
  2002. return arrayReduce(array, function (a, b) {
  2003. return a + b;
  2004. }, 0);
  2005. }
  2006. /**
  2007. * Returns the highest value from an array. Can be array of numbers or array of strings.
  2008. * NOTICE: Mixed values is not supported.
  2009. *
  2010. * @param {Array} array The array to process.
  2011. * @returns {Number} Returns the highest value from an array.
  2012. */
  2013. function arrayMax(array) {
  2014. return arrayReduce(array, function (a, b) {
  2015. return a > b ? a : b;
  2016. }, Array.isArray(array) ? array[0] : void 0);
  2017. }
  2018. /**
  2019. * Returns the lowest value from an array. Can be array of numbers or array of strings.
  2020. * NOTICE: Mixed values is not supported.
  2021. *
  2022. * @param {Array} array The array to process.
  2023. * @returns {Number} Returns the lowest value from an array.
  2024. */
  2025. function arrayMin(array) {
  2026. return arrayReduce(array, function (a, b) {
  2027. return a < b ? a : b;
  2028. }, Array.isArray(array) ? array[0] : void 0);
  2029. }
  2030. /**
  2031. * Calculate average value for each item of the array.
  2032. *
  2033. * @param {Array} array The array to process.
  2034. * @returns {Number} Returns calculated average value.
  2035. */
  2036. function arrayAvg(array) {
  2037. if (!array.length) {
  2038. return 0;
  2039. }
  2040. return arraySum(array) / array.length;
  2041. }
  2042. /**
  2043. * Flatten multidimensional array.
  2044. *
  2045. * @param {Array} array Array of Arrays
  2046. * @returns {Array}
  2047. */
  2048. function arrayFlatten(array) {
  2049. return arrayReduce(array, function (initial, value) {
  2050. return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value);
  2051. }, []);
  2052. }
  2053. /**
  2054. * Unique values in the array.
  2055. *
  2056. * @param {Array} array The array to process.
  2057. * @returns {Array}
  2058. */
  2059. function arrayUnique(array) {
  2060. var unique = [];
  2061. arrayEach(array, function (value) {
  2062. if (unique.indexOf(value) === -1) {
  2063. unique.push(value);
  2064. }
  2065. });
  2066. return unique;
  2067. }
  2068. /***/ }),
  2069. /* 25 */
  2070. /***/ (function(module, exports, __webpack_require__) {
  2071. "use strict";
  2072. exports.__esModule = true;
  2073. 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; };
  2074. exports.duckSchema = duckSchema;
  2075. exports.inherit = inherit;
  2076. exports.extend = extend;
  2077. exports.deepExtend = deepExtend;
  2078. exports.deepClone = deepClone;
  2079. exports.clone = clone;
  2080. exports.mixin = mixin;
  2081. exports.isObjectEquals = isObjectEquals;
  2082. exports.isObject = isObject;
  2083. exports.defineGetter = defineGetter;
  2084. exports.objectEach = objectEach;
  2085. exports.getProperty = getProperty;
  2086. exports.deepObjectSize = deepObjectSize;
  2087. exports.createObjectPropListener = createObjectPropListener;
  2088. exports.hasOwnProperty = hasOwnProperty;
  2089. var _array = __webpack_require__(24);
  2090. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  2091. /**
  2092. * Generate schema for passed object.
  2093. *
  2094. * @param {Array|Object} object
  2095. * @returns {Array|Object}
  2096. */
  2097. function duckSchema(object) {
  2098. var schema;
  2099. if (Array.isArray(object)) {
  2100. schema = [];
  2101. } else {
  2102. schema = {};
  2103. objectEach(object, function (value, key) {
  2104. if (key === '__children') {
  2105. return;
  2106. }
  2107. if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !Array.isArray(value)) {
  2108. schema[key] = duckSchema(value);
  2109. } else if (Array.isArray(value)) {
  2110. if (value.length && _typeof(value[0]) === 'object' && !Array.isArray(value[0])) {
  2111. schema[key] = [duckSchema(value[0])];
  2112. } else {
  2113. schema[key] = [];
  2114. }
  2115. } else {
  2116. schema[key] = null;
  2117. }
  2118. });
  2119. }
  2120. return schema;
  2121. }
  2122. /**
  2123. * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`.
  2124. * Creates temporary dummy function to call it as constructor.
  2125. * Described in ticket: https://github.com/handsontable/handsontable/pull/516
  2126. *
  2127. * @param {Object} Child child class
  2128. * @param {Object} Parent parent class
  2129. * @return {Object} extended Child
  2130. */
  2131. function inherit(Child, Parent) {
  2132. Parent.prototype.constructor = Parent;
  2133. Child.prototype = new Parent();
  2134. Child.prototype.constructor = Child;
  2135. return Child;
  2136. }
  2137. /**
  2138. * Perform shallow extend of a target object with extension's own properties.
  2139. *
  2140. * @param {Object} target An object that will receive the new properties.
  2141. * @param {Object} extension An object containing additional properties to merge into the target.
  2142. */
  2143. function extend(target, extension) {
  2144. objectEach(extension, function (value, key) {
  2145. target[key] = value;
  2146. });
  2147. return target;
  2148. }
  2149. /**
  2150. * Perform deep extend of a target object with extension's own properties.
  2151. *
  2152. * @param {Object} target An object that will receive the new properties.
  2153. * @param {Object} extension An object containing additional properties to merge into the target.
  2154. */
  2155. function deepExtend(target, extension) {
  2156. objectEach(extension, function (value, key) {
  2157. if (extension[key] && _typeof(extension[key]) === 'object') {
  2158. if (!target[key]) {
  2159. if (Array.isArray(extension[key])) {
  2160. target[key] = [];
  2161. } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') {
  2162. target[key] = extension[key];
  2163. } else {
  2164. target[key] = {};
  2165. }
  2166. }
  2167. deepExtend(target[key], extension[key]);
  2168. } else {
  2169. target[key] = extension[key];
  2170. }
  2171. });
  2172. }
  2173. /**
  2174. * Perform deep clone of an object.
  2175. * WARNING! Only clones JSON properties. Will cause error when `obj` contains a function, Date, etc.
  2176. *
  2177. * @param {Object} obj An object that will be cloned
  2178. * @return {Object}
  2179. */
  2180. function deepClone(obj) {
  2181. if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {
  2182. return JSON.parse(JSON.stringify(obj));
  2183. }
  2184. return obj;
  2185. }
  2186. /**
  2187. * Shallow clone object.
  2188. *
  2189. * @param {Object} object
  2190. * @returns {Object}
  2191. */
  2192. function clone(object) {
  2193. var result = {};
  2194. objectEach(object, function (value, key) {
  2195. result[key] = value;
  2196. });
  2197. return result;
  2198. }
  2199. /**
  2200. * Extend the Base object (usually prototype) of the functionality the `mixins` objects.
  2201. *
  2202. * @param {Object} Base Base object which will be extended.
  2203. * @param {Object} mixins The object of the functionality will be "copied".
  2204. * @returns {Object}
  2205. */
  2206. function mixin(Base) {
  2207. if (!Base.MIXINS) {
  2208. Base.MIXINS = [];
  2209. }
  2210. for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2211. mixins[_key - 1] = arguments[_key];
  2212. }
  2213. (0, _array.arrayEach)(mixins, function (mixin) {
  2214. Base.MIXINS.push(mixin.MIXIN_NAME);
  2215. objectEach(mixin, function (value, key) {
  2216. if (Base.prototype[key] !== void 0) {
  2217. throw new Error('Mixin conflict. Property \'' + key + '\' already exist and cannot be overwritten.');
  2218. }
  2219. if (typeof value === 'function') {
  2220. Base.prototype[key] = value;
  2221. } else {
  2222. var getter = function _getter(propertyName, initialValue) {
  2223. propertyName = '_' + propertyName;
  2224. var initValue = function initValue(value) {
  2225. if (Array.isArray(value) || isObject(value)) {
  2226. value = deepClone(value);
  2227. }
  2228. return value;
  2229. };
  2230. return function () {
  2231. if (this[propertyName] === void 0) {
  2232. this[propertyName] = initValue(initialValue);
  2233. }
  2234. return this[propertyName];
  2235. };
  2236. };
  2237. var setter = function _setter(propertyName) {
  2238. propertyName = '_' + propertyName;
  2239. return function (value) {
  2240. this[propertyName] = value;
  2241. };
  2242. };
  2243. Object.defineProperty(Base.prototype, key, {
  2244. get: getter(key, value),
  2245. set: setter(key),
  2246. configurable: true
  2247. });
  2248. }
  2249. });
  2250. });
  2251. return Base;
  2252. }
  2253. /**
  2254. * Checks if two objects or arrays are (deep) equal
  2255. *
  2256. * @param {Object|Array} object1
  2257. * @param {Object|Array} object2
  2258. * @returns {Boolean}
  2259. */
  2260. function isObjectEquals(object1, object2) {
  2261. return JSON.stringify(object1) === JSON.stringify(object2);
  2262. }
  2263. /**
  2264. * Determines whether given object is a plain Object.
  2265. * Note: String and Array are not plain Objects
  2266. * @param {*} obj
  2267. * @returns {boolean}
  2268. */
  2269. function isObject(obj) {
  2270. return Object.prototype.toString.call(obj) == '[object Object]';
  2271. }
  2272. function defineGetter(object, property, value, options) {
  2273. options.value = value;
  2274. options.writable = options.writable !== false;
  2275. options.enumerable = options.enumerable !== false;
  2276. options.configurable = options.configurable !== false;
  2277. Object.defineProperty(object, property, options);
  2278. }
  2279. /**
  2280. * A specialized version of `.forEach` for objects.
  2281. *
  2282. * @param {Object} object The object to iterate over.
  2283. * @param {Function} iteratee The function invoked per iteration.
  2284. * @returns {Object} Returns `object`.
  2285. */
  2286. function objectEach(object, iteratee) {
  2287. for (var key in object) {
  2288. if (!object.hasOwnProperty || object.hasOwnProperty && Object.prototype.hasOwnProperty.call(object, key)) {
  2289. if (iteratee(object[key], key, object) === false) {
  2290. break;
  2291. }
  2292. }
  2293. }
  2294. return object;
  2295. }
  2296. /**
  2297. * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`).
  2298. *
  2299. * @param {Object} object Object which value will be exported.
  2300. * @param {String} name Object property name.
  2301. * @returns {*}
  2302. */
  2303. function getProperty(object, name) {
  2304. var names = name.split('.');
  2305. var result = object;
  2306. objectEach(names, function (name) {
  2307. result = result[name];
  2308. if (result === void 0) {
  2309. result = void 0;
  2310. return false;
  2311. }
  2312. });
  2313. return result;
  2314. }
  2315. /**
  2316. * Return object length (recursively).
  2317. *
  2318. * @param {*} object Object for which we want get length.
  2319. * @returns {Number}
  2320. */
  2321. function deepObjectSize(object) {
  2322. if (!isObject(object)) {
  2323. return 0;
  2324. }
  2325. var recursObjLen = function recursObjLen(obj) {
  2326. var result = 0;
  2327. if (isObject(obj)) {
  2328. objectEach(obj, function (key) {
  2329. result += recursObjLen(key);
  2330. });
  2331. } else {
  2332. result++;
  2333. }
  2334. return result;
  2335. };
  2336. return recursObjLen(object);
  2337. }
  2338. /**
  2339. * Create object with property where its value change will be observed.
  2340. *
  2341. * @param {*} [defaultValue=undefined] Default value.
  2342. * @param {String} [propertyToListen='value'] Property to listen.
  2343. * @returns {Object}
  2344. */
  2345. function createObjectPropListener(defaultValue) {
  2346. var _holder;
  2347. var propertyToListen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
  2348. var privateProperty = '_' + propertyToListen;
  2349. var holder = (_holder = {
  2350. _touched: false
  2351. }, _defineProperty(_holder, privateProperty, defaultValue), _defineProperty(_holder, 'isTouched', function isTouched() {
  2352. return this._touched;
  2353. }), _holder);
  2354. Object.defineProperty(holder, propertyToListen, {
  2355. get: function get() {
  2356. return this[privateProperty];
  2357. },
  2358. set: function set(value) {
  2359. this._touched = true;
  2360. this[privateProperty] = value;
  2361. },
  2362. enumerable: true,
  2363. configurable: true
  2364. });
  2365. return holder;
  2366. }
  2367. /**
  2368. * Check if at specified `key` there is any value for `object`.
  2369. *
  2370. * @param {Object} object Object to search value at specyfic key.
  2371. * @param {String} key String key to check.
  2372. */
  2373. function hasOwnProperty(object, key) {
  2374. return Object.prototype.hasOwnProperty.call(object, key);
  2375. }
  2376. /***/ }),
  2377. /* 26 */
  2378. /***/ (function(module, exports) {
  2379. var core = module.exports = {version: '2.4.0'};
  2380. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  2381. /***/ }),
  2382. /* 27 */
  2383. /***/ (function(module, exports) {
  2384. module.exports = {};
  2385. /***/ }),
  2386. /* 28 */
  2387. /***/ (function(module, exports, __webpack_require__) {
  2388. var META = __webpack_require__(31)('meta')
  2389. , isObject = __webpack_require__(4)
  2390. , has = __webpack_require__(8)
  2391. , setDesc = __webpack_require__(6).f
  2392. , id = 0;
  2393. var isExtensible = Object.isExtensible || function(){
  2394. return true;
  2395. };
  2396. var FREEZE = !__webpack_require__(14)(function(){
  2397. return isExtensible(Object.preventExtensions({}));
  2398. });
  2399. var setMeta = function(it){
  2400. setDesc(it, META, {value: {
  2401. i: 'O' + ++id, // object ID
  2402. w: {} // weak collections IDs
  2403. }});
  2404. };
  2405. var fastKey = function(it, create){
  2406. // return primitive with prefix
  2407. if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  2408. if(!has(it, META)){
  2409. // can't set metadata to uncaught frozen object
  2410. if(!isExtensible(it))return 'F';
  2411. // not necessary to add metadata
  2412. if(!create)return 'E';
  2413. // add missing metadata
  2414. setMeta(it);
  2415. // return object ID
  2416. } return it[META].i;
  2417. };
  2418. var getWeak = function(it, create){
  2419. if(!has(it, META)){
  2420. // can't set metadata to uncaught frozen object
  2421. if(!isExtensible(it))return true;
  2422. // not necessary to add metadata
  2423. if(!create)return false;
  2424. // add missing metadata
  2425. setMeta(it);
  2426. // return hash weak collections IDs
  2427. } return it[META].w;
  2428. };
  2429. // add metadata on freeze-family methods calling
  2430. var onFreeze = function(it){
  2431. if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
  2432. return it;
  2433. };
  2434. var meta = module.exports = {
  2435. KEY: META,
  2436. NEED: false,
  2437. fastKey: fastKey,
  2438. getWeak: getWeak,
  2439. onFreeze: onFreeze
  2440. };
  2441. /***/ }),
  2442. /* 29 */
  2443. /***/ (function(module, exports) {
  2444. exports.f = {}.propertyIsEnumerable;
  2445. /***/ }),
  2446. /* 30 */
  2447. /***/ (function(module, exports, __webpack_require__) {
  2448. var def = __webpack_require__(6).f
  2449. , has = __webpack_require__(8)
  2450. , TAG = __webpack_require__(1)('toStringTag');
  2451. module.exports = function(it, tag, stat){
  2452. if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
  2453. };
  2454. /***/ }),
  2455. /* 31 */
  2456. /***/ (function(module, exports) {
  2457. var id = 0
  2458. , px = Math.random();
  2459. module.exports = function(key){
  2460. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  2461. };
  2462. /***/ }),
  2463. /* 32 */
  2464. /***/ (function(module, exports, __webpack_require__) {
  2465. "use strict";
  2466. exports.__esModule = true;
  2467. exports.isIE8 = isIE8;
  2468. exports.isIE9 = isIE9;
  2469. exports.isSafari = isSafari;
  2470. exports.isChrome = isChrome;
  2471. exports.isMobileBrowser = isMobileBrowser;
  2472. var _isIE8 = !document.createTextNode('test').textContent;
  2473. function isIE8() {
  2474. return _isIE8;
  2475. }
  2476. var _isIE9 = !!document.documentMode;
  2477. function isIE9() {
  2478. return _isIE9;
  2479. }
  2480. var _isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
  2481. function isSafari() {
  2482. return _isSafari;
  2483. }
  2484. var _isChrome = /Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor);
  2485. function isChrome() {
  2486. return _isChrome;
  2487. }
  2488. function isMobileBrowser(userAgent) {
  2489. if (!userAgent) {
  2490. userAgent = navigator.userAgent;
  2491. }
  2492. return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)
  2493. );
  2494. }
  2495. /***/ }),
  2496. /* 33 */
  2497. /***/ (function(module, exports) {
  2498. module.exports = function(it, Constructor, name, forbiddenField){
  2499. if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
  2500. throw TypeError(name + ': incorrect invocation!');
  2501. } return it;
  2502. };
  2503. /***/ }),
  2504. /* 34 */
  2505. /***/ (function(module, exports, __webpack_require__) {
  2506. // 0 -> Array#forEach
  2507. // 1 -> Array#map
  2508. // 2 -> Array#filter
  2509. // 3 -> Array#some
  2510. // 4 -> Array#every
  2511. // 5 -> Array#find
  2512. // 6 -> Array#findIndex
  2513. var ctx = __webpack_require__(12)
  2514. , IObject = __webpack_require__(49)
  2515. , toObject = __webpack_require__(21)
  2516. , toLength = __webpack_require__(10)
  2517. , asc = __webpack_require__(154);
  2518. module.exports = function(TYPE, $create){
  2519. var IS_MAP = TYPE == 1
  2520. , IS_FILTER = TYPE == 2
  2521. , IS_SOME = TYPE == 3
  2522. , IS_EVERY = TYPE == 4
  2523. , IS_FIND_INDEX = TYPE == 6
  2524. , NO_HOLES = TYPE == 5 || IS_FIND_INDEX
  2525. , create = $create || asc;
  2526. return function($this, callbackfn, that){
  2527. var O = toObject($this)
  2528. , self = IObject(O)
  2529. , f = ctx(callbackfn, that, 3)
  2530. , length = toLength(self.length)
  2531. , index = 0
  2532. , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
  2533. , val, res;
  2534. for(;length > index; index++)if(NO_HOLES || index in self){
  2535. val = self[index];
  2536. res = f(val, index, O);
  2537. if(TYPE){
  2538. if(IS_MAP)result[index] = res; // map
  2539. else if(res)switch(TYPE){
  2540. case 3: return true; // some
  2541. case 5: return val; // find
  2542. case 6: return index; // findIndex
  2543. case 2: result.push(val); // filter
  2544. } else if(IS_EVERY)return false; // every
  2545. }
  2546. }
  2547. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  2548. };
  2549. };
  2550. /***/ }),
  2551. /* 35 */
  2552. /***/ (function(module, exports, __webpack_require__) {
  2553. "use strict";
  2554. var global = __webpack_require__(3)
  2555. , $export = __webpack_require__(0)
  2556. , redefine = __webpack_require__(16)
  2557. , redefineAll = __webpack_require__(40)
  2558. , meta = __webpack_require__(28)
  2559. , forOf = __webpack_require__(37)
  2560. , anInstance = __webpack_require__(33)
  2561. , isObject = __webpack_require__(4)
  2562. , fails = __webpack_require__(14)
  2563. , $iterDetect = __webpack_require__(50)
  2564. , setToStringTag = __webpack_require__(30)
  2565. , inheritIfRequired = __webpack_require__(157);
  2566. module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
  2567. var Base = global[NAME]
  2568. , C = Base
  2569. , ADDER = IS_MAP ? 'set' : 'add'
  2570. , proto = C && C.prototype
  2571. , O = {};
  2572. var fixMethod = function(KEY){
  2573. var fn = proto[KEY];
  2574. redefine(proto, KEY,
  2575. KEY == 'delete' ? function(a){
  2576. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  2577. } : KEY == 'has' ? function has(a){
  2578. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  2579. } : KEY == 'get' ? function get(a){
  2580. return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
  2581. } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }
  2582. : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }
  2583. );
  2584. };
  2585. if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){
  2586. new C().entries().next();
  2587. }))){
  2588. // create collection constructor
  2589. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  2590. redefineAll(C.prototype, methods);
  2591. meta.NEED = true;
  2592. } else {
  2593. var instance = new C
  2594. // early implementations not supports chaining
  2595. , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance
  2596. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  2597. , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })
  2598. // most early implementations doesn't supports iterables, most modern - not close it correctly
  2599. , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new
  2600. // for early implementations -0 and +0 not the same
  2601. , BUGGY_ZERO = !IS_WEAK && fails(function(){
  2602. // V8 ~ Chromium 42- fails only with 5+ elements
  2603. var $instance = new C()
  2604. , index = 5;
  2605. while(index--)$instance[ADDER](index, index);
  2606. return !$instance.has(-0);
  2607. });
  2608. if(!ACCEPT_ITERABLES){
  2609. C = wrapper(function(target, iterable){
  2610. anInstance(target, C, NAME);
  2611. var that = inheritIfRequired(new Base, target, C);
  2612. if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
  2613. return that;
  2614. });
  2615. C.prototype = proto;
  2616. proto.constructor = C;
  2617. }
  2618. if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){
  2619. fixMethod('delete');
  2620. fixMethod('has');
  2621. IS_MAP && fixMethod('get');
  2622. }
  2623. if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);
  2624. // weak collections should not contains .clear method
  2625. if(IS_WEAK && proto.clear)delete proto.clear;
  2626. }
  2627. setToStringTag(C, NAME);
  2628. O[NAME] = C;
  2629. $export($export.G + $export.W + $export.F * (C != Base), O);
  2630. if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
  2631. return C;
  2632. };
  2633. /***/ }),
  2634. /* 36 */
  2635. /***/ (function(module, exports, __webpack_require__) {
  2636. "use strict";
  2637. var hide = __webpack_require__(15)
  2638. , redefine = __webpack_require__(16)
  2639. , fails = __webpack_require__(14)
  2640. , defined = __webpack_require__(13)
  2641. , wks = __webpack_require__(1);
  2642. module.exports = function(KEY, length, exec){
  2643. var SYMBOL = wks(KEY)
  2644. , fns = exec(defined, SYMBOL, ''[KEY])
  2645. , strfn = fns[0]
  2646. , rxfn = fns[1];
  2647. if(fails(function(){
  2648. var O = {};
  2649. O[SYMBOL] = function(){ return 7; };
  2650. return ''[KEY](O) != 7;
  2651. })){
  2652. redefine(String.prototype, KEY, strfn);
  2653. hide(RegExp.prototype, SYMBOL, length == 2
  2654. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  2655. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  2656. ? function(string, arg){ return rxfn.call(string, this, arg); }
  2657. // 21.2.5.6 RegExp.prototype[@@match](string)
  2658. // 21.2.5.9 RegExp.prototype[@@search](string)
  2659. : function(string){ return rxfn.call(string, this); }
  2660. );
  2661. }
  2662. };
  2663. /***/ }),
  2664. /* 37 */
  2665. /***/ (function(module, exports, __webpack_require__) {
  2666. var ctx = __webpack_require__(12)
  2667. , call = __webpack_require__(87)
  2668. , isArrayIter = __webpack_require__(83)
  2669. , anObject = __webpack_require__(5)
  2670. , toLength = __webpack_require__(10)
  2671. , getIterFn = __webpack_require__(98)
  2672. , BREAK = {}
  2673. , RETURN = {};
  2674. var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
  2675. var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
  2676. , f = ctx(fn, that, entries ? 2 : 1)
  2677. , index = 0
  2678. , length, step, iterator, result;
  2679. if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
  2680. // fast case for arrays with default iterator
  2681. if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
  2682. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  2683. if(result === BREAK || result === RETURN)return result;
  2684. } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
  2685. result = call(iterator, f, step.value, entries);
  2686. if(result === BREAK || result === RETURN)return result;
  2687. }
  2688. };
  2689. exports.BREAK = BREAK;
  2690. exports.RETURN = RETURN;
  2691. /***/ }),
  2692. /* 38 */
  2693. /***/ (function(module, exports) {
  2694. module.exports = false;
  2695. /***/ }),
  2696. /* 39 */
  2697. /***/ (function(module, exports) {
  2698. exports.f = Object.getOwnPropertySymbols;
  2699. /***/ }),
  2700. /* 40 */
  2701. /***/ (function(module, exports, __webpack_require__) {
  2702. var redefine = __webpack_require__(16);
  2703. module.exports = function(target, src, safe){
  2704. for(var key in src)redefine(target, key, src[key], safe);
  2705. return target;
  2706. };
  2707. /***/ }),
  2708. /* 41 */
  2709. /***/ (function(module, exports, __webpack_require__) {
  2710. var toInteger = __webpack_require__(42)
  2711. , max = Math.max
  2712. , min = Math.min;
  2713. module.exports = function(index, length){
  2714. index = toInteger(index);
  2715. return index < 0 ? max(index + length, 0) : min(index, length);
  2716. };
  2717. /***/ }),
  2718. /* 42 */
  2719. /***/ (function(module, exports) {
  2720. // 7.1.4 ToInteger
  2721. var ceil = Math.ceil
  2722. , floor = Math.floor;
  2723. module.exports = function(it){
  2724. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  2725. };
  2726. /***/ }),
  2727. /* 43 */
  2728. /***/ (function(module, exports, __webpack_require__) {
  2729. "use strict";
  2730. exports.__esModule = true;
  2731. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2732. var _coords = __webpack_require__(22);
  2733. var _coords2 = _interopRequireDefault(_coords);
  2734. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2735. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2736. /**
  2737. * A cell range is a set of exactly two CellCoords (that can be the same or different)
  2738. *
  2739. * @class CellRange
  2740. */
  2741. var CellRange = function () {
  2742. /**
  2743. * @param {CellCoords} highlight Used to draw bold border around a cell where selection was
  2744. * started and to edit the cell when you press Enter
  2745. * @param {CellCoords} from Usually the same as highlight, but in Excel there is distinction - one can change
  2746. * highlight within a selection
  2747. * @param {CellCoords} to End selection
  2748. */
  2749. function CellRange(highlight, from, to) {
  2750. _classCallCheck(this, CellRange);
  2751. this.highlight = highlight;
  2752. this.from = from;
  2753. this.to = to;
  2754. }
  2755. /**
  2756. * Checks if given coords are valid in context of a given Walkontable instance
  2757. *
  2758. * @param {Walkontable} wotInstance
  2759. * @returns {Boolean}
  2760. */
  2761. _createClass(CellRange, [{
  2762. key: 'isValid',
  2763. value: function isValid(wotInstance) {
  2764. return this.from.isValid(wotInstance) && this.to.isValid(wotInstance);
  2765. }
  2766. /**
  2767. * Checks if this cell range is restricted to one cell
  2768. *
  2769. * @returns {Boolean}
  2770. */
  2771. }, {
  2772. key: 'isSingle',
  2773. value: function isSingle() {
  2774. return this.from.row === this.to.row && this.from.col === this.to.col;
  2775. }
  2776. /**
  2777. * Returns selected range height (in number of rows)
  2778. *
  2779. * @returns {Number}
  2780. */
  2781. }, {
  2782. key: 'getHeight',
  2783. value: function getHeight() {
  2784. return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;
  2785. }
  2786. /**
  2787. * Returns selected range width (in number of columns)
  2788. *
  2789. * @returns {Number}
  2790. */
  2791. }, {
  2792. key: 'getWidth',
  2793. value: function getWidth() {
  2794. return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;
  2795. }
  2796. /**
  2797. * Checks if given cell coords is within `from` and `to` cell coords of this range
  2798. *
  2799. * @param {CellCoords} cellCoords
  2800. * @returns {Boolean}
  2801. */
  2802. }, {
  2803. key: 'includes',
  2804. value: function includes(cellCoords) {
  2805. var row = cellCoords.row,
  2806. col = cellCoords.col;
  2807. var topLeft = this.getTopLeftCorner();
  2808. var bottomRight = this.getBottomRightCorner();
  2809. return topLeft.row <= row && bottomRight.row >= row && topLeft.col <= col && bottomRight.col >= col;
  2810. }
  2811. /**
  2812. * Checks if given range is within of this range
  2813. *
  2814. * @param {CellRange} testedRange
  2815. * @returns {Boolean}
  2816. */
  2817. }, {
  2818. key: 'includesRange',
  2819. value: function includesRange(testedRange) {
  2820. return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner());
  2821. }
  2822. /**
  2823. * Checks if given range is equal to this range
  2824. *
  2825. * @param {CellRange} testedRange
  2826. * @returns {Boolean}
  2827. */
  2828. }, {
  2829. key: 'isEqual',
  2830. value: function isEqual(testedRange) {
  2831. return Math.min(this.from.row, this.to.row) == Math.min(testedRange.from.row, testedRange.to.row) && Math.max(this.from.row, this.to.row) == Math.max(testedRange.from.row, testedRange.to.row) && Math.min(this.from.col, this.to.col) == Math.min(testedRange.from.col, testedRange.to.col) && Math.max(this.from.col, this.to.col) == Math.max(testedRange.from.col, testedRange.to.col);
  2832. }
  2833. /**
  2834. * Checks if tested range overlaps with the range.
  2835. * Range A is considered to to be overlapping with range B if intersection of A and B or B and A is not empty.
  2836. *
  2837. * @param {CellRange} testedRange
  2838. * @returns {Boolean}
  2839. */
  2840. }, {
  2841. key: 'overlaps',
  2842. value: function overlaps(testedRange) {
  2843. return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner());
  2844. }
  2845. /**
  2846. * @param {CellRange} testedCoords
  2847. * @returns {Boolean}
  2848. */
  2849. }, {
  2850. key: 'isSouthEastOf',
  2851. value: function isSouthEastOf(testedCoords) {
  2852. return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords);
  2853. }
  2854. /**
  2855. * @param {CellRange} testedCoords
  2856. * @returns {Boolean}
  2857. */
  2858. }, {
  2859. key: 'isNorthWestOf',
  2860. value: function isNorthWestOf(testedCoords) {
  2861. return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords);
  2862. }
  2863. /**
  2864. * Adds a cell to a range (only if exceeds corners of the range). Returns information if range was expanded
  2865. *
  2866. * @param {CellCoords} cellCoords
  2867. * @returns {Boolean}
  2868. */
  2869. }, {
  2870. key: 'expand',
  2871. value: function expand(cellCoords) {
  2872. var topLeft = this.getTopLeftCorner();
  2873. var bottomRight = this.getBottomRightCorner();
  2874. if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {
  2875. this.from = new _coords2.default(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));
  2876. this.to = new _coords2.default(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));
  2877. return true;
  2878. }
  2879. return false;
  2880. }
  2881. /**
  2882. * @param {CellRange} expandingRange
  2883. * @returns {Boolean}
  2884. */
  2885. }, {
  2886. key: 'expandByRange',
  2887. value: function expandByRange(expandingRange) {
  2888. if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {
  2889. return false;
  2890. }
  2891. var topLeft = this.getTopLeftCorner();
  2892. var bottomRight = this.getBottomRightCorner();
  2893. var topRight = this.getTopRightCorner();
  2894. var bottomLeft = this.getBottomLeftCorner();
  2895. var expandingTopLeft = expandingRange.getTopLeftCorner();
  2896. var expandingBottomRight = expandingRange.getBottomRightCorner();
  2897. var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);
  2898. var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);
  2899. var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);
  2900. var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);
  2901. var finalFrom = new _coords2.default(resultTopRow, resultTopCol),
  2902. finalTo = new _coords2.default(resultBottomRow, resultBottomCol);
  2903. var isCorner = new CellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange),
  2904. onlyMerge = expandingRange.isEqual(new CellRange(finalFrom, finalFrom, finalTo));
  2905. if (isCorner && !onlyMerge) {
  2906. if (this.from.col > finalFrom.col) {
  2907. finalFrom.col = resultBottomCol;
  2908. finalTo.col = resultTopCol;
  2909. }
  2910. if (this.from.row > finalFrom.row) {
  2911. finalFrom.row = resultBottomRow;
  2912. finalTo.row = resultTopRow;
  2913. }
  2914. }
  2915. this.from = finalFrom;
  2916. this.to = finalTo;
  2917. return true;
  2918. }
  2919. /**
  2920. * @returns {String}
  2921. */
  2922. }, {
  2923. key: 'getDirection',
  2924. value: function getDirection() {
  2925. if (this.from.isNorthWestOf(this.to)) {
  2926. // NorthWest - SouthEast
  2927. return 'NW-SE';
  2928. } else if (this.from.isNorthEastOf(this.to)) {
  2929. // NorthEast - SouthWest
  2930. return 'NE-SW';
  2931. } else if (this.from.isSouthEastOf(this.to)) {
  2932. // SouthEast - NorthWest
  2933. return 'SE-NW';
  2934. } else if (this.from.isSouthWestOf(this.to)) {
  2935. // SouthWest - NorthEast
  2936. return 'SW-NE';
  2937. }
  2938. }
  2939. /**
  2940. * @param {String} direction
  2941. */
  2942. }, {
  2943. key: 'setDirection',
  2944. value: function setDirection(direction) {
  2945. switch (direction) {
  2946. case 'NW-SE':
  2947. var _ref = [this.getTopLeftCorner(), this.getBottomRightCorner()];
  2948. this.from = _ref[0];
  2949. this.to = _ref[1];
  2950. break;
  2951. case 'NE-SW':
  2952. var _ref2 = [this.getTopRightCorner(), this.getBottomLeftCorner()];
  2953. this.from = _ref2[0];
  2954. this.to = _ref2[1];
  2955. break;
  2956. case 'SE-NW':
  2957. var _ref3 = [this.getBottomRightCorner(), this.getTopLeftCorner()];
  2958. this.from = _ref3[0];
  2959. this.to = _ref3[1];
  2960. break;
  2961. case 'SW-NE':
  2962. var _ref4 = [this.getBottomLeftCorner(), this.getTopRightCorner()];
  2963. this.from = _ref4[0];
  2964. this.to = _ref4[1];
  2965. break;
  2966. default:
  2967. break;
  2968. }
  2969. }
  2970. /**
  2971. * Get top left corner of this range
  2972. *
  2973. * @returns {CellCoords}
  2974. */
  2975. }, {
  2976. key: 'getTopLeftCorner',
  2977. value: function getTopLeftCorner() {
  2978. return new _coords2.default(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));
  2979. }
  2980. /**
  2981. * Get bottom right corner of this range
  2982. *
  2983. * @returns {CellCoords}
  2984. */
  2985. }, {
  2986. key: 'getBottomRightCorner',
  2987. value: function getBottomRightCorner() {
  2988. return new _coords2.default(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));
  2989. }
  2990. /**
  2991. * Get top right corner of this range
  2992. *
  2993. * @returns {CellCoords}
  2994. */
  2995. }, {
  2996. key: 'getTopRightCorner',
  2997. value: function getTopRightCorner() {
  2998. return new _coords2.default(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));
  2999. }
  3000. /**
  3001. * Get bottom left corner of this range
  3002. *
  3003. * @returns {CellCoords}
  3004. */
  3005. }, {
  3006. key: 'getBottomLeftCorner',
  3007. value: function getBottomLeftCorner() {
  3008. return new _coords2.default(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));
  3009. }
  3010. /**
  3011. * @param {CellCoords} coords
  3012. * @param {CellRange} expandedRange
  3013. * @returns {*}
  3014. */
  3015. }, {
  3016. key: 'isCorner',
  3017. value: function isCorner(coords, expandedRange) {
  3018. if (expandedRange) {
  3019. if (expandedRange.includes(coords)) {
  3020. if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col)) || this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col)) || this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col)) || this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {
  3021. return true;
  3022. }
  3023. }
  3024. }
  3025. return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner());
  3026. }
  3027. /**
  3028. * @param {CellCoords} coords
  3029. * @param {CellRange} expandedRange
  3030. * @returns {CellCoords}
  3031. */
  3032. }, {
  3033. key: 'getOppositeCorner',
  3034. value: function getOppositeCorner(coords, expandedRange) {
  3035. if (!(coords instanceof _coords2.default)) {
  3036. return false;
  3037. }
  3038. if (expandedRange) {
  3039. if (expandedRange.includes(coords)) {
  3040. if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col))) {
  3041. return this.getBottomRightCorner();
  3042. }
  3043. if (this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col))) {
  3044. return this.getBottomLeftCorner();
  3045. }
  3046. if (this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col))) {
  3047. return this.getTopRightCorner();
  3048. }
  3049. if (this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {
  3050. return this.getTopLeftCorner();
  3051. }
  3052. }
  3053. }
  3054. if (coords.isEqual(this.getBottomRightCorner())) {
  3055. return this.getTopLeftCorner();
  3056. } else if (coords.isEqual(this.getTopLeftCorner())) {
  3057. return this.getBottomRightCorner();
  3058. } else if (coords.isEqual(this.getTopRightCorner())) {
  3059. return this.getBottomLeftCorner();
  3060. } else if (coords.isEqual(this.getBottomLeftCorner())) {
  3061. return this.getTopRightCorner();
  3062. }
  3063. }
  3064. /**
  3065. * @param {CellRange} range
  3066. * @returns {Array}
  3067. */
  3068. }, {
  3069. key: 'getBordersSharedWith',
  3070. value: function getBordersSharedWith(range) {
  3071. if (!this.includesRange(range)) {
  3072. return [];
  3073. }
  3074. var thisBorders = {
  3075. top: Math.min(this.from.row, this.to.row),
  3076. bottom: Math.max(this.from.row, this.to.row),
  3077. left: Math.min(this.from.col, this.to.col),
  3078. right: Math.max(this.from.col, this.to.col)
  3079. };
  3080. var rangeBorders = {
  3081. top: Math.min(range.from.row, range.to.row),
  3082. bottom: Math.max(range.from.row, range.to.row),
  3083. left: Math.min(range.from.col, range.to.col),
  3084. right: Math.max(range.from.col, range.to.col)
  3085. };
  3086. var result = [];
  3087. if (thisBorders.top == rangeBorders.top) {
  3088. result.push('top');
  3089. }
  3090. if (thisBorders.right == rangeBorders.right) {
  3091. result.push('right');
  3092. }
  3093. if (thisBorders.bottom == rangeBorders.bottom) {
  3094. result.push('bottom');
  3095. }
  3096. if (thisBorders.left == rangeBorders.left) {
  3097. result.push('left');
  3098. }
  3099. return result;
  3100. }
  3101. /**
  3102. * Get inner selected cell coords defined by this range
  3103. *
  3104. * @returns {Array}
  3105. */
  3106. }, {
  3107. key: 'getInner',
  3108. value: function getInner() {
  3109. var topLeft = this.getTopLeftCorner();
  3110. var bottomRight = this.getBottomRightCorner();
  3111. var out = [];
  3112. for (var r = topLeft.row; r <= bottomRight.row; r++) {
  3113. for (var c = topLeft.col; c <= bottomRight.col; c++) {
  3114. if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {
  3115. out.push(new _coords2.default(r, c));
  3116. }
  3117. }
  3118. }
  3119. return out;
  3120. }
  3121. /**
  3122. * Get all selected cell coords defined by this range
  3123. *
  3124. * @returns {Array}
  3125. */
  3126. }, {
  3127. key: 'getAll',
  3128. value: function getAll() {
  3129. var topLeft = this.getTopLeftCorner();
  3130. var bottomRight = this.getBottomRightCorner();
  3131. var out = [];
  3132. for (var r = topLeft.row; r <= bottomRight.row; r++) {
  3133. for (var c = topLeft.col; c <= bottomRight.col; c++) {
  3134. if (topLeft.row === r && topLeft.col === c) {
  3135. out.push(topLeft);
  3136. } else if (bottomRight.row === r && bottomRight.col === c) {
  3137. out.push(bottomRight);
  3138. } else {
  3139. out.push(new _coords2.default(r, c));
  3140. }
  3141. }
  3142. }
  3143. return out;
  3144. }
  3145. /**
  3146. * Runs a callback function against all cells in the range. You can break the iteration by returning
  3147. * `false` in the callback function
  3148. *
  3149. * @param callback {Function}
  3150. */
  3151. }, {
  3152. key: 'forAll',
  3153. value: function forAll(callback) {
  3154. var topLeft = this.getTopLeftCorner();
  3155. var bottomRight = this.getBottomRightCorner();
  3156. for (var r = topLeft.row; r <= bottomRight.row; r++) {
  3157. for (var c = topLeft.col; c <= bottomRight.col; c++) {
  3158. var breakIteration = callback(r, c);
  3159. if (breakIteration === false) {
  3160. return;
  3161. }
  3162. }
  3163. }
  3164. }
  3165. }]);
  3166. return CellRange;
  3167. }();
  3168. exports.default = CellRange;
  3169. /***/ }),
  3170. /* 44 */
  3171. /***/ (function(module, exports) {
  3172. module.exports = function(it){
  3173. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  3174. return it;
  3175. };
  3176. /***/ }),
  3177. /* 45 */
  3178. /***/ (function(module, exports, __webpack_require__) {
  3179. "use strict";
  3180. var $defineProperty = __webpack_require__(6)
  3181. , createDesc = __webpack_require__(20);
  3182. module.exports = function(object, index, value){
  3183. if(index in object)$defineProperty.f(object, index, createDesc(0, value));
  3184. else object[index] = value;
  3185. };
  3186. /***/ }),
  3187. /* 46 */
  3188. /***/ (function(module, exports, __webpack_require__) {
  3189. var isObject = __webpack_require__(4)
  3190. , document = __webpack_require__(3).document
  3191. // in old IE typeof document.createElement is 'object'
  3192. , is = isObject(document) && isObject(document.createElement);
  3193. module.exports = function(it){
  3194. return is ? document.createElement(it) : {};
  3195. };
  3196. /***/ }),
  3197. /* 47 */
  3198. /***/ (function(module, exports) {
  3199. // IE 8- don't enum bug keys
  3200. module.exports = (
  3201. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  3202. ).split(',');
  3203. /***/ }),
  3204. /* 48 */
  3205. /***/ (function(module, exports, __webpack_require__) {
  3206. var MATCH = __webpack_require__(1)('match');
  3207. module.exports = function(KEY){
  3208. var re = /./;
  3209. try {
  3210. '/./'[KEY](re);
  3211. } catch(e){
  3212. try {
  3213. re[MATCH] = false;
  3214. return !'/./'[KEY](re);
  3215. } catch(f){ /* empty */ }
  3216. } return true;
  3217. };
  3218. /***/ }),
  3219. /* 49 */
  3220. /***/ (function(module, exports, __webpack_require__) {
  3221. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  3222. var cof = __webpack_require__(18);
  3223. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
  3224. return cof(it) == 'String' ? it.split('') : Object(it);
  3225. };
  3226. /***/ }),
  3227. /* 50 */
  3228. /***/ (function(module, exports, __webpack_require__) {
  3229. var ITERATOR = __webpack_require__(1)('iterator')
  3230. , SAFE_CLOSING = false;
  3231. try {
  3232. var riter = [7][ITERATOR]();
  3233. riter['return'] = function(){ SAFE_CLOSING = true; };
  3234. Array.from(riter, function(){ throw 2; });
  3235. } catch(e){ /* empty */ }
  3236. module.exports = function(exec, skipClosing){
  3237. if(!skipClosing && !SAFE_CLOSING)return false;
  3238. var safe = false;
  3239. try {
  3240. var arr = [7]
  3241. , iter = arr[ITERATOR]();
  3242. iter.next = function(){ return {done: safe = true}; };
  3243. arr[ITERATOR] = function(){ return iter; };
  3244. exec(arr);
  3245. } catch(e){ /* empty */ }
  3246. return safe;
  3247. };
  3248. /***/ }),
  3249. /* 51 */
  3250. /***/ (function(module, exports, __webpack_require__) {
  3251. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  3252. var anObject = __webpack_require__(5)
  3253. , dPs = __webpack_require__(162)
  3254. , enumBugKeys = __webpack_require__(47)
  3255. , IE_PROTO = __webpack_require__(54)('IE_PROTO')
  3256. , Empty = function(){ /* empty */ }
  3257. , PROTOTYPE = 'prototype';
  3258. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  3259. var createDict = function(){
  3260. // Thrash, waste and sodomy: IE GC bug
  3261. var iframe = __webpack_require__(46)('iframe')
  3262. , i = enumBugKeys.length
  3263. , lt = '<'
  3264. , gt = '>'
  3265. , iframeDocument;
  3266. iframe.style.display = 'none';
  3267. __webpack_require__(81).appendChild(iframe);
  3268. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  3269. // createDict = iframe.contentWindow.Object;
  3270. // html.removeChild(iframe);
  3271. iframeDocument = iframe.contentWindow.document;
  3272. iframeDocument.open();
  3273. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  3274. iframeDocument.close();
  3275. createDict = iframeDocument.F;
  3276. while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
  3277. return createDict();
  3278. };
  3279. module.exports = Object.create || function create(O, Properties){
  3280. var result;
  3281. if(O !== null){
  3282. Empty[PROTOTYPE] = anObject(O);
  3283. result = new Empty;
  3284. Empty[PROTOTYPE] = null;
  3285. // add "__proto__" for Object.getPrototypeOf polyfill
  3286. result[IE_PROTO] = O;
  3287. } else result = createDict();
  3288. return Properties === undefined ? result : dPs(result, Properties);
  3289. };
  3290. /***/ }),
  3291. /* 52 */
  3292. /***/ (function(module, exports, __webpack_require__) {
  3293. var pIE = __webpack_require__(29)
  3294. , createDesc = __webpack_require__(20)
  3295. , toIObject = __webpack_require__(9)
  3296. , toPrimitive = __webpack_require__(58)
  3297. , has = __webpack_require__(8)
  3298. , IE8_DOM_DEFINE = __webpack_require__(82)
  3299. , gOPD = Object.getOwnPropertyDescriptor;
  3300. exports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P){
  3301. O = toIObject(O);
  3302. P = toPrimitive(P, true);
  3303. if(IE8_DOM_DEFINE)try {
  3304. return gOPD(O, P);
  3305. } catch(e){ /* empty */ }
  3306. if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
  3307. };
  3308. /***/ }),
  3309. /* 53 */
  3310. /***/ (function(module, exports, __webpack_require__) {
  3311. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  3312. var $keys = __webpack_require__(91)
  3313. , hiddenKeys = __webpack_require__(47).concat('length', 'prototype');
  3314. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
  3315. return $keys(O, hiddenKeys);
  3316. };
  3317. /***/ }),
  3318. /* 54 */
  3319. /***/ (function(module, exports, __webpack_require__) {
  3320. var shared = __webpack_require__(55)('keys')
  3321. , uid = __webpack_require__(31);
  3322. module.exports = function(key){
  3323. return shared[key] || (shared[key] = uid(key));
  3324. };
  3325. /***/ }),
  3326. /* 55 */
  3327. /***/ (function(module, exports, __webpack_require__) {
  3328. var global = __webpack_require__(3)
  3329. , SHARED = '__core-js_shared__'
  3330. , store = global[SHARED] || (global[SHARED] = {});
  3331. module.exports = function(key){
  3332. return store[key] || (store[key] = {});
  3333. };
  3334. /***/ }),
  3335. /* 56 */
  3336. /***/ (function(module, exports, __webpack_require__) {
  3337. // helper for String#{startsWith, endsWith, includes}
  3338. var isRegExp = __webpack_require__(86)
  3339. , defined = __webpack_require__(13);
  3340. module.exports = function(that, searchString, NAME){
  3341. if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!");
  3342. return String(defined(that));
  3343. };
  3344. /***/ }),
  3345. /* 57 */
  3346. /***/ (function(module, exports, __webpack_require__) {
  3347. var ctx = __webpack_require__(12)
  3348. , invoke = __webpack_require__(158)
  3349. , html = __webpack_require__(81)
  3350. , cel = __webpack_require__(46)
  3351. , global = __webpack_require__(3)
  3352. , process = global.process
  3353. , setTask = global.setImmediate
  3354. , clearTask = global.clearImmediate
  3355. , MessageChannel = global.MessageChannel
  3356. , counter = 0
  3357. , queue = {}
  3358. , ONREADYSTATECHANGE = 'onreadystatechange'
  3359. , defer, channel, port;
  3360. var run = function(){
  3361. var id = +this;
  3362. if(queue.hasOwnProperty(id)){
  3363. var fn = queue[id];
  3364. delete queue[id];
  3365. fn();
  3366. }
  3367. };
  3368. var listener = function(event){
  3369. run.call(event.data);
  3370. };
  3371. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  3372. if(!setTask || !clearTask){
  3373. setTask = function setImmediate(fn){
  3374. var args = [], i = 1;
  3375. while(arguments.length > i)args.push(arguments[i++]);
  3376. queue[++counter] = function(){
  3377. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  3378. };
  3379. defer(counter);
  3380. return counter;
  3381. };
  3382. clearTask = function clearImmediate(id){
  3383. delete queue[id];
  3384. };
  3385. // Node.js 0.8-
  3386. if(__webpack_require__(18)(process) == 'process'){
  3387. defer = function(id){
  3388. process.nextTick(ctx(run, id, 1));
  3389. };
  3390. // Browsers with MessageChannel, includes WebWorkers
  3391. } else if(MessageChannel){
  3392. channel = new MessageChannel;
  3393. port = channel.port2;
  3394. channel.port1.onmessage = listener;
  3395. defer = ctx(port.postMessage, port, 1);
  3396. // Browsers with postMessage, skip WebWorkers
  3397. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  3398. } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
  3399. defer = function(id){
  3400. global.postMessage(id + '', '*');
  3401. };
  3402. global.addEventListener('message', listener, false);
  3403. // IE8-
  3404. } else if(ONREADYSTATECHANGE in cel('script')){
  3405. defer = function(id){
  3406. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
  3407. html.removeChild(this);
  3408. run.call(id);
  3409. };
  3410. };
  3411. // Rest old browsers
  3412. } else {
  3413. defer = function(id){
  3414. setTimeout(ctx(run, id, 1), 0);
  3415. };
  3416. }
  3417. }
  3418. module.exports = {
  3419. set: setTask,
  3420. clear: clearTask
  3421. };
  3422. /***/ }),
  3423. /* 58 */
  3424. /***/ (function(module, exports, __webpack_require__) {
  3425. // 7.1.1 ToPrimitive(input [, PreferredType])
  3426. var isObject = __webpack_require__(4);
  3427. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  3428. // and the second argument - flag - preferred type is a string
  3429. module.exports = function(it, S){
  3430. if(!isObject(it))return it;
  3431. var fn, val;
  3432. if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  3433. if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
  3434. if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  3435. throw TypeError("Can't convert object to primitive value");
  3436. };
  3437. /***/ }),
  3438. /* 59 */
  3439. /***/ (function(module, exports, __webpack_require__) {
  3440. "use strict";
  3441. exports.__esModule = true;
  3442. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3443. var _element = __webpack_require__(2);
  3444. var _event = __webpack_require__(73);
  3445. var _object = __webpack_require__(25);
  3446. var _browser = __webpack_require__(32);
  3447. var _eventManager = __webpack_require__(23);
  3448. var _eventManager2 = _interopRequireDefault(_eventManager);
  3449. var _coords = __webpack_require__(22);
  3450. var _coords2 = _interopRequireDefault(_coords);
  3451. var _base = __webpack_require__(11);
  3452. var _base2 = _interopRequireDefault(_base);
  3453. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3454. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3455. /**
  3456. *
  3457. */
  3458. var Border = function () {
  3459. /**
  3460. * @param {Walkontable} wotInstance
  3461. * @param {Object} settings
  3462. */
  3463. function Border(wotInstance, settings) {
  3464. _classCallCheck(this, Border);
  3465. if (!settings) {
  3466. return;
  3467. }
  3468. this.eventManager = new _eventManager2.default(wotInstance);
  3469. this.instance = wotInstance;
  3470. this.wot = wotInstance;
  3471. this.settings = settings;
  3472. this.mouseDown = false;
  3473. this.main = null;
  3474. this.top = null;
  3475. this.left = null;
  3476. this.bottom = null;
  3477. this.right = null;
  3478. this.topStyle = null;
  3479. this.leftStyle = null;
  3480. this.bottomStyle = null;
  3481. this.rightStyle = null;
  3482. this.cornerDefaultStyle = {
  3483. width: '5px',
  3484. height: '5px',
  3485. borderWidth: '2px',
  3486. borderStyle: 'solid',
  3487. borderColor: '#FFF'
  3488. };
  3489. this.corner = null;
  3490. this.cornerStyle = null;
  3491. this.createBorders(settings);
  3492. this.registerListeners();
  3493. }
  3494. /**
  3495. * Register all necessary events
  3496. */
  3497. _createClass(Border, [{
  3498. key: 'registerListeners',
  3499. value: function registerListeners() {
  3500. var _this2 = this;
  3501. this.eventManager.addEventListener(document.body, 'mousedown', function () {
  3502. return _this2.onMouseDown();
  3503. });
  3504. this.eventManager.addEventListener(document.body, 'mouseup', function () {
  3505. return _this2.onMouseUp();
  3506. });
  3507. var _loop = function _loop(c, len) {
  3508. _this2.eventManager.addEventListener(_this2.main.childNodes[c], 'mouseenter', function (event) {
  3509. return _this2.onMouseEnter(event, _this2.main.childNodes[c]);
  3510. });
  3511. };
  3512. for (var c = 0, len = this.main.childNodes.length; c < len; c++) {
  3513. _loop(c, len);
  3514. }
  3515. }
  3516. /**
  3517. * Mouse down listener
  3518. *
  3519. * @private
  3520. */
  3521. }, {
  3522. key: 'onMouseDown',
  3523. value: function onMouseDown() {
  3524. this.mouseDown = true;
  3525. }
  3526. /**
  3527. * Mouse up listener
  3528. *
  3529. * @private
  3530. */
  3531. }, {
  3532. key: 'onMouseUp',
  3533. value: function onMouseUp() {
  3534. this.mouseDown = false;
  3535. }
  3536. /**
  3537. * Mouse enter listener for fragment selection functionality.
  3538. *
  3539. * @private
  3540. * @param {Event} event Dom event
  3541. * @param {HTMLElement} parentElement Part of border element.
  3542. */
  3543. }, {
  3544. key: 'onMouseEnter',
  3545. value: function onMouseEnter(event, parentElement) {
  3546. if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {
  3547. return;
  3548. }
  3549. event.preventDefault();
  3550. (0, _event.stopImmediatePropagation)(event);
  3551. var _this = this;
  3552. var bounds = parentElement.getBoundingClientRect();
  3553. // Hide border to prevents selection jumping when fragmentSelection is enabled.
  3554. parentElement.style.display = 'none';
  3555. function isOutside(event) {
  3556. if (event.clientY < Math.floor(bounds.top)) {
  3557. return true;
  3558. }
  3559. if (event.clientY > Math.ceil(bounds.top + bounds.height)) {
  3560. return true;
  3561. }
  3562. if (event.clientX < Math.floor(bounds.left)) {
  3563. return true;
  3564. }
  3565. if (event.clientX > Math.ceil(bounds.left + bounds.width)) {
  3566. return true;
  3567. }
  3568. }
  3569. function handler(event) {
  3570. if (isOutside(event)) {
  3571. _this.eventManager.removeEventListener(document.body, 'mousemove', handler);
  3572. parentElement.style.display = 'block';
  3573. }
  3574. }
  3575. this.eventManager.addEventListener(document.body, 'mousemove', handler);
  3576. }
  3577. /**
  3578. * Create border elements
  3579. *
  3580. * @param {Object} settings
  3581. */
  3582. }, {
  3583. key: 'createBorders',
  3584. value: function createBorders(settings) {
  3585. this.main = document.createElement('div');
  3586. var borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];
  3587. var style = this.main.style;
  3588. style.position = 'absolute';
  3589. style.top = 0;
  3590. style.left = 0;
  3591. for (var i = 0; i < 5; i++) {
  3592. var position = borderDivs[i];
  3593. var div = document.createElement('div');
  3594. div.className = 'wtBorder ' + (this.settings.className || ''); // + borderDivs[i];
  3595. if (this.settings[position] && this.settings[position].hide) {
  3596. div.className += ' hidden';
  3597. }
  3598. style = div.style;
  3599. style.backgroundColor = this.settings[position] && this.settings[position].color ? this.settings[position].color : settings.border.color;
  3600. style.height = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';
  3601. style.width = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';
  3602. this.main.appendChild(div);
  3603. }
  3604. this.top = this.main.childNodes[0];
  3605. this.left = this.main.childNodes[1];
  3606. this.bottom = this.main.childNodes[2];
  3607. this.right = this.main.childNodes[3];
  3608. this.topStyle = this.top.style;
  3609. this.leftStyle = this.left.style;
  3610. this.bottomStyle = this.bottom.style;
  3611. this.rightStyle = this.right.style;
  3612. this.corner = this.main.childNodes[4];
  3613. this.corner.className += ' corner';
  3614. this.cornerStyle = this.corner.style;
  3615. this.cornerStyle.width = this.cornerDefaultStyle.width;
  3616. this.cornerStyle.height = this.cornerDefaultStyle.height;
  3617. this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
  3618. if ((0, _browser.isMobileBrowser)()) {
  3619. this.createMultipleSelectorHandles();
  3620. }
  3621. this.disappear();
  3622. if (!this.wot.wtTable.bordersHolder) {
  3623. this.wot.wtTable.bordersHolder = document.createElement('div');
  3624. this.wot.wtTable.bordersHolder.className = 'htBorders';
  3625. this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder);
  3626. }
  3627. this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild);
  3628. }
  3629. /**
  3630. * Create multiple selector handler for mobile devices
  3631. */
  3632. }, {
  3633. key: 'createMultipleSelectorHandles',
  3634. value: function createMultipleSelectorHandles() {
  3635. this.selectionHandles = {
  3636. topLeft: document.createElement('DIV'),
  3637. topLeftHitArea: document.createElement('DIV'),
  3638. bottomRight: document.createElement('DIV'),
  3639. bottomRightHitArea: document.createElement('DIV')
  3640. };
  3641. var width = 10;
  3642. var hitAreaWidth = 40;
  3643. this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';
  3644. this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';
  3645. this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';
  3646. this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';
  3647. this.selectionHandles.styles = {
  3648. topLeft: this.selectionHandles.topLeft.style,
  3649. topLeftHitArea: this.selectionHandles.topLeftHitArea.style,
  3650. bottomRight: this.selectionHandles.bottomRight.style,
  3651. bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style
  3652. };
  3653. var hitAreaStyle = {
  3654. position: 'absolute',
  3655. height: hitAreaWidth + 'px',
  3656. width: hitAreaWidth + 'px',
  3657. 'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px'
  3658. };
  3659. for (var prop in hitAreaStyle) {
  3660. if ((0, _object.hasOwnProperty)(hitAreaStyle, prop)) {
  3661. this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop];
  3662. this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop];
  3663. }
  3664. }
  3665. var handleStyle = {
  3666. position: 'absolute',
  3667. height: width + 'px',
  3668. width: width + 'px',
  3669. 'border-radius': parseInt(width / 1.5, 10) + 'px',
  3670. background: '#F5F5FF',
  3671. border: '1px solid #4285c8'
  3672. };
  3673. for (var _prop in handleStyle) {
  3674. if ((0, _object.hasOwnProperty)(handleStyle, _prop)) {
  3675. this.selectionHandles.styles.bottomRight[_prop] = handleStyle[_prop];
  3676. this.selectionHandles.styles.topLeft[_prop] = handleStyle[_prop];
  3677. }
  3678. }
  3679. this.main.appendChild(this.selectionHandles.topLeft);
  3680. this.main.appendChild(this.selectionHandles.bottomRight);
  3681. this.main.appendChild(this.selectionHandles.topLeftHitArea);
  3682. this.main.appendChild(this.selectionHandles.bottomRightHitArea);
  3683. }
  3684. }, {
  3685. key: 'isPartRange',
  3686. value: function isPartRange(row, col) {
  3687. if (this.wot.selections.area.cellRange) {
  3688. if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) {
  3689. return true;
  3690. }
  3691. }
  3692. return false;
  3693. }
  3694. }, {
  3695. key: 'updateMultipleSelectionHandlesPosition',
  3696. value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {
  3697. var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);
  3698. var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);
  3699. this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px';
  3700. this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px';
  3701. this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - hitAreaWidth / 4 * 3, 10) + 'px';
  3702. this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - hitAreaWidth / 4 * 3, 10) + 'px';
  3703. this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px';
  3704. this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px';
  3705. this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px';
  3706. this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px';
  3707. if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) {
  3708. this.selectionHandles.styles.topLeft.display = 'block';
  3709. this.selectionHandles.styles.topLeftHitArea.display = 'block';
  3710. if (this.isPartRange(row, col)) {
  3711. this.selectionHandles.styles.bottomRight.display = 'none';
  3712. this.selectionHandles.styles.bottomRightHitArea.display = 'none';
  3713. } else {
  3714. this.selectionHandles.styles.bottomRight.display = 'block';
  3715. this.selectionHandles.styles.bottomRightHitArea.display = 'block';
  3716. }
  3717. } else {
  3718. this.selectionHandles.styles.topLeft.display = 'none';
  3719. this.selectionHandles.styles.bottomRight.display = 'none';
  3720. this.selectionHandles.styles.topLeftHitArea.display = 'none';
  3721. this.selectionHandles.styles.bottomRightHitArea.display = 'none';
  3722. }
  3723. if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) {
  3724. this.selectionHandles.styles.topLeft.zIndex = '9999';
  3725. this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';
  3726. } else {
  3727. this.selectionHandles.styles.topLeft.zIndex = '';
  3728. this.selectionHandles.styles.topLeftHitArea.zIndex = '';
  3729. }
  3730. }
  3731. /**
  3732. * Show border around one or many cells
  3733. *
  3734. * @param {Array} corners
  3735. */
  3736. }, {
  3737. key: 'appear',
  3738. value: function appear(corners) {
  3739. if (this.disabled) {
  3740. return;
  3741. }
  3742. var isMultiple, fromTD, toTD, fromOffset, toOffset, containerOffset, top, minTop, left, minLeft, height, width, fromRow, fromColumn, toRow, toColumn, trimmingContainer, cornerOverlappingContainer, ilen;
  3743. ilen = this.wot.wtTable.getRenderedRowsCount();
  3744. for (var i = 0; i < ilen; i++) {
  3745. var s = this.wot.wtTable.rowFilter.renderedToSource(i);
  3746. if (s >= corners[0] && s <= corners[2]) {
  3747. fromRow = s;
  3748. break;
  3749. }
  3750. }
  3751. for (var _i = ilen - 1; _i >= 0; _i--) {
  3752. var _s = this.wot.wtTable.rowFilter.renderedToSource(_i);
  3753. if (_s >= corners[0] && _s <= corners[2]) {
  3754. toRow = _s;
  3755. break;
  3756. }
  3757. }
  3758. ilen = this.wot.wtTable.getRenderedColumnsCount();
  3759. for (var _i2 = 0; _i2 < ilen; _i2++) {
  3760. var _s2 = this.wot.wtTable.columnFilter.renderedToSource(_i2);
  3761. if (_s2 >= corners[1] && _s2 <= corners[3]) {
  3762. fromColumn = _s2;
  3763. break;
  3764. }
  3765. }
  3766. for (var _i3 = ilen - 1; _i3 >= 0; _i3--) {
  3767. var _s3 = this.wot.wtTable.columnFilter.renderedToSource(_i3);
  3768. if (_s3 >= corners[1] && _s3 <= corners[3]) {
  3769. toColumn = _s3;
  3770. break;
  3771. }
  3772. }
  3773. if (fromRow === void 0 || fromColumn === void 0) {
  3774. this.disappear();
  3775. return;
  3776. }
  3777. isMultiple = fromRow !== toRow || fromColumn !== toColumn;
  3778. fromTD = this.wot.wtTable.getCell(new _coords2.default(fromRow, fromColumn));
  3779. toTD = isMultiple ? this.wot.wtTable.getCell(new _coords2.default(toRow, toColumn)) : fromTD;
  3780. fromOffset = (0, _element.offset)(fromTD);
  3781. toOffset = isMultiple ? (0, _element.offset)(toTD) : fromOffset;
  3782. containerOffset = (0, _element.offset)(this.wot.wtTable.TABLE);
  3783. minTop = fromOffset.top;
  3784. height = toOffset.top + (0, _element.outerHeight)(toTD) - minTop;
  3785. minLeft = fromOffset.left;
  3786. width = toOffset.left + (0, _element.outerWidth)(toTD) - minLeft;
  3787. top = minTop - containerOffset.top - 1;
  3788. left = minLeft - containerOffset.left - 1;
  3789. var style = (0, _element.getComputedStyle)(fromTD);
  3790. if (parseInt(style.borderTopWidth, 10) > 0) {
  3791. top += 1;
  3792. height = height > 0 ? height - 1 : 0;
  3793. }
  3794. if (parseInt(style.borderLeftWidth, 10) > 0) {
  3795. left += 1;
  3796. width = width > 0 ? width - 1 : 0;
  3797. }
  3798. this.topStyle.top = top + 'px';
  3799. this.topStyle.left = left + 'px';
  3800. this.topStyle.width = width + 'px';
  3801. this.topStyle.display = 'block';
  3802. this.leftStyle.top = top + 'px';
  3803. this.leftStyle.left = left + 'px';
  3804. this.leftStyle.height = height + 'px';
  3805. this.leftStyle.display = 'block';
  3806. var delta = Math.floor(this.settings.border.width / 2);
  3807. this.bottomStyle.top = top + height - delta + 'px';
  3808. this.bottomStyle.left = left + 'px';
  3809. this.bottomStyle.width = width + 'px';
  3810. this.bottomStyle.display = 'block';
  3811. this.rightStyle.top = top + 'px';
  3812. this.rightStyle.left = left + width - delta + 'px';
  3813. this.rightStyle.height = height + 1 + 'px';
  3814. this.rightStyle.display = 'block';
  3815. if ((0, _browser.isMobileBrowser)() || !this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn)) {
  3816. this.cornerStyle.display = 'none';
  3817. } else {
  3818. this.cornerStyle.top = top + height - 4 + 'px';
  3819. this.cornerStyle.left = left + width - 4 + 'px';
  3820. this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;
  3821. this.cornerStyle.width = this.cornerDefaultStyle.width;
  3822. // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.
  3823. this.cornerStyle.display = 'none';
  3824. trimmingContainer = (0, _element.getTrimmingContainer)(this.wot.wtTable.TABLE);
  3825. if (toColumn === this.wot.getSetting('totalColumns') - 1) {
  3826. cornerOverlappingContainer = toTD.offsetLeft + (0, _element.outerWidth)(toTD) + parseInt(this.cornerDefaultStyle.width, 10) / 2 >= (0, _element.innerWidth)(trimmingContainer);
  3827. if (cornerOverlappingContainer) {
  3828. this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width, 10) / 2) + 'px';
  3829. this.cornerStyle.borderRightWidth = 0;
  3830. }
  3831. }
  3832. if (toRow === this.wot.getSetting('totalRows') - 1) {
  3833. cornerOverlappingContainer = toTD.offsetTop + (0, _element.outerHeight)(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2 >= (0, _element.innerHeight)(trimmingContainer);
  3834. if (cornerOverlappingContainer) {
  3835. this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height, 10) / 2) + 'px';
  3836. this.cornerStyle.borderBottomWidth = 0;
  3837. }
  3838. }
  3839. this.cornerStyle.display = 'block';
  3840. }
  3841. if ((0, _browser.isMobileBrowser)()) {
  3842. this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height);
  3843. }
  3844. }
  3845. /**
  3846. * Hide border
  3847. */
  3848. }, {
  3849. key: 'disappear',
  3850. value: function disappear() {
  3851. this.topStyle.display = 'none';
  3852. this.leftStyle.display = 'none';
  3853. this.bottomStyle.display = 'none';
  3854. this.rightStyle.display = 'none';
  3855. this.cornerStyle.display = 'none';
  3856. if ((0, _browser.isMobileBrowser)()) {
  3857. this.selectionHandles.styles.topLeft.display = 'none';
  3858. this.selectionHandles.styles.bottomRight.display = 'none';
  3859. }
  3860. }
  3861. /**
  3862. * @param {Function} setting
  3863. * @returns {*}
  3864. */
  3865. }, {
  3866. key: 'hasSetting',
  3867. value: function hasSetting(setting) {
  3868. if (typeof setting === 'function') {
  3869. return setting();
  3870. }
  3871. return !!setting;
  3872. }
  3873. }]);
  3874. return Border;
  3875. }();
  3876. exports.default = Border;
  3877. /***/ }),
  3878. /* 60 */
  3879. /***/ (function(module, exports, __webpack_require__) {
  3880. "use strict";
  3881. exports.__esModule = true;
  3882. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3883. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3884. var privatePool = new WeakMap();
  3885. /**
  3886. * Calculates indexes of columns to render OR columns that are visible.
  3887. * To redo the calculation, you need to create a new calculator.
  3888. *
  3889. * @class ViewportColumnsCalculator
  3890. */
  3891. var ViewportColumnsCalculator = function () {
  3892. _createClass(ViewportColumnsCalculator, null, [{
  3893. key: 'DEFAULT_WIDTH',
  3894. /**
  3895. * Default column width
  3896. *
  3897. * @type {Number}
  3898. */
  3899. get: function get() {
  3900. return 50;
  3901. }
  3902. /**
  3903. * @param {Number} viewportWidth Width of the viewport
  3904. * @param {Number} scrollOffset Current horizontal scroll position of the viewport
  3905. * @param {Number} totalColumns Total number of rows
  3906. * @param {Function} columnWidthFn Function that returns the width of the column at a given index (in px)
  3907. * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)
  3908. * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport
  3909. * @param {Boolean} stretchH
  3910. * @param {Function} [stretchingColumnWidthFn] Function that returns the new width of the stretched column.
  3911. */
  3912. }]);
  3913. function ViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) {
  3914. var stretchingColumnWidthFn = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : function (width) {
  3915. return width;
  3916. };
  3917. _classCallCheck(this, ViewportColumnsCalculator);
  3918. privatePool.set(this, {
  3919. viewportWidth: viewportWidth,
  3920. scrollOffset: scrollOffset,
  3921. totalColumns: totalColumns,
  3922. columnWidthFn: columnWidthFn,
  3923. overrideFn: overrideFn,
  3924. onlyFullyVisible: onlyFullyVisible,
  3925. stretchingColumnWidthFn: stretchingColumnWidthFn
  3926. });
  3927. /**
  3928. * Number of rendered/visible columns
  3929. *
  3930. * @type {Number}
  3931. */
  3932. this.count = 0;
  3933. /**
  3934. * Index of the first rendered/visible column (can be overwritten using overrideFn)
  3935. *
  3936. * @type {Number|null}
  3937. */
  3938. this.startColumn = null;
  3939. /**
  3940. * Index of the last rendered/visible column (can be overwritten using overrideFn)
  3941. *
  3942. * @type {null}
  3943. */
  3944. this.endColumn = null;
  3945. /**
  3946. * Position of the first rendered/visible column (in px)
  3947. *
  3948. * @type {Number|null}
  3949. */
  3950. this.startPosition = null;
  3951. this.stretchAllRatio = 0;
  3952. this.stretchLastWidth = 0;
  3953. this.stretch = stretchH;
  3954. this.totalTargetWidth = 0;
  3955. this.needVerifyLastColumnWidth = true;
  3956. this.stretchAllColumnsWidth = [];
  3957. this.calculate();
  3958. }
  3959. /**
  3960. * Calculates viewport
  3961. */
  3962. _createClass(ViewportColumnsCalculator, [{
  3963. key: 'calculate',
  3964. value: function calculate() {
  3965. var sum = 0;
  3966. var needReverse = true;
  3967. var startPositions = [];
  3968. var columnWidth = void 0;
  3969. var priv = privatePool.get(this);
  3970. var onlyFullyVisible = priv.onlyFullyVisible;
  3971. var overrideFn = priv.overrideFn;
  3972. var scrollOffset = priv.scrollOffset;
  3973. var totalColumns = priv.totalColumns;
  3974. var viewportWidth = priv.viewportWidth;
  3975. for (var i = 0; i < totalColumns; i++) {
  3976. columnWidth = this._getColumnWidth(i);
  3977. if (sum <= scrollOffset && !onlyFullyVisible) {
  3978. this.startColumn = i;
  3979. }
  3980. // +1 pixel for row header width compensation for horizontal scroll > 0
  3981. var compensatedViewportWidth = scrollOffset > 0 ? viewportWidth + 1 : viewportWidth;
  3982. if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + compensatedViewportWidth) {
  3983. if (this.startColumn == null) {
  3984. this.startColumn = i;
  3985. }
  3986. this.endColumn = i;
  3987. }
  3988. startPositions.push(sum);
  3989. sum += columnWidth;
  3990. if (!onlyFullyVisible) {
  3991. this.endColumn = i;
  3992. }
  3993. if (sum >= scrollOffset + viewportWidth) {
  3994. needReverse = false;
  3995. break;
  3996. }
  3997. }
  3998. if (this.endColumn === totalColumns - 1 && needReverse) {
  3999. this.startColumn = this.endColumn;
  4000. while (this.startColumn > 0) {
  4001. var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];
  4002. if (viewportSum <= viewportWidth || !onlyFullyVisible) {
  4003. this.startColumn--;
  4004. }
  4005. if (viewportSum > viewportWidth) {
  4006. break;
  4007. }
  4008. }
  4009. }
  4010. if (this.startColumn !== null && overrideFn) {
  4011. overrideFn(this);
  4012. }
  4013. this.startPosition = startPositions[this.startColumn];
  4014. if (this.startPosition == void 0) {
  4015. this.startPosition = null;
  4016. }
  4017. if (this.startColumn !== null) {
  4018. this.count = this.endColumn - this.startColumn + 1;
  4019. }
  4020. }
  4021. /**
  4022. * Recalculate columns stretching.
  4023. *
  4024. * @param {Number} totalWidth
  4025. */
  4026. }, {
  4027. key: 'refreshStretching',
  4028. value: function refreshStretching(totalWidth) {
  4029. if (this.stretch === 'none') {
  4030. return;
  4031. }
  4032. this.totalTargetWidth = totalWidth;
  4033. var priv = privatePool.get(this);
  4034. var totalColumns = priv.totalColumns;
  4035. var sumAll = 0;
  4036. for (var i = 0; i < totalColumns; i++) {
  4037. var columnWidth = this._getColumnWidth(i);
  4038. var permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);
  4039. if (typeof permanentColumnWidth === 'number') {
  4040. totalWidth -= permanentColumnWidth;
  4041. } else {
  4042. sumAll += columnWidth;
  4043. }
  4044. }
  4045. var remainingSize = totalWidth - sumAll;
  4046. if (this.stretch === 'all' && remainingSize > 0) {
  4047. this.stretchAllRatio = totalWidth / sumAll;
  4048. this.stretchAllColumnsWidth = [];
  4049. this.needVerifyLastColumnWidth = true;
  4050. } else if (this.stretch === 'last' && totalWidth !== Infinity) {
  4051. var _columnWidth = this._getColumnWidth(totalColumns - 1);
  4052. var lastColumnWidth = remainingSize + _columnWidth;
  4053. this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : _columnWidth;
  4054. }
  4055. }
  4056. /**
  4057. * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
  4058. *
  4059. * @param {Number} column
  4060. * @param {Number} baseWidth
  4061. * @returns {Number|null}
  4062. */
  4063. }, {
  4064. key: 'getStretchedColumnWidth',
  4065. value: function getStretchedColumnWidth(column, baseWidth) {
  4066. var result = null;
  4067. if (this.stretch === 'all' && this.stretchAllRatio !== 0) {
  4068. result = this._getStretchedAllColumnWidth(column, baseWidth);
  4069. } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {
  4070. result = this._getStretchedLastColumnWidth(column);
  4071. }
  4072. return result;
  4073. }
  4074. /**
  4075. * @param {Number} column
  4076. * @param {Number} baseWidth
  4077. * @returns {Number}
  4078. * @private
  4079. */
  4080. }, {
  4081. key: '_getStretchedAllColumnWidth',
  4082. value: function _getStretchedAllColumnWidth(column, baseWidth) {
  4083. var sumRatioWidth = 0;
  4084. var priv = privatePool.get(this);
  4085. var totalColumns = priv.totalColumns;
  4086. if (!this.stretchAllColumnsWidth[column]) {
  4087. var stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
  4088. var newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);
  4089. if (newStretchedWidth === void 0) {
  4090. this.stretchAllColumnsWidth[column] = stretchedWidth;
  4091. } else {
  4092. this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
  4093. }
  4094. }
  4095. if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
  4096. this.needVerifyLastColumnWidth = false;
  4097. for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) {
  4098. sumRatioWidth += this.stretchAllColumnsWidth[i];
  4099. }
  4100. if (sumRatioWidth !== this.totalTargetWidth) {
  4101. this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;
  4102. }
  4103. }
  4104. return this.stretchAllColumnsWidth[column];
  4105. }
  4106. /**
  4107. * @param {Number} column
  4108. * @returns {Number|null}
  4109. * @private
  4110. */
  4111. }, {
  4112. key: '_getStretchedLastColumnWidth',
  4113. value: function _getStretchedLastColumnWidth(column) {
  4114. var priv = privatePool.get(this);
  4115. var totalColumns = priv.totalColumns;
  4116. if (column === totalColumns - 1) {
  4117. return this.stretchLastWidth;
  4118. }
  4119. return null;
  4120. }
  4121. /**
  4122. * @param {Number} column Column index.
  4123. * @returns {Number}
  4124. * @private
  4125. */
  4126. }, {
  4127. key: '_getColumnWidth',
  4128. value: function _getColumnWidth(column) {
  4129. var width = privatePool.get(this).columnWidthFn(column);
  4130. if (width === void 0) {
  4131. width = ViewportColumnsCalculator.DEFAULT_WIDTH;
  4132. }
  4133. return width;
  4134. }
  4135. }]);
  4136. return ViewportColumnsCalculator;
  4137. }();
  4138. exports.default = ViewportColumnsCalculator;
  4139. /***/ }),
  4140. /* 61 */
  4141. /***/ (function(module, exports, __webpack_require__) {
  4142. "use strict";
  4143. exports.__esModule = true;
  4144. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4145. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4146. var privatePool = new WeakMap();
  4147. /**
  4148. * Calculates indexes of rows to render OR rows that are visible.
  4149. * To redo the calculation, you need to create a new calculator.
  4150. *
  4151. * @class ViewportRowsCalculator
  4152. */
  4153. var ViewportRowsCalculator = function () {
  4154. _createClass(ViewportRowsCalculator, null, [{
  4155. key: "DEFAULT_HEIGHT",
  4156. /**
  4157. * Default row height
  4158. *
  4159. * @type {Number}
  4160. */
  4161. get: function get() {
  4162. return 23;
  4163. }
  4164. /**
  4165. * @param {Number} viewportHeight Height of the viewport
  4166. * @param {Number} scrollOffset Current vertical scroll position of the viewport
  4167. * @param {Number} totalRows Total number of rows
  4168. * @param {Function} rowHeightFn Function that returns the height of the row at a given index (in px)
  4169. * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)
  4170. * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport
  4171. * @param {Number} horizontalScrollbarHeight
  4172. */
  4173. }]);
  4174. function ViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) {
  4175. _classCallCheck(this, ViewportRowsCalculator);
  4176. privatePool.set(this, {
  4177. viewportHeight: viewportHeight,
  4178. scrollOffset: scrollOffset,
  4179. totalRows: totalRows,
  4180. rowHeightFn: rowHeightFn,
  4181. overrideFn: overrideFn,
  4182. onlyFullyVisible: onlyFullyVisible,
  4183. horizontalScrollbarHeight: horizontalScrollbarHeight
  4184. });
  4185. /**
  4186. * Number of rendered/visible rows
  4187. *
  4188. * @type {Number}
  4189. */
  4190. this.count = 0;
  4191. /**
  4192. * Index of the first rendered/visible row (can be overwritten using overrideFn)
  4193. *
  4194. * @type {Number|null}
  4195. */
  4196. this.startRow = null;
  4197. /**
  4198. * Index of the last rendered/visible row (can be overwritten using overrideFn)
  4199. *
  4200. * @type {null}
  4201. */
  4202. this.endRow = null;
  4203. /**
  4204. * Position of the first rendered/visible row (in px)
  4205. *
  4206. * @type {Number|null}
  4207. */
  4208. this.startPosition = null;
  4209. this.calculate();
  4210. }
  4211. /**
  4212. * Calculates viewport
  4213. */
  4214. _createClass(ViewportRowsCalculator, [{
  4215. key: "calculate",
  4216. value: function calculate() {
  4217. var sum = 0;
  4218. var needReverse = true;
  4219. var startPositions = [];
  4220. var priv = privatePool.get(this);
  4221. var onlyFullyVisible = priv.onlyFullyVisible;
  4222. var overrideFn = priv.overrideFn;
  4223. var rowHeightFn = priv.rowHeightFn;
  4224. var scrollOffset = priv.scrollOffset;
  4225. var totalRows = priv.totalRows;
  4226. var viewportHeight = priv.viewportHeight;
  4227. var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;
  4228. var rowHeight = void 0;
  4229. // Calculate the number (start and end index) of rows needed
  4230. for (var i = 0; i < totalRows; i++) {
  4231. rowHeight = rowHeightFn(i);
  4232. if (rowHeight === undefined) {
  4233. rowHeight = ViewportRowsCalculator.DEFAULT_HEIGHT;
  4234. }
  4235. if (sum <= scrollOffset && !onlyFullyVisible) {
  4236. this.startRow = i;
  4237. }
  4238. // the row is within the "visible range"
  4239. if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {
  4240. if (this.startRow === null) {
  4241. this.startRow = i;
  4242. }
  4243. this.endRow = i;
  4244. }
  4245. startPositions.push(sum);
  4246. sum += rowHeight;
  4247. if (!onlyFullyVisible) {
  4248. this.endRow = i;
  4249. }
  4250. if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {
  4251. needReverse = false;
  4252. break;
  4253. }
  4254. }
  4255. // If the estimation has reached the last row and there is still some space available in the viewport,
  4256. // we need to render in reverse in order to fill the whole viewport with rows
  4257. if (this.endRow === totalRows - 1 && needReverse) {
  4258. this.startRow = this.endRow;
  4259. while (this.startRow > 0) {
  4260. // rowHeight is the height of the last row
  4261. var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];
  4262. if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) {
  4263. this.startRow--;
  4264. }
  4265. if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {
  4266. break;
  4267. }
  4268. }
  4269. }
  4270. if (this.startRow !== null && overrideFn) {
  4271. overrideFn(this);
  4272. }
  4273. this.startPosition = startPositions[this.startRow];
  4274. if (this.startPosition == void 0) {
  4275. this.startPosition = null;
  4276. }
  4277. if (this.startRow !== null) {
  4278. this.count = this.endRow - this.startRow + 1;
  4279. }
  4280. }
  4281. }]);
  4282. return ViewportRowsCalculator;
  4283. }();
  4284. exports.default = ViewportRowsCalculator;
  4285. /***/ }),
  4286. /* 62 */
  4287. /***/ (function(module, exports, __webpack_require__) {
  4288. "use strict";
  4289. exports.__esModule = true;
  4290. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4291. var _element = __webpack_require__(2);
  4292. var _object = __webpack_require__(25);
  4293. var _string = __webpack_require__(149);
  4294. var _event = __webpack_require__(63);
  4295. var _event2 = _interopRequireDefault(_event);
  4296. var _overlays = __webpack_require__(66);
  4297. var _overlays2 = _interopRequireDefault(_overlays);
  4298. var _scroll = __webpack_require__(67);
  4299. var _scroll2 = _interopRequireDefault(_scroll);
  4300. var _settings = __webpack_require__(68);
  4301. var _settings2 = _interopRequireDefault(_settings);
  4302. var _table = __webpack_require__(69);
  4303. var _table2 = _interopRequireDefault(_table);
  4304. var _viewport = __webpack_require__(71);
  4305. var _viewport2 = _interopRequireDefault(_viewport);
  4306. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4307. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4308. /**
  4309. * @class Walkontable
  4310. */
  4311. var Walkontable = function () {
  4312. /**
  4313. * @param {Object} settings
  4314. */
  4315. function Walkontable(settings) {
  4316. _classCallCheck(this, Walkontable);
  4317. var originalHeaders = [];
  4318. // this is the namespace for global events
  4319. this.guid = 'wt_' + (0, _string.randomString)();
  4320. // bootstrap from settings
  4321. if (settings.cloneSource) {
  4322. this.cloneSource = settings.cloneSource;
  4323. this.cloneOverlay = settings.cloneOverlay;
  4324. this.wtSettings = settings.cloneSource.wtSettings;
  4325. this.wtTable = new _table2.default(this, settings.table, settings.wtRootElement);
  4326. this.wtScroll = new _scroll2.default(this);
  4327. this.wtViewport = settings.cloneSource.wtViewport;
  4328. this.wtEvent = new _event2.default(this);
  4329. this.selections = this.cloneSource.selections;
  4330. } else {
  4331. this.wtSettings = new _settings2.default(this, settings);
  4332. this.wtTable = new _table2.default(this, settings.table);
  4333. this.wtScroll = new _scroll2.default(this);
  4334. this.wtViewport = new _viewport2.default(this);
  4335. this.wtEvent = new _event2.default(this);
  4336. this.selections = this.getSetting('selections');
  4337. this.wtOverlays = new _overlays2.default(this);
  4338. this.exportSettingsAsClassNames();
  4339. }
  4340. // find original headers
  4341. if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {
  4342. for (var c = 0, clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {
  4343. originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);
  4344. }
  4345. if (!this.getSetting('columnHeaders').length) {
  4346. this.update('columnHeaders', [function (column, TH) {
  4347. (0, _element.fastInnerText)(TH, originalHeaders[column]);
  4348. }]);
  4349. }
  4350. }
  4351. this.drawn = false;
  4352. this.drawInterrupted = false;
  4353. }
  4354. /**
  4355. * Force rerender of Walkontable
  4356. *
  4357. * @param {Boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering
  4358. * the data. It will only work if Table.draw() does not force
  4359. * rendering anyway
  4360. * @returns {Walkontable}
  4361. */
  4362. _createClass(Walkontable, [{
  4363. key: 'draw',
  4364. value: function draw() {
  4365. var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4366. this.drawInterrupted = false;
  4367. if (!fastDraw && !(0, _element.isVisible)(this.wtTable.TABLE)) {
  4368. // draw interrupted because TABLE is not visible
  4369. this.drawInterrupted = true;
  4370. } else {
  4371. this.wtTable.draw(fastDraw);
  4372. }
  4373. return this;
  4374. }
  4375. /**
  4376. * Returns the TD at coords. If topmost is set to true, returns TD from the topmost overlay layer,
  4377. * if not set or set to false, returns TD from the master table.
  4378. *
  4379. * @param {CellCoords} coords
  4380. * @param {Boolean} [topmost=false]
  4381. * @returns {Object}
  4382. */
  4383. }, {
  4384. key: 'getCell',
  4385. value: function getCell(coords) {
  4386. var topmost = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4387. if (!topmost) {
  4388. return this.wtTable.getCell(coords);
  4389. }
  4390. var totalRows = this.wtSettings.getSetting('totalRows');
  4391. var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
  4392. var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
  4393. var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');
  4394. if (coords.row < fixedRowsTop && coords.col < fixedColumns) {
  4395. return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);
  4396. } else if (coords.row < fixedRowsTop) {
  4397. return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);
  4398. } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {
  4399. if (this.wtOverlays.bottomLeftCornerOverlay && this.wtOverlays.bottomLeftCornerOverlay.clone) {
  4400. return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);
  4401. }
  4402. } else if (coords.col < fixedColumns) {
  4403. return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);
  4404. } else if (coords.row < totalRows && coords.row > totalRows - fixedRowsBottom) {
  4405. if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {
  4406. return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);
  4407. }
  4408. }
  4409. return this.wtTable.getCell(coords);
  4410. }
  4411. /**
  4412. * @param {Object} settings
  4413. * @param {*} value
  4414. * @returns {Walkontable}
  4415. */
  4416. }, {
  4417. key: 'update',
  4418. value: function update(settings, value) {
  4419. return this.wtSettings.update(settings, value);
  4420. }
  4421. /**
  4422. * Scroll the viewport to a row at the given index in the data source
  4423. *
  4424. * @param {Number} row
  4425. * @returns {Walkontable}
  4426. */
  4427. }, {
  4428. key: 'scrollVertical',
  4429. value: function scrollVertical(row) {
  4430. this.wtOverlays.topOverlay.scrollTo(row);
  4431. this.getSetting('onScrollVertically');
  4432. return this;
  4433. }
  4434. /**
  4435. * Scroll the viewport to a column at the given index in the data source
  4436. *
  4437. * @param {Number} column
  4438. * @returns {Walkontable}
  4439. */
  4440. }, {
  4441. key: 'scrollHorizontal',
  4442. value: function scrollHorizontal(column) {
  4443. this.wtOverlays.leftOverlay.scrollTo(column);
  4444. this.getSetting('onScrollHorizontally');
  4445. return this;
  4446. }
  4447. /**
  4448. * Scrolls the viewport to a cell (rerenders if needed)
  4449. *
  4450. * @param {CellCoords} coords
  4451. * @returns {Walkontable}
  4452. */
  4453. }, {
  4454. key: 'scrollViewport',
  4455. value: function scrollViewport(coords) {
  4456. this.wtScroll.scrollViewport(coords);
  4457. return this;
  4458. }
  4459. /**
  4460. * @returns {Array}
  4461. */
  4462. }, {
  4463. key: 'getViewport',
  4464. value: function getViewport() {
  4465. return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()];
  4466. }
  4467. /**
  4468. * Get overlay name
  4469. *
  4470. * @returns {String}
  4471. */
  4472. }, {
  4473. key: 'getOverlayName',
  4474. value: function getOverlayName() {
  4475. return this.cloneOverlay ? this.cloneOverlay.type : 'master';
  4476. }
  4477. /**
  4478. * Check overlay type of this Walkontable instance.
  4479. *
  4480. * @param {String} name Clone type @see {Overlay.CLONE_TYPES}.
  4481. * @returns {Boolean}
  4482. */
  4483. }, {
  4484. key: 'isOverlayName',
  4485. value: function isOverlayName(name) {
  4486. if (this.cloneOverlay) {
  4487. return this.cloneOverlay.type === name;
  4488. }
  4489. return false;
  4490. }
  4491. /**
  4492. * Export settings as class names added to the parent element of the table.
  4493. */
  4494. }, {
  4495. key: 'exportSettingsAsClassNames',
  4496. value: function exportSettingsAsClassNames() {
  4497. var _this = this;
  4498. var toExport = {
  4499. rowHeaders: ['array'],
  4500. columnHeaders: ['array']
  4501. };
  4502. var allClassNames = [];
  4503. var newClassNames = [];
  4504. (0, _object.objectEach)(toExport, function (optionType, key) {
  4505. if (optionType.indexOf('array') > -1 && _this.getSetting(key).length) {
  4506. newClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));
  4507. }
  4508. allClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));
  4509. });
  4510. (0, _element.removeClass)(this.wtTable.wtRootElement.parentNode, allClassNames);
  4511. (0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);
  4512. }
  4513. /**
  4514. * Get/Set Walkontable instance setting
  4515. *
  4516. * @param {String} key
  4517. * @param {*} [param1]
  4518. * @param {*} [param2]
  4519. * @param {*} [param3]
  4520. * @param {*} [param4]
  4521. * @returns {*}
  4522. */
  4523. }, {
  4524. key: 'getSetting',
  4525. value: function getSetting(key, param1, param2, param3, param4) {
  4526. // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
  4527. return this.wtSettings.getSetting(key, param1, param2, param3, param4);
  4528. }
  4529. /**
  4530. * Checks if setting exists
  4531. *
  4532. * @param {String} key
  4533. * @returns {Boolean}
  4534. */
  4535. }, {
  4536. key: 'hasSetting',
  4537. value: function hasSetting(key) {
  4538. return this.wtSettings.has(key);
  4539. }
  4540. /**
  4541. * Destroy instance
  4542. */
  4543. }, {
  4544. key: 'destroy',
  4545. value: function destroy() {
  4546. this.wtOverlays.destroy();
  4547. this.wtEvent.destroy();
  4548. }
  4549. }]);
  4550. return Walkontable;
  4551. }();
  4552. exports.default = Walkontable;
  4553. /***/ }),
  4554. /* 63 */
  4555. /***/ (function(module, exports, __webpack_require__) {
  4556. "use strict";
  4557. exports.__esModule = true;
  4558. var _element = __webpack_require__(2);
  4559. var _function = __webpack_require__(75);
  4560. var _browser = __webpack_require__(32);
  4561. var _eventManager = __webpack_require__(23);
  4562. var _eventManager2 = _interopRequireDefault(_eventManager);
  4563. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4564. /**
  4565. *
  4566. */
  4567. function Event(instance) {
  4568. var that = this;
  4569. var eventManager = new _eventManager2.default(instance);
  4570. this.instance = instance;
  4571. var dblClickOrigin = [null, null];
  4572. this.dblClickTimeout = [null, null];
  4573. var onMouseDown = function onMouseDown(event) {
  4574. var activeElement = document.activeElement;
  4575. var getParentNode = (0, _function.partial)(_element.getParent, event.realTarget);
  4576. var realTarget = event.realTarget;
  4577. // ignore focusable element from mouse down processing (https://github.com/handsontable/handsontable/issues/3555)
  4578. if (realTarget === activeElement || getParentNode(0) === activeElement || getParentNode(1) === activeElement) {
  4579. return;
  4580. }
  4581. var cell = that.parentCell(realTarget);
  4582. if ((0, _element.hasClass)(realTarget, 'corner')) {
  4583. that.instance.getSetting('onCellCornerMouseDown', event, realTarget);
  4584. } else if (cell.TD) {
  4585. if (that.instance.hasSetting('onCellMouseDown')) {
  4586. that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance);
  4587. }
  4588. }
  4589. if (event.button !== 2) {
  4590. // if not right mouse button
  4591. if (cell.TD) {
  4592. dblClickOrigin[0] = cell.TD;
  4593. clearTimeout(that.dblClickTimeout[0]);
  4594. that.dblClickTimeout[0] = setTimeout(function () {
  4595. dblClickOrigin[0] = null;
  4596. }, 1000);
  4597. }
  4598. }
  4599. };
  4600. var onTouchMove = function onTouchMove(event) {
  4601. that.instance.touchMoving = true;
  4602. };
  4603. var longTouchTimeout;
  4604. var onTouchStart = function onTouchStart(event) {
  4605. var container = this;
  4606. eventManager.addEventListener(this, 'touchmove', onTouchMove);
  4607. // Prevent cell selection when scrolling with touch event - not the best solution performance-wise
  4608. that.checkIfTouchMove = setTimeout(function () {
  4609. if (that.instance.touchMoving === true) {
  4610. that.instance.touchMoving = void 0;
  4611. eventManager.removeEventListener('touchmove', onTouchMove, false);
  4612. }
  4613. onMouseDown(event);
  4614. }, 30);
  4615. };
  4616. var onMouseOver = function onMouseOver(event) {
  4617. var table, td, mainWOT;
  4618. if (that.instance.hasSetting('onCellMouseOver')) {
  4619. table = that.instance.wtTable.TABLE;
  4620. td = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);
  4621. mainWOT = that.instance.cloneSource || that.instance;
  4622. if (td && td !== mainWOT.lastMouseOver && (0, _element.isChildOf)(td, table)) {
  4623. mainWOT.lastMouseOver = td;
  4624. that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance);
  4625. }
  4626. }
  4627. };
  4628. var onMouseOut = function onMouseOut(event) {
  4629. var table = void 0;
  4630. var lastTD = void 0;
  4631. var nextTD = void 0;
  4632. if (that.instance.hasSetting('onCellMouseOut')) {
  4633. table = that.instance.wtTable.TABLE;
  4634. lastTD = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);
  4635. nextTD = (0, _element.closestDown)(event.relatedTarget, ['TD', 'TH'], table);
  4636. if (lastTD && lastTD !== nextTD && (0, _element.isChildOf)(lastTD, table)) {
  4637. that.instance.getSetting('onCellMouseOut', event, that.instance.wtTable.getCoords(lastTD), lastTD, that.instance);
  4638. }
  4639. }
  4640. };
  4641. var onMouseUp = function onMouseUp(event) {
  4642. if (event.button !== 2) {
  4643. // if not right mouse button
  4644. var cell = that.parentCell(event.realTarget);
  4645. if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) {
  4646. if ((0, _element.hasClass)(event.realTarget, 'corner')) {
  4647. that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance);
  4648. } else {
  4649. that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance);
  4650. }
  4651. dblClickOrigin[0] = null;
  4652. dblClickOrigin[1] = null;
  4653. } else if (cell.TD === dblClickOrigin[0]) {
  4654. that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);
  4655. dblClickOrigin[1] = cell.TD;
  4656. clearTimeout(that.dblClickTimeout[1]);
  4657. that.dblClickTimeout[1] = setTimeout(function () {
  4658. dblClickOrigin[1] = null;
  4659. }, 500);
  4660. } else if (cell.TD && that.instance.hasSetting('onCellMouseUp')) {
  4661. that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);
  4662. }
  4663. }
  4664. };
  4665. var onTouchEnd = function onTouchEnd(event) {
  4666. clearTimeout(longTouchTimeout);
  4667. // that.instance.longTouch == void 0;
  4668. event.preventDefault();
  4669. onMouseUp(event);
  4670. // eventManager.removeEventListener(that.instance.wtTable.holder, "mouseup", onMouseUp);
  4671. };
  4672. eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown);
  4673. eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver);
  4674. eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseout', onMouseOut);
  4675. eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp);
  4676. // check if full HOT instance, or detached WOT AND run on mobile device
  4677. if (this.instance.wtTable.holder.parentNode.parentNode && (0, _browser.isMobileBrowser)() && !that.instance.wtTable.isWorkingOnClone()) {
  4678. var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.');
  4679. eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function (event) {
  4680. that.instance.touchApplied = true;
  4681. if ((0, _element.isChildOf)(event.target, classSelector)) {
  4682. onTouchStart.call(event.target, event);
  4683. }
  4684. });
  4685. eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function (event) {
  4686. that.instance.touchApplied = false;
  4687. if ((0, _element.isChildOf)(event.target, classSelector)) {
  4688. onTouchEnd.call(event.target, event);
  4689. }
  4690. });
  4691. if (!that.instance.momentumScrolling) {
  4692. that.instance.momentumScrolling = {};
  4693. }
  4694. eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function (event) {
  4695. clearTimeout(that.instance.momentumScrolling._timeout);
  4696. if (!that.instance.momentumScrolling.ongoing) {
  4697. that.instance.getSetting('onBeforeTouchScroll');
  4698. }
  4699. that.instance.momentumScrolling.ongoing = true;
  4700. that.instance.momentumScrolling._timeout = setTimeout(function () {
  4701. if (!that.instance.touchApplied) {
  4702. that.instance.momentumScrolling.ongoing = false;
  4703. that.instance.getSetting('onAfterMomentumScroll');
  4704. }
  4705. }, 200);
  4706. });
  4707. }
  4708. eventManager.addEventListener(window, 'resize', function () {
  4709. if (that.instance.getSetting('stretchH') !== 'none') {
  4710. that.instance.draw();
  4711. }
  4712. });
  4713. this.destroy = function () {
  4714. clearTimeout(this.dblClickTimeout[0]);
  4715. clearTimeout(this.dblClickTimeout[1]);
  4716. eventManager.destroy();
  4717. };
  4718. }
  4719. Event.prototype.parentCell = function (elem) {
  4720. var cell = {};
  4721. var TABLE = this.instance.wtTable.TABLE;
  4722. var TD = (0, _element.closestDown)(elem, ['TD', 'TH'], TABLE);
  4723. if (TD) {
  4724. cell.coords = this.instance.wtTable.getCoords(TD);
  4725. cell.TD = TD;
  4726. } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'current')) {
  4727. cell.coords = this.instance.selections.current.cellRange.highlight; // selections.current is current selected cell
  4728. cell.TD = this.instance.wtTable.getCell(cell.coords);
  4729. } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'area')) {
  4730. if (this.instance.selections.area.cellRange) {
  4731. cell.coords = this.instance.selections.area.cellRange.to; // selections.area is area selected cells
  4732. cell.TD = this.instance.wtTable.getCell(cell.coords);
  4733. }
  4734. }
  4735. return cell;
  4736. };
  4737. exports.default = Event;
  4738. /***/ }),
  4739. /* 64 */
  4740. /***/ (function(module, exports, __webpack_require__) {
  4741. "use strict";
  4742. exports.__esModule = true;
  4743. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4744. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4745. /**
  4746. * @class ColumnFilter
  4747. */
  4748. var ColumnFilter = function () {
  4749. /**
  4750. * @param {Number} offset
  4751. * @param {Number} total
  4752. * @param {Number} countTH
  4753. */
  4754. function ColumnFilter(offset, total, countTH) {
  4755. _classCallCheck(this, ColumnFilter);
  4756. this.offset = offset;
  4757. this.total = total;
  4758. this.countTH = countTH;
  4759. }
  4760. /**
  4761. * @param index
  4762. * @returns {Number}
  4763. */
  4764. _createClass(ColumnFilter, [{
  4765. key: "offsetted",
  4766. value: function offsetted(index) {
  4767. return index + this.offset;
  4768. }
  4769. /**
  4770. * @param index
  4771. * @returns {Number}
  4772. */
  4773. }, {
  4774. key: "unOffsetted",
  4775. value: function unOffsetted(index) {
  4776. return index - this.offset;
  4777. }
  4778. /**
  4779. * @param index
  4780. * @returns {Number}
  4781. */
  4782. }, {
  4783. key: "renderedToSource",
  4784. value: function renderedToSource(index) {
  4785. return this.offsetted(index);
  4786. }
  4787. /**
  4788. * @param index
  4789. * @returns {Number}
  4790. */
  4791. }, {
  4792. key: "sourceToRendered",
  4793. value: function sourceToRendered(index) {
  4794. return this.unOffsetted(index);
  4795. }
  4796. /**
  4797. * @param index
  4798. * @returns {Number}
  4799. */
  4800. }, {
  4801. key: "offsettedTH",
  4802. value: function offsettedTH(index) {
  4803. return index - this.countTH;
  4804. }
  4805. /**
  4806. * @param index
  4807. * @returns {Number}
  4808. */
  4809. }, {
  4810. key: "unOffsettedTH",
  4811. value: function unOffsettedTH(index) {
  4812. return index + this.countTH;
  4813. }
  4814. /**
  4815. * @param index
  4816. * @returns {Number}
  4817. */
  4818. }, {
  4819. key: "visibleRowHeadedColumnToSourceColumn",
  4820. value: function visibleRowHeadedColumnToSourceColumn(index) {
  4821. return this.renderedToSource(this.offsettedTH(index));
  4822. }
  4823. /**
  4824. * @param index
  4825. * @returns {Number}
  4826. */
  4827. }, {
  4828. key: "sourceColumnToVisibleRowHeadedColumn",
  4829. value: function sourceColumnToVisibleRowHeadedColumn(index) {
  4830. return this.unOffsettedTH(this.sourceToRendered(index));
  4831. }
  4832. }]);
  4833. return ColumnFilter;
  4834. }();
  4835. exports.default = ColumnFilter;
  4836. /***/ }),
  4837. /* 65 */
  4838. /***/ (function(module, exports, __webpack_require__) {
  4839. "use strict";
  4840. exports.__esModule = true;
  4841. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4842. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4843. /**
  4844. * @class RowFilter
  4845. */
  4846. var RowFilter = function () {
  4847. /**
  4848. * @param {Number} offset
  4849. * @param {Number} total
  4850. * @param {Number} countTH
  4851. */
  4852. function RowFilter(offset, total, countTH) {
  4853. _classCallCheck(this, RowFilter);
  4854. this.offset = offset;
  4855. this.total = total;
  4856. this.countTH = countTH;
  4857. }
  4858. /**
  4859. * @param index
  4860. * @returns {Number}
  4861. */
  4862. _createClass(RowFilter, [{
  4863. key: "offsetted",
  4864. value: function offsetted(index) {
  4865. return index + this.offset;
  4866. }
  4867. /**
  4868. * @param index
  4869. * @returns {Number}
  4870. */
  4871. }, {
  4872. key: "unOffsetted",
  4873. value: function unOffsetted(index) {
  4874. return index - this.offset;
  4875. }
  4876. /**
  4877. * @param index
  4878. * @returns {Number}
  4879. */
  4880. }, {
  4881. key: "renderedToSource",
  4882. value: function renderedToSource(index) {
  4883. return this.offsetted(index);
  4884. }
  4885. /**
  4886. * @param index
  4887. * @returns {Number}
  4888. */
  4889. }, {
  4890. key: "sourceToRendered",
  4891. value: function sourceToRendered(index) {
  4892. return this.unOffsetted(index);
  4893. }
  4894. /**
  4895. * @param index
  4896. * @returns {Number}
  4897. */
  4898. }, {
  4899. key: "offsettedTH",
  4900. value: function offsettedTH(index) {
  4901. return index - this.countTH;
  4902. }
  4903. /**
  4904. * @param index
  4905. * @returns {Number}
  4906. */
  4907. }, {
  4908. key: "unOffsettedTH",
  4909. value: function unOffsettedTH(index) {
  4910. return index + this.countTH;
  4911. }
  4912. /**
  4913. * @param index
  4914. * @returns {Number}
  4915. */
  4916. }, {
  4917. key: "visibleColHeadedRowToSourceRow",
  4918. value: function visibleColHeadedRowToSourceRow(index) {
  4919. return this.renderedToSource(this.offsettedTH(index));
  4920. }
  4921. /**
  4922. * @param index
  4923. * @returns {Number}
  4924. */
  4925. }, {
  4926. key: "sourceRowToVisibleColHeadedRow",
  4927. value: function sourceRowToVisibleColHeadedRow(index) {
  4928. return this.unOffsettedTH(this.sourceToRendered(index));
  4929. }
  4930. }]);
  4931. return RowFilter;
  4932. }();
  4933. exports.default = RowFilter;
  4934. /***/ }),
  4935. /* 66 */
  4936. /***/ (function(module, exports, __webpack_require__) {
  4937. "use strict";
  4938. exports.__esModule = true;
  4939. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4940. var _element = __webpack_require__(2);
  4941. var _array = __webpack_require__(24);
  4942. var _unicode = __webpack_require__(150);
  4943. var _browser = __webpack_require__(32);
  4944. var _eventManager = __webpack_require__(23);
  4945. var _eventManager2 = _interopRequireDefault(_eventManager);
  4946. var _base = __webpack_require__(11);
  4947. var _base2 = _interopRequireDefault(_base);
  4948. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4949. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4950. /**
  4951. * @class Overlays
  4952. */
  4953. var Overlays = function () {
  4954. /**
  4955. * @param {Walkontable} wotInstance
  4956. */
  4957. function Overlays(wotInstance) {
  4958. _classCallCheck(this, Overlays);
  4959. this.wot = wotInstance;
  4960. // legacy support
  4961. this.instance = this.wot;
  4962. this.eventManager = new _eventManager2.default(this.wot);
  4963. this.wot.update('scrollbarWidth', (0, _element.getScrollbarWidth)());
  4964. this.wot.update('scrollbarHeight', (0, _element.getScrollbarWidth)());
  4965. this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
  4966. this.prepareOverlays();
  4967. this.destroyed = false;
  4968. this.keyPressed = false;
  4969. this.spreaderLastSize = {
  4970. width: null,
  4971. height: null
  4972. };
  4973. this.overlayScrollPositions = {
  4974. master: {
  4975. top: 0,
  4976. left: 0
  4977. },
  4978. top: {
  4979. top: null,
  4980. left: 0
  4981. },
  4982. bottom: {
  4983. top: null,
  4984. left: 0
  4985. },
  4986. left: {
  4987. top: 0,
  4988. left: null
  4989. }
  4990. };
  4991. this.pendingScrollCallbacks = {
  4992. master: {
  4993. top: 0,
  4994. left: 0
  4995. },
  4996. top: {
  4997. left: 0
  4998. },
  4999. bottom: {
  5000. left: 0
  5001. },
  5002. left: {
  5003. top: 0
  5004. }
  5005. };
  5006. this.verticalScrolling = false;
  5007. this.horizontalScrolling = false;
  5008. this.delegatedScrollCallback = false;
  5009. this.registeredListeners = [];
  5010. this.registerListeners();
  5011. }
  5012. /**
  5013. * Prepare overlays based on user settings.
  5014. *
  5015. * @returns {Boolean} Returns `true` if changes applied to overlay needs scroll synchronization.
  5016. */
  5017. _createClass(Overlays, [{
  5018. key: 'prepareOverlays',
  5019. value: function prepareOverlays() {
  5020. var syncScroll = false;
  5021. if (this.topOverlay) {
  5022. syncScroll = this.topOverlay.updateStateOfRendering() || syncScroll;
  5023. } else {
  5024. this.topOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP, this.wot);
  5025. }
  5026. if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM)) {
  5027. this.bottomOverlay = {
  5028. needFullRender: false,
  5029. updateStateOfRendering: function updateStateOfRendering() {
  5030. return false;
  5031. }
  5032. };
  5033. }
  5034. if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
  5035. this.bottomLeftCornerOverlay = {
  5036. needFullRender: false,
  5037. updateStateOfRendering: function updateStateOfRendering() {
  5038. return false;
  5039. }
  5040. };
  5041. }
  5042. if (this.bottomOverlay) {
  5043. syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;
  5044. } else {
  5045. this.bottomOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM, this.wot);
  5046. }
  5047. if (this.leftOverlay) {
  5048. syncScroll = this.leftOverlay.updateStateOfRendering() || syncScroll;
  5049. } else {
  5050. this.leftOverlay = _base2.default.createOverlay(_base2.default.CLONE_LEFT, this.wot);
  5051. }
  5052. if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {
  5053. if (this.topLeftCornerOverlay) {
  5054. syncScroll = this.topLeftCornerOverlay.updateStateOfRendering() || syncScroll;
  5055. } else {
  5056. this.topLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, this.wot);
  5057. }
  5058. }
  5059. if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender) {
  5060. if (this.bottomLeftCornerOverlay) {
  5061. syncScroll = this.bottomLeftCornerOverlay.updateStateOfRendering() || syncScroll;
  5062. } else {
  5063. this.bottomLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER, this.wot);
  5064. }
  5065. }
  5066. if (this.wot.getSetting('debug') && !this.debug) {
  5067. this.debug = _base2.default.createOverlay(_base2.default.CLONE_DEBUG, this.wot);
  5068. }
  5069. return syncScroll;
  5070. }
  5071. /**
  5072. * Refresh and redraw table
  5073. */
  5074. }, {
  5075. key: 'refreshAll',
  5076. value: function refreshAll() {
  5077. if (!this.wot.drawn) {
  5078. return;
  5079. }
  5080. if (!this.wot.wtTable.holder.parentNode) {
  5081. // Walkontable was detached from DOM, but this handler was not removed
  5082. this.destroy();
  5083. return;
  5084. }
  5085. this.wot.draw(true);
  5086. if (this.verticalScrolling) {
  5087. this.leftOverlay.onScroll();
  5088. }
  5089. if (this.horizontalScrolling) {
  5090. this.topOverlay.onScroll();
  5091. }
  5092. this.verticalScrolling = false;
  5093. this.horizontalScrolling = false;
  5094. }
  5095. /**
  5096. * Register all necessary event listeners.
  5097. */
  5098. }, {
  5099. key: 'registerListeners',
  5100. value: function registerListeners() {
  5101. var _this = this;
  5102. var topOverlayScrollable = this.topOverlay.mainTableScrollableElement;
  5103. var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement;
  5104. var listenersToRegister = [];
  5105. listenersToRegister.push([document.documentElement, 'keydown', function (event) {
  5106. return _this.onKeyDown(event);
  5107. }]);
  5108. listenersToRegister.push([document.documentElement, 'keyup', function () {
  5109. return _this.onKeyUp();
  5110. }]);
  5111. listenersToRegister.push([document, 'visibilitychange', function () {
  5112. return _this.onKeyUp();
  5113. }]);
  5114. listenersToRegister.push([topOverlayScrollable, 'scroll', function (event) {
  5115. return _this.onTableScroll(event);
  5116. }]);
  5117. if (topOverlayScrollable !== leftOverlayScrollable) {
  5118. listenersToRegister.push([leftOverlayScrollable, 'scroll', function (event) {
  5119. return _this.onTableScroll(event);
  5120. }]);
  5121. }
  5122. if (this.topOverlay.needFullRender) {
  5123. listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', function (event) {
  5124. return _this.onTableScroll(event);
  5125. }]);
  5126. listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'wheel', function (event) {
  5127. return _this.onTableScroll(event);
  5128. }]);
  5129. }
  5130. if (this.bottomOverlay.needFullRender) {
  5131. listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', function (event) {
  5132. return _this.onTableScroll(event);
  5133. }]);
  5134. listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'wheel', function (event) {
  5135. return _this.onTableScroll(event);
  5136. }]);
  5137. }
  5138. if (this.leftOverlay.needFullRender) {
  5139. listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', function (event) {
  5140. return _this.onTableScroll(event);
  5141. }]);
  5142. listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'wheel', function (event) {
  5143. return _this.onTableScroll(event);
  5144. }]);
  5145. }
  5146. if (this.topLeftCornerOverlay && this.topLeftCornerOverlay.needFullRender) {
  5147. listenersToRegister.push([this.topLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {
  5148. return _this.onTableScroll(event);
  5149. }]);
  5150. }
  5151. if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.needFullRender) {
  5152. listenersToRegister.push([this.bottomLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {
  5153. return _this.onTableScroll(event);
  5154. }]);
  5155. }
  5156. if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) {
  5157. // This is necessary?
  5158. // eventManager.addEventListener(window, 'scroll', (event) => this.refreshAll(event));
  5159. listenersToRegister.push([window, 'wheel', function (event) {
  5160. var overlay = void 0;
  5161. var deltaY = event.wheelDeltaY || event.deltaY;
  5162. var deltaX = event.wheelDeltaX || event.deltaX;
  5163. if (_this.topOverlay.clone.wtTable.holder.contains(event.realTarget)) {
  5164. overlay = 'top';
  5165. } else if (_this.bottomOverlay.clone && _this.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) {
  5166. overlay = 'bottom';
  5167. } else if (_this.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) {
  5168. overlay = 'left';
  5169. } else if (_this.topLeftCornerOverlay && _this.topLeftCornerOverlay.clone && _this.topLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {
  5170. overlay = 'topLeft';
  5171. } else if (_this.bottomLeftCornerOverlay && _this.bottomLeftCornerOverlay.clone && _this.bottomLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {
  5172. overlay = 'bottomLeft';
  5173. }
  5174. if (overlay == 'top' && deltaY !== 0 || overlay == 'left' && deltaX !== 0 || overlay == 'bottom' && deltaY !== 0 || (overlay === 'topLeft' || overlay === 'bottomLeft') && (deltaY !== 0 || deltaX !== 0)) {
  5175. event.preventDefault();
  5176. }
  5177. }]);
  5178. }
  5179. while (listenersToRegister.length) {
  5180. var listener = listenersToRegister.pop();
  5181. this.eventManager.addEventListener(listener[0], listener[1], listener[2]);
  5182. this.registeredListeners.push(listener);
  5183. }
  5184. }
  5185. /**
  5186. * Deregister all previously registered listeners.
  5187. */
  5188. }, {
  5189. key: 'deregisterListeners',
  5190. value: function deregisterListeners() {
  5191. while (this.registeredListeners.length) {
  5192. var listener = this.registeredListeners.pop();
  5193. this.eventManager.removeEventListener(listener[0], listener[1], listener[2]);
  5194. }
  5195. }
  5196. /**
  5197. * Scroll listener
  5198. *
  5199. * @param {Event} event
  5200. */
  5201. }, {
  5202. key: 'onTableScroll',
  5203. value: function onTableScroll(event) {
  5204. // if mobile browser, do not update scroll positions, as the overlays are hidden during the scroll
  5205. if ((0, _browser.isMobileBrowser)()) {
  5206. return;
  5207. }
  5208. var masterHorizontal = this.leftOverlay.mainTableScrollableElement;
  5209. var masterVertical = this.topOverlay.mainTableScrollableElement;
  5210. var target = event.target;
  5211. // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered
  5212. // by hot.refreshBorder
  5213. if (this.keyPressed) {
  5214. if (masterVertical !== window && target !== window && !event.target.contains(masterVertical) || masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal)) {
  5215. return;
  5216. }
  5217. }
  5218. if (event.type === 'scroll') {
  5219. this.syncScrollPositions(event);
  5220. } else {
  5221. this.translateMouseWheelToScroll(event);
  5222. }
  5223. }
  5224. /**
  5225. * Key down listener
  5226. */
  5227. }, {
  5228. key: 'onKeyDown',
  5229. value: function onKeyDown(event) {
  5230. this.keyPressed = (0, _unicode.isKey)(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');
  5231. }
  5232. /**
  5233. * Key up listener
  5234. */
  5235. }, {
  5236. key: 'onKeyUp',
  5237. value: function onKeyUp() {
  5238. this.keyPressed = false;
  5239. }
  5240. /**
  5241. * Translate wheel event into scroll event and sync scroll overlays position
  5242. *
  5243. * @private
  5244. * @param {Event} event
  5245. * @returns {Boolean}
  5246. */
  5247. }, {
  5248. key: 'translateMouseWheelToScroll',
  5249. value: function translateMouseWheelToScroll(event) {
  5250. var topOverlay = this.topOverlay.clone.wtTable.holder;
  5251. var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null;
  5252. var leftOverlay = this.leftOverlay.clone.wtTable.holder;
  5253. var topLeftCornerOverlay = this.topLeftCornerOverlay && this.topLeftCornerOverlay.clone ? this.topLeftCornerOverlay.clone.wtTable.holder : null;
  5254. var bottomLeftCornerOverlay = this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone ? this.bottomLeftCornerOverlay.clone.wtTable.holder : null;
  5255. var mouseWheelSpeedRatio = -0.2;
  5256. var deltaY = event.wheelDeltaY || -1 * event.deltaY;
  5257. var deltaX = event.wheelDeltaX || -1 * event.deltaX;
  5258. var parentHolder = null;
  5259. var eventMockup = { type: 'wheel' };
  5260. var tempElem = event.target;
  5261. var delta = null;
  5262. // Fix for extremely slow header scrolling with a mousewheel on Firefox
  5263. if (event.deltaMode === 1) {
  5264. deltaY *= 120;
  5265. deltaX *= 120;
  5266. }
  5267. while (tempElem != document && tempElem != null) {
  5268. if (tempElem.className.indexOf('wtHolder') > -1) {
  5269. parentHolder = tempElem;
  5270. break;
  5271. }
  5272. tempElem = tempElem.parentNode;
  5273. }
  5274. eventMockup.target = parentHolder;
  5275. if (parentHolder === topLeftCornerOverlay || parentHolder === bottomLeftCornerOverlay) {
  5276. this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaX, 'x');
  5277. this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaY, 'y');
  5278. } else {
  5279. if (parentHolder === topOverlay || parentHolder === bottomOverlay) {
  5280. delta = deltaY;
  5281. } else if (parentHolder === leftOverlay) {
  5282. delta = deltaX;
  5283. }
  5284. this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * delta);
  5285. }
  5286. return false;
  5287. }
  5288. /**
  5289. * Synchronize scroll position between master table and overlay table.
  5290. *
  5291. * @private
  5292. * @param {Event|Object} event
  5293. * @param {Number} [fakeScrollValue=null]
  5294. * @param {String} [fakeScrollDirection=null] `x` or `y`.
  5295. */
  5296. }, {
  5297. key: 'syncScrollPositions',
  5298. value: function syncScrollPositions(event) {
  5299. var fakeScrollValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  5300. var fakeScrollDirection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  5301. if (this.destroyed) {
  5302. return;
  5303. }
  5304. if (arguments.length === 0) {
  5305. this.syncScrollWithMaster();
  5306. return;
  5307. }
  5308. var masterHorizontal = this.leftOverlay.mainTableScrollableElement;
  5309. var masterVertical = this.topOverlay.mainTableScrollableElement;
  5310. var target = event.target;
  5311. var tempScrollValue = 0;
  5312. var scrollValueChanged = false;
  5313. var topOverlay = void 0;
  5314. var leftOverlay = void 0;
  5315. var topLeftCornerOverlay = void 0;
  5316. var bottomLeftCornerOverlay = void 0;
  5317. var bottomOverlay = void 0;
  5318. var delegatedScroll = false;
  5319. var preventOverflow = this.wot.getSetting('preventOverflow');
  5320. if (this.topOverlay.needFullRender) {
  5321. topOverlay = this.topOverlay.clone.wtTable.holder;
  5322. }
  5323. if (this.bottomOverlay.needFullRender) {
  5324. bottomOverlay = this.bottomOverlay.clone.wtTable.holder;
  5325. }
  5326. if (this.leftOverlay.needFullRender) {
  5327. leftOverlay = this.leftOverlay.clone.wtTable.holder;
  5328. }
  5329. if (this.leftOverlay.needFullRender && this.topOverlay.needFullRender) {
  5330. topLeftCornerOverlay = this.topLeftCornerOverlay.clone.wtTable.holder;
  5331. }
  5332. if (this.leftOverlay.needFullRender && this.bottomOverlay.needFullRender) {
  5333. bottomLeftCornerOverlay = this.bottomLeftCornerOverlay.clone.wtTable.holder;
  5334. }
  5335. if (target === document) {
  5336. target = window;
  5337. }
  5338. if (target === masterHorizontal || target === masterVertical) {
  5339. if (preventOverflow) {
  5340. tempScrollValue = (0, _element.getScrollLeft)(this.scrollableElement);
  5341. } else {
  5342. tempScrollValue = (0, _element.getScrollLeft)(target);
  5343. }
  5344. // if scrolling the master table - populate the scroll values to both top and left overlays
  5345. this.horizontalScrolling = true;
  5346. this.overlayScrollPositions.master.left = tempScrollValue;
  5347. scrollValueChanged = true;
  5348. if (this.pendingScrollCallbacks.master.left > 0) {
  5349. this.pendingScrollCallbacks.master.left--;
  5350. } else {
  5351. if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {
  5352. if (fakeScrollValue == null) {
  5353. this.pendingScrollCallbacks.top.left++;
  5354. }
  5355. topOverlay.scrollLeft = tempScrollValue;
  5356. delegatedScroll = masterHorizontal !== window;
  5357. }
  5358. if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {
  5359. if (fakeScrollValue == null) {
  5360. this.pendingScrollCallbacks.bottom.left++;
  5361. }
  5362. bottomOverlay.scrollLeft = tempScrollValue;
  5363. delegatedScroll = masterHorizontal !== window;
  5364. }
  5365. }
  5366. tempScrollValue = (0, _element.getScrollTop)(target);
  5367. this.verticalScrolling = true;
  5368. this.overlayScrollPositions.master.top = tempScrollValue;
  5369. scrollValueChanged = true;
  5370. if (this.pendingScrollCallbacks.master.top > 0) {
  5371. this.pendingScrollCallbacks.master.top--;
  5372. } else if (leftOverlay && leftOverlay.scrollTop !== tempScrollValue) {
  5373. if (fakeScrollValue == null) {
  5374. this.pendingScrollCallbacks.left.top++;
  5375. }
  5376. leftOverlay.scrollTop = tempScrollValue;
  5377. delegatedScroll = masterVertical !== window;
  5378. }
  5379. } else if (target === bottomOverlay) {
  5380. tempScrollValue = (0, _element.getScrollLeft)(target);
  5381. // if scrolling the bottom overlay - populate the horizontal scroll to the master table
  5382. this.horizontalScrolling = true;
  5383. this.overlayScrollPositions.bottom.left = tempScrollValue;
  5384. scrollValueChanged = true;
  5385. if (this.pendingScrollCallbacks.bottom.left > 0) {
  5386. this.pendingScrollCallbacks.bottom.left--;
  5387. } else {
  5388. if (fakeScrollValue == null) {
  5389. this.pendingScrollCallbacks.master.left++;
  5390. }
  5391. masterHorizontal.scrollLeft = tempScrollValue;
  5392. if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {
  5393. if (fakeScrollValue == null) {
  5394. this.pendingScrollCallbacks.top.left++;
  5395. }
  5396. topOverlay.scrollLeft = tempScrollValue;
  5397. delegatedScroll = masterVertical !== window;
  5398. }
  5399. }
  5400. // "fake" scroll value calculated from the mousewheel event
  5401. if (fakeScrollValue !== null) {
  5402. scrollValueChanged = true;
  5403. masterVertical.scrollTop += fakeScrollValue;
  5404. }
  5405. } else if (target === topOverlay) {
  5406. tempScrollValue = (0, _element.getScrollLeft)(target);
  5407. // if scrolling the top overlay - populate the horizontal scroll to the master table
  5408. this.horizontalScrolling = true;
  5409. this.overlayScrollPositions.top.left = tempScrollValue;
  5410. scrollValueChanged = true;
  5411. if (this.pendingScrollCallbacks.top.left > 0) {
  5412. this.pendingScrollCallbacks.top.left--;
  5413. } else {
  5414. if (fakeScrollValue == null) {
  5415. this.pendingScrollCallbacks.master.left++;
  5416. }
  5417. masterHorizontal.scrollLeft = tempScrollValue;
  5418. }
  5419. // "fake" scroll value calculated from the mousewheel event
  5420. if (fakeScrollValue !== null) {
  5421. scrollValueChanged = true;
  5422. masterVertical.scrollTop += fakeScrollValue;
  5423. }
  5424. if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {
  5425. if (fakeScrollValue == null) {
  5426. this.pendingScrollCallbacks.bottom.left++;
  5427. }
  5428. bottomOverlay.scrollLeft = tempScrollValue;
  5429. delegatedScroll = masterVertical !== window;
  5430. }
  5431. } else if (target === leftOverlay) {
  5432. tempScrollValue = (0, _element.getScrollTop)(target);
  5433. // if scrolling the left overlay - populate the vertical scroll to the master table
  5434. if (this.overlayScrollPositions.left.top !== tempScrollValue) {
  5435. this.verticalScrolling = true;
  5436. this.overlayScrollPositions.left.top = tempScrollValue;
  5437. scrollValueChanged = true;
  5438. if (this.pendingScrollCallbacks.left.top > 0) {
  5439. this.pendingScrollCallbacks.left.top--;
  5440. } else {
  5441. if (fakeScrollValue == null) {
  5442. this.pendingScrollCallbacks.master.top++;
  5443. }
  5444. masterVertical.scrollTop = tempScrollValue;
  5445. }
  5446. }
  5447. // "fake" scroll value calculated from the mousewheel event
  5448. if (fakeScrollValue !== null) {
  5449. scrollValueChanged = true;
  5450. masterVertical.scrollLeft += fakeScrollValue;
  5451. }
  5452. } else if (target === topLeftCornerOverlay || target === bottomLeftCornerOverlay) {
  5453. if (fakeScrollValue !== null) {
  5454. scrollValueChanged = true;
  5455. if (fakeScrollDirection === 'x') {
  5456. masterVertical.scrollLeft += fakeScrollValue;
  5457. } else if (fakeScrollDirection === 'y') {
  5458. masterVertical.scrollTop += fakeScrollValue;
  5459. }
  5460. }
  5461. }
  5462. if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') {
  5463. if (this.delegatedScrollCallback) {
  5464. this.delegatedScrollCallback = false;
  5465. } else {
  5466. this.refreshAll();
  5467. }
  5468. if (delegatedScroll) {
  5469. this.delegatedScrollCallback = true;
  5470. }
  5471. }
  5472. }
  5473. /**
  5474. * Synchronize overlay scrollbars with the master scrollbar
  5475. */
  5476. }, {
  5477. key: 'syncScrollWithMaster',
  5478. value: function syncScrollWithMaster() {
  5479. var master = this.topOverlay.mainTableScrollableElement;
  5480. var scrollLeft = master.scrollLeft,
  5481. scrollTop = master.scrollTop;
  5482. if (this.topOverlay.needFullRender) {
  5483. this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;
  5484. }
  5485. if (this.bottomOverlay.needFullRender) {
  5486. this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;
  5487. }
  5488. if (this.leftOverlay.needFullRender) {
  5489. this.leftOverlay.clone.wtTable.holder.scrollTop = scrollTop;
  5490. }
  5491. }
  5492. /**
  5493. * Update the main scrollable elements for all the overlays.
  5494. */
  5495. }, {
  5496. key: 'updateMainScrollableElements',
  5497. value: function updateMainScrollableElements() {
  5498. this.deregisterListeners();
  5499. this.leftOverlay.updateMainScrollableElement();
  5500. this.topOverlay.updateMainScrollableElement();
  5501. if (this.bottomOverlay.needFullRender) {
  5502. this.bottomOverlay.updateMainScrollableElement();
  5503. }
  5504. this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
  5505. this.registerListeners();
  5506. }
  5507. /**
  5508. *
  5509. */
  5510. }, {
  5511. key: 'destroy',
  5512. value: function destroy() {
  5513. this.eventManager.destroy();
  5514. this.topOverlay.destroy();
  5515. if (this.bottomOverlay.clone) {
  5516. this.bottomOverlay.destroy();
  5517. }
  5518. this.leftOverlay.destroy();
  5519. if (this.topLeftCornerOverlay) {
  5520. this.topLeftCornerOverlay.destroy();
  5521. }
  5522. if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {
  5523. this.bottomLeftCornerOverlay.destroy();
  5524. }
  5525. if (this.debug) {
  5526. this.debug.destroy();
  5527. }
  5528. this.destroyed = true;
  5529. }
  5530. /**
  5531. * @param {Boolean} [fastDraw=false]
  5532. */
  5533. }, {
  5534. key: 'refresh',
  5535. value: function refresh() {
  5536. var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5537. if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) {
  5538. var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement;
  5539. var width = container.clientWidth;
  5540. var height = container.clientHeight;
  5541. if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {
  5542. this.spreaderLastSize.width = width;
  5543. this.spreaderLastSize.height = height;
  5544. this.adjustElementsSize();
  5545. }
  5546. }
  5547. if (this.bottomOverlay.clone) {
  5548. this.bottomOverlay.refresh(fastDraw);
  5549. }
  5550. this.leftOverlay.refresh(fastDraw);
  5551. this.topOverlay.refresh(fastDraw);
  5552. if (this.topLeftCornerOverlay) {
  5553. this.topLeftCornerOverlay.refresh(fastDraw);
  5554. }
  5555. if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {
  5556. this.bottomLeftCornerOverlay.refresh(fastDraw);
  5557. }
  5558. if (this.debug) {
  5559. this.debug.refresh(fastDraw);
  5560. }
  5561. }
  5562. /**
  5563. * Adjust overlays elements size and master table size
  5564. *
  5565. * @param {Boolean} [force=false]
  5566. */
  5567. }, {
  5568. key: 'adjustElementsSize',
  5569. value: function adjustElementsSize() {
  5570. var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5571. var totalColumns = this.wot.getSetting('totalColumns');
  5572. var totalRows = this.wot.getSetting('totalRows');
  5573. var headerRowSize = this.wot.wtViewport.getRowHeaderWidth();
  5574. var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight();
  5575. var hiderStyle = this.wot.wtTable.hider.style;
  5576. hiderStyle.width = headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns) + 'px';
  5577. hiderStyle.height = headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1 + 'px';
  5578. this.topOverlay.adjustElementsSize(force);
  5579. this.leftOverlay.adjustElementsSize(force);
  5580. if (this.bottomOverlay.clone) {
  5581. this.bottomOverlay.adjustElementsSize(force);
  5582. }
  5583. }
  5584. /**
  5585. *
  5586. */
  5587. }, {
  5588. key: 'applyToDOM',
  5589. value: function applyToDOM() {
  5590. if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) {
  5591. this.adjustElementsSize();
  5592. }
  5593. this.topOverlay.applyToDOM();
  5594. if (this.bottomOverlay.clone) {
  5595. this.bottomOverlay.applyToDOM();
  5596. }
  5597. this.leftOverlay.applyToDOM();
  5598. }
  5599. /**
  5600. * Get the parent overlay of the provided element.
  5601. *
  5602. * @param {HTMLElement} element
  5603. * @returns {Object|null}
  5604. */
  5605. }, {
  5606. key: 'getParentOverlay',
  5607. value: function getParentOverlay(element) {
  5608. if (!element) {
  5609. return null;
  5610. }
  5611. var overlays = [this.topOverlay, this.leftOverlay, this.bottomOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];
  5612. var result = null;
  5613. (0, _array.arrayEach)(overlays, function (elem, i) {
  5614. if (!elem) {
  5615. return;
  5616. }
  5617. if (elem.clone && elem.clone.wtTable.TABLE.contains(element)) {
  5618. result = elem.clone;
  5619. }
  5620. });
  5621. return result;
  5622. }
  5623. }]);
  5624. return Overlays;
  5625. }();
  5626. exports.default = Overlays;
  5627. /***/ }),
  5628. /* 67 */
  5629. /***/ (function(module, exports, __webpack_require__) {
  5630. "use strict";
  5631. exports.__esModule = true;
  5632. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5633. var _element = __webpack_require__(2);
  5634. var _number = __webpack_require__(76);
  5635. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5636. /**
  5637. * @class Scroll
  5638. */
  5639. var Scroll = function () {
  5640. /**
  5641. * @param {Walkontable} wotInstance
  5642. */
  5643. function Scroll(wotInstance) {
  5644. _classCallCheck(this, Scroll);
  5645. this.wot = wotInstance;
  5646. // legacy support
  5647. this.instance = wotInstance;
  5648. }
  5649. /**
  5650. * Scrolls viewport to a cell by minimum number of cells
  5651. *
  5652. * @param {CellCoords} coords
  5653. */
  5654. _createClass(Scroll, [{
  5655. key: 'scrollViewport',
  5656. value: function scrollViewport(coords) {
  5657. if (!this.wot.drawn) {
  5658. return;
  5659. }
  5660. var _getVariables2 = this._getVariables(),
  5661. topOverlay = _getVariables2.topOverlay,
  5662. leftOverlay = _getVariables2.leftOverlay,
  5663. totalRows = _getVariables2.totalRows,
  5664. totalColumns = _getVariables2.totalColumns,
  5665. fixedRowsTop = _getVariables2.fixedRowsTop,
  5666. fixedRowsBottom = _getVariables2.fixedRowsBottom,
  5667. fixedColumnsLeft = _getVariables2.fixedColumnsLeft;
  5668. if (coords.row < 0 || coords.row > Math.max(totalRows - 1, 0)) {
  5669. throw new Error('row ' + coords.row + ' does not exist');
  5670. }
  5671. if (coords.col < 0 || coords.col > Math.max(totalColumns - 1, 0)) {
  5672. throw new Error('column ' + coords.col + ' does not exist');
  5673. }
  5674. if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) {
  5675. topOverlay.scrollTo(coords.row);
  5676. } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) {
  5677. topOverlay.scrollTo(coords.row, true);
  5678. }
  5679. if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) {
  5680. leftOverlay.scrollTo(coords.col);
  5681. } else if (coords.col > this.getLastVisibleColumn()) {
  5682. leftOverlay.scrollTo(coords.col, true);
  5683. }
  5684. }
  5685. /**
  5686. * Get first visible row based on virtual dom and how table is visible in browser window viewport.
  5687. *
  5688. * @returns {Number}
  5689. */
  5690. }, {
  5691. key: 'getFirstVisibleRow',
  5692. value: function getFirstVisibleRow() {
  5693. var _getVariables3 = this._getVariables(),
  5694. topOverlay = _getVariables3.topOverlay,
  5695. wtTable = _getVariables3.wtTable,
  5696. wtViewport = _getVariables3.wtViewport,
  5697. totalRows = _getVariables3.totalRows,
  5698. fixedRowsTop = _getVariables3.fixedRowsTop;
  5699. var firstVisibleRow = wtTable.getFirstVisibleRow();
  5700. if (topOverlay.mainTableScrollableElement === window) {
  5701. var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
  5702. var totalTableHeight = (0, _element.innerHeight)(wtTable.hider);
  5703. var windowHeight = (0, _element.innerHeight)(window);
  5704. var windowScrollTop = (0, _element.getScrollTop)(window);
  5705. // Only calculate firstVisibleRow when table didn't filled (from up) whole viewport space
  5706. if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {
  5707. var rowsHeight = wtViewport.getColumnHeaderHeight();
  5708. rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);
  5709. (0, _number.rangeEachReverse)(totalRows, 1, function (row) {
  5710. rowsHeight += topOverlay.sumCellSizes(row - 1, row);
  5711. if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {
  5712. // Return physical row + 1
  5713. firstVisibleRow = row;
  5714. return false;
  5715. }
  5716. });
  5717. }
  5718. }
  5719. return firstVisibleRow;
  5720. }
  5721. /**
  5722. * Get last visible row based on virtual dom and how table is visible in browser window viewport.
  5723. *
  5724. * @returns {Number}
  5725. */
  5726. }, {
  5727. key: 'getLastVisibleRow',
  5728. value: function getLastVisibleRow() {
  5729. var _getVariables4 = this._getVariables(),
  5730. topOverlay = _getVariables4.topOverlay,
  5731. wtTable = _getVariables4.wtTable,
  5732. wtViewport = _getVariables4.wtViewport,
  5733. totalRows = _getVariables4.totalRows;
  5734. var lastVisibleRow = wtTable.getLastVisibleRow();
  5735. if (topOverlay.mainTableScrollableElement === window) {
  5736. var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
  5737. var windowHeight = (0, _element.innerHeight)(window);
  5738. var windowScrollTop = (0, _element.getScrollTop)(window);
  5739. // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space
  5740. if (rootElementOffset.top > windowScrollTop) {
  5741. var rowsHeight = wtViewport.getColumnHeaderHeight();
  5742. (0, _number.rangeEach)(1, totalRows, function (row) {
  5743. rowsHeight += topOverlay.sumCellSizes(row - 1, row);
  5744. if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {
  5745. // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)
  5746. lastVisibleRow = row - 2;
  5747. return false;
  5748. }
  5749. });
  5750. }
  5751. }
  5752. return lastVisibleRow;
  5753. }
  5754. /**
  5755. * Get first visible column based on virtual dom and how table is visible in browser window viewport.
  5756. *
  5757. * @returns {Number}
  5758. */
  5759. }, {
  5760. key: 'getFirstVisibleColumn',
  5761. value: function getFirstVisibleColumn() {
  5762. var _getVariables5 = this._getVariables(),
  5763. leftOverlay = _getVariables5.leftOverlay,
  5764. wtTable = _getVariables5.wtTable,
  5765. wtViewport = _getVariables5.wtViewport,
  5766. totalColumns = _getVariables5.totalColumns,
  5767. fixedColumnsLeft = _getVariables5.fixedColumnsLeft;
  5768. var firstVisibleColumn = wtTable.getFirstVisibleColumn();
  5769. if (leftOverlay.mainTableScrollableElement === window) {
  5770. var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
  5771. var totalTableWidth = (0, _element.innerWidth)(wtTable.hider);
  5772. var windowWidth = (0, _element.innerWidth)(window);
  5773. var windowScrollLeft = (0, _element.getScrollLeft)(window);
  5774. // Only calculate firstVisibleColumn when table didn't filled (from left) whole viewport space
  5775. if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {
  5776. var columnsWidth = wtViewport.getRowHeaderWidth();
  5777. (0, _number.rangeEachReverse)(totalColumns, 1, function (column) {
  5778. columnsWidth += leftOverlay.sumCellSizes(column - 1, column);
  5779. if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {
  5780. // Return physical column + 1
  5781. firstVisibleColumn = column;
  5782. return false;
  5783. }
  5784. });
  5785. }
  5786. }
  5787. return firstVisibleColumn;
  5788. }
  5789. /**
  5790. * Get last visible column based on virtual dom and how table is visible in browser window viewport.
  5791. *
  5792. * @returns {Number}
  5793. */
  5794. }, {
  5795. key: 'getLastVisibleColumn',
  5796. value: function getLastVisibleColumn() {
  5797. var _getVariables6 = this._getVariables(),
  5798. leftOverlay = _getVariables6.leftOverlay,
  5799. wtTable = _getVariables6.wtTable,
  5800. wtViewport = _getVariables6.wtViewport,
  5801. totalColumns = _getVariables6.totalColumns;
  5802. var lastVisibleColumn = wtTable.getLastVisibleColumn();
  5803. if (leftOverlay.mainTableScrollableElement === window) {
  5804. var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
  5805. var windowWidth = (0, _element.innerWidth)(window);
  5806. var windowScrollLeft = (0, _element.getScrollLeft)(window);
  5807. // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space
  5808. if (rootElementOffset.left > windowScrollLeft) {
  5809. var columnsWidth = wtViewport.getRowHeaderWidth();
  5810. (0, _number.rangeEach)(1, totalColumns, function (column) {
  5811. columnsWidth += leftOverlay.sumCellSizes(column - 1, column);
  5812. if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {
  5813. // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)
  5814. lastVisibleColumn = column - 2;
  5815. return false;
  5816. }
  5817. });
  5818. }
  5819. }
  5820. return lastVisibleColumn;
  5821. }
  5822. /**
  5823. * Returns collection of variables used to rows and columns visibility calculations.
  5824. *
  5825. * @returns {Object}
  5826. * @private
  5827. */
  5828. }, {
  5829. key: '_getVariables',
  5830. value: function _getVariables() {
  5831. var wot = this.wot;
  5832. var topOverlay = wot.wtOverlays.topOverlay;
  5833. var leftOverlay = wot.wtOverlays.leftOverlay;
  5834. var wtTable = wot.wtTable;
  5835. var wtViewport = wot.wtViewport;
  5836. var totalRows = wot.getSetting('totalRows');
  5837. var totalColumns = wot.getSetting('totalColumns');
  5838. var fixedRowsTop = wot.getSetting('fixedRowsTop');
  5839. var fixedRowsBottom = wot.getSetting('fixedRowsBottom');
  5840. var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');
  5841. return {
  5842. topOverlay: topOverlay,
  5843. leftOverlay: leftOverlay,
  5844. wtTable: wtTable,
  5845. wtViewport: wtViewport,
  5846. totalRows: totalRows,
  5847. totalColumns: totalColumns,
  5848. fixedRowsTop: fixedRowsTop,
  5849. fixedRowsBottom: fixedRowsBottom,
  5850. fixedColumnsLeft: fixedColumnsLeft
  5851. };
  5852. }
  5853. }]);
  5854. return Scroll;
  5855. }();
  5856. exports.default = Scroll;
  5857. /***/ }),
  5858. /* 68 */
  5859. /***/ (function(module, exports, __webpack_require__) {
  5860. "use strict";
  5861. exports.__esModule = true;
  5862. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5863. var _element = __webpack_require__(2);
  5864. var _object = __webpack_require__(25);
  5865. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5866. /**
  5867. * @class Settings
  5868. */
  5869. var Settings = function () {
  5870. /**
  5871. * @param {Walkontable} wotInstance
  5872. * @param {Object} settings
  5873. */
  5874. function Settings(wotInstance, settings) {
  5875. var _this = this;
  5876. _classCallCheck(this, Settings);
  5877. this.wot = wotInstance;
  5878. // legacy support
  5879. this.instance = wotInstance;
  5880. // default settings. void 0 means it is required, null means it can be empty
  5881. this.defaults = {
  5882. table: void 0,
  5883. debug: false, // shows WalkontableDebugOverlay
  5884. // presentation mode
  5885. externalRowCalculator: false,
  5886. stretchH: 'none', // values: all, last, none
  5887. currentRowClassName: null,
  5888. currentColumnClassName: null,
  5889. preventOverflow: function preventOverflow() {
  5890. return false;
  5891. },
  5892. // data source
  5893. data: void 0,
  5894. freezeOverlays: false,
  5895. fixedColumnsLeft: 0,
  5896. fixedRowsTop: 0,
  5897. fixedRowsBottom: 0,
  5898. minSpareRows: 0,
  5899. // this must be array of functions: [function (row, TH) {}]
  5900. rowHeaders: function rowHeaders() {
  5901. return [];
  5902. },
  5903. // this must be array of functions: [function (column, TH) {}]
  5904. columnHeaders: function columnHeaders() {
  5905. return [];
  5906. },
  5907. totalRows: void 0,
  5908. totalColumns: void 0,
  5909. cellRenderer: function cellRenderer(row, column, TD) {
  5910. var cellData = _this.getSetting('data', row, column);
  5911. (0, _element.fastInnerText)(TD, cellData === void 0 || cellData === null ? '' : cellData);
  5912. },
  5913. // columnWidth: 50,
  5914. columnWidth: function columnWidth(col) {
  5915. // return undefined means use default size for the rendered cell content
  5916. },
  5917. rowHeight: function rowHeight(row) {
  5918. // return undefined means use default size for the rendered cell content
  5919. },
  5920. defaultRowHeight: 23,
  5921. defaultColumnWidth: 50,
  5922. selections: null,
  5923. hideBorderOnMouseDownOver: false,
  5924. viewportRowCalculatorOverride: null,
  5925. viewportColumnCalculatorOverride: null,
  5926. // callbacks
  5927. onCellMouseDown: null,
  5928. onCellMouseOver: null,
  5929. onCellMouseOut: null,
  5930. onCellMouseUp: null,
  5931. // onCellMouseOut: null,
  5932. onCellDblClick: null,
  5933. onCellCornerMouseDown: null,
  5934. onCellCornerDblClick: null,
  5935. beforeDraw: null,
  5936. onDraw: null,
  5937. onBeforeDrawBorders: null,
  5938. onScrollVertically: null,
  5939. onScrollHorizontally: null,
  5940. onBeforeTouchScroll: null,
  5941. onAfterMomentumScroll: null,
  5942. onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(width) {
  5943. return width;
  5944. },
  5945. onModifyRowHeaderWidth: null,
  5946. // constants
  5947. scrollbarWidth: 10,
  5948. scrollbarHeight: 10,
  5949. renderAllRows: false,
  5950. groups: false,
  5951. rowHeaderWidth: null,
  5952. columnHeaderHeight: null,
  5953. headerClassName: null
  5954. };
  5955. // reference to settings
  5956. this.settings = {};
  5957. for (var i in this.defaults) {
  5958. if ((0, _object.hasOwnProperty)(this.defaults, i)) {
  5959. if (settings[i] !== void 0) {
  5960. this.settings[i] = settings[i];
  5961. } else if (this.defaults[i] === void 0) {
  5962. throw new Error('A required setting "' + i + '" was not provided');
  5963. } else {
  5964. this.settings[i] = this.defaults[i];
  5965. }
  5966. }
  5967. }
  5968. }
  5969. /**
  5970. * Update settings
  5971. *
  5972. * @param {Object} settings
  5973. * @param {*} value
  5974. * @returns {Walkontable}
  5975. */
  5976. _createClass(Settings, [{
  5977. key: 'update',
  5978. value: function update(settings, value) {
  5979. if (value === void 0) {
  5980. // settings is object
  5981. for (var i in settings) {
  5982. if ((0, _object.hasOwnProperty)(settings, i)) {
  5983. this.settings[i] = settings[i];
  5984. }
  5985. }
  5986. } else {
  5987. // if value is defined then settings is the key
  5988. this.settings[settings] = value;
  5989. }
  5990. return this.wot;
  5991. }
  5992. /**
  5993. * Get setting by name
  5994. *
  5995. * @param {String} key
  5996. * @param {*} param1
  5997. * @param {*} param2
  5998. * @param {*} param3
  5999. * @param {*} param4
  6000. * @returns {*}
  6001. */
  6002. }, {
  6003. key: 'getSetting',
  6004. value: function getSetting(key, param1, param2, param3, param4) {
  6005. if (typeof this.settings[key] === 'function') {
  6006. // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
  6007. return this.settings[key](param1, param2, param3, param4);
  6008. } else if (param1 !== void 0 && Array.isArray(this.settings[key])) {
  6009. // perhaps this can be removed, it is only used in tests
  6010. return this.settings[key][param1];
  6011. }
  6012. return this.settings[key];
  6013. }
  6014. /**
  6015. * Checks if setting exists
  6016. *
  6017. * @param {Boolean} key
  6018. * @returns {Boolean}
  6019. */
  6020. }, {
  6021. key: 'has',
  6022. value: function has(key) {
  6023. return !!this.settings[key];
  6024. }
  6025. }]);
  6026. return Settings;
  6027. }();
  6028. exports.default = Settings;
  6029. /***/ }),
  6030. /* 69 */
  6031. /***/ (function(module, exports, __webpack_require__) {
  6032. "use strict";
  6033. exports.__esModule = true;
  6034. 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; };
  6035. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6036. var _element = __webpack_require__(2);
  6037. var _function = __webpack_require__(75);
  6038. var _coords = __webpack_require__(22);
  6039. var _coords2 = _interopRequireDefault(_coords);
  6040. var _range = __webpack_require__(43);
  6041. var _range2 = _interopRequireDefault(_range);
  6042. var _column = __webpack_require__(64);
  6043. var _column2 = _interopRequireDefault(_column);
  6044. var _row = __webpack_require__(65);
  6045. var _row2 = _interopRequireDefault(_row);
  6046. var _tableRenderer = __webpack_require__(70);
  6047. var _tableRenderer2 = _interopRequireDefault(_tableRenderer);
  6048. var _base = __webpack_require__(11);
  6049. var _base2 = _interopRequireDefault(_base);
  6050. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6051. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  6052. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6053. /**
  6054. *
  6055. */
  6056. var Table = function () {
  6057. /**
  6058. * @param {Walkontable} wotInstance
  6059. * @param {HTMLTableElement} table
  6060. */
  6061. function Table(wotInstance, table) {
  6062. var _this = this;
  6063. _classCallCheck(this, Table);
  6064. this.wot = wotInstance;
  6065. // legacy support
  6066. this.instance = this.wot;
  6067. this.TABLE = table;
  6068. this.TBODY = null;
  6069. this.THEAD = null;
  6070. this.COLGROUP = null;
  6071. this.tableOffset = 0;
  6072. this.holderOffset = 0;
  6073. (0, _element.removeTextNodes)(this.TABLE);
  6074. this.spreader = this.createSpreader(this.TABLE);
  6075. this.hider = this.createHider(this.spreader);
  6076. this.holder = this.createHolder(this.hider);
  6077. this.wtRootElement = this.holder.parentNode;
  6078. this.alignOverlaysWithTrimmingContainer();
  6079. this.fixTableDomTree();
  6080. this.colgroupChildrenLength = this.COLGROUP.childNodes.length;
  6081. this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0;
  6082. this.tbodyChildrenLength = this.TBODY.childNodes.length;
  6083. this.rowFilter = null;
  6084. this.columnFilter = null;
  6085. this.correctHeaderWidth = false;
  6086. var origRowHeaderWidth = this.wot.wtSettings.settings.rowHeaderWidth;
  6087. // Fix for jumping row headers (https://github.com/handsontable/handsontable/issues/3850)
  6088. this.wot.wtSettings.settings.rowHeaderWidth = function () {
  6089. return _this._modifyRowHeaderWidth(origRowHeaderWidth);
  6090. };
  6091. }
  6092. /**
  6093. *
  6094. */
  6095. _createClass(Table, [{
  6096. key: 'fixTableDomTree',
  6097. value: function fixTableDomTree() {
  6098. this.TBODY = this.TABLE.querySelector('tbody');
  6099. if (!this.TBODY) {
  6100. this.TBODY = document.createElement('tbody');
  6101. this.TABLE.appendChild(this.TBODY);
  6102. }
  6103. this.THEAD = this.TABLE.querySelector('thead');
  6104. if (!this.THEAD) {
  6105. this.THEAD = document.createElement('thead');
  6106. this.TABLE.insertBefore(this.THEAD, this.TBODY);
  6107. }
  6108. this.COLGROUP = this.TABLE.querySelector('colgroup');
  6109. if (!this.COLGROUP) {
  6110. this.COLGROUP = document.createElement('colgroup');
  6111. this.TABLE.insertBefore(this.COLGROUP, this.THEAD);
  6112. }
  6113. if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {
  6114. this.THEAD.appendChild(document.createElement('TR'));
  6115. }
  6116. }
  6117. /**
  6118. * @param table
  6119. * @returns {HTMLElement}
  6120. */
  6121. }, {
  6122. key: 'createSpreader',
  6123. value: function createSpreader(table) {
  6124. var parent = table.parentNode;
  6125. var spreader = void 0;
  6126. if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {
  6127. spreader = document.createElement('div');
  6128. spreader.className = 'wtSpreader';
  6129. if (parent) {
  6130. // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
  6131. parent.insertBefore(spreader, table);
  6132. }
  6133. spreader.appendChild(table);
  6134. }
  6135. spreader.style.position = 'relative';
  6136. return spreader;
  6137. }
  6138. /**
  6139. * @param spreader
  6140. * @returns {HTMLElement}
  6141. */
  6142. }, {
  6143. key: 'createHider',
  6144. value: function createHider(spreader) {
  6145. var parent = spreader.parentNode;
  6146. var hider = void 0;
  6147. if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {
  6148. hider = document.createElement('div');
  6149. hider.className = 'wtHider';
  6150. if (parent) {
  6151. // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
  6152. parent.insertBefore(hider, spreader);
  6153. }
  6154. hider.appendChild(spreader);
  6155. }
  6156. return hider;
  6157. }
  6158. /**
  6159. *
  6160. * @param hider
  6161. * @returns {HTMLElement}
  6162. */
  6163. }, {
  6164. key: 'createHolder',
  6165. value: function createHolder(hider) {
  6166. var parent = hider.parentNode;
  6167. var holder = void 0;
  6168. if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {
  6169. holder = document.createElement('div');
  6170. holder.style.position = 'relative';
  6171. holder.className = 'wtHolder';
  6172. if (parent) {
  6173. // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
  6174. parent.insertBefore(holder, hider);
  6175. }
  6176. if (!this.isWorkingOnClone()) {
  6177. holder.parentNode.className += 'ht_master handsontable';
  6178. }
  6179. holder.appendChild(hider);
  6180. }
  6181. return holder;
  6182. }
  6183. }, {
  6184. key: 'alignOverlaysWithTrimmingContainer',
  6185. value: function alignOverlaysWithTrimmingContainer() {
  6186. var trimmingElement = (0, _element.getTrimmingContainer)(this.wtRootElement);
  6187. if (!this.isWorkingOnClone()) {
  6188. this.holder.parentNode.style.position = 'relative';
  6189. if (trimmingElement === window) {
  6190. var preventOverflow = this.wot.getSetting('preventOverflow');
  6191. if (!preventOverflow) {
  6192. this.holder.style.overflow = 'visible';
  6193. this.wtRootElement.style.overflow = 'visible';
  6194. }
  6195. } else {
  6196. this.holder.style.width = (0, _element.getStyle)(trimmingElement, 'width');
  6197. this.holder.style.height = (0, _element.getStyle)(trimmingElement, 'height');
  6198. this.holder.style.overflow = '';
  6199. }
  6200. }
  6201. }
  6202. }, {
  6203. key: 'isWorkingOnClone',
  6204. value: function isWorkingOnClone() {
  6205. return !!this.wot.cloneSource;
  6206. }
  6207. /**
  6208. * Redraws the table
  6209. *
  6210. * @param {Boolean} fastDraw If TRUE, will try to avoid full redraw and only update the border positions. If FALSE or UNDEFINED, will perform a full redraw
  6211. * @returns {Table}
  6212. */
  6213. }, {
  6214. key: 'draw',
  6215. value: function draw(fastDraw) {
  6216. var _wot = this.wot,
  6217. wtOverlays = _wot.wtOverlays,
  6218. wtViewport = _wot.wtViewport;
  6219. var totalRows = this.instance.getSetting('totalRows');
  6220. var rowHeaders = this.wot.getSetting('rowHeaders').length;
  6221. var columnHeaders = this.wot.getSetting('columnHeaders').length;
  6222. var syncScroll = false;
  6223. if (!this.isWorkingOnClone()) {
  6224. this.holderOffset = (0, _element.offset)(this.holder);
  6225. fastDraw = wtViewport.createRenderCalculators(fastDraw);
  6226. if (rowHeaders && !this.wot.getSetting('fixedColumnsLeft')) {
  6227. var leftScrollPos = wtOverlays.leftOverlay.getScrollPosition();
  6228. var previousState = this.correctHeaderWidth;
  6229. this.correctHeaderWidth = leftScrollPos > 0;
  6230. if (previousState !== this.correctHeaderWidth) {
  6231. fastDraw = false;
  6232. }
  6233. }
  6234. }
  6235. if (!this.isWorkingOnClone()) {
  6236. syncScroll = wtOverlays.prepareOverlays();
  6237. }
  6238. if (fastDraw) {
  6239. if (!this.isWorkingOnClone()) {
  6240. // in case we only scrolled without redraw, update visible rows information in oldRowsCalculator
  6241. wtViewport.createVisibleCalculators();
  6242. }
  6243. if (wtOverlays) {
  6244. wtOverlays.refresh(true);
  6245. }
  6246. } else {
  6247. if (this.isWorkingOnClone()) {
  6248. this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;
  6249. } else {
  6250. this.tableOffset = (0, _element.offset)(this.TABLE);
  6251. }
  6252. var startRow = void 0;
  6253. if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_DEBUG) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP_LEFT_CORNER)) {
  6254. startRow = 0;
  6255. } else if (_base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
  6256. startRow = Math.max(totalRows - this.wot.getSetting('fixedRowsBottom'), 0);
  6257. } else {
  6258. startRow = wtViewport.rowsRenderCalculator.startRow;
  6259. }
  6260. var startColumn = void 0;
  6261. if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_DEBUG) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_LEFT) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_TOP_LEFT_CORNER) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
  6262. startColumn = 0;
  6263. } else {
  6264. startColumn = wtViewport.columnsRenderCalculator.startColumn;
  6265. }
  6266. this.rowFilter = new _row2.default(startRow, totalRows, columnHeaders);
  6267. this.columnFilter = new _column2.default(startColumn, this.wot.getSetting('totalColumns'), rowHeaders);
  6268. this.alignOverlaysWithTrimmingContainer();
  6269. this._doDraw(); // creates calculator after draw
  6270. }
  6271. this.refreshSelections(fastDraw);
  6272. if (!this.isWorkingOnClone()) {
  6273. wtOverlays.topOverlay.resetFixedPosition();
  6274. if (wtOverlays.bottomOverlay.clone) {
  6275. wtOverlays.bottomOverlay.resetFixedPosition();
  6276. }
  6277. wtOverlays.leftOverlay.resetFixedPosition();
  6278. if (wtOverlays.topLeftCornerOverlay) {
  6279. wtOverlays.topLeftCornerOverlay.resetFixedPosition();
  6280. }
  6281. if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {
  6282. wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();
  6283. }
  6284. }
  6285. if (syncScroll) {
  6286. wtOverlays.syncScrollWithMaster();
  6287. }
  6288. this.wot.drawn = true;
  6289. return this;
  6290. }
  6291. }, {
  6292. key: '_doDraw',
  6293. value: function _doDraw() {
  6294. var wtRenderer = new _tableRenderer2.default(this);
  6295. wtRenderer.render();
  6296. }
  6297. }, {
  6298. key: 'removeClassFromCells',
  6299. value: function removeClassFromCells(className) {
  6300. var nodes = this.TABLE.querySelectorAll('.' + className);
  6301. for (var i = 0, len = nodes.length; i < len; i++) {
  6302. (0, _element.removeClass)(nodes[i], className);
  6303. }
  6304. }
  6305. }, {
  6306. key: 'refreshSelections',
  6307. value: function refreshSelections(fastDraw) {
  6308. if (!this.wot.selections) {
  6309. return;
  6310. }
  6311. var len = this.wot.selections.length;
  6312. if (fastDraw) {
  6313. for (var i = 0; i < len; i++) {
  6314. // there was no rerender, so we need to remove classNames by ourselves
  6315. if (this.wot.selections[i].settings.className) {
  6316. this.removeClassFromCells(this.wot.selections[i].settings.className);
  6317. }
  6318. if (this.wot.selections[i].settings.highlightHeaderClassName) {
  6319. this.removeClassFromCells(this.wot.selections[i].settings.highlightHeaderClassName);
  6320. }
  6321. if (this.wot.selections[i].settings.highlightRowClassName) {
  6322. this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName);
  6323. }
  6324. if (this.wot.selections[i].settings.highlightColumnClassName) {
  6325. this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName);
  6326. }
  6327. }
  6328. }
  6329. for (var _i = 0; _i < len; _i++) {
  6330. this.wot.selections[_i].draw(this.wot, fastDraw);
  6331. }
  6332. }
  6333. /**
  6334. * Get cell element at coords.
  6335. *
  6336. * @param {CellCoords} coords
  6337. * @returns {HTMLElement|Number} HTMLElement on success or Number one of the exit codes on error:
  6338. * -1 row before viewport
  6339. * -2 row after viewport
  6340. */
  6341. }, {
  6342. key: 'getCell',
  6343. value: function getCell(coords) {
  6344. if (this.isRowBeforeRenderedRows(coords.row)) {
  6345. // row before rendered rows
  6346. return -1;
  6347. } else if (this.isRowAfterRenderedRows(coords.row)) {
  6348. // row after rendered rows
  6349. return -2;
  6350. }
  6351. var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)];
  6352. if (TR) {
  6353. return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)];
  6354. }
  6355. }
  6356. /**
  6357. * getColumnHeader
  6358. *
  6359. * @param {Number} col Column index
  6360. * @param {Number} [level=0] Header level (0 = most distant to the table)
  6361. * @returns {Object} HTMLElement on success or undefined on error
  6362. */
  6363. }, {
  6364. key: 'getColumnHeader',
  6365. value: function getColumnHeader(col) {
  6366. var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  6367. var TR = this.THEAD.childNodes[level];
  6368. if (TR) {
  6369. return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];
  6370. }
  6371. }
  6372. /**
  6373. * getRowHeader
  6374. *
  6375. * @param {Number} row Row index
  6376. * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table doesn't have row headers`
  6377. */
  6378. }, {
  6379. key: 'getRowHeader',
  6380. value: function getRowHeader(row) {
  6381. if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {
  6382. return null;
  6383. }
  6384. var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];
  6385. if (TR) {
  6386. return TR.childNodes[0];
  6387. }
  6388. }
  6389. /**
  6390. * Returns cell coords object for a given TD (or a child element of a TD element).
  6391. *
  6392. * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one).
  6393. * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or null, if the provided element is not applicable.
  6394. */
  6395. }, {
  6396. key: 'getCoords',
  6397. value: function getCoords(TD) {
  6398. if (TD.nodeName !== 'TD' && TD.nodeName !== 'TH') {
  6399. TD = (0, _element.closest)(TD, ['TD', 'TH']);
  6400. }
  6401. if (TD === null) {
  6402. return null;
  6403. }
  6404. var TR = TD.parentNode;
  6405. var CONTAINER = TR.parentNode;
  6406. var row = (0, _element.index)(TR);
  6407. var col = TD.cellIndex;
  6408. if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_TOP, TD)) {
  6409. if (CONTAINER.nodeName === 'THEAD') {
  6410. row -= CONTAINER.childNodes.length;
  6411. }
  6412. } else if (CONTAINER === this.THEAD) {
  6413. row = this.rowFilter.visibleColHeadedRowToSourceRow(row);
  6414. } else {
  6415. row = this.rowFilter.renderedToSource(row);
  6416. }
  6417. if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_LEFT, TD)) {
  6418. col = this.columnFilter.offsettedTH(col);
  6419. } else {
  6420. col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);
  6421. }
  6422. return new _coords2.default(row, col);
  6423. }
  6424. }, {
  6425. key: 'getTrForRow',
  6426. value: function getTrForRow(row) {
  6427. return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];
  6428. }
  6429. }, {
  6430. key: 'getFirstRenderedRow',
  6431. value: function getFirstRenderedRow() {
  6432. return this.wot.wtViewport.rowsRenderCalculator.startRow;
  6433. }
  6434. }, {
  6435. key: 'getFirstVisibleRow',
  6436. value: function getFirstVisibleRow() {
  6437. return this.wot.wtViewport.rowsVisibleCalculator.startRow;
  6438. }
  6439. }, {
  6440. key: 'getFirstRenderedColumn',
  6441. value: function getFirstRenderedColumn() {
  6442. return this.wot.wtViewport.columnsRenderCalculator.startColumn;
  6443. }
  6444. /**
  6445. * @returns {Number} Returns -1 if no row is visible
  6446. */
  6447. }, {
  6448. key: 'getFirstVisibleColumn',
  6449. value: function getFirstVisibleColumn() {
  6450. return this.wot.wtViewport.columnsVisibleCalculator.startColumn;
  6451. }
  6452. /**
  6453. * @returns {Number} Returns -1 if no row is visible
  6454. */
  6455. }, {
  6456. key: 'getLastRenderedRow',
  6457. value: function getLastRenderedRow() {
  6458. return this.wot.wtViewport.rowsRenderCalculator.endRow;
  6459. }
  6460. }, {
  6461. key: 'getLastVisibleRow',
  6462. value: function getLastVisibleRow() {
  6463. return this.wot.wtViewport.rowsVisibleCalculator.endRow;
  6464. }
  6465. }, {
  6466. key: 'getLastRenderedColumn',
  6467. value: function getLastRenderedColumn() {
  6468. return this.wot.wtViewport.columnsRenderCalculator.endColumn;
  6469. }
  6470. /**
  6471. * @returns {Number} Returns -1 if no column is visible
  6472. */
  6473. }, {
  6474. key: 'getLastVisibleColumn',
  6475. value: function getLastVisibleColumn() {
  6476. return this.wot.wtViewport.columnsVisibleCalculator.endColumn;
  6477. }
  6478. }, {
  6479. key: 'isRowBeforeRenderedRows',
  6480. value: function isRowBeforeRenderedRows(row) {
  6481. return this.rowFilter && this.rowFilter.sourceToRendered(row) < 0 && row >= 0;
  6482. }
  6483. }, {
  6484. key: 'isRowAfterViewport',
  6485. value: function isRowAfterViewport(row) {
  6486. return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow();
  6487. }
  6488. }, {
  6489. key: 'isRowAfterRenderedRows',
  6490. value: function isRowAfterRenderedRows(row) {
  6491. return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow();
  6492. }
  6493. }, {
  6494. key: 'isColumnBeforeViewport',
  6495. value: function isColumnBeforeViewport(column) {
  6496. return this.columnFilter && this.columnFilter.sourceToRendered(column) < 0 && column >= 0;
  6497. }
  6498. }, {
  6499. key: 'isColumnAfterViewport',
  6500. value: function isColumnAfterViewport(column) {
  6501. return this.columnFilter && this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn();
  6502. }
  6503. }, {
  6504. key: 'isLastRowFullyVisible',
  6505. value: function isLastRowFullyVisible() {
  6506. return this.getLastVisibleRow() === this.getLastRenderedRow();
  6507. }
  6508. }, {
  6509. key: 'isLastColumnFullyVisible',
  6510. value: function isLastColumnFullyVisible() {
  6511. return this.getLastVisibleColumn() === this.getLastRenderedColumn();
  6512. }
  6513. }, {
  6514. key: 'getRenderedColumnsCount',
  6515. value: function getRenderedColumnsCount() {
  6516. var columnsCount = this.wot.wtViewport.columnsRenderCalculator.count;
  6517. var totalColumns = this.wot.getSetting('totalColumns');
  6518. if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {
  6519. columnsCount = totalColumns;
  6520. } else if (this.wot.isOverlayName(_base2.default.CLONE_LEFT) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
  6521. return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);
  6522. }
  6523. return columnsCount;
  6524. }
  6525. }, {
  6526. key: 'getRenderedRowsCount',
  6527. value: function getRenderedRowsCount() {
  6528. var rowsCount = this.wot.wtViewport.rowsRenderCalculator.count;
  6529. var totalRows = this.wot.getSetting('totalRows');
  6530. if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {
  6531. rowsCount = totalRows;
  6532. } else if (this.wot.isOverlayName(_base2.default.CLONE_TOP) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER)) {
  6533. rowsCount = Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);
  6534. } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
  6535. rowsCount = Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);
  6536. }
  6537. return rowsCount;
  6538. }
  6539. }, {
  6540. key: 'getVisibleRowsCount',
  6541. value: function getVisibleRowsCount() {
  6542. return this.wot.wtViewport.rowsVisibleCalculator.count;
  6543. }
  6544. }, {
  6545. key: 'allRowsInViewport',
  6546. value: function allRowsInViewport() {
  6547. return this.wot.getSetting('totalRows') == this.getVisibleRowsCount();
  6548. }
  6549. /**
  6550. * Checks if any of the row's cells content exceeds its initial height, and if so, returns the oversized height
  6551. *
  6552. * @param {Number} sourceRow
  6553. * @returns {Number}
  6554. */
  6555. }, {
  6556. key: 'getRowHeight',
  6557. value: function getRowHeight(sourceRow) {
  6558. var height = this.wot.wtSettings.settings.rowHeight(sourceRow);
  6559. var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow];
  6560. if (oversizedHeight !== void 0) {
  6561. height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);
  6562. }
  6563. return height;
  6564. }
  6565. }, {
  6566. key: 'getColumnHeaderHeight',
  6567. value: function getColumnHeaderHeight(level) {
  6568. var height = this.wot.wtSettings.settings.defaultRowHeight;
  6569. var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];
  6570. if (oversizedHeight !== void 0) {
  6571. height = height ? Math.max(height, oversizedHeight) : oversizedHeight;
  6572. }
  6573. return height;
  6574. }
  6575. }, {
  6576. key: 'getVisibleColumnsCount',
  6577. value: function getVisibleColumnsCount() {
  6578. return this.wot.wtViewport.columnsVisibleCalculator.count;
  6579. }
  6580. }, {
  6581. key: 'allColumnsInViewport',
  6582. value: function allColumnsInViewport() {
  6583. return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount();
  6584. }
  6585. }, {
  6586. key: 'getColumnWidth',
  6587. value: function getColumnWidth(sourceColumn) {
  6588. var width = this.wot.wtSettings.settings.columnWidth;
  6589. if (typeof width === 'function') {
  6590. width = width(sourceColumn);
  6591. } else if ((typeof width === 'undefined' ? 'undefined' : _typeof(width)) === 'object') {
  6592. width = width[sourceColumn];
  6593. }
  6594. return width || this.wot.wtSettings.settings.defaultColumnWidth;
  6595. }
  6596. }, {
  6597. key: 'getStretchedColumnWidth',
  6598. value: function getStretchedColumnWidth(sourceColumn) {
  6599. var columnWidth = this.getColumnWidth(sourceColumn);
  6600. var width = columnWidth == null ? this.instance.wtSettings.settings.defaultColumnWidth : columnWidth;
  6601. var calculator = this.wot.wtViewport.columnsRenderCalculator;
  6602. if (calculator) {
  6603. var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width);
  6604. if (stretchedWidth) {
  6605. width = stretchedWidth;
  6606. }
  6607. }
  6608. return width;
  6609. }
  6610. /**
  6611. * Modify row header widths provided by user in class contructor.
  6612. *
  6613. * @private
  6614. */
  6615. }, {
  6616. key: '_modifyRowHeaderWidth',
  6617. value: function _modifyRowHeaderWidth(rowHeaderWidthFactory) {
  6618. var widths = (0, _function.isFunction)(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;
  6619. if (Array.isArray(widths)) {
  6620. widths = [].concat(_toConsumableArray(widths));
  6621. widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);
  6622. } else {
  6623. widths = this._correctRowHeaderWidth(widths);
  6624. }
  6625. return widths;
  6626. }
  6627. /**
  6628. * Correct row header width if necessary.
  6629. *
  6630. * @private
  6631. */
  6632. }, {
  6633. key: '_correctRowHeaderWidth',
  6634. value: function _correctRowHeaderWidth(width) {
  6635. if (typeof width !== 'number') {
  6636. width = this.wot.getSetting('defaultColumnWidth');
  6637. }
  6638. if (this.correctHeaderWidth) {
  6639. width++;
  6640. }
  6641. return width;
  6642. }
  6643. }]);
  6644. return Table;
  6645. }();
  6646. exports.default = Table;
  6647. /***/ }),
  6648. /* 70 */
  6649. /***/ (function(module, exports, __webpack_require__) {
  6650. "use strict";
  6651. exports.__esModule = true;
  6652. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6653. var _element = __webpack_require__(2);
  6654. var _base = __webpack_require__(11);
  6655. var _base2 = _interopRequireDefault(_base);
  6656. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6657. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6658. var performanceWarningAppeared = false;
  6659. /**
  6660. * @class TableRenderer
  6661. */
  6662. var TableRenderer = function () {
  6663. /**
  6664. * @param {WalkontableTable} wtTable
  6665. */
  6666. function TableRenderer(wtTable) {
  6667. _classCallCheck(this, TableRenderer);
  6668. this.wtTable = wtTable;
  6669. this.wot = wtTable.instance;
  6670. // legacy support
  6671. this.instance = wtTable.instance;
  6672. this.rowFilter = wtTable.rowFilter;
  6673. this.columnFilter = wtTable.columnFilter;
  6674. this.TABLE = wtTable.TABLE;
  6675. this.THEAD = wtTable.THEAD;
  6676. this.TBODY = wtTable.TBODY;
  6677. this.COLGROUP = wtTable.COLGROUP;
  6678. this.rowHeaders = [];
  6679. this.rowHeaderCount = 0;
  6680. this.columnHeaders = [];
  6681. this.columnHeaderCount = 0;
  6682. this.fixedRowsTop = 0;
  6683. this.fixedRowsBottom = 0;
  6684. }
  6685. /**
  6686. *
  6687. */
  6688. _createClass(TableRenderer, [{
  6689. key: 'render',
  6690. value: function render() {
  6691. if (!this.wtTable.isWorkingOnClone()) {
  6692. var skipRender = {};
  6693. this.wot.getSetting('beforeDraw', true, skipRender);
  6694. if (skipRender.skipRender === true) {
  6695. return;
  6696. }
  6697. }
  6698. this.rowHeaders = this.wot.getSetting('rowHeaders');
  6699. this.rowHeaderCount = this.rowHeaders.length;
  6700. this.fixedRowsTop = this.wot.getSetting('fixedRowsTop');
  6701. this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
  6702. this.columnHeaders = this.wot.getSetting('columnHeaders');
  6703. this.columnHeaderCount = this.columnHeaders.length;
  6704. var columnsToRender = this.wtTable.getRenderedColumnsCount();
  6705. var rowsToRender = this.wtTable.getRenderedRowsCount();
  6706. var totalColumns = this.wot.getSetting('totalColumns');
  6707. var totalRows = this.wot.getSetting('totalRows');
  6708. var workspaceWidth = void 0;
  6709. var adjusted = false;
  6710. if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
  6711. // do NOT render headers on the bottom or bottom-left corner overlay
  6712. this.columnHeaders = [];
  6713. this.columnHeaderCount = 0;
  6714. }
  6715. if (totalColumns >= 0) {
  6716. // prepare COL and TH elements for rendering
  6717. this.adjustAvailableNodes();
  6718. adjusted = true;
  6719. // adjust column widths according to user widths settings
  6720. this.renderColumnHeaders();
  6721. // Render table rows
  6722. this.renderRows(totalRows, rowsToRender, columnsToRender);
  6723. if (!this.wtTable.isWorkingOnClone()) {
  6724. workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();
  6725. this.wot.wtViewport.containerWidth = null;
  6726. }
  6727. this.adjustColumnWidths(columnsToRender);
  6728. this.markOversizedColumnHeaders();
  6729. this.adjustColumnHeaderHeights();
  6730. }
  6731. if (!adjusted) {
  6732. this.adjustAvailableNodes();
  6733. }
  6734. this.removeRedundantRows(rowsToRender);
  6735. if (!this.wtTable.isWorkingOnClone() || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {
  6736. this.markOversizedRows();
  6737. }
  6738. if (!this.wtTable.isWorkingOnClone()) {
  6739. this.wot.wtViewport.createVisibleCalculators();
  6740. this.wot.wtOverlays.refresh(false);
  6741. this.wot.wtOverlays.applyToDOM();
  6742. var hiderWidth = (0, _element.outerWidth)(this.wtTable.hider);
  6743. var tableWidth = (0, _element.outerWidth)(this.wtTable.TABLE);
  6744. if (hiderWidth !== 0 && tableWidth !== hiderWidth) {
  6745. // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.
  6746. this.adjustColumnWidths(columnsToRender);
  6747. }
  6748. if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {
  6749. // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching
  6750. this.wot.wtViewport.containerWidth = null;
  6751. var firstRendered = this.wtTable.getFirstRenderedColumn();
  6752. var lastRendered = this.wtTable.getLastRenderedColumn();
  6753. var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');
  6754. var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');
  6755. rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
  6756. if (rowHeaderWidthSetting != null) {
  6757. for (var i = 0; i < this.rowHeaderCount; i++) {
  6758. var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;
  6759. width = width == null ? defaultColumnWidth : width;
  6760. this.COLGROUP.childNodes[i].style.width = width + 'px';
  6761. }
  6762. }
  6763. for (var _i = firstRendered; _i < lastRendered; _i++) {
  6764. var _width = this.wtTable.getStretchedColumnWidth(_i);
  6765. var renderedIndex = this.columnFilter.sourceToRendered(_i);
  6766. this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = _width + 'px';
  6767. }
  6768. }
  6769. this.wot.getSetting('onDraw', true);
  6770. } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {
  6771. this.wot.cloneSource.wtOverlays.adjustElementsSize();
  6772. }
  6773. }
  6774. /**
  6775. * @param {Number} renderedRowsCount
  6776. */
  6777. }, {
  6778. key: 'removeRedundantRows',
  6779. value: function removeRedundantRows(renderedRowsCount) {
  6780. while (this.wtTable.tbodyChildrenLength > renderedRowsCount) {
  6781. this.TBODY.removeChild(this.TBODY.lastChild);
  6782. this.wtTable.tbodyChildrenLength--;
  6783. }
  6784. }
  6785. /**
  6786. * @param {Number} totalRows
  6787. * @param {Number} rowsToRender
  6788. * @param {Number} columnsToRender
  6789. */
  6790. }, {
  6791. key: 'renderRows',
  6792. value: function renderRows(totalRows, rowsToRender, columnsToRender) {
  6793. var lastTD = void 0,
  6794. TR = void 0;
  6795. var visibleRowIndex = 0;
  6796. var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);
  6797. var isWorkingOnClone = this.wtTable.isWorkingOnClone();
  6798. while (sourceRowIndex < totalRows && sourceRowIndex >= 0) {
  6799. if (!performanceWarningAppeared && visibleRowIndex > 1000) {
  6800. performanceWarningAppeared = true;
  6801. console.warn('Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting the number ' + 'of rendered rows by specifying the table height and/or turning off the "renderAllRows" option.');
  6802. }
  6803. if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) {
  6804. // We have as much rows as needed for this clone
  6805. break;
  6806. }
  6807. TR = this.getOrCreateTrForRow(visibleRowIndex, TR);
  6808. // Render row headers
  6809. this.renderRowHeaders(sourceRowIndex, TR);
  6810. // Add and/or remove TDs to TR to match the desired number
  6811. this.adjustColumns(TR, columnsToRender + this.rowHeaderCount);
  6812. lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender);
  6813. if (!isWorkingOnClone ||
  6814. // Necessary to refresh oversized row heights after editing cell in overlays
  6815. this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {
  6816. // Reset the oversized row cache for this row
  6817. this.resetOversizedRow(sourceRowIndex);
  6818. }
  6819. if (TR.firstChild) {
  6820. // if I have 2 fixed columns with one-line content and the 3rd column has a multiline content, this is
  6821. // the way to make sure that the overlay will has same row height
  6822. var height = this.wot.wtTable.getRowHeight(sourceRowIndex);
  6823. if (height) {
  6824. // Decrease height. 1 pixel will be "replaced" by 1px border top
  6825. height--;
  6826. TR.firstChild.style.height = height + 'px';
  6827. } else {
  6828. TR.firstChild.style.height = '';
  6829. }
  6830. }
  6831. visibleRowIndex++;
  6832. sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);
  6833. }
  6834. }
  6835. /**
  6836. * Reset the oversized row cache for the provided index
  6837. *
  6838. * @param {Number} sourceRow Row index
  6839. */
  6840. }, {
  6841. key: 'resetOversizedRow',
  6842. value: function resetOversizedRow(sourceRow) {
  6843. if (this.wot.getSetting('externalRowCalculator')) {
  6844. return;
  6845. }
  6846. if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) {
  6847. this.wot.wtViewport.oversizedRows[sourceRow] = void 0;
  6848. }
  6849. }
  6850. /**
  6851. * Check if any of the rendered rows is higher than expected, and if so, cache them
  6852. */
  6853. }, {
  6854. key: 'markOversizedRows',
  6855. value: function markOversizedRows() {
  6856. if (this.wot.getSetting('externalRowCalculator')) {
  6857. return;
  6858. }
  6859. var rowCount = this.instance.wtTable.TBODY.childNodes.length;
  6860. var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight;
  6861. var actualTableHeight = (0, _element.innerHeight)(this.instance.wtTable.TBODY) - 1;
  6862. var previousRowHeight = void 0;
  6863. var rowInnerHeight = void 0;
  6864. var sourceRowIndex = void 0;
  6865. var currentTr = void 0;
  6866. var rowHeader = void 0;
  6867. var totalRows = this.instance.getSetting('totalRows');
  6868. if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) {
  6869. // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them
  6870. return;
  6871. }
  6872. while (rowCount) {
  6873. rowCount--;
  6874. sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount);
  6875. previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex);
  6876. currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex);
  6877. rowHeader = currentTr.querySelector('th');
  6878. if (rowHeader) {
  6879. rowInnerHeight = (0, _element.innerHeight)(rowHeader);
  6880. } else {
  6881. rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;
  6882. }
  6883. if (!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight) {
  6884. this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight;
  6885. }
  6886. }
  6887. }
  6888. /**
  6889. * Check if any of the rendered columns is higher than expected, and if so, cache them.
  6890. */
  6891. }, {
  6892. key: 'markOversizedColumnHeaders',
  6893. value: function markOversizedColumnHeaders() {
  6894. var overlayName = this.wot.getOverlayName();
  6895. if (!this.columnHeaderCount || this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] || this.wtTable.isWorkingOnClone()) {
  6896. return;
  6897. }
  6898. var columnCount = this.wtTable.getRenderedColumnsCount();
  6899. for (var i = 0; i < this.columnHeaderCount; i++) {
  6900. for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {
  6901. this.markIfOversizedColumnHeader(renderedColumnIndex);
  6902. }
  6903. }
  6904. this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] = true;
  6905. }
  6906. /**
  6907. *
  6908. */
  6909. }, {
  6910. key: 'adjustColumnHeaderHeights',
  6911. value: function adjustColumnHeaderHeights() {
  6912. var columnHeaders = this.wot.getSetting('columnHeaders');
  6913. var children = this.wot.wtTable.THEAD.childNodes;
  6914. var oversizedColumnHeaders = this.wot.wtViewport.oversizedColumnHeaders;
  6915. for (var i = 0, len = columnHeaders.length; i < len; i++) {
  6916. if (oversizedColumnHeaders[i]) {
  6917. if (!children[i] || children[i].childNodes.length === 0) {
  6918. return;
  6919. }
  6920. children[i].childNodes[0].style.height = oversizedColumnHeaders[i] + 'px';
  6921. }
  6922. }
  6923. }
  6924. /**
  6925. * Check if column header for the specified column is higher than expected, and if so, cache it
  6926. *
  6927. * @param {Number} col Index of column
  6928. */
  6929. }, {
  6930. key: 'markIfOversizedColumnHeader',
  6931. value: function markIfOversizedColumnHeader(col) {
  6932. var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);
  6933. var level = this.columnHeaderCount;
  6934. var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;
  6935. var previousColHeaderHeight = void 0;
  6936. var currentHeader = void 0;
  6937. var currentHeaderHeight = void 0;
  6938. var columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];
  6939. while (level) {
  6940. level--;
  6941. previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);
  6942. currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);
  6943. if (!currentHeader) {
  6944. /* eslint-disable no-continue */
  6945. continue;
  6946. }
  6947. currentHeaderHeight = (0, _element.innerHeight)(currentHeader);
  6948. if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {
  6949. this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;
  6950. }
  6951. if (Array.isArray(columnHeaderHeightSetting)) {
  6952. if (columnHeaderHeightSetting[level] != null) {
  6953. this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];
  6954. }
  6955. } else if (!isNaN(columnHeaderHeightSetting)) {
  6956. this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;
  6957. }
  6958. if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {
  6959. this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level] || columnHeaderHeightSetting;
  6960. }
  6961. }
  6962. }
  6963. /**
  6964. * @param {Number} sourceRowIndex
  6965. * @param {HTMLTableRowElement} TR
  6966. * @param {Number} columnsToRender
  6967. * @returns {HTMLTableCellElement}
  6968. */
  6969. }, {
  6970. key: 'renderCells',
  6971. value: function renderCells(sourceRowIndex, TR, columnsToRender) {
  6972. var TD = void 0;
  6973. var sourceColIndex = void 0;
  6974. for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) {
  6975. sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex);
  6976. if (visibleColIndex === 0) {
  6977. TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)];
  6978. } else {
  6979. TD = TD.nextSibling; // http://jsperf.com/nextsibling-vs-indexed-childnodes
  6980. }
  6981. // If the number of headers has been reduced, we need to replace excess TH with TD
  6982. if (TD.nodeName == 'TH') {
  6983. TD = replaceThWithTd(TD, TR);
  6984. }
  6985. if (!(0, _element.hasClass)(TD, 'hide')) {
  6986. TD.className = '';
  6987. }
  6988. TD.removeAttribute('style');
  6989. this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD);
  6990. }
  6991. return TD;
  6992. }
  6993. /**
  6994. * @param {Number} columnsToRender Number of columns to render.
  6995. */
  6996. }, {
  6997. key: 'adjustColumnWidths',
  6998. value: function adjustColumnWidths(columnsToRender) {
  6999. var scrollbarCompensation = 0;
  7000. var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
  7001. var mainHolder = sourceInstance.wtTable.holder;
  7002. var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');
  7003. var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');
  7004. if (mainHolder.offsetHeight < mainHolder.scrollHeight) {
  7005. scrollbarCompensation = (0, _element.getScrollbarWidth)();
  7006. }
  7007. this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation);
  7008. rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
  7009. if (rowHeaderWidthSetting != null) {
  7010. for (var i = 0; i < this.rowHeaderCount; i++) {
  7011. var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;
  7012. width = width == null ? defaultColumnWidth : width;
  7013. this.COLGROUP.childNodes[i].style.width = width + 'px';
  7014. }
  7015. }
  7016. for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) {
  7017. var _width2 = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex));
  7018. this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = _width2 + 'px';
  7019. }
  7020. }
  7021. /**
  7022. * @param {HTMLTableCellElement} TR
  7023. */
  7024. }, {
  7025. key: 'appendToTbody',
  7026. value: function appendToTbody(TR) {
  7027. this.TBODY.appendChild(TR);
  7028. this.wtTable.tbodyChildrenLength++;
  7029. }
  7030. /**
  7031. * @param {Number} rowIndex
  7032. * @param {HTMLTableRowElement} currentTr
  7033. * @returns {HTMLTableCellElement}
  7034. */
  7035. }, {
  7036. key: 'getOrCreateTrForRow',
  7037. value: function getOrCreateTrForRow(rowIndex, currentTr) {
  7038. var TR = void 0;
  7039. if (rowIndex >= this.wtTable.tbodyChildrenLength) {
  7040. TR = this.createRow();
  7041. this.appendToTbody(TR);
  7042. } else if (rowIndex === 0) {
  7043. TR = this.TBODY.firstChild;
  7044. } else {
  7045. // http://jsperf.com/nextsibling-vs-indexed-childnodes
  7046. TR = currentTr.nextSibling;
  7047. }
  7048. if (TR.className) {
  7049. TR.removeAttribute('class');
  7050. }
  7051. return TR;
  7052. }
  7053. /**
  7054. * @returns {HTMLTableCellElement}
  7055. */
  7056. }, {
  7057. key: 'createRow',
  7058. value: function createRow() {
  7059. var TR = document.createElement('TR');
  7060. for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {
  7061. TR.appendChild(document.createElement('TH'));
  7062. }
  7063. return TR;
  7064. }
  7065. /**
  7066. * @param {Number} row
  7067. * @param {Number} col
  7068. * @param {HTMLTableCellElement} TH
  7069. */
  7070. }, {
  7071. key: 'renderRowHeader',
  7072. value: function renderRowHeader(row, col, TH) {
  7073. TH.className = '';
  7074. TH.removeAttribute('style');
  7075. this.rowHeaders[col](row, TH, col);
  7076. }
  7077. /**
  7078. * @param {Number} row
  7079. * @param {HTMLTableCellElement} TR
  7080. */
  7081. }, {
  7082. key: 'renderRowHeaders',
  7083. value: function renderRowHeaders(row, TR) {
  7084. for (var TH = TR.firstChild, visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {
  7085. // If the number of row headers increased we need to create TH or replace an existing TD node with TH
  7086. if (!TH) {
  7087. TH = document.createElement('TH');
  7088. TR.appendChild(TH);
  7089. } else if (TH.nodeName == 'TD') {
  7090. TH = replaceTdWithTh(TH, TR);
  7091. }
  7092. this.renderRowHeader(row, visibleColIndex, TH);
  7093. // http://jsperf.com/nextsibling-vs-indexed-childnodes
  7094. TH = TH.nextSibling;
  7095. }
  7096. }
  7097. /**
  7098. * Adjust the number of COL and TH elements to match the number of columns and headers that need to be rendered
  7099. */
  7100. }, {
  7101. key: 'adjustAvailableNodes',
  7102. value: function adjustAvailableNodes() {
  7103. this.adjustColGroups();
  7104. this.adjustThead();
  7105. }
  7106. /**
  7107. * Renders the column headers
  7108. */
  7109. }, {
  7110. key: 'renderColumnHeaders',
  7111. value: function renderColumnHeaders() {
  7112. if (!this.columnHeaderCount) {
  7113. return;
  7114. }
  7115. var columnCount = this.wtTable.getRenderedColumnsCount();
  7116. for (var i = 0; i < this.columnHeaderCount; i++) {
  7117. var TR = this.getTrForColumnHeaders(i);
  7118. for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {
  7119. var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex);
  7120. this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]);
  7121. }
  7122. }
  7123. }
  7124. /**
  7125. * Adjusts the number of COL elements to match the number of columns that need to be rendered
  7126. */
  7127. }, {
  7128. key: 'adjustColGroups',
  7129. value: function adjustColGroups() {
  7130. var columnCount = this.wtTable.getRenderedColumnsCount();
  7131. while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) {
  7132. this.COLGROUP.appendChild(document.createElement('COL'));
  7133. this.wtTable.colgroupChildrenLength++;
  7134. }
  7135. while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) {
  7136. this.COLGROUP.removeChild(this.COLGROUP.lastChild);
  7137. this.wtTable.colgroupChildrenLength--;
  7138. }
  7139. if (this.rowHeaderCount) {
  7140. (0, _element.addClass)(this.COLGROUP.childNodes[0], 'rowHeader');
  7141. }
  7142. }
  7143. /**
  7144. * Adjusts the number of TH elements in THEAD to match the number of headers and columns that need to be rendered
  7145. */
  7146. }, {
  7147. key: 'adjustThead',
  7148. value: function adjustThead() {
  7149. var columnCount = this.wtTable.getRenderedColumnsCount();
  7150. var TR = this.THEAD.firstChild;
  7151. if (this.columnHeaders.length) {
  7152. for (var i = 0, len = this.columnHeaders.length; i < len; i++) {
  7153. TR = this.THEAD.childNodes[i];
  7154. if (!TR) {
  7155. TR = document.createElement('TR');
  7156. this.THEAD.appendChild(TR);
  7157. }
  7158. this.theadChildrenLength = TR.childNodes.length;
  7159. while (this.theadChildrenLength < columnCount + this.rowHeaderCount) {
  7160. TR.appendChild(document.createElement('TH'));
  7161. this.theadChildrenLength++;
  7162. }
  7163. while (this.theadChildrenLength > columnCount + this.rowHeaderCount) {
  7164. TR.removeChild(TR.lastChild);
  7165. this.theadChildrenLength--;
  7166. }
  7167. }
  7168. var theadChildrenLength = this.THEAD.childNodes.length;
  7169. if (theadChildrenLength > this.columnHeaders.length) {
  7170. for (var _i2 = this.columnHeaders.length; _i2 < theadChildrenLength; _i2++) {
  7171. this.THEAD.removeChild(this.THEAD.lastChild);
  7172. }
  7173. }
  7174. } else if (TR) {
  7175. (0, _element.empty)(TR);
  7176. }
  7177. }
  7178. /**
  7179. * @param {Number} index
  7180. * @returns {HTMLTableCellElement}
  7181. */
  7182. }, {
  7183. key: 'getTrForColumnHeaders',
  7184. value: function getTrForColumnHeaders(index) {
  7185. return this.THEAD.childNodes[index];
  7186. }
  7187. /**
  7188. * @param {Number} row
  7189. * @param {Number} col
  7190. * @param {HTMLTableCellElement} TH
  7191. * @returns {*}
  7192. */
  7193. }, {
  7194. key: 'renderColumnHeader',
  7195. value: function renderColumnHeader(row, col, TH) {
  7196. TH.className = '';
  7197. TH.removeAttribute('style');
  7198. return this.columnHeaders[row](col, TH, row);
  7199. }
  7200. /**
  7201. * Add and/or remove the TDs to match the desired number
  7202. *
  7203. * @param {HTMLTableCellElement} TR Table row in question
  7204. * @param {Number} desiredCount The desired number of TDs in the TR
  7205. */
  7206. }, {
  7207. key: 'adjustColumns',
  7208. value: function adjustColumns(TR, desiredCount) {
  7209. var count = TR.childNodes.length;
  7210. while (count < desiredCount) {
  7211. var TD = document.createElement('TD');
  7212. TR.appendChild(TD);
  7213. count++;
  7214. }
  7215. while (count > desiredCount) {
  7216. TR.removeChild(TR.lastChild);
  7217. count--;
  7218. }
  7219. }
  7220. /**
  7221. * @param {Number} columnsToRender
  7222. */
  7223. }, {
  7224. key: 'removeRedundantColumns',
  7225. value: function removeRedundantColumns(columnsToRender) {
  7226. while (this.wtTable.tbodyChildrenLength > columnsToRender) {
  7227. this.TBODY.removeChild(this.TBODY.lastChild);
  7228. this.wtTable.tbodyChildrenLength--;
  7229. }
  7230. }
  7231. }]);
  7232. return TableRenderer;
  7233. }();
  7234. function replaceTdWithTh(TD, TR) {
  7235. var TH = document.createElement('TH');
  7236. TR.insertBefore(TH, TD);
  7237. TR.removeChild(TD);
  7238. return TH;
  7239. }
  7240. function replaceThWithTd(TH, TR) {
  7241. var TD = document.createElement('TD');
  7242. TR.insertBefore(TD, TH);
  7243. TR.removeChild(TH);
  7244. return TD;
  7245. }
  7246. exports.default = TableRenderer;
  7247. /***/ }),
  7248. /* 71 */
  7249. /***/ (function(module, exports, __webpack_require__) {
  7250. "use strict";
  7251. exports.__esModule = true;
  7252. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7253. var _element = __webpack_require__(2);
  7254. var _object = __webpack_require__(25);
  7255. var _eventManager = __webpack_require__(23);
  7256. var _eventManager2 = _interopRequireDefault(_eventManager);
  7257. var _viewportColumns = __webpack_require__(60);
  7258. var _viewportColumns2 = _interopRequireDefault(_viewportColumns);
  7259. var _viewportRows = __webpack_require__(61);
  7260. var _viewportRows2 = _interopRequireDefault(_viewportRows);
  7261. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7262. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7263. /**
  7264. * @class Viewport
  7265. */
  7266. var Viewport = function () {
  7267. /**
  7268. * @param wotInstance
  7269. */
  7270. function Viewport(wotInstance) {
  7271. var _this = this;
  7272. _classCallCheck(this, Viewport);
  7273. this.wot = wotInstance;
  7274. // legacy support
  7275. this.instance = this.wot;
  7276. this.oversizedRows = [];
  7277. this.oversizedColumnHeaders = [];
  7278. this.hasOversizedColumnHeadersMarked = {};
  7279. this.clientHeight = 0;
  7280. this.containerWidth = NaN;
  7281. this.rowHeaderWidth = NaN;
  7282. this.rowsVisibleCalculator = null;
  7283. this.columnsVisibleCalculator = null;
  7284. this.eventManager = new _eventManager2.default(this.wot);
  7285. this.eventManager.addEventListener(window, 'resize', function () {
  7286. _this.clientHeight = _this.getWorkspaceHeight();
  7287. });
  7288. }
  7289. /**
  7290. * @returns {number}
  7291. */
  7292. _createClass(Viewport, [{
  7293. key: 'getWorkspaceHeight',
  7294. value: function getWorkspaceHeight() {
  7295. var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;
  7296. var elemHeight = void 0;
  7297. var height = 0;
  7298. if (trimmingContainer === window) {
  7299. height = document.documentElement.clientHeight;
  7300. } else {
  7301. elemHeight = (0, _element.outerHeight)(trimmingContainer);
  7302. // returns height without DIV scrollbar
  7303. height = elemHeight > 0 && trimmingContainer.clientHeight > 0 ? trimmingContainer.clientHeight : Infinity;
  7304. }
  7305. return height;
  7306. }
  7307. }, {
  7308. key: 'getWorkspaceWidth',
  7309. value: function getWorkspaceWidth() {
  7310. var width = void 0;
  7311. var totalColumns = this.wot.getSetting('totalColumns');
  7312. var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;
  7313. var overflow = void 0;
  7314. var stretchSetting = this.wot.getSetting('stretchH');
  7315. var docOffsetWidth = document.documentElement.offsetWidth;
  7316. var preventOverflow = this.wot.getSetting('preventOverflow');
  7317. if (preventOverflow) {
  7318. return (0, _element.outerWidth)(this.instance.wtTable.wtRootElement);
  7319. }
  7320. if (this.wot.getSetting('freezeOverlays')) {
  7321. width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);
  7322. } else {
  7323. width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);
  7324. }
  7325. if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {
  7326. // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window
  7327. // otherwise continue below, which will allow stretching
  7328. // this is used in `scroll_window.html`
  7329. // TODO test me
  7330. return document.documentElement.clientWidth;
  7331. }
  7332. if (trimmingContainer !== window) {
  7333. overflow = (0, _element.getStyle)(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow');
  7334. if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') {
  7335. // this is used in `scroll.html`
  7336. // TODO test me
  7337. return Math.max(width, trimmingContainer.clientWidth);
  7338. }
  7339. }
  7340. if (stretchSetting === 'none' || !stretchSetting) {
  7341. // if no stretching is used, return the maximum used workspace width
  7342. return Math.max(width, (0, _element.outerWidth)(this.instance.wtTable.TABLE));
  7343. }
  7344. // if stretching is used, return the actual container width, so the columns can fit inside it
  7345. return width;
  7346. }
  7347. /**
  7348. * Checks if viewport has vertical scroll
  7349. *
  7350. * @returns {Boolean}
  7351. */
  7352. }, {
  7353. key: 'hasVerticalScroll',
  7354. value: function hasVerticalScroll() {
  7355. return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();
  7356. }
  7357. /**
  7358. * Checks if viewport has horizontal scroll
  7359. *
  7360. * @returns {Boolean}
  7361. */
  7362. }, {
  7363. key: 'hasHorizontalScroll',
  7364. value: function hasHorizontalScroll() {
  7365. return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();
  7366. }
  7367. /**
  7368. * @param from
  7369. * @param length
  7370. * @returns {Number}
  7371. */
  7372. }, {
  7373. key: 'sumColumnWidths',
  7374. value: function sumColumnWidths(from, length) {
  7375. var sum = 0;
  7376. while (from < length) {
  7377. sum += this.wot.wtTable.getColumnWidth(from);
  7378. from++;
  7379. }
  7380. return sum;
  7381. }
  7382. /**
  7383. * @returns {Number}
  7384. */
  7385. }, {
  7386. key: 'getContainerFillWidth',
  7387. value: function getContainerFillWidth() {
  7388. if (this.containerWidth) {
  7389. return this.containerWidth;
  7390. }
  7391. var mainContainer = this.instance.wtTable.holder;
  7392. var fillWidth = void 0;
  7393. var dummyElement = void 0;
  7394. dummyElement = document.createElement('div');
  7395. dummyElement.style.width = '100%';
  7396. dummyElement.style.height = '1px';
  7397. mainContainer.appendChild(dummyElement);
  7398. fillWidth = dummyElement.offsetWidth;
  7399. this.containerWidth = fillWidth;
  7400. mainContainer.removeChild(dummyElement);
  7401. return fillWidth;
  7402. }
  7403. /**
  7404. * @returns {Number}
  7405. */
  7406. }, {
  7407. key: 'getWorkspaceOffset',
  7408. value: function getWorkspaceOffset() {
  7409. return (0, _element.offset)(this.wot.wtTable.TABLE);
  7410. }
  7411. /**
  7412. * @returns {Number}
  7413. */
  7414. }, {
  7415. key: 'getWorkspaceActualHeight',
  7416. value: function getWorkspaceActualHeight() {
  7417. return (0, _element.outerHeight)(this.wot.wtTable.TABLE);
  7418. }
  7419. /**
  7420. * @returns {Number}
  7421. */
  7422. }, {
  7423. key: 'getWorkspaceActualWidth',
  7424. value: function getWorkspaceActualWidth() {
  7425. return (0, _element.outerWidth)(this.wot.wtTable.TABLE) || (0, _element.outerWidth)(this.wot.wtTable.TBODY) || (0, _element.outerWidth)(this.wot.wtTable.THEAD); // IE8 reports 0 as <table> offsetWidth;
  7426. }
  7427. /**
  7428. * @returns {Number}
  7429. */
  7430. }, {
  7431. key: 'getColumnHeaderHeight',
  7432. value: function getColumnHeaderHeight() {
  7433. if (isNaN(this.columnHeaderHeight)) {
  7434. this.columnHeaderHeight = (0, _element.outerHeight)(this.wot.wtTable.THEAD);
  7435. }
  7436. return this.columnHeaderHeight;
  7437. }
  7438. /**
  7439. * @returns {Number}
  7440. */
  7441. }, {
  7442. key: 'getViewportHeight',
  7443. value: function getViewportHeight() {
  7444. var containerHeight = this.getWorkspaceHeight();
  7445. var columnHeaderHeight = void 0;
  7446. if (containerHeight === Infinity) {
  7447. return containerHeight;
  7448. }
  7449. columnHeaderHeight = this.getColumnHeaderHeight();
  7450. if (columnHeaderHeight > 0) {
  7451. containerHeight -= columnHeaderHeight;
  7452. }
  7453. return containerHeight;
  7454. }
  7455. /**
  7456. * @returns {Number}
  7457. */
  7458. }, {
  7459. key: 'getRowHeaderWidth',
  7460. value: function getRowHeaderWidth() {
  7461. var rowHeadersHeightSetting = this.instance.getSetting('rowHeaderWidth');
  7462. var rowHeaders = this.instance.getSetting('rowHeaders');
  7463. if (rowHeadersHeightSetting) {
  7464. this.rowHeaderWidth = 0;
  7465. for (var i = 0, len = rowHeaders.length; i < len; i++) {
  7466. this.rowHeaderWidth += rowHeadersHeightSetting[i] || rowHeadersHeightSetting;
  7467. }
  7468. }
  7469. if (this.wot.cloneSource) {
  7470. return this.wot.cloneSource.wtViewport.getRowHeaderWidth();
  7471. }
  7472. if (isNaN(this.rowHeaderWidth)) {
  7473. if (rowHeaders.length) {
  7474. var TH = this.instance.wtTable.TABLE.querySelector('TH');
  7475. this.rowHeaderWidth = 0;
  7476. for (var _i = 0, _len = rowHeaders.length; _i < _len; _i++) {
  7477. if (TH) {
  7478. this.rowHeaderWidth += (0, _element.outerWidth)(TH);
  7479. TH = TH.nextSibling;
  7480. } else {
  7481. // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.
  7482. // TODO: proper fix
  7483. this.rowHeaderWidth += 50;
  7484. }
  7485. }
  7486. } else {
  7487. this.rowHeaderWidth = 0;
  7488. }
  7489. }
  7490. this.rowHeaderWidth = this.instance.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;
  7491. return this.rowHeaderWidth;
  7492. }
  7493. /**
  7494. * @returns {Number}
  7495. */
  7496. }, {
  7497. key: 'getViewportWidth',
  7498. value: function getViewportWidth() {
  7499. var containerWidth = this.getWorkspaceWidth();
  7500. var rowHeaderWidth = void 0;
  7501. if (containerWidth === Infinity) {
  7502. return containerWidth;
  7503. }
  7504. rowHeaderWidth = this.getRowHeaderWidth();
  7505. if (rowHeaderWidth > 0) {
  7506. return containerWidth - rowHeaderWidth;
  7507. }
  7508. return containerWidth;
  7509. }
  7510. /**
  7511. * Creates:
  7512. * - rowsRenderCalculator (before draw, to qualify rows for rendering)
  7513. * - rowsVisibleCalculator (after draw, to measure which rows are actually visible)
  7514. *
  7515. * @returns {ViewportRowsCalculator}
  7516. */
  7517. }, {
  7518. key: 'createRowsCalculator',
  7519. value: function createRowsCalculator() {
  7520. var _this2 = this;
  7521. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  7522. var height = void 0;
  7523. var pos = void 0;
  7524. var fixedRowsTop = void 0;
  7525. var scrollbarHeight = void 0;
  7526. var fixedRowsBottom = void 0;
  7527. var fixedRowsHeight = void 0;
  7528. var totalRows = void 0;
  7529. this.rowHeaderWidth = NaN;
  7530. if (this.wot.wtSettings.settings.renderAllRows) {
  7531. height = Infinity;
  7532. } else {
  7533. height = this.getViewportHeight();
  7534. }
  7535. pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset();
  7536. if (pos < 0) {
  7537. pos = 0;
  7538. }
  7539. fixedRowsTop = this.wot.getSetting('fixedRowsTop');
  7540. fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
  7541. totalRows = this.wot.getSetting('totalRows');
  7542. if (fixedRowsTop) {
  7543. fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);
  7544. pos += fixedRowsHeight;
  7545. height -= fixedRowsHeight;
  7546. }
  7547. if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) {
  7548. fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);
  7549. height -= fixedRowsHeight;
  7550. }
  7551. if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) {
  7552. scrollbarHeight = 0;
  7553. } else {
  7554. scrollbarHeight = (0, _element.getScrollbarWidth)();
  7555. }
  7556. return new _viewportRows2.default(height, pos, this.wot.getSetting('totalRows'), function (sourceRow) {
  7557. return _this2.wot.wtTable.getRowHeight(sourceRow);
  7558. }, visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight);
  7559. }
  7560. /**
  7561. * Creates:
  7562. * - columnsRenderCalculator (before draw, to qualify columns for rendering)
  7563. * - columnsVisibleCalculator (after draw, to measure which columns are actually visible)
  7564. *
  7565. * @returns {ViewportRowsCalculator}
  7566. */
  7567. }, {
  7568. key: 'createColumnsCalculator',
  7569. value: function createColumnsCalculator() {
  7570. var _this3 = this;
  7571. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  7572. var width = this.getViewportWidth();
  7573. var pos = void 0;
  7574. var fixedColumnsLeft = void 0;
  7575. this.columnHeaderHeight = NaN;
  7576. pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset();
  7577. if (pos < 0) {
  7578. pos = 0;
  7579. }
  7580. fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');
  7581. if (fixedColumnsLeft) {
  7582. var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);
  7583. pos += fixedColumnsWidth;
  7584. width -= fixedColumnsWidth;
  7585. }
  7586. if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) {
  7587. width -= (0, _element.getScrollbarWidth)();
  7588. }
  7589. return new _viewportColumns2.default(width, pos, this.wot.getSetting('totalColumns'), function (sourceCol) {
  7590. return _this3.wot.wtTable.getColumnWidth(sourceCol);
  7591. }, visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH'), function (stretchedWidth, column) {
  7592. return _this3.wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);
  7593. });
  7594. }
  7595. /**
  7596. * Creates rowsRenderCalculator and columnsRenderCalculator (before draw, to determine what rows and
  7597. * cols should be rendered)
  7598. *
  7599. * @param fastDraw {Boolean} If `true`, will try to avoid full redraw and only update the border positions.
  7600. * If `false` or `undefined`, will perform a full redraw
  7601. * @returns fastDraw {Boolean} The fastDraw value, possibly modified
  7602. */
  7603. }, {
  7604. key: 'createRenderCalculators',
  7605. value: function createRenderCalculators() {
  7606. var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  7607. if (fastDraw) {
  7608. var proposedRowsVisibleCalculator = this.createRowsCalculator(true);
  7609. var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true);
  7610. if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {
  7611. fastDraw = false;
  7612. }
  7613. }
  7614. if (!fastDraw) {
  7615. this.rowsRenderCalculator = this.createRowsCalculator();
  7616. this.columnsRenderCalculator = this.createColumnsCalculator();
  7617. }
  7618. // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator
  7619. this.rowsVisibleCalculator = null;
  7620. this.columnsVisibleCalculator = null;
  7621. return fastDraw;
  7622. }
  7623. /**
  7624. * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are
  7625. * the actually visible rows and columns)
  7626. */
  7627. }, {
  7628. key: 'createVisibleCalculators',
  7629. value: function createVisibleCalculators() {
  7630. this.rowsVisibleCalculator = this.createRowsCalculator(true);
  7631. this.columnsVisibleCalculator = this.createColumnsCalculator(true);
  7632. }
  7633. /**
  7634. * Returns information whether proposedRowsVisibleCalculator viewport
  7635. * is contained inside rows rendered in previous draw (cached in rowsRenderCalculator)
  7636. *
  7637. * @param {Object} proposedRowsVisibleCalculator
  7638. * @returns {Boolean} Returns `true` if all proposed visible rows are already rendered (meaning: redraw is not needed).
  7639. * Returns `false` if at least one proposed visible row is not already rendered (meaning: redraw is needed)
  7640. */
  7641. }, {
  7642. key: 'areAllProposedVisibleRowsAlreadyRendered',
  7643. value: function areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) {
  7644. if (this.rowsVisibleCalculator) {
  7645. if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0) {
  7646. return false;
  7647. } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1) {
  7648. return false;
  7649. }
  7650. return true;
  7651. }
  7652. return false;
  7653. }
  7654. /**
  7655. * Returns information whether proposedColumnsVisibleCalculator viewport
  7656. * is contained inside column rendered in previous draw (cached in columnsRenderCalculator)
  7657. *
  7658. * @param {Object} proposedColumnsVisibleCalculator
  7659. * @returns {Boolean} Returns `true` if all proposed visible columns are already rendered (meaning: redraw is not needed).
  7660. * Returns `false` if at least one proposed visible column is not already rendered (meaning: redraw is needed)
  7661. */
  7662. }, {
  7663. key: 'areAllProposedVisibleColumnsAlreadyRendered',
  7664. value: function areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator) {
  7665. if (this.columnsVisibleCalculator) {
  7666. if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0) {
  7667. return false;
  7668. } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1) {
  7669. return false;
  7670. }
  7671. return true;
  7672. }
  7673. return false;
  7674. }
  7675. /**
  7676. * Resets values in keys of the hasOversizedColumnHeadersMarked object after updateSettings.
  7677. */
  7678. }, {
  7679. key: 'resetHasOversizedColumnHeadersMarked',
  7680. value: function resetHasOversizedColumnHeadersMarked() {
  7681. (0, _object.objectEach)(this.hasOversizedColumnHeadersMarked, function (value, key, object) {
  7682. object[key] = void 0;
  7683. });
  7684. }
  7685. }]);
  7686. return Viewport;
  7687. }();
  7688. exports.default = Viewport;
  7689. /***/ }),
  7690. /* 72 */
  7691. /***/ (function(module, exports, __webpack_require__) {
  7692. "use strict";
  7693. var addToUnscopables = __webpack_require__(17)
  7694. , step = __webpack_require__(89)
  7695. , Iterators = __webpack_require__(27)
  7696. , toIObject = __webpack_require__(9);
  7697. // 22.1.3.4 Array.prototype.entries()
  7698. // 22.1.3.13 Array.prototype.keys()
  7699. // 22.1.3.29 Array.prototype.values()
  7700. // 22.1.3.30 Array.prototype[@@iterator]()
  7701. module.exports = __webpack_require__(88)(Array, 'Array', function(iterated, kind){
  7702. this._t = toIObject(iterated); // target
  7703. this._i = 0; // next index
  7704. this._k = kind; // kind
  7705. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  7706. }, function(){
  7707. var O = this._t
  7708. , kind = this._k
  7709. , index = this._i++;
  7710. if(!O || index >= O.length){
  7711. this._t = undefined;
  7712. return step(1);
  7713. }
  7714. if(kind == 'keys' )return step(0, index);
  7715. if(kind == 'values')return step(0, O[index]);
  7716. return step(0, [index, O[index]]);
  7717. }, 'values');
  7718. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  7719. Iterators.Arguments = Iterators.Array;
  7720. addToUnscopables('keys');
  7721. addToUnscopables('values');
  7722. addToUnscopables('entries');
  7723. /***/ }),
  7724. /* 73 */
  7725. /***/ (function(module, exports, __webpack_require__) {
  7726. "use strict";
  7727. exports.__esModule = true;
  7728. exports.stopImmediatePropagation = stopImmediatePropagation;
  7729. exports.isImmediatePropagationStopped = isImmediatePropagationStopped;
  7730. exports.stopPropagation = stopPropagation;
  7731. exports.pageX = pageX;
  7732. exports.pageY = pageY;
  7733. exports.isRightClick = isRightClick;
  7734. exports.isLeftClick = isLeftClick;
  7735. var _element = __webpack_require__(2);
  7736. /**
  7737. * Prevent other listeners of the same event from being called.
  7738. *
  7739. * @param {Event} event
  7740. */
  7741. function stopImmediatePropagation(event) {
  7742. event.isImmediatePropagationEnabled = false;
  7743. event.cancelBubble = true;
  7744. }
  7745. /**
  7746. * Check if event was stopped by `stopImmediatePropagation`.
  7747. *
  7748. * @param event {Event}
  7749. * @returns {Boolean}
  7750. */
  7751. function isImmediatePropagationStopped(event) {
  7752. return event.isImmediatePropagationEnabled === false;
  7753. }
  7754. /**
  7755. * Prevent further propagation of the current event (prevent bubbling).
  7756. *
  7757. * @param event {Event}
  7758. */
  7759. function stopPropagation(event) {
  7760. // ie8
  7761. // http://msdn.microsoft.com/en-us/library/ie/ff975462(v=vs.85).aspx
  7762. if (typeof event.stopPropagation === 'function') {
  7763. event.stopPropagation();
  7764. } else {
  7765. event.cancelBubble = true;
  7766. }
  7767. }
  7768. /**
  7769. * Get horizontal coordinate of the event object relative to the whole document.
  7770. *
  7771. * @param {Event} event
  7772. * @returns {Number}
  7773. */
  7774. function pageX(event) {
  7775. if (event.pageX) {
  7776. return event.pageX;
  7777. }
  7778. return event.clientX + (0, _element.getWindowScrollLeft)();
  7779. }
  7780. /**
  7781. * Get vertical coordinate of the event object relative to the whole document.
  7782. *
  7783. * @param {Event} event
  7784. * @returns {Number}
  7785. */
  7786. function pageY(event) {
  7787. if (event.pageY) {
  7788. return event.pageY;
  7789. }
  7790. return event.clientY + (0, _element.getWindowScrollTop)();
  7791. }
  7792. /**
  7793. * Check if provided event was triggered by clicking the right mouse button.
  7794. *
  7795. * @param {Event} event DOM Event.
  7796. * @returns {Boolean}
  7797. */
  7798. function isRightClick(event) {
  7799. return event.button === 2;
  7800. }
  7801. /**
  7802. * Check if provided event was triggered by clicking the left mouse button.
  7803. *
  7804. * @param {Event} event DOM Event.
  7805. * @returns {Boolean}
  7806. */
  7807. function isLeftClick(event) {
  7808. return event.button === 0;
  7809. }
  7810. /***/ }),
  7811. /* 74 */
  7812. /***/ (function(module, exports, __webpack_require__) {
  7813. "use strict";
  7814. exports.__esModule = true;
  7815. 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; };
  7816. exports.requestAnimationFrame = requestAnimationFrame;
  7817. exports.cancelAnimationFrame = cancelAnimationFrame;
  7818. exports.isTouchSupported = isTouchSupported;
  7819. exports.isWebComponentSupportedNatively = isWebComponentSupportedNatively;
  7820. exports.hasCaptionProblem = hasCaptionProblem;
  7821. exports.getComparisonFunction = getComparisonFunction;
  7822. // https://gist.github.com/paulirish/1579671
  7823. var lastTime = 0;
  7824. var vendors = ['ms', 'moz', 'webkit', 'o'];
  7825. var _requestAnimationFrame = window.requestAnimationFrame;
  7826. var _cancelAnimationFrame = window.cancelAnimationFrame;
  7827. for (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) {
  7828. _requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
  7829. _cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
  7830. }
  7831. if (!_requestAnimationFrame) {
  7832. _requestAnimationFrame = function _requestAnimationFrame(callback) {
  7833. var currTime = new Date().getTime();
  7834. var timeToCall = Math.max(0, 16 - (currTime - lastTime));
  7835. var id = window.setTimeout(function () {
  7836. callback(currTime + timeToCall);
  7837. }, timeToCall);
  7838. lastTime = currTime + timeToCall;
  7839. return id;
  7840. };
  7841. }
  7842. if (!_cancelAnimationFrame) {
  7843. _cancelAnimationFrame = function _cancelAnimationFrame(id) {
  7844. clearTimeout(id);
  7845. };
  7846. }
  7847. /**
  7848. * Polyfill for requestAnimationFrame
  7849. *
  7850. * @param {Function} callback
  7851. * @returns {Number}
  7852. */
  7853. function requestAnimationFrame(callback) {
  7854. return _requestAnimationFrame.call(window, callback);
  7855. }
  7856. /**
  7857. * Polyfill for cancelAnimationFrame
  7858. *
  7859. * @param {Number} id
  7860. */
  7861. function cancelAnimationFrame(id) {
  7862. _cancelAnimationFrame.call(window, id);
  7863. }
  7864. function isTouchSupported() {
  7865. return 'ontouchstart' in window;
  7866. }
  7867. /**
  7868. * Checks if browser is support web components natively
  7869. *
  7870. * @returns {Boolean}
  7871. */
  7872. function isWebComponentSupportedNatively() {
  7873. var test = document.createElement('div');
  7874. return !!(test.createShadowRoot && test.createShadowRoot.toString().match(/\[native code\]/));
  7875. }
  7876. var _hasCaptionProblem;
  7877. function detectCaptionProblem() {
  7878. var TABLE = document.createElement('TABLE');
  7879. TABLE.style.borderSpacing = 0;
  7880. TABLE.style.borderWidth = 0;
  7881. TABLE.style.padding = 0;
  7882. var TBODY = document.createElement('TBODY');
  7883. TABLE.appendChild(TBODY);
  7884. TBODY.appendChild(document.createElement('TR'));
  7885. TBODY.firstChild.appendChild(document.createElement('TD'));
  7886. TBODY.firstChild.firstChild.innerHTML = '<tr><td>t<br>t</td></tr>';
  7887. var CAPTION = document.createElement('CAPTION');
  7888. CAPTION.innerHTML = 'c<br>c<br>c<br>c';
  7889. CAPTION.style.padding = 0;
  7890. CAPTION.style.margin = 0;
  7891. TABLE.insertBefore(CAPTION, TBODY);
  7892. document.body.appendChild(TABLE);
  7893. _hasCaptionProblem = TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight; // boolean
  7894. document.body.removeChild(TABLE);
  7895. }
  7896. function hasCaptionProblem() {
  7897. if (_hasCaptionProblem === void 0) {
  7898. detectCaptionProblem();
  7899. }
  7900. return _hasCaptionProblem;
  7901. }
  7902. var comparisonFunction = void 0;
  7903. /**
  7904. * Get string comparison function for sorting purposes. It supports multilingual string comparison base on Internationalization API.
  7905. *
  7906. * @param {String} [language]
  7907. * @param {Object} [options]
  7908. * @returns {*}
  7909. */
  7910. function getComparisonFunction(language) {
  7911. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7912. if (comparisonFunction) {
  7913. return comparisonFunction;
  7914. }
  7915. if ((typeof Intl === 'undefined' ? 'undefined' : _typeof(Intl)) === 'object') {
  7916. comparisonFunction = new Intl.Collator(language, options).compare;
  7917. } else if (typeof String.prototype.localeCompare === 'function') {
  7918. comparisonFunction = function comparisonFunction(a, b) {
  7919. return ('' + a).localeCompare(b);
  7920. };
  7921. } else {
  7922. comparisonFunction = function comparisonFunction(a, b) {
  7923. if (a === b) {
  7924. return 0;
  7925. }
  7926. return a > b ? -1 : 1;
  7927. };
  7928. }
  7929. return comparisonFunction;
  7930. }
  7931. /***/ }),
  7932. /* 75 */
  7933. /***/ (function(module, exports, __webpack_require__) {
  7934. "use strict";
  7935. exports.__esModule = true;
  7936. exports.isFunction = isFunction;
  7937. exports.throttle = throttle;
  7938. exports.throttleAfterHits = throttleAfterHits;
  7939. exports.debounce = debounce;
  7940. exports.pipe = pipe;
  7941. exports.partial = partial;
  7942. exports.curry = curry;
  7943. exports.curryRight = curryRight;
  7944. var _array = __webpack_require__(24);
  7945. /**
  7946. * Checks if given variable is function.
  7947. *
  7948. * @param {*} func Variable to check.
  7949. * @returns {Boolean}
  7950. */
  7951. function isFunction(func) {
  7952. return typeof func === 'function';
  7953. }
  7954. /**
  7955. * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over time (`wait`).
  7956. *
  7957. * @param {Function} func Function to invoke.
  7958. * @param {Number} wait Delay in miliseconds.
  7959. * @returns {Function}
  7960. */
  7961. function throttle(func) {
  7962. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  7963. var lastCalled = 0;
  7964. var result = {
  7965. lastCallThrottled: true
  7966. };
  7967. var lastTimer = null;
  7968. function _throttle() {
  7969. var _this = this;
  7970. var args = arguments;
  7971. var stamp = Date.now();
  7972. var needCall = false;
  7973. result.lastCallThrottled = true;
  7974. if (!lastCalled) {
  7975. lastCalled = stamp;
  7976. needCall = true;
  7977. }
  7978. var remaining = wait - (stamp - lastCalled);
  7979. if (needCall) {
  7980. result.lastCallThrottled = false;
  7981. func.apply(this, args);
  7982. } else {
  7983. if (lastTimer) {
  7984. clearTimeout(lastTimer);
  7985. }
  7986. lastTimer = setTimeout(function () {
  7987. result.lastCallThrottled = false;
  7988. func.apply(_this, args);
  7989. lastCalled = 0;
  7990. lastTimer = void 0;
  7991. }, remaining);
  7992. }
  7993. return result;
  7994. }
  7995. return _throttle;
  7996. }
  7997. /**
  7998. * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over
  7999. * time (`wait`) after specified hits.
  8000. *
  8001. * @param {Function} func Function to invoke.
  8002. * @param {Number} wait Delay in miliseconds.
  8003. * @param {Number} hits Number of hits after throttling will be applied.
  8004. * @returns {Function}
  8005. */
  8006. function throttleAfterHits(func) {
  8007. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  8008. var hits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  8009. var funcThrottle = throttle(func, wait);
  8010. var remainHits = hits;
  8011. function _clearHits() {
  8012. remainHits = hits;
  8013. }
  8014. function _throttleAfterHits() {
  8015. if (remainHits) {
  8016. remainHits--;
  8017. return func.apply(this, arguments);
  8018. }
  8019. return funcThrottle.apply(this, arguments);
  8020. }
  8021. _throttleAfterHits.clearHits = _clearHits;
  8022. return _throttleAfterHits;
  8023. }
  8024. /**
  8025. * Creates debounce function that enforces a function (`func`) not be called again until a certain amount of time (`wait`)
  8026. * has passed without it being called.
  8027. *
  8028. * @param {Function} func Function to invoke.
  8029. * @param {Number} wait Delay in milliseconds.
  8030. * @returns {Function}
  8031. */
  8032. function debounce(func) {
  8033. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  8034. var lastTimer = null;
  8035. var result = void 0;
  8036. function _debounce() {
  8037. var _this2 = this;
  8038. var args = arguments;
  8039. if (lastTimer) {
  8040. clearTimeout(lastTimer);
  8041. }
  8042. lastTimer = setTimeout(function () {
  8043. result = func.apply(_this2, args);
  8044. }, wait);
  8045. return result;
  8046. }
  8047. return _debounce;
  8048. }
  8049. /**
  8050. * Creates the function that returns the result of calling the given functions. Result of the first function is passed to
  8051. * the second as an argument and so on. Only first function in the chain can handle multiple arguments.
  8052. *
  8053. * @param {Function} functions Functions to compose.
  8054. * @returns {Function}
  8055. */
  8056. function pipe() {
  8057. for (var _len = arguments.length, functions = Array(_len), _key = 0; _key < _len; _key++) {
  8058. functions[_key] = arguments[_key];
  8059. }
  8060. var firstFunc = functions[0],
  8061. restFunc = functions.slice(1);
  8062. return function _pipe() {
  8063. return (0, _array.arrayReduce)(restFunc, function (acc, fn) {
  8064. return fn(acc);
  8065. }, firstFunc.apply(this, arguments));
  8066. };
  8067. }
  8068. /**
  8069. * Creates the function that returns the function with cached arguments.
  8070. *
  8071. * @param {Function} func Function to partialization.
  8072. * @param {Array} params Function arguments to cache.
  8073. * @returns {Function}
  8074. */
  8075. function partial(func) {
  8076. for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  8077. params[_key2 - 1] = arguments[_key2];
  8078. }
  8079. return function _partial() {
  8080. for (var _len3 = arguments.length, restParams = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  8081. restParams[_key3] = arguments[_key3];
  8082. }
  8083. return func.apply(this, params.concat(restParams));
  8084. };
  8085. }
  8086. /**
  8087. * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
  8088. * to the arguments defined in `func` then function will be invoked.
  8089. * Arguments are added to the stack in direction from the left to the right.
  8090. *
  8091. * @example
  8092. * ```
  8093. * var replace = curry(function(find, replace, string) {
  8094. * return string.replace(find, replace);
  8095. * });
  8096. *
  8097. * // returns function with bounded first argument
  8098. * var replace = replace('foo')
  8099. *
  8100. * // returns replaced string - all arguments was passed so function was invoked
  8101. * replace('bar', 'Some test with foo...');
  8102. *
  8103. * ```
  8104. *
  8105. * @param {Function} func Function to currying.
  8106. * @returns {Function}
  8107. */
  8108. function curry(func) {
  8109. var argsLength = func.length;
  8110. function given(argsSoFar) {
  8111. return function _curry() {
  8112. for (var _len4 = arguments.length, params = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  8113. params[_key4] = arguments[_key4];
  8114. }
  8115. var passedArgsSoFar = argsSoFar.concat(params);
  8116. var result = void 0;
  8117. if (passedArgsSoFar.length >= argsLength) {
  8118. result = func.apply(this, passedArgsSoFar);
  8119. } else {
  8120. result = given(passedArgsSoFar);
  8121. }
  8122. return result;
  8123. };
  8124. }
  8125. return given([]);
  8126. }
  8127. /**
  8128. * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
  8129. * to the arguments defined in `func` then function will be invoked.
  8130. * Arguments are added to the stack in direction from the right to the left.
  8131. *
  8132. * @example
  8133. * ```
  8134. * var replace = curry(function(find, replace, string) {
  8135. * return string.replace(find, replace);
  8136. * });
  8137. *
  8138. * // returns function with bounded first argument
  8139. * var replace = replace('Some test with foo...')
  8140. *
  8141. * // returns replaced string - all arguments was passed so function was invoked
  8142. * replace('bar', 'foo');
  8143. *
  8144. * ```
  8145. *
  8146. * @param {Function} func Function to currying.
  8147. * @returns {Function}
  8148. */
  8149. function curryRight(func) {
  8150. var argsLength = func.length;
  8151. function given(argsSoFar) {
  8152. return function _curry() {
  8153. for (var _len5 = arguments.length, params = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  8154. params[_key5] = arguments[_key5];
  8155. }
  8156. var passedArgsSoFar = argsSoFar.concat(params.reverse());
  8157. var result = void 0;
  8158. if (passedArgsSoFar.length >= argsLength) {
  8159. result = func.apply(this, passedArgsSoFar);
  8160. } else {
  8161. result = given(passedArgsSoFar);
  8162. }
  8163. return result;
  8164. };
  8165. }
  8166. return given([]);
  8167. }
  8168. /***/ }),
  8169. /* 76 */
  8170. /***/ (function(module, exports, __webpack_require__) {
  8171. "use strict";
  8172. exports.__esModule = true;
  8173. 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; };
  8174. exports.isNumeric = isNumeric;
  8175. exports.rangeEach = rangeEach;
  8176. exports.rangeEachReverse = rangeEachReverse;
  8177. exports.valueAccordingPercent = valueAccordingPercent;
  8178. /**
  8179. * Checks if value of n is a numeric one
  8180. * http://jsperf.com/isnan-vs-isnumeric/4
  8181. * @param n
  8182. * @returns {boolean}
  8183. */
  8184. function isNumeric(n) {
  8185. /* eslint-disable */
  8186. var t = typeof n === 'undefined' ? 'undefined' : _typeof(n);
  8187. return t == 'number' ? !isNaN(n) && isFinite(n) : t == 'string' ? !n.length ? false : n.length == 1 ? /\d/.test(n) : /^\s*[+-]?\s*(?:(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?)|(?:0x[a-f\d]+))\s*$/i.test(n) : t == 'object' ? !!n && typeof n.valueOf() == 'number' && !(n instanceof Date) : false;
  8188. }
  8189. /**
  8190. * A specialized version of `.forEach` defined by ranges.
  8191. *
  8192. * @param {Number} rangeFrom The number from start iterate.
  8193. * @param {Number|Function} rangeTo The number where finish iterate or function as a iteratee.
  8194. * @param {Function} [iteratee] The function invoked per iteration.
  8195. */
  8196. function rangeEach(rangeFrom, rangeTo, iteratee) {
  8197. var index = -1;
  8198. if (typeof rangeTo === 'function') {
  8199. iteratee = rangeTo;
  8200. rangeTo = rangeFrom;
  8201. } else {
  8202. index = rangeFrom - 1;
  8203. }
  8204. while (++index <= rangeTo) {
  8205. if (iteratee(index) === false) {
  8206. break;
  8207. }
  8208. }
  8209. }
  8210. /**
  8211. * A specialized version of `.forEach` defined by ranges iterable in reverse order.
  8212. *
  8213. * @param {Number} rangeFrom The number from start iterate.
  8214. * @param {Number} rangeTo The number where finish iterate.
  8215. * @param {Function} iteratee The function invoked per iteration.
  8216. */
  8217. function rangeEachReverse(rangeFrom, rangeTo, iteratee) {
  8218. var index = rangeFrom + 1;
  8219. if (typeof rangeTo === 'function') {
  8220. iteratee = rangeTo;
  8221. rangeTo = 0;
  8222. }
  8223. while (--index >= rangeTo) {
  8224. if (iteratee(index) === false) {
  8225. break;
  8226. }
  8227. }
  8228. }
  8229. /**
  8230. * Calculate value from percent.
  8231. *
  8232. * @param {Number} value Base value from percent will be calculated.
  8233. * @param {String|Number} percent Can be Number or String (eq. `'33%'`).
  8234. * @returns {Number}
  8235. */
  8236. function valueAccordingPercent(value, percent) {
  8237. percent = parseInt(percent.toString().replace('%', ''), 10);
  8238. percent = parseInt(value * percent / 100, 10);
  8239. return percent;
  8240. }
  8241. /***/ }),
  8242. /* 77 */
  8243. /***/ (function(module, exports, __webpack_require__) {
  8244. // false -> Array#indexOf
  8245. // true -> Array#includes
  8246. var toIObject = __webpack_require__(9)
  8247. , toLength = __webpack_require__(10)
  8248. , toIndex = __webpack_require__(41);
  8249. module.exports = function(IS_INCLUDES){
  8250. return function($this, el, fromIndex){
  8251. var O = toIObject($this)
  8252. , length = toLength(O.length)
  8253. , index = toIndex(fromIndex, length)
  8254. , value;
  8255. // Array#includes uses SameValueZero equality algorithm
  8256. if(IS_INCLUDES && el != el)while(length > index){
  8257. value = O[index++];
  8258. if(value != value)return true;
  8259. // Array#toIndex ignores holes, Array#includes - not
  8260. } else for(;length > index; index++)if(IS_INCLUDES || index in O){
  8261. if(O[index] === el)return IS_INCLUDES || index || 0;
  8262. } return !IS_INCLUDES && -1;
  8263. };
  8264. };
  8265. /***/ }),
  8266. /* 78 */
  8267. /***/ (function(module, exports, __webpack_require__) {
  8268. // getting tag from 19.1.3.6 Object.prototype.toString()
  8269. var cof = __webpack_require__(18)
  8270. , TAG = __webpack_require__(1)('toStringTag')
  8271. // ES3 wrong here
  8272. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  8273. // fallback for IE11 Script Access Denied error
  8274. var tryGet = function(it, key){
  8275. try {
  8276. return it[key];
  8277. } catch(e){ /* empty */ }
  8278. };
  8279. module.exports = function(it){
  8280. var O, T, B;
  8281. return it === undefined ? 'Undefined' : it === null ? 'Null'
  8282. // @@toStringTag case
  8283. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  8284. // builtinTag case
  8285. : ARG ? cof(O)
  8286. // ES3 arguments fallback
  8287. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  8288. };
  8289. /***/ }),
  8290. /* 79 */
  8291. /***/ (function(module, exports, __webpack_require__) {
  8292. "use strict";
  8293. var dP = __webpack_require__(6).f
  8294. , create = __webpack_require__(51)
  8295. , redefineAll = __webpack_require__(40)
  8296. , ctx = __webpack_require__(12)
  8297. , anInstance = __webpack_require__(33)
  8298. , defined = __webpack_require__(13)
  8299. , forOf = __webpack_require__(37)
  8300. , $iterDefine = __webpack_require__(88)
  8301. , step = __webpack_require__(89)
  8302. , setSpecies = __webpack_require__(94)
  8303. , DESCRIPTORS = __webpack_require__(7)
  8304. , fastKey = __webpack_require__(28).fastKey
  8305. , SIZE = DESCRIPTORS ? '_s' : 'size';
  8306. var getEntry = function(that, key){
  8307. // fast case
  8308. var index = fastKey(key), entry;
  8309. if(index !== 'F')return that._i[index];
  8310. // frozen object case
  8311. for(entry = that._f; entry; entry = entry.n){
  8312. if(entry.k == key)return entry;
  8313. }
  8314. };
  8315. module.exports = {
  8316. getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
  8317. var C = wrapper(function(that, iterable){
  8318. anInstance(that, C, NAME, '_i');
  8319. that._i = create(null); // index
  8320. that._f = undefined; // first entry
  8321. that._l = undefined; // last entry
  8322. that[SIZE] = 0; // size
  8323. if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
  8324. });
  8325. redefineAll(C.prototype, {
  8326. // 23.1.3.1 Map.prototype.clear()
  8327. // 23.2.3.2 Set.prototype.clear()
  8328. clear: function clear(){
  8329. for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
  8330. entry.r = true;
  8331. if(entry.p)entry.p = entry.p.n = undefined;
  8332. delete data[entry.i];
  8333. }
  8334. that._f = that._l = undefined;
  8335. that[SIZE] = 0;
  8336. },
  8337. // 23.1.3.3 Map.prototype.delete(key)
  8338. // 23.2.3.4 Set.prototype.delete(value)
  8339. 'delete': function(key){
  8340. var that = this
  8341. , entry = getEntry(that, key);
  8342. if(entry){
  8343. var next = entry.n
  8344. , prev = entry.p;
  8345. delete that._i[entry.i];
  8346. entry.r = true;
  8347. if(prev)prev.n = next;
  8348. if(next)next.p = prev;
  8349. if(that._f == entry)that._f = next;
  8350. if(that._l == entry)that._l = prev;
  8351. that[SIZE]--;
  8352. } return !!entry;
  8353. },
  8354. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  8355. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  8356. forEach: function forEach(callbackfn /*, that = undefined */){
  8357. anInstance(this, C, 'forEach');
  8358. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)
  8359. , entry;
  8360. while(entry = entry ? entry.n : this._f){
  8361. f(entry.v, entry.k, this);
  8362. // revert to the last existing entry
  8363. while(entry && entry.r)entry = entry.p;
  8364. }
  8365. },
  8366. // 23.1.3.7 Map.prototype.has(key)
  8367. // 23.2.3.7 Set.prototype.has(value)
  8368. has: function has(key){
  8369. return !!getEntry(this, key);
  8370. }
  8371. });
  8372. if(DESCRIPTORS)dP(C.prototype, 'size', {
  8373. get: function(){
  8374. return defined(this[SIZE]);
  8375. }
  8376. });
  8377. return C;
  8378. },
  8379. def: function(that, key, value){
  8380. var entry = getEntry(that, key)
  8381. , prev, index;
  8382. // change existing entry
  8383. if(entry){
  8384. entry.v = value;
  8385. // create new entry
  8386. } else {
  8387. that._l = entry = {
  8388. i: index = fastKey(key, true), // <- index
  8389. k: key, // <- key
  8390. v: value, // <- value
  8391. p: prev = that._l, // <- previous entry
  8392. n: undefined, // <- next entry
  8393. r: false // <- removed
  8394. };
  8395. if(!that._f)that._f = entry;
  8396. if(prev)prev.n = entry;
  8397. that[SIZE]++;
  8398. // add to index
  8399. if(index !== 'F')that._i[index] = entry;
  8400. } return that;
  8401. },
  8402. getEntry: getEntry,
  8403. setStrong: function(C, NAME, IS_MAP){
  8404. // add .keys, .values, .entries, [@@iterator]
  8405. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  8406. $iterDefine(C, NAME, function(iterated, kind){
  8407. this._t = iterated; // target
  8408. this._k = kind; // kind
  8409. this._l = undefined; // previous
  8410. }, function(){
  8411. var that = this
  8412. , kind = that._k
  8413. , entry = that._l;
  8414. // revert to the last existing entry
  8415. while(entry && entry.r)entry = entry.p;
  8416. // get next entry
  8417. if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
  8418. // or finish the iteration
  8419. that._t = undefined;
  8420. return step(1);
  8421. }
  8422. // return step by kind
  8423. if(kind == 'keys' )return step(0, entry.k);
  8424. if(kind == 'values')return step(0, entry.v);
  8425. return step(0, [entry.k, entry.v]);
  8426. }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
  8427. // add [@@species], 23.1.2.2, 23.2.2.2
  8428. setSpecies(NAME);
  8429. }
  8430. };
  8431. /***/ }),
  8432. /* 80 */
  8433. /***/ (function(module, exports, __webpack_require__) {
  8434. "use strict";
  8435. var redefineAll = __webpack_require__(40)
  8436. , getWeak = __webpack_require__(28).getWeak
  8437. , anObject = __webpack_require__(5)
  8438. , isObject = __webpack_require__(4)
  8439. , anInstance = __webpack_require__(33)
  8440. , forOf = __webpack_require__(37)
  8441. , createArrayMethod = __webpack_require__(34)
  8442. , $has = __webpack_require__(8)
  8443. , arrayFind = createArrayMethod(5)
  8444. , arrayFindIndex = createArrayMethod(6)
  8445. , id = 0;
  8446. // fallback for uncaught frozen keys
  8447. var uncaughtFrozenStore = function(that){
  8448. return that._l || (that._l = new UncaughtFrozenStore);
  8449. };
  8450. var UncaughtFrozenStore = function(){
  8451. this.a = [];
  8452. };
  8453. var findUncaughtFrozen = function(store, key){
  8454. return arrayFind(store.a, function(it){
  8455. return it[0] === key;
  8456. });
  8457. };
  8458. UncaughtFrozenStore.prototype = {
  8459. get: function(key){
  8460. var entry = findUncaughtFrozen(this, key);
  8461. if(entry)return entry[1];
  8462. },
  8463. has: function(key){
  8464. return !!findUncaughtFrozen(this, key);
  8465. },
  8466. set: function(key, value){
  8467. var entry = findUncaughtFrozen(this, key);
  8468. if(entry)entry[1] = value;
  8469. else this.a.push([key, value]);
  8470. },
  8471. 'delete': function(key){
  8472. var index = arrayFindIndex(this.a, function(it){
  8473. return it[0] === key;
  8474. });
  8475. if(~index)this.a.splice(index, 1);
  8476. return !!~index;
  8477. }
  8478. };
  8479. module.exports = {
  8480. getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
  8481. var C = wrapper(function(that, iterable){
  8482. anInstance(that, C, NAME, '_i');
  8483. that._i = id++; // collection id
  8484. that._l = undefined; // leak store for uncaught frozen objects
  8485. if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
  8486. });
  8487. redefineAll(C.prototype, {
  8488. // 23.3.3.2 WeakMap.prototype.delete(key)
  8489. // 23.4.3.3 WeakSet.prototype.delete(value)
  8490. 'delete': function(key){
  8491. if(!isObject(key))return false;
  8492. var data = getWeak(key);
  8493. if(data === true)return uncaughtFrozenStore(this)['delete'](key);
  8494. return data && $has(data, this._i) && delete data[this._i];
  8495. },
  8496. // 23.3.3.4 WeakMap.prototype.has(key)
  8497. // 23.4.3.4 WeakSet.prototype.has(value)
  8498. has: function has(key){
  8499. if(!isObject(key))return false;
  8500. var data = getWeak(key);
  8501. if(data === true)return uncaughtFrozenStore(this).has(key);
  8502. return data && $has(data, this._i);
  8503. }
  8504. });
  8505. return C;
  8506. },
  8507. def: function(that, key, value){
  8508. var data = getWeak(anObject(key), true);
  8509. if(data === true)uncaughtFrozenStore(that).set(key, value);
  8510. else data[that._i] = value;
  8511. return that;
  8512. },
  8513. ufstore: uncaughtFrozenStore
  8514. };
  8515. /***/ }),
  8516. /* 81 */
  8517. /***/ (function(module, exports, __webpack_require__) {
  8518. module.exports = __webpack_require__(3).document && document.documentElement;
  8519. /***/ }),
  8520. /* 82 */
  8521. /***/ (function(module, exports, __webpack_require__) {
  8522. module.exports = !__webpack_require__(7) && !__webpack_require__(14)(function(){
  8523. return Object.defineProperty(__webpack_require__(46)('div'), 'a', {get: function(){ return 7; }}).a != 7;
  8524. });
  8525. /***/ }),
  8526. /* 83 */
  8527. /***/ (function(module, exports, __webpack_require__) {
  8528. // check on default Array iterator
  8529. var Iterators = __webpack_require__(27)
  8530. , ITERATOR = __webpack_require__(1)('iterator')
  8531. , ArrayProto = Array.prototype;
  8532. module.exports = function(it){
  8533. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  8534. };
  8535. /***/ }),
  8536. /* 84 */
  8537. /***/ (function(module, exports, __webpack_require__) {
  8538. // 7.2.2 IsArray(argument)
  8539. var cof = __webpack_require__(18);
  8540. module.exports = Array.isArray || function isArray(arg){
  8541. return cof(arg) == 'Array';
  8542. };
  8543. /***/ }),
  8544. /* 85 */
  8545. /***/ (function(module, exports, __webpack_require__) {
  8546. // 20.1.2.3 Number.isInteger(number)
  8547. var isObject = __webpack_require__(4)
  8548. , floor = Math.floor;
  8549. module.exports = function isInteger(it){
  8550. return !isObject(it) && isFinite(it) && floor(it) === it;
  8551. };
  8552. /***/ }),
  8553. /* 86 */
  8554. /***/ (function(module, exports, __webpack_require__) {
  8555. // 7.2.8 IsRegExp(argument)
  8556. var isObject = __webpack_require__(4)
  8557. , cof = __webpack_require__(18)
  8558. , MATCH = __webpack_require__(1)('match');
  8559. module.exports = function(it){
  8560. var isRegExp;
  8561. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  8562. };
  8563. /***/ }),
  8564. /* 87 */
  8565. /***/ (function(module, exports, __webpack_require__) {
  8566. // call something on iterator step with safe closing on error
  8567. var anObject = __webpack_require__(5);
  8568. module.exports = function(iterator, fn, value, entries){
  8569. try {
  8570. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  8571. // 7.4.6 IteratorClose(iterator, completion)
  8572. } catch(e){
  8573. var ret = iterator['return'];
  8574. if(ret !== undefined)anObject(ret.call(iterator));
  8575. throw e;
  8576. }
  8577. };
  8578. /***/ }),
  8579. /* 88 */
  8580. /***/ (function(module, exports, __webpack_require__) {
  8581. "use strict";
  8582. var LIBRARY = __webpack_require__(38)
  8583. , $export = __webpack_require__(0)
  8584. , redefine = __webpack_require__(16)
  8585. , hide = __webpack_require__(15)
  8586. , has = __webpack_require__(8)
  8587. , Iterators = __webpack_require__(27)
  8588. , $iterCreate = __webpack_require__(159)
  8589. , setToStringTag = __webpack_require__(30)
  8590. , getPrototypeOf = __webpack_require__(164)
  8591. , ITERATOR = __webpack_require__(1)('iterator')
  8592. , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
  8593. , FF_ITERATOR = '@@iterator'
  8594. , KEYS = 'keys'
  8595. , VALUES = 'values';
  8596. var returnThis = function(){ return this; };
  8597. module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
  8598. $iterCreate(Constructor, NAME, next);
  8599. var getMethod = function(kind){
  8600. if(!BUGGY && kind in proto)return proto[kind];
  8601. switch(kind){
  8602. case KEYS: return function keys(){ return new Constructor(this, kind); };
  8603. case VALUES: return function values(){ return new Constructor(this, kind); };
  8604. } return function entries(){ return new Constructor(this, kind); };
  8605. };
  8606. var TAG = NAME + ' Iterator'
  8607. , DEF_VALUES = DEFAULT == VALUES
  8608. , VALUES_BUG = false
  8609. , proto = Base.prototype
  8610. , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
  8611. , $default = $native || getMethod(DEFAULT)
  8612. , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
  8613. , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
  8614. , methods, key, IteratorPrototype;
  8615. // Fix native
  8616. if($anyNative){
  8617. IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
  8618. if(IteratorPrototype !== Object.prototype){
  8619. // Set @@toStringTag to native iterators
  8620. setToStringTag(IteratorPrototype, TAG, true);
  8621. // fix for some old engines
  8622. if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
  8623. }
  8624. }
  8625. // fix Array#{values, @@iterator}.name in V8 / FF
  8626. if(DEF_VALUES && $native && $native.name !== VALUES){
  8627. VALUES_BUG = true;
  8628. $default = function values(){ return $native.call(this); };
  8629. }
  8630. // Define iterator
  8631. if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
  8632. hide(proto, ITERATOR, $default);
  8633. }
  8634. // Plug for library
  8635. Iterators[NAME] = $default;
  8636. Iterators[TAG] = returnThis;
  8637. if(DEFAULT){
  8638. methods = {
  8639. values: DEF_VALUES ? $default : getMethod(VALUES),
  8640. keys: IS_SET ? $default : getMethod(KEYS),
  8641. entries: $entries
  8642. };
  8643. if(FORCED)for(key in methods){
  8644. if(!(key in proto))redefine(proto, key, methods[key]);
  8645. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  8646. }
  8647. return methods;
  8648. };
  8649. /***/ }),
  8650. /* 89 */
  8651. /***/ (function(module, exports) {
  8652. module.exports = function(done, value){
  8653. return {value: value, done: !!done};
  8654. };
  8655. /***/ }),
  8656. /* 90 */
  8657. /***/ (function(module, exports, __webpack_require__) {
  8658. "use strict";
  8659. // 19.1.2.1 Object.assign(target, source, ...)
  8660. var getKeys = __webpack_require__(19)
  8661. , gOPS = __webpack_require__(39)
  8662. , pIE = __webpack_require__(29)
  8663. , toObject = __webpack_require__(21)
  8664. , IObject = __webpack_require__(49)
  8665. , $assign = Object.assign;
  8666. // should work with symbols and should have deterministic property order (V8 bug)
  8667. module.exports = !$assign || __webpack_require__(14)(function(){
  8668. var A = {}
  8669. , B = {}
  8670. , S = Symbol()
  8671. , K = 'abcdefghijklmnopqrst';
  8672. A[S] = 7;
  8673. K.split('').forEach(function(k){ B[k] = k; });
  8674. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  8675. }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
  8676. var T = toObject(target)
  8677. , aLen = arguments.length
  8678. , index = 1
  8679. , getSymbols = gOPS.f
  8680. , isEnum = pIE.f;
  8681. while(aLen > index){
  8682. var S = IObject(arguments[index++])
  8683. , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
  8684. , length = keys.length
  8685. , j = 0
  8686. , key;
  8687. while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
  8688. } return T;
  8689. } : $assign;
  8690. /***/ }),
  8691. /* 91 */
  8692. /***/ (function(module, exports, __webpack_require__) {
  8693. var has = __webpack_require__(8)
  8694. , toIObject = __webpack_require__(9)
  8695. , arrayIndexOf = __webpack_require__(77)(false)
  8696. , IE_PROTO = __webpack_require__(54)('IE_PROTO');
  8697. module.exports = function(object, names){
  8698. var O = toIObject(object)
  8699. , i = 0
  8700. , result = []
  8701. , key;
  8702. for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
  8703. // Don't enum bug & hidden keys
  8704. while(names.length > i)if(has(O, key = names[i++])){
  8705. ~arrayIndexOf(result, key) || result.push(key);
  8706. }
  8707. return result;
  8708. };
  8709. /***/ }),
  8710. /* 92 */
  8711. /***/ (function(module, exports, __webpack_require__) {
  8712. var getKeys = __webpack_require__(19)
  8713. , toIObject = __webpack_require__(9)
  8714. , isEnum = __webpack_require__(29).f;
  8715. module.exports = function(isEntries){
  8716. return function(it){
  8717. var O = toIObject(it)
  8718. , keys = getKeys(O)
  8719. , length = keys.length
  8720. , i = 0
  8721. , result = []
  8722. , key;
  8723. while(length > i)if(isEnum.call(O, key = keys[i++])){
  8724. result.push(isEntries ? [key, O[key]] : O[key]);
  8725. } return result;
  8726. };
  8727. };
  8728. /***/ }),
  8729. /* 93 */
  8730. /***/ (function(module, exports, __webpack_require__) {
  8731. // Works with __proto__ only. Old v8 can't work with null proto objects.
  8732. /* eslint-disable no-proto */
  8733. var isObject = __webpack_require__(4)
  8734. , anObject = __webpack_require__(5);
  8735. var check = function(O, proto){
  8736. anObject(O);
  8737. if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
  8738. };
  8739. module.exports = {
  8740. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  8741. function(test, buggy, set){
  8742. try {
  8743. set = __webpack_require__(12)(Function.call, __webpack_require__(52).f(Object.prototype, '__proto__').set, 2);
  8744. set(test, []);
  8745. buggy = !(test instanceof Array);
  8746. } catch(e){ buggy = true; }
  8747. return function setPrototypeOf(O, proto){
  8748. check(O, proto);
  8749. if(buggy)O.__proto__ = proto;
  8750. else set(O, proto);
  8751. return O;
  8752. };
  8753. }({}, false) : undefined),
  8754. check: check
  8755. };
  8756. /***/ }),
  8757. /* 94 */
  8758. /***/ (function(module, exports, __webpack_require__) {
  8759. "use strict";
  8760. var global = __webpack_require__(3)
  8761. , dP = __webpack_require__(6)
  8762. , DESCRIPTORS = __webpack_require__(7)
  8763. , SPECIES = __webpack_require__(1)('species');
  8764. module.exports = function(KEY){
  8765. var C = global[KEY];
  8766. if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
  8767. configurable: true,
  8768. get: function(){ return this; }
  8769. });
  8770. };
  8771. /***/ }),
  8772. /* 95 */
  8773. /***/ (function(module, exports, __webpack_require__) {
  8774. // https://github.com/tc39/proposal-string-pad-start-end
  8775. var toLength = __webpack_require__(10)
  8776. , repeat = __webpack_require__(96)
  8777. , defined = __webpack_require__(13);
  8778. module.exports = function(that, maxLength, fillString, left){
  8779. var S = String(defined(that))
  8780. , stringLength = S.length
  8781. , fillStr = fillString === undefined ? ' ' : String(fillString)
  8782. , intMaxLength = toLength(maxLength);
  8783. if(intMaxLength <= stringLength || fillStr == '')return S;
  8784. var fillLen = intMaxLength - stringLength
  8785. , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
  8786. if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);
  8787. return left ? stringFiller + S : S + stringFiller;
  8788. };
  8789. /***/ }),
  8790. /* 96 */
  8791. /***/ (function(module, exports, __webpack_require__) {
  8792. "use strict";
  8793. var toInteger = __webpack_require__(42)
  8794. , defined = __webpack_require__(13);
  8795. module.exports = function repeat(count){
  8796. var str = String(defined(this))
  8797. , res = ''
  8798. , n = toInteger(count);
  8799. if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
  8800. for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
  8801. return res;
  8802. };
  8803. /***/ }),
  8804. /* 97 */
  8805. /***/ (function(module, exports, __webpack_require__) {
  8806. exports.f = __webpack_require__(1);
  8807. /***/ }),
  8808. /* 98 */
  8809. /***/ (function(module, exports, __webpack_require__) {
  8810. var classof = __webpack_require__(78)
  8811. , ITERATOR = __webpack_require__(1)('iterator')
  8812. , Iterators = __webpack_require__(27);
  8813. module.exports = __webpack_require__(26).getIteratorMethod = function(it){
  8814. if(it != undefined)return it[ITERATOR]
  8815. || it['@@iterator']
  8816. || Iterators[classof(it)];
  8817. };
  8818. /***/ }),
  8819. /* 99 */
  8820. /***/ (function(module, exports, __webpack_require__) {
  8821. "use strict";
  8822. exports.__esModule = true;
  8823. var _element = __webpack_require__(2);
  8824. var _base = __webpack_require__(11);
  8825. var _base2 = _interopRequireDefault(_base);
  8826. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8827. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8828. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8829. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8830. /**
  8831. * A overlay that renders ALL available rows & columns positioned on top of the original Walkontable instance and all other overlays.
  8832. * Used for debugging purposes to see if the other overlays (that render only part of the rows & columns) are positioned correctly
  8833. *
  8834. * @class DebugOverlay
  8835. */
  8836. var DebugOverlay = function (_Overlay) {
  8837. _inherits(DebugOverlay, _Overlay);
  8838. /**
  8839. * @param {Walkontable} wotInstance
  8840. */
  8841. function DebugOverlay(wotInstance) {
  8842. _classCallCheck(this, DebugOverlay);
  8843. var _this = _possibleConstructorReturn(this, (DebugOverlay.__proto__ || Object.getPrototypeOf(DebugOverlay)).call(this, wotInstance));
  8844. _this.clone = _this.makeClone(_base2.default.CLONE_DEBUG);
  8845. _this.clone.wtTable.holder.style.opacity = 0.4;
  8846. _this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000';
  8847. (0, _element.addClass)(_this.clone.wtTable.holder.parentNode, 'wtDebugVisible');
  8848. return _this;
  8849. }
  8850. return DebugOverlay;
  8851. }(_base2.default);
  8852. _base2.default.registerOverlay(_base2.default.CLONE_DEBUG, DebugOverlay);
  8853. exports.default = DebugOverlay;
  8854. /***/ }),
  8855. /* 100 */
  8856. /***/ (function(module, exports, __webpack_require__) {
  8857. "use strict";
  8858. exports.__esModule = true;
  8859. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8860. var _element = __webpack_require__(2);
  8861. var _base = __webpack_require__(11);
  8862. var _base2 = _interopRequireDefault(_base);
  8863. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8864. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8865. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8866. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8867. /**
  8868. * @class LeftOverlay
  8869. */
  8870. var LeftOverlay = function (_Overlay) {
  8871. _inherits(LeftOverlay, _Overlay);
  8872. /**
  8873. * @param {Walkontable} wotInstance
  8874. */
  8875. function LeftOverlay(wotInstance) {
  8876. _classCallCheck(this, LeftOverlay);
  8877. var _this = _possibleConstructorReturn(this, (LeftOverlay.__proto__ || Object.getPrototypeOf(LeftOverlay)).call(this, wotInstance));
  8878. _this.clone = _this.makeClone(_base2.default.CLONE_LEFT);
  8879. return _this;
  8880. }
  8881. /**
  8882. * Checks if overlay should be fully rendered
  8883. *
  8884. * @returns {Boolean}
  8885. */
  8886. _createClass(LeftOverlay, [{
  8887. key: 'shouldBeRendered',
  8888. value: function shouldBeRendered() {
  8889. return !!(this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length);
  8890. }
  8891. /**
  8892. * Updates the left overlay position
  8893. */
  8894. }, {
  8895. key: 'resetFixedPosition',
  8896. value: function resetFixedPosition() {
  8897. if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
  8898. // removed from DOM
  8899. return;
  8900. }
  8901. var overlayRoot = this.clone.wtTable.holder.parentNode;
  8902. var headerPosition = 0;
  8903. var preventOverflow = this.wot.getSetting('preventOverflow');
  8904. if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {
  8905. var box = this.wot.wtTable.hider.getBoundingClientRect();
  8906. var left = Math.ceil(box.left);
  8907. var right = Math.ceil(box.right);
  8908. var finalLeft = void 0;
  8909. var finalTop = void 0;
  8910. finalTop = this.wot.wtTable.hider.style.top;
  8911. finalTop = finalTop === '' ? 0 : finalTop;
  8912. if (left < 0 && right - overlayRoot.offsetWidth > 0) {
  8913. finalLeft = -left;
  8914. } else {
  8915. finalLeft = 0;
  8916. }
  8917. headerPosition = finalLeft;
  8918. finalLeft += 'px';
  8919. (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);
  8920. } else {
  8921. headerPosition = this.getScrollPosition();
  8922. (0, _element.resetCssTransform)(overlayRoot);
  8923. }
  8924. this.adjustHeaderBordersPosition(headerPosition);
  8925. this.adjustElementsSize();
  8926. }
  8927. /**
  8928. * Sets the main overlay's horizontal scroll position
  8929. *
  8930. * @param {Number} pos
  8931. */
  8932. }, {
  8933. key: 'setScrollPosition',
  8934. value: function setScrollPosition(pos) {
  8935. if (this.mainTableScrollableElement === window) {
  8936. window.scrollTo(pos, (0, _element.getWindowScrollTop)());
  8937. } else {
  8938. this.mainTableScrollableElement.scrollLeft = pos;
  8939. }
  8940. }
  8941. /**
  8942. * Triggers onScroll hook callback
  8943. */
  8944. }, {
  8945. key: 'onScroll',
  8946. value: function onScroll() {
  8947. this.wot.getSetting('onScrollVertically');
  8948. }
  8949. /**
  8950. * Calculates total sum cells width
  8951. *
  8952. * @param {Number} from Column index which calculates started from
  8953. * @param {Number} to Column index where calculation is finished
  8954. * @returns {Number} Width sum
  8955. */
  8956. }, {
  8957. key: 'sumCellSizes',
  8958. value: function sumCellSizes(from, to) {
  8959. var sum = 0;
  8960. var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;
  8961. while (from < to) {
  8962. sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth;
  8963. from++;
  8964. }
  8965. return sum;
  8966. }
  8967. /**
  8968. * Adjust overlay root element, childs and master table element sizes (width, height).
  8969. *
  8970. * @param {Boolean} [force=false]
  8971. */
  8972. }, {
  8973. key: 'adjustElementsSize',
  8974. value: function adjustElementsSize() {
  8975. var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  8976. this.updateTrimmingContainer();
  8977. if (this.needFullRender || force) {
  8978. this.adjustRootElementSize();
  8979. this.adjustRootChildrenSize();
  8980. if (!force) {
  8981. this.areElementSizesAdjusted = true;
  8982. }
  8983. }
  8984. }
  8985. /**
  8986. * Adjust overlay root element size (width and height).
  8987. */
  8988. }, {
  8989. key: 'adjustRootElementSize',
  8990. value: function adjustRootElementSize() {
  8991. var masterHolder = this.wot.wtTable.holder;
  8992. var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : (0, _element.getScrollbarWidth)();
  8993. var overlayRoot = this.clone.wtTable.holder.parentNode;
  8994. var overlayRootStyle = overlayRoot.style;
  8995. var preventOverflow = this.wot.getSetting('preventOverflow');
  8996. var tableWidth = void 0;
  8997. if (this.trimmingContainer !== window || preventOverflow === 'vertical') {
  8998. var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight;
  8999. height = Math.min(height, (0, _element.innerHeight)(this.wot.wtTable.wtRootElement));
  9000. overlayRootStyle.height = height + 'px';
  9001. } else {
  9002. overlayRootStyle.height = '';
  9003. }
  9004. this.clone.wtTable.holder.style.height = overlayRootStyle.height;
  9005. tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);
  9006. overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';
  9007. }
  9008. /**
  9009. * Adjust overlay root childs size
  9010. */
  9011. }, {
  9012. key: 'adjustRootChildrenSize',
  9013. value: function adjustRootChildrenSize() {
  9014. var scrollbarWidth = (0, _element.getScrollbarWidth)();
  9015. this.clone.wtTable.hider.style.height = this.hider.style.height;
  9016. this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;
  9017. if (scrollbarWidth === 0) {
  9018. scrollbarWidth = 30;
  9019. }
  9020. this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px';
  9021. }
  9022. /**
  9023. * Adjust the overlay dimensions and position
  9024. */
  9025. }, {
  9026. key: 'applyToDOM',
  9027. value: function applyToDOM() {
  9028. var total = this.wot.getSetting('totalColumns');
  9029. if (!this.areElementSizesAdjusted) {
  9030. this.adjustElementsSize();
  9031. }
  9032. if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
  9033. this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';
  9034. } else if (total === 0) {
  9035. this.spreader.style.left = '0';
  9036. } else {
  9037. throw new Error('Incorrect value of the columnsRenderCalculator');
  9038. }
  9039. this.spreader.style.right = '';
  9040. if (this.needFullRender) {
  9041. this.syncOverlayOffset();
  9042. }
  9043. }
  9044. /**
  9045. * Synchronize calculated top position to an element
  9046. */
  9047. }, {
  9048. key: 'syncOverlayOffset',
  9049. value: function syncOverlayOffset() {
  9050. if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
  9051. this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';
  9052. } else {
  9053. this.clone.wtTable.spreader.style.top = '';
  9054. }
  9055. }
  9056. /**
  9057. * Scrolls horizontally to a column at the left edge of the viewport
  9058. *
  9059. * @param sourceCol {Number} Column index which you want to scroll to
  9060. * @param [beyondRendered=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)
  9061. */
  9062. }, {
  9063. key: 'scrollTo',
  9064. value: function scrollTo(sourceCol, beyondRendered) {
  9065. var newX = this.getTableParentOffset();
  9066. var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
  9067. var mainHolder = sourceInstance.wtTable.holder;
  9068. var scrollbarCompensation = 0;
  9069. if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {
  9070. scrollbarCompensation = (0, _element.getScrollbarWidth)();
  9071. }
  9072. if (beyondRendered) {
  9073. newX += this.sumCellSizes(0, sourceCol + 1);
  9074. newX -= this.wot.wtViewport.getViewportWidth();
  9075. } else {
  9076. newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);
  9077. }
  9078. newX += scrollbarCompensation;
  9079. this.setScrollPosition(newX);
  9080. }
  9081. /**
  9082. * Gets table parent left position
  9083. *
  9084. * @returns {Number}
  9085. */
  9086. }, {
  9087. key: 'getTableParentOffset',
  9088. value: function getTableParentOffset() {
  9089. var preventOverflow = this.wot.getSetting('preventOverflow');
  9090. var offset = 0;
  9091. if (!preventOverflow && this.trimmingContainer === window) {
  9092. offset = this.wot.wtTable.holderOffset.left;
  9093. }
  9094. return offset;
  9095. }
  9096. /**
  9097. * Gets the main overlay's horizontal scroll position
  9098. *
  9099. * @returns {Number} Main table's vertical scroll position
  9100. */
  9101. }, {
  9102. key: 'getScrollPosition',
  9103. value: function getScrollPosition() {
  9104. return (0, _element.getScrollLeft)(this.mainTableScrollableElement);
  9105. }
  9106. /**
  9107. * Adds css classes to hide the header border's header (cell-selection border hiding issue)
  9108. *
  9109. * @param {Number} position Header X position if trimming container is window or scroll top if not
  9110. */
  9111. }, {
  9112. key: 'adjustHeaderBordersPosition',
  9113. value: function adjustHeaderBordersPosition(position) {
  9114. var masterParent = this.wot.wtTable.holder.parentNode;
  9115. var rowHeaders = this.wot.getSetting('rowHeaders');
  9116. var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');
  9117. var totalRows = this.wot.getSetting('totalRows');
  9118. if (totalRows) {
  9119. (0, _element.removeClass)(masterParent, 'emptyRows');
  9120. } else {
  9121. (0, _element.addClass)(masterParent, 'emptyRows');
  9122. }
  9123. if (fixedColumnsLeft && !rowHeaders.length) {
  9124. (0, _element.addClass)(masterParent, 'innerBorderLeft');
  9125. } else if (!fixedColumnsLeft && rowHeaders.length) {
  9126. var previousState = (0, _element.hasClass)(masterParent, 'innerBorderLeft');
  9127. if (position) {
  9128. (0, _element.addClass)(masterParent, 'innerBorderLeft');
  9129. } else {
  9130. (0, _element.removeClass)(masterParent, 'innerBorderLeft');
  9131. }
  9132. if (!previousState && position || previousState && !position) {
  9133. this.wot.wtOverlays.adjustElementsSize();
  9134. }
  9135. }
  9136. }
  9137. }]);
  9138. return LeftOverlay;
  9139. }(_base2.default);
  9140. _base2.default.registerOverlay(_base2.default.CLONE_LEFT, LeftOverlay);
  9141. exports.default = LeftOverlay;
  9142. /***/ }),
  9143. /* 101 */
  9144. /***/ (function(module, exports, __webpack_require__) {
  9145. "use strict";
  9146. exports.__esModule = true;
  9147. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9148. var _element = __webpack_require__(2);
  9149. var _base = __webpack_require__(11);
  9150. var _base2 = _interopRequireDefault(_base);
  9151. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9152. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9153. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9154. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9155. /**
  9156. * @class TopOverlay
  9157. */
  9158. var TopOverlay = function (_Overlay) {
  9159. _inherits(TopOverlay, _Overlay);
  9160. /**
  9161. * @param {Walkontable} wotInstance
  9162. */
  9163. function TopOverlay(wotInstance) {
  9164. _classCallCheck(this, TopOverlay);
  9165. var _this = _possibleConstructorReturn(this, (TopOverlay.__proto__ || Object.getPrototypeOf(TopOverlay)).call(this, wotInstance));
  9166. _this.clone = _this.makeClone(_base2.default.CLONE_TOP);
  9167. return _this;
  9168. }
  9169. /**
  9170. * Checks if overlay should be fully rendered
  9171. *
  9172. * @returns {Boolean}
  9173. */
  9174. _createClass(TopOverlay, [{
  9175. key: 'shouldBeRendered',
  9176. value: function shouldBeRendered() {
  9177. return !!(this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length);
  9178. }
  9179. /**
  9180. * Updates the top overlay position
  9181. */
  9182. }, {
  9183. key: 'resetFixedPosition',
  9184. value: function resetFixedPosition() {
  9185. if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
  9186. // removed from DOM
  9187. return;
  9188. }
  9189. var overlayRoot = this.clone.wtTable.holder.parentNode;
  9190. var headerPosition = 0;
  9191. var preventOverflow = this.wot.getSetting('preventOverflow');
  9192. if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) {
  9193. var box = this.wot.wtTable.hider.getBoundingClientRect();
  9194. var top = Math.ceil(box.top);
  9195. var bottom = Math.ceil(box.bottom);
  9196. var finalLeft = void 0;
  9197. var finalTop = void 0;
  9198. finalLeft = this.wot.wtTable.hider.style.left;
  9199. finalLeft = finalLeft === '' ? 0 : finalLeft;
  9200. if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {
  9201. finalTop = -top;
  9202. } else {
  9203. finalTop = 0;
  9204. }
  9205. headerPosition = finalTop;
  9206. finalTop += 'px';
  9207. (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);
  9208. } else {
  9209. headerPosition = this.getScrollPosition();
  9210. (0, _element.resetCssTransform)(overlayRoot);
  9211. }
  9212. this.adjustHeaderBordersPosition(headerPosition);
  9213. this.adjustElementsSize();
  9214. }
  9215. /**
  9216. * Sets the main overlay's vertical scroll position
  9217. *
  9218. * @param {Number} pos
  9219. */
  9220. }, {
  9221. key: 'setScrollPosition',
  9222. value: function setScrollPosition(pos) {
  9223. if (this.mainTableScrollableElement === window) {
  9224. window.scrollTo((0, _element.getWindowScrollLeft)(), pos);
  9225. } else {
  9226. this.mainTableScrollableElement.scrollTop = pos;
  9227. }
  9228. }
  9229. /**
  9230. * Triggers onScroll hook callback
  9231. */
  9232. }, {
  9233. key: 'onScroll',
  9234. value: function onScroll() {
  9235. this.wot.getSetting('onScrollHorizontally');
  9236. }
  9237. /**
  9238. * Calculates total sum cells height
  9239. *
  9240. * @param {Number} from Row index which calculates started from
  9241. * @param {Number} to Row index where calculation is finished
  9242. * @returns {Number} Height sum
  9243. */
  9244. }, {
  9245. key: 'sumCellSizes',
  9246. value: function sumCellSizes(from, to) {
  9247. var sum = 0;
  9248. var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;
  9249. while (from < to) {
  9250. var height = this.wot.wtTable.getRowHeight(from);
  9251. sum += height === void 0 ? defaultRowHeight : height;
  9252. from++;
  9253. }
  9254. return sum;
  9255. }
  9256. /**
  9257. * Adjust overlay root element, childs and master table element sizes (width, height).
  9258. *
  9259. * @param {Boolean} [force=false]
  9260. */
  9261. }, {
  9262. key: 'adjustElementsSize',
  9263. value: function adjustElementsSize() {
  9264. var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  9265. this.updateTrimmingContainer();
  9266. if (this.needFullRender || force) {
  9267. this.adjustRootElementSize();
  9268. this.adjustRootChildrenSize();
  9269. if (!force) {
  9270. this.areElementSizesAdjusted = true;
  9271. }
  9272. }
  9273. }
  9274. /**
  9275. * Adjust overlay root element size (width and height).
  9276. */
  9277. }, {
  9278. key: 'adjustRootElementSize',
  9279. value: function adjustRootElementSize() {
  9280. var masterHolder = this.wot.wtTable.holder;
  9281. var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : (0, _element.getScrollbarWidth)();
  9282. var overlayRoot = this.clone.wtTable.holder.parentNode;
  9283. var overlayRootStyle = overlayRoot.style;
  9284. var preventOverflow = this.wot.getSetting('preventOverflow');
  9285. var tableHeight = void 0;
  9286. if (this.trimmingContainer !== window || preventOverflow === 'horizontal') {
  9287. var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth;
  9288. width = Math.min(width, (0, _element.innerWidth)(this.wot.wtTable.wtRootElement));
  9289. overlayRootStyle.width = width + 'px';
  9290. } else {
  9291. overlayRootStyle.width = '';
  9292. }
  9293. this.clone.wtTable.holder.style.width = overlayRootStyle.width;
  9294. tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);
  9295. overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';
  9296. }
  9297. /**
  9298. * Adjust overlay root childs size
  9299. */
  9300. }, {
  9301. key: 'adjustRootChildrenSize',
  9302. value: function adjustRootChildrenSize() {
  9303. var scrollbarWidth = (0, _element.getScrollbarWidth)();
  9304. this.clone.wtTable.hider.style.width = this.hider.style.width;
  9305. this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width;
  9306. if (scrollbarWidth === 0) {
  9307. scrollbarWidth = 30;
  9308. }
  9309. this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px';
  9310. }
  9311. /**
  9312. * Adjust the overlay dimensions and position
  9313. */
  9314. }, {
  9315. key: 'applyToDOM',
  9316. value: function applyToDOM() {
  9317. var total = this.wot.getSetting('totalRows');
  9318. if (!this.areElementSizesAdjusted) {
  9319. this.adjustElementsSize();
  9320. }
  9321. if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
  9322. this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';
  9323. } else if (total === 0) {
  9324. // can happen if there are 0 rows
  9325. this.spreader.style.top = '0';
  9326. } else {
  9327. throw new Error('Incorrect value of the rowsRenderCalculator');
  9328. }
  9329. this.spreader.style.bottom = '';
  9330. if (this.needFullRender) {
  9331. this.syncOverlayOffset();
  9332. }
  9333. }
  9334. /**
  9335. * Synchronize calculated left position to an element
  9336. */
  9337. }, {
  9338. key: 'syncOverlayOffset',
  9339. value: function syncOverlayOffset() {
  9340. if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
  9341. this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';
  9342. } else {
  9343. this.clone.wtTable.spreader.style.left = '';
  9344. }
  9345. }
  9346. /**
  9347. * Scrolls vertically to a row
  9348. *
  9349. * @param sourceRow {Number} Row index which you want to scroll to
  9350. * @param [bottomEdge=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)
  9351. */
  9352. }, {
  9353. key: 'scrollTo',
  9354. value: function scrollTo(sourceRow, bottomEdge) {
  9355. var newY = this.getTableParentOffset();
  9356. var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
  9357. var mainHolder = sourceInstance.wtTable.holder;
  9358. var scrollbarCompensation = 0;
  9359. if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {
  9360. scrollbarCompensation = (0, _element.getScrollbarWidth)();
  9361. }
  9362. if (bottomEdge) {
  9363. var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
  9364. var fixedRowsTop = this.wot.getSetting('fixedRowsTop');
  9365. var totalRows = this.wot.getSetting('totalRows');
  9366. newY += this.sumCellSizes(0, sourceRow + 1);
  9367. newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows);
  9368. // Fix 1 pixel offset when cell is selected
  9369. newY += 1;
  9370. } else {
  9371. newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow);
  9372. }
  9373. newY += scrollbarCompensation;
  9374. this.setScrollPosition(newY);
  9375. }
  9376. /**
  9377. * Gets table parent top position
  9378. *
  9379. * @returns {Number}
  9380. */
  9381. }, {
  9382. key: 'getTableParentOffset',
  9383. value: function getTableParentOffset() {
  9384. if (this.mainTableScrollableElement === window) {
  9385. return this.wot.wtTable.holderOffset.top;
  9386. }
  9387. return 0;
  9388. }
  9389. /**
  9390. * Gets the main overlay's vertical scroll position
  9391. *
  9392. * @returns {Number} Main table's vertical scroll position
  9393. */
  9394. }, {
  9395. key: 'getScrollPosition',
  9396. value: function getScrollPosition() {
  9397. return (0, _element.getScrollTop)(this.mainTableScrollableElement);
  9398. }
  9399. /**
  9400. * Redraw borders of selection
  9401. *
  9402. * @param {WalkontableSelection} selection Selection for redraw
  9403. */
  9404. }, {
  9405. key: 'redrawSelectionBorders',
  9406. value: function redrawSelectionBorders(selection) {
  9407. if (selection && selection.cellRange) {
  9408. var border = selection.getBorder(this.wot);
  9409. if (border) {
  9410. var corners = selection.getCorners();
  9411. border.disappear();
  9412. border.appear(corners);
  9413. }
  9414. }
  9415. }
  9416. /**
  9417. * Redrawing borders of all selections
  9418. */
  9419. }, {
  9420. key: 'redrawAllSelectionsBorders',
  9421. value: function redrawAllSelectionsBorders() {
  9422. var selections = this.wot.selections;
  9423. this.redrawSelectionBorders(selections.current);
  9424. this.redrawSelectionBorders(selections.area);
  9425. this.redrawSelectionBorders(selections.fill);
  9426. this.wot.wtTable.wot.wtOverlays.leftOverlay.refresh();
  9427. }
  9428. /**
  9429. * Adds css classes to hide the header border's header (cell-selection border hiding issue)
  9430. *
  9431. * @param {Number} position Header Y position if trimming container is window or scroll top if not
  9432. */
  9433. }, {
  9434. key: 'adjustHeaderBordersPosition',
  9435. value: function adjustHeaderBordersPosition(position) {
  9436. var masterParent = this.wot.wtTable.holder.parentNode;
  9437. var totalColumns = this.wot.getSetting('totalColumns');
  9438. if (totalColumns) {
  9439. (0, _element.removeClass)(masterParent, 'emptyColumns');
  9440. } else {
  9441. (0, _element.addClass)(masterParent, 'emptyColumns');
  9442. }
  9443. if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) {
  9444. var previousState = (0, _element.hasClass)(masterParent, 'innerBorderTop');
  9445. if (position || this.wot.getSetting('totalRows') === 0) {
  9446. (0, _element.addClass)(masterParent, 'innerBorderTop');
  9447. } else {
  9448. (0, _element.removeClass)(masterParent, 'innerBorderTop');
  9449. }
  9450. if (!previousState && position || previousState && !position) {
  9451. this.wot.wtOverlays.adjustElementsSize();
  9452. // cell borders should be positioned once again,
  9453. // because we added / removed 1px border from table header
  9454. this.redrawAllSelectionsBorders();
  9455. }
  9456. }
  9457. // nasty workaround for double border in the header, TODO: find a pure-css solution
  9458. if (this.wot.getSetting('rowHeaders').length === 0) {
  9459. var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');
  9460. if (secondHeaderCell) {
  9461. for (var i = 0; i < secondHeaderCell.length; i++) {
  9462. secondHeaderCell[i].style['border-left-width'] = 0;
  9463. }
  9464. }
  9465. }
  9466. }
  9467. }]);
  9468. return TopOverlay;
  9469. }(_base2.default);
  9470. _base2.default.registerOverlay(_base2.default.CLONE_TOP, TopOverlay);
  9471. exports.default = TopOverlay;
  9472. /***/ }),
  9473. /* 102 */
  9474. /***/ (function(module, exports, __webpack_require__) {
  9475. "use strict";
  9476. exports.__esModule = true;
  9477. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9478. var _element = __webpack_require__(2);
  9479. var _base = __webpack_require__(11);
  9480. var _base2 = _interopRequireDefault(_base);
  9481. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9482. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9483. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9484. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9485. /**
  9486. * @class TopLeftCornerOverlay
  9487. */
  9488. var TopLeftCornerOverlay = function (_Overlay) {
  9489. _inherits(TopLeftCornerOverlay, _Overlay);
  9490. /**
  9491. * @param {Walkontable} wotInstance
  9492. */
  9493. function TopLeftCornerOverlay(wotInstance) {
  9494. _classCallCheck(this, TopLeftCornerOverlay);
  9495. var _this = _possibleConstructorReturn(this, (TopLeftCornerOverlay.__proto__ || Object.getPrototypeOf(TopLeftCornerOverlay)).call(this, wotInstance));
  9496. _this.clone = _this.makeClone(_base2.default.CLONE_TOP_LEFT_CORNER);
  9497. return _this;
  9498. }
  9499. /**
  9500. * Checks if overlay should be fully rendered
  9501. *
  9502. * @returns {Boolean}
  9503. */
  9504. _createClass(TopLeftCornerOverlay, [{
  9505. key: 'shouldBeRendered',
  9506. value: function shouldBeRendered() {
  9507. return !!((this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length));
  9508. }
  9509. /**
  9510. * Updates the corner overlay position
  9511. */
  9512. }, {
  9513. key: 'resetFixedPosition',
  9514. value: function resetFixedPosition() {
  9515. this.updateTrimmingContainer();
  9516. if (!this.wot.wtTable.holder.parentNode) {
  9517. // removed from DOM
  9518. return;
  9519. }
  9520. var overlayRoot = this.clone.wtTable.holder.parentNode;
  9521. var tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);
  9522. var tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);
  9523. var preventOverflow = this.wot.getSetting('preventOverflow');
  9524. if (this.trimmingContainer === window) {
  9525. var box = this.wot.wtTable.hider.getBoundingClientRect();
  9526. var top = Math.ceil(box.top);
  9527. var left = Math.ceil(box.left);
  9528. var bottom = Math.ceil(box.bottom);
  9529. var right = Math.ceil(box.right);
  9530. var finalLeft = '0';
  9531. var finalTop = '0';
  9532. if (!preventOverflow || preventOverflow === 'vertical') {
  9533. if (left < 0 && right - overlayRoot.offsetWidth > 0) {
  9534. finalLeft = -left + 'px';
  9535. }
  9536. }
  9537. if (!preventOverflow || preventOverflow === 'horizontal') {
  9538. if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {
  9539. finalTop = -top + 'px';
  9540. }
  9541. }
  9542. (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);
  9543. } else {
  9544. (0, _element.resetCssTransform)(overlayRoot);
  9545. }
  9546. overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';
  9547. overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';
  9548. }
  9549. }]);
  9550. return TopLeftCornerOverlay;
  9551. }(_base2.default);
  9552. _base2.default.registerOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, TopLeftCornerOverlay);
  9553. exports.default = TopLeftCornerOverlay;
  9554. /***/ }),
  9555. /* 103 */
  9556. /***/ (function(module, exports, __webpack_require__) {
  9557. "use strict";
  9558. exports.__esModule = true;
  9559. 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; };
  9560. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9561. var _element = __webpack_require__(2);
  9562. var _border2 = __webpack_require__(59);
  9563. var _border3 = _interopRequireDefault(_border2);
  9564. var _coords = __webpack_require__(22);
  9565. var _coords2 = _interopRequireDefault(_coords);
  9566. var _range = __webpack_require__(43);
  9567. var _range2 = _interopRequireDefault(_range);
  9568. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9569. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9570. /**
  9571. * @class Selection
  9572. */
  9573. var Selection = function () {
  9574. /**
  9575. * @param {Object} settings
  9576. * @param {CellRange} cellRange
  9577. */
  9578. function Selection(settings, cellRange) {
  9579. _classCallCheck(this, Selection);
  9580. this.settings = settings;
  9581. this.cellRange = cellRange || null;
  9582. this.instanceBorders = {};
  9583. }
  9584. /**
  9585. * Each Walkontable clone requires it's own border for every selection. This method creates and returns selection
  9586. * borders per instance
  9587. *
  9588. * @param {Walkontable} wotInstance
  9589. * @returns {Border}
  9590. */
  9591. _createClass(Selection, [{
  9592. key: 'getBorder',
  9593. value: function getBorder(wotInstance) {
  9594. if (this.instanceBorders[wotInstance.guid]) {
  9595. return this.instanceBorders[wotInstance.guid];
  9596. }
  9597. // where is this returned?
  9598. this.instanceBorders[wotInstance.guid] = new _border3.default(wotInstance, this.settings);
  9599. }
  9600. /**
  9601. * Checks if selection is empty
  9602. *
  9603. * @returns {Boolean}
  9604. */
  9605. }, {
  9606. key: 'isEmpty',
  9607. value: function isEmpty() {
  9608. return this.cellRange === null;
  9609. }
  9610. /**
  9611. * Adds a cell coords to the selection
  9612. *
  9613. * @param {CellCoords} coords
  9614. */
  9615. }, {
  9616. key: 'add',
  9617. value: function add(coords) {
  9618. if (this.isEmpty()) {
  9619. this.cellRange = new _range2.default(coords, coords, coords);
  9620. } else {
  9621. this.cellRange.expand(coords);
  9622. }
  9623. }
  9624. /**
  9625. * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean
  9626. * information about success
  9627. *
  9628. * @param {CellCoords} oldCoords
  9629. * @param {CellCoords} newCoords
  9630. * @returns {Boolean}
  9631. */
  9632. }, {
  9633. key: 'replace',
  9634. value: function replace(oldCoords, newCoords) {
  9635. if (!this.isEmpty()) {
  9636. if (this.cellRange.from.isEqual(oldCoords)) {
  9637. this.cellRange.from = newCoords;
  9638. return true;
  9639. }
  9640. if (this.cellRange.to.isEqual(oldCoords)) {
  9641. this.cellRange.to = newCoords;
  9642. return true;
  9643. }
  9644. }
  9645. return false;
  9646. }
  9647. /**
  9648. * Clears selection
  9649. */
  9650. }, {
  9651. key: 'clear',
  9652. value: function clear() {
  9653. this.cellRange = null;
  9654. }
  9655. /**
  9656. * Returns the top left (TL) and bottom right (BR) selection coordinates
  9657. *
  9658. * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`
  9659. */
  9660. }, {
  9661. key: 'getCorners',
  9662. value: function getCorners() {
  9663. var topLeft = this.cellRange.getTopLeftCorner();
  9664. var bottomRight = this.cellRange.getBottomRightCorner();
  9665. return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];
  9666. }
  9667. /**
  9668. * Adds class name to cell element at given coords
  9669. *
  9670. * @param {Walkontable} wotInstance Walkontable instance
  9671. * @param {Number} sourceRow Cell row coord
  9672. * @param {Number} sourceColumn Cell column coord
  9673. * @param {String} className Class name
  9674. */
  9675. }, {
  9676. key: 'addClassAtCoords',
  9677. value: function addClassAtCoords(wotInstance, sourceRow, sourceColumn, className) {
  9678. var TD = wotInstance.wtTable.getCell(new _coords2.default(sourceRow, sourceColumn));
  9679. if ((typeof TD === 'undefined' ? 'undefined' : _typeof(TD)) === 'object') {
  9680. (0, _element.addClass)(TD, className);
  9681. }
  9682. }
  9683. /**
  9684. * @param wotInstance
  9685. */
  9686. }, {
  9687. key: 'draw',
  9688. value: function draw(wotInstance) {
  9689. if (this.isEmpty()) {
  9690. if (this.settings.border) {
  9691. var border = this.getBorder(wotInstance);
  9692. if (border) {
  9693. border.disappear();
  9694. }
  9695. }
  9696. return;
  9697. }
  9698. var renderedRows = wotInstance.wtTable.getRenderedRowsCount();
  9699. var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();
  9700. var corners = this.getCorners();
  9701. var sourceRow = void 0,
  9702. sourceCol = void 0,
  9703. TH = void 0;
  9704. for (var column = 0; column < renderedColumns; column++) {
  9705. sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);
  9706. if (sourceCol >= corners[1] && sourceCol <= corners[3]) {
  9707. TH = wotInstance.wtTable.getColumnHeader(sourceCol);
  9708. if (TH) {
  9709. var newClasses = [];
  9710. if (this.settings.highlightHeaderClassName) {
  9711. newClasses.push(this.settings.highlightHeaderClassName);
  9712. }
  9713. if (this.settings.highlightColumnClassName) {
  9714. newClasses.push(this.settings.highlightColumnClassName);
  9715. }
  9716. (0, _element.addClass)(TH, newClasses);
  9717. }
  9718. }
  9719. }
  9720. for (var row = 0; row < renderedRows; row++) {
  9721. sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);
  9722. if (sourceRow >= corners[0] && sourceRow <= corners[2]) {
  9723. TH = wotInstance.wtTable.getRowHeader(sourceRow);
  9724. if (TH) {
  9725. var _newClasses = [];
  9726. if (this.settings.highlightHeaderClassName) {
  9727. _newClasses.push(this.settings.highlightHeaderClassName);
  9728. }
  9729. if (this.settings.highlightRowClassName) {
  9730. _newClasses.push(this.settings.highlightRowClassName);
  9731. }
  9732. (0, _element.addClass)(TH, _newClasses);
  9733. }
  9734. }
  9735. for (var _column = 0; _column < renderedColumns; _column++) {
  9736. sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(_column);
  9737. if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) {
  9738. // selected cell
  9739. if (this.settings.className) {
  9740. this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className);
  9741. }
  9742. } else if (sourceRow >= corners[0] && sourceRow <= corners[2]) {
  9743. // selection is in this row
  9744. if (this.settings.highlightRowClassName) {
  9745. this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName);
  9746. }
  9747. } else if (sourceCol >= corners[1] && sourceCol <= corners[3]) {
  9748. // selection is in this column
  9749. if (this.settings.highlightColumnClassName) {
  9750. this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName);
  9751. }
  9752. }
  9753. }
  9754. }
  9755. wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);
  9756. if (this.settings.border) {
  9757. var _border = this.getBorder(wotInstance);
  9758. if (_border) {
  9759. // warning! border.appear modifies corners!
  9760. _border.appear(corners);
  9761. }
  9762. }
  9763. }
  9764. }]);
  9765. return Selection;
  9766. }();
  9767. exports.default = Selection;
  9768. /***/ }),
  9769. /* 104 */
  9770. /***/ (function(module, exports, __webpack_require__) {
  9771. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  9772. var $export = __webpack_require__(0);
  9773. $export($export.P, 'Array', {copyWithin: __webpack_require__(151)});
  9774. __webpack_require__(17)('copyWithin');
  9775. /***/ }),
  9776. /* 105 */
  9777. /***/ (function(module, exports, __webpack_require__) {
  9778. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  9779. var $export = __webpack_require__(0);
  9780. $export($export.P, 'Array', {fill: __webpack_require__(152)});
  9781. __webpack_require__(17)('fill');
  9782. /***/ }),
  9783. /* 106 */
  9784. /***/ (function(module, exports, __webpack_require__) {
  9785. "use strict";
  9786. // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
  9787. var $export = __webpack_require__(0)
  9788. , $find = __webpack_require__(34)(6)
  9789. , KEY = 'findIndex'
  9790. , forced = true;
  9791. // Shouldn't skip holes
  9792. if(KEY in [])Array(1)[KEY](function(){ forced = false; });
  9793. $export($export.P + $export.F * forced, 'Array', {
  9794. findIndex: function findIndex(callbackfn/*, that = undefined */){
  9795. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  9796. }
  9797. });
  9798. __webpack_require__(17)(KEY);
  9799. /***/ }),
  9800. /* 107 */
  9801. /***/ (function(module, exports, __webpack_require__) {
  9802. "use strict";
  9803. // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
  9804. var $export = __webpack_require__(0)
  9805. , $find = __webpack_require__(34)(5)
  9806. , KEY = 'find'
  9807. , forced = true;
  9808. // Shouldn't skip holes
  9809. if(KEY in [])Array(1)[KEY](function(){ forced = false; });
  9810. $export($export.P + $export.F * forced, 'Array', {
  9811. find: function find(callbackfn/*, that = undefined */){
  9812. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  9813. }
  9814. });
  9815. __webpack_require__(17)(KEY);
  9816. /***/ }),
  9817. /* 108 */
  9818. /***/ (function(module, exports, __webpack_require__) {
  9819. "use strict";
  9820. var ctx = __webpack_require__(12)
  9821. , $export = __webpack_require__(0)
  9822. , toObject = __webpack_require__(21)
  9823. , call = __webpack_require__(87)
  9824. , isArrayIter = __webpack_require__(83)
  9825. , toLength = __webpack_require__(10)
  9826. , createProperty = __webpack_require__(45)
  9827. , getIterFn = __webpack_require__(98);
  9828. $export($export.S + $export.F * !__webpack_require__(50)(function(iter){ Array.from(iter); }), 'Array', {
  9829. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  9830. from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
  9831. var O = toObject(arrayLike)
  9832. , C = typeof this == 'function' ? this : Array
  9833. , aLen = arguments.length
  9834. , mapfn = aLen > 1 ? arguments[1] : undefined
  9835. , mapping = mapfn !== undefined
  9836. , index = 0
  9837. , iterFn = getIterFn(O)
  9838. , length, result, step, iterator;
  9839. if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  9840. // if object isn't iterable or it's array with default iterator - use simple case
  9841. if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
  9842. for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
  9843. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  9844. }
  9845. } else {
  9846. length = toLength(O.length);
  9847. for(result = new C(length); length > index; index++){
  9848. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  9849. }
  9850. }
  9851. result.length = index;
  9852. return result;
  9853. }
  9854. });
  9855. /***/ }),
  9856. /* 109 */
  9857. /***/ (function(module, exports, __webpack_require__) {
  9858. "use strict";
  9859. var $export = __webpack_require__(0)
  9860. , createProperty = __webpack_require__(45);
  9861. // WebKit Array.of isn't generic
  9862. $export($export.S + $export.F * __webpack_require__(14)(function(){
  9863. function F(){}
  9864. return !(Array.of.call(F) instanceof F);
  9865. }), 'Array', {
  9866. // 22.1.2.3 Array.of( ...items)
  9867. of: function of(/* ...args */){
  9868. var index = 0
  9869. , aLen = arguments.length
  9870. , result = new (typeof this == 'function' ? this : Array)(aLen);
  9871. while(aLen > index)createProperty(result, index, arguments[index++]);
  9872. result.length = aLen;
  9873. return result;
  9874. }
  9875. });
  9876. /***/ }),
  9877. /* 110 */
  9878. /***/ (function(module, exports, __webpack_require__) {
  9879. var dP = __webpack_require__(6).f
  9880. , createDesc = __webpack_require__(20)
  9881. , has = __webpack_require__(8)
  9882. , FProto = Function.prototype
  9883. , nameRE = /^\s*function ([^ (]*)/
  9884. , NAME = 'name';
  9885. var isExtensible = Object.isExtensible || function(){
  9886. return true;
  9887. };
  9888. // 19.2.4.2 name
  9889. NAME in FProto || __webpack_require__(7) && dP(FProto, NAME, {
  9890. configurable: true,
  9891. get: function(){
  9892. try {
  9893. var that = this
  9894. , name = ('' + that).match(nameRE)[1];
  9895. has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));
  9896. return name;
  9897. } catch(e){
  9898. return '';
  9899. }
  9900. }
  9901. });
  9902. /***/ }),
  9903. /* 111 */
  9904. /***/ (function(module, exports, __webpack_require__) {
  9905. "use strict";
  9906. var strong = __webpack_require__(79);
  9907. // 23.1 Map Objects
  9908. module.exports = __webpack_require__(35)('Map', function(get){
  9909. return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  9910. }, {
  9911. // 23.1.3.6 Map.prototype.get(key)
  9912. get: function get(key){
  9913. var entry = strong.getEntry(this, key);
  9914. return entry && entry.v;
  9915. },
  9916. // 23.1.3.9 Map.prototype.set(key, value)
  9917. set: function set(key, value){
  9918. return strong.def(this, key === 0 ? 0 : key, value);
  9919. }
  9920. }, strong, true);
  9921. /***/ }),
  9922. /* 112 */
  9923. /***/ (function(module, exports, __webpack_require__) {
  9924. // 20.1.2.1 Number.EPSILON
  9925. var $export = __webpack_require__(0);
  9926. $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});
  9927. /***/ }),
  9928. /* 113 */
  9929. /***/ (function(module, exports, __webpack_require__) {
  9930. // 20.1.2.2 Number.isFinite(number)
  9931. var $export = __webpack_require__(0)
  9932. , _isFinite = __webpack_require__(3).isFinite;
  9933. $export($export.S, 'Number', {
  9934. isFinite: function isFinite(it){
  9935. return typeof it == 'number' && _isFinite(it);
  9936. }
  9937. });
  9938. /***/ }),
  9939. /* 114 */
  9940. /***/ (function(module, exports, __webpack_require__) {
  9941. // 20.1.2.3 Number.isInteger(number)
  9942. var $export = __webpack_require__(0);
  9943. $export($export.S, 'Number', {isInteger: __webpack_require__(85)});
  9944. /***/ }),
  9945. /* 115 */
  9946. /***/ (function(module, exports, __webpack_require__) {
  9947. // 20.1.2.4 Number.isNaN(number)
  9948. var $export = __webpack_require__(0);
  9949. $export($export.S, 'Number', {
  9950. isNaN: function isNaN(number){
  9951. return number != number;
  9952. }
  9953. });
  9954. /***/ }),
  9955. /* 116 */
  9956. /***/ (function(module, exports, __webpack_require__) {
  9957. // 20.1.2.5 Number.isSafeInteger(number)
  9958. var $export = __webpack_require__(0)
  9959. , isInteger = __webpack_require__(85)
  9960. , abs = Math.abs;
  9961. $export($export.S, 'Number', {
  9962. isSafeInteger: function isSafeInteger(number){
  9963. return isInteger(number) && abs(number) <= 0x1fffffffffffff;
  9964. }
  9965. });
  9966. /***/ }),
  9967. /* 117 */
  9968. /***/ (function(module, exports, __webpack_require__) {
  9969. // 20.1.2.6 Number.MAX_SAFE_INTEGER
  9970. var $export = __webpack_require__(0);
  9971. $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});
  9972. /***/ }),
  9973. /* 118 */
  9974. /***/ (function(module, exports, __webpack_require__) {
  9975. // 20.1.2.10 Number.MIN_SAFE_INTEGER
  9976. var $export = __webpack_require__(0);
  9977. $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});
  9978. /***/ }),
  9979. /* 119 */
  9980. /***/ (function(module, exports, __webpack_require__) {
  9981. // 19.1.3.1 Object.assign(target, source)
  9982. var $export = __webpack_require__(0);
  9983. $export($export.S + $export.F, 'Object', {assign: __webpack_require__(90)});
  9984. /***/ }),
  9985. /* 120 */
  9986. /***/ (function(module, exports, __webpack_require__) {
  9987. // 19.1.3.10 Object.is(value1, value2)
  9988. var $export = __webpack_require__(0);
  9989. $export($export.S, 'Object', {is: __webpack_require__(166)});
  9990. /***/ }),
  9991. /* 121 */
  9992. /***/ (function(module, exports, __webpack_require__) {
  9993. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  9994. var $export = __webpack_require__(0);
  9995. $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(93).set});
  9996. /***/ }),
  9997. /* 122 */
  9998. /***/ (function(module, exports, __webpack_require__) {
  9999. "use strict";
  10000. var LIBRARY = __webpack_require__(38)
  10001. , global = __webpack_require__(3)
  10002. , ctx = __webpack_require__(12)
  10003. , classof = __webpack_require__(78)
  10004. , $export = __webpack_require__(0)
  10005. , isObject = __webpack_require__(4)
  10006. , aFunction = __webpack_require__(44)
  10007. , anInstance = __webpack_require__(33)
  10008. , forOf = __webpack_require__(37)
  10009. , speciesConstructor = __webpack_require__(167)
  10010. , task = __webpack_require__(57).set
  10011. , microtask = __webpack_require__(161)()
  10012. , PROMISE = 'Promise'
  10013. , TypeError = global.TypeError
  10014. , process = global.process
  10015. , $Promise = global[PROMISE]
  10016. , process = global.process
  10017. , isNode = classof(process) == 'process'
  10018. , empty = function(){ /* empty */ }
  10019. , Internal, GenericPromiseCapability, Wrapper;
  10020. var USE_NATIVE = !!function(){
  10021. try {
  10022. // correct subclassing with @@species support
  10023. var promise = $Promise.resolve(1)
  10024. , FakePromise = (promise.constructor = {})[__webpack_require__(1)('species')] = function(exec){ exec(empty, empty); };
  10025. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  10026. return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
  10027. } catch(e){ /* empty */ }
  10028. }();
  10029. // helpers
  10030. var sameConstructor = function(a, b){
  10031. // with library wrapper special case
  10032. return a === b || a === $Promise && b === Wrapper;
  10033. };
  10034. var isThenable = function(it){
  10035. var then;
  10036. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  10037. };
  10038. var newPromiseCapability = function(C){
  10039. return sameConstructor($Promise, C)
  10040. ? new PromiseCapability(C)
  10041. : new GenericPromiseCapability(C);
  10042. };
  10043. var PromiseCapability = GenericPromiseCapability = function(C){
  10044. var resolve, reject;
  10045. this.promise = new C(function($$resolve, $$reject){
  10046. if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
  10047. resolve = $$resolve;
  10048. reject = $$reject;
  10049. });
  10050. this.resolve = aFunction(resolve);
  10051. this.reject = aFunction(reject);
  10052. };
  10053. var perform = function(exec){
  10054. try {
  10055. exec();
  10056. } catch(e){
  10057. return {error: e};
  10058. }
  10059. };
  10060. var notify = function(promise, isReject){
  10061. if(promise._n)return;
  10062. promise._n = true;
  10063. var chain = promise._c;
  10064. microtask(function(){
  10065. var value = promise._v
  10066. , ok = promise._s == 1
  10067. , i = 0;
  10068. var run = function(reaction){
  10069. var handler = ok ? reaction.ok : reaction.fail
  10070. , resolve = reaction.resolve
  10071. , reject = reaction.reject
  10072. , domain = reaction.domain
  10073. , result, then;
  10074. try {
  10075. if(handler){
  10076. if(!ok){
  10077. if(promise._h == 2)onHandleUnhandled(promise);
  10078. promise._h = 1;
  10079. }
  10080. if(handler === true)result = value;
  10081. else {
  10082. if(domain)domain.enter();
  10083. result = handler(value);
  10084. if(domain)domain.exit();
  10085. }
  10086. if(result === reaction.promise){
  10087. reject(TypeError('Promise-chain cycle'));
  10088. } else if(then = isThenable(result)){
  10089. then.call(result, resolve, reject);
  10090. } else resolve(result);
  10091. } else reject(value);
  10092. } catch(e){
  10093. reject(e);
  10094. }
  10095. };
  10096. while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
  10097. promise._c = [];
  10098. promise._n = false;
  10099. if(isReject && !promise._h)onUnhandled(promise);
  10100. });
  10101. };
  10102. var onUnhandled = function(promise){
  10103. task.call(global, function(){
  10104. var value = promise._v
  10105. , abrupt, handler, console;
  10106. if(isUnhandled(promise)){
  10107. abrupt = perform(function(){
  10108. if(isNode){
  10109. process.emit('unhandledRejection', value, promise);
  10110. } else if(handler = global.onunhandledrejection){
  10111. handler({promise: promise, reason: value});
  10112. } else if((console = global.console) && console.error){
  10113. console.error('Unhandled promise rejection', value);
  10114. }
  10115. });
  10116. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  10117. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  10118. } promise._a = undefined;
  10119. if(abrupt)throw abrupt.error;
  10120. });
  10121. };
  10122. var isUnhandled = function(promise){
  10123. if(promise._h == 1)return false;
  10124. var chain = promise._a || promise._c
  10125. , i = 0
  10126. , reaction;
  10127. while(chain.length > i){
  10128. reaction = chain[i++];
  10129. if(reaction.fail || !isUnhandled(reaction.promise))return false;
  10130. } return true;
  10131. };
  10132. var onHandleUnhandled = function(promise){
  10133. task.call(global, function(){
  10134. var handler;
  10135. if(isNode){
  10136. process.emit('rejectionHandled', promise);
  10137. } else if(handler = global.onrejectionhandled){
  10138. handler({promise: promise, reason: promise._v});
  10139. }
  10140. });
  10141. };
  10142. var $reject = function(value){
  10143. var promise = this;
  10144. if(promise._d)return;
  10145. promise._d = true;
  10146. promise = promise._w || promise; // unwrap
  10147. promise._v = value;
  10148. promise._s = 2;
  10149. if(!promise._a)promise._a = promise._c.slice();
  10150. notify(promise, true);
  10151. };
  10152. var $resolve = function(value){
  10153. var promise = this
  10154. , then;
  10155. if(promise._d)return;
  10156. promise._d = true;
  10157. promise = promise._w || promise; // unwrap
  10158. try {
  10159. if(promise === value)throw TypeError("Promise can't be resolved itself");
  10160. if(then = isThenable(value)){
  10161. microtask(function(){
  10162. var wrapper = {_w: promise, _d: false}; // wrap
  10163. try {
  10164. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  10165. } catch(e){
  10166. $reject.call(wrapper, e);
  10167. }
  10168. });
  10169. } else {
  10170. promise._v = value;
  10171. promise._s = 1;
  10172. notify(promise, false);
  10173. }
  10174. } catch(e){
  10175. $reject.call({_w: promise, _d: false}, e); // wrap
  10176. }
  10177. };
  10178. // constructor polyfill
  10179. if(!USE_NATIVE){
  10180. // 25.4.3.1 Promise(executor)
  10181. $Promise = function Promise(executor){
  10182. anInstance(this, $Promise, PROMISE, '_h');
  10183. aFunction(executor);
  10184. Internal.call(this);
  10185. try {
  10186. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  10187. } catch(err){
  10188. $reject.call(this, err);
  10189. }
  10190. };
  10191. Internal = function Promise(executor){
  10192. this._c = []; // <- awaiting reactions
  10193. this._a = undefined; // <- checked in isUnhandled reactions
  10194. this._s = 0; // <- state
  10195. this._d = false; // <- done
  10196. this._v = undefined; // <- value
  10197. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  10198. this._n = false; // <- notify
  10199. };
  10200. Internal.prototype = __webpack_require__(40)($Promise.prototype, {
  10201. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  10202. then: function then(onFulfilled, onRejected){
  10203. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  10204. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  10205. reaction.fail = typeof onRejected == 'function' && onRejected;
  10206. reaction.domain = isNode ? process.domain : undefined;
  10207. this._c.push(reaction);
  10208. if(this._a)this._a.push(reaction);
  10209. if(this._s)notify(this, false);
  10210. return reaction.promise;
  10211. },
  10212. // 25.4.5.1 Promise.prototype.catch(onRejected)
  10213. 'catch': function(onRejected){
  10214. return this.then(undefined, onRejected);
  10215. }
  10216. });
  10217. PromiseCapability = function(){
  10218. var promise = new Internal;
  10219. this.promise = promise;
  10220. this.resolve = ctx($resolve, promise, 1);
  10221. this.reject = ctx($reject, promise, 1);
  10222. };
  10223. }
  10224. $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
  10225. __webpack_require__(30)($Promise, PROMISE);
  10226. __webpack_require__(94)(PROMISE);
  10227. Wrapper = __webpack_require__(26)[PROMISE];
  10228. // statics
  10229. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  10230. // 25.4.4.5 Promise.reject(r)
  10231. reject: function reject(r){
  10232. var capability = newPromiseCapability(this)
  10233. , $$reject = capability.reject;
  10234. $$reject(r);
  10235. return capability.promise;
  10236. }
  10237. });
  10238. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  10239. // 25.4.4.6 Promise.resolve(x)
  10240. resolve: function resolve(x){
  10241. // instanceof instead of internal slot check because we should fix it without replacement native Promise core
  10242. if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
  10243. var capability = newPromiseCapability(this)
  10244. , $$resolve = capability.resolve;
  10245. $$resolve(x);
  10246. return capability.promise;
  10247. }
  10248. });
  10249. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(50)(function(iter){
  10250. $Promise.all(iter)['catch'](empty);
  10251. })), PROMISE, {
  10252. // 25.4.4.1 Promise.all(iterable)
  10253. all: function all(iterable){
  10254. var C = this
  10255. , capability = newPromiseCapability(C)
  10256. , resolve = capability.resolve
  10257. , reject = capability.reject;
  10258. var abrupt = perform(function(){
  10259. var values = []
  10260. , index = 0
  10261. , remaining = 1;
  10262. forOf(iterable, false, function(promise){
  10263. var $index = index++
  10264. , alreadyCalled = false;
  10265. values.push(undefined);
  10266. remaining++;
  10267. C.resolve(promise).then(function(value){
  10268. if(alreadyCalled)return;
  10269. alreadyCalled = true;
  10270. values[$index] = value;
  10271. --remaining || resolve(values);
  10272. }, reject);
  10273. });
  10274. --remaining || resolve(values);
  10275. });
  10276. if(abrupt)reject(abrupt.error);
  10277. return capability.promise;
  10278. },
  10279. // 25.4.4.4 Promise.race(iterable)
  10280. race: function race(iterable){
  10281. var C = this
  10282. , capability = newPromiseCapability(C)
  10283. , reject = capability.reject;
  10284. var abrupt = perform(function(){
  10285. forOf(iterable, false, function(promise){
  10286. C.resolve(promise).then(capability.resolve, reject);
  10287. });
  10288. });
  10289. if(abrupt)reject(abrupt.error);
  10290. return capability.promise;
  10291. }
  10292. });
  10293. /***/ }),
  10294. /* 123 */
  10295. /***/ (function(module, exports, __webpack_require__) {
  10296. // 21.2.5.3 get RegExp.prototype.flags()
  10297. if(__webpack_require__(7) && /./g.flags != 'g')__webpack_require__(6).f(RegExp.prototype, 'flags', {
  10298. configurable: true,
  10299. get: __webpack_require__(156)
  10300. });
  10301. /***/ }),
  10302. /* 124 */
  10303. /***/ (function(module, exports, __webpack_require__) {
  10304. // @@match logic
  10305. __webpack_require__(36)('match', 1, function(defined, MATCH, $match){
  10306. // 21.1.3.11 String.prototype.match(regexp)
  10307. return [function match(regexp){
  10308. 'use strict';
  10309. var O = defined(this)
  10310. , fn = regexp == undefined ? undefined : regexp[MATCH];
  10311. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  10312. }, $match];
  10313. });
  10314. /***/ }),
  10315. /* 125 */
  10316. /***/ (function(module, exports, __webpack_require__) {
  10317. // @@replace logic
  10318. __webpack_require__(36)('replace', 2, function(defined, REPLACE, $replace){
  10319. // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
  10320. return [function replace(searchValue, replaceValue){
  10321. 'use strict';
  10322. var O = defined(this)
  10323. , fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  10324. return fn !== undefined
  10325. ? fn.call(searchValue, O, replaceValue)
  10326. : $replace.call(String(O), searchValue, replaceValue);
  10327. }, $replace];
  10328. });
  10329. /***/ }),
  10330. /* 126 */
  10331. /***/ (function(module, exports, __webpack_require__) {
  10332. // @@search logic
  10333. __webpack_require__(36)('search', 1, function(defined, SEARCH, $search){
  10334. // 21.1.3.15 String.prototype.search(regexp)
  10335. return [function search(regexp){
  10336. 'use strict';
  10337. var O = defined(this)
  10338. , fn = regexp == undefined ? undefined : regexp[SEARCH];
  10339. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  10340. }, $search];
  10341. });
  10342. /***/ }),
  10343. /* 127 */
  10344. /***/ (function(module, exports, __webpack_require__) {
  10345. // @@split logic
  10346. __webpack_require__(36)('split', 2, function(defined, SPLIT, $split){
  10347. 'use strict';
  10348. var isRegExp = __webpack_require__(86)
  10349. , _split = $split
  10350. , $push = [].push
  10351. , $SPLIT = 'split'
  10352. , LENGTH = 'length'
  10353. , LAST_INDEX = 'lastIndex';
  10354. if(
  10355. 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
  10356. 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
  10357. 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
  10358. '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
  10359. '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
  10360. ''[$SPLIT](/.?/)[LENGTH]
  10361. ){
  10362. var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
  10363. // based on es5-shim implementation, need to rework it
  10364. $split = function(separator, limit){
  10365. var string = String(this);
  10366. if(separator === undefined && limit === 0)return [];
  10367. // If `separator` is not a regex, use native split
  10368. if(!isRegExp(separator))return _split.call(string, separator, limit);
  10369. var output = [];
  10370. var flags = (separator.ignoreCase ? 'i' : '') +
  10371. (separator.multiline ? 'm' : '') +
  10372. (separator.unicode ? 'u' : '') +
  10373. (separator.sticky ? 'y' : '');
  10374. var lastLastIndex = 0;
  10375. var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
  10376. // Make `global` and avoid `lastIndex` issues by working with a copy
  10377. var separatorCopy = new RegExp(separator.source, flags + 'g');
  10378. var separator2, match, lastIndex, lastLength, i;
  10379. // Doesn't need flags gy, but they don't hurt
  10380. if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
  10381. while(match = separatorCopy.exec(string)){
  10382. // `separatorCopy.lastIndex` is not reliable cross-browser
  10383. lastIndex = match.index + match[0][LENGTH];
  10384. if(lastIndex > lastLastIndex){
  10385. output.push(string.slice(lastLastIndex, match.index));
  10386. // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
  10387. if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){
  10388. for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;
  10389. });
  10390. if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));
  10391. lastLength = match[0][LENGTH];
  10392. lastLastIndex = lastIndex;
  10393. if(output[LENGTH] >= splitLimit)break;
  10394. }
  10395. if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
  10396. }
  10397. if(lastLastIndex === string[LENGTH]){
  10398. if(lastLength || !separatorCopy.test(''))output.push('');
  10399. } else output.push(string.slice(lastLastIndex));
  10400. return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
  10401. };
  10402. // Chakra, V8
  10403. } else if('0'[$SPLIT](undefined, 0)[LENGTH]){
  10404. $split = function(separator, limit){
  10405. return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
  10406. };
  10407. }
  10408. // 21.1.3.17 String.prototype.split(separator, limit)
  10409. return [function split(separator, limit){
  10410. var O = defined(this)
  10411. , fn = separator == undefined ? undefined : separator[SPLIT];
  10412. return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
  10413. }, $split];
  10414. });
  10415. /***/ }),
  10416. /* 128 */
  10417. /***/ (function(module, exports, __webpack_require__) {
  10418. "use strict";
  10419. var strong = __webpack_require__(79);
  10420. // 23.2 Set Objects
  10421. module.exports = __webpack_require__(35)('Set', function(get){
  10422. return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  10423. }, {
  10424. // 23.2.3.1 Set.prototype.add(value)
  10425. add: function add(value){
  10426. return strong.def(this, value = value === 0 ? 0 : value, value);
  10427. }
  10428. }, strong);
  10429. /***/ }),
  10430. /* 129 */
  10431. /***/ (function(module, exports, __webpack_require__) {
  10432. "use strict";
  10433. var $export = __webpack_require__(0)
  10434. , $at = __webpack_require__(168)(false);
  10435. $export($export.P, 'String', {
  10436. // 21.1.3.3 String.prototype.codePointAt(pos)
  10437. codePointAt: function codePointAt(pos){
  10438. return $at(this, pos);
  10439. }
  10440. });
  10441. /***/ }),
  10442. /* 130 */
  10443. /***/ (function(module, exports, __webpack_require__) {
  10444. "use strict";
  10445. // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
  10446. var $export = __webpack_require__(0)
  10447. , toLength = __webpack_require__(10)
  10448. , context = __webpack_require__(56)
  10449. , ENDS_WITH = 'endsWith'
  10450. , $endsWith = ''[ENDS_WITH];
  10451. $export($export.P + $export.F * __webpack_require__(48)(ENDS_WITH), 'String', {
  10452. endsWith: function endsWith(searchString /*, endPosition = @length */){
  10453. var that = context(this, searchString, ENDS_WITH)
  10454. , endPosition = arguments.length > 1 ? arguments[1] : undefined
  10455. , len = toLength(that.length)
  10456. , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)
  10457. , search = String(searchString);
  10458. return $endsWith
  10459. ? $endsWith.call(that, search, end)
  10460. : that.slice(end - search.length, end) === search;
  10461. }
  10462. });
  10463. /***/ }),
  10464. /* 131 */
  10465. /***/ (function(module, exports, __webpack_require__) {
  10466. var $export = __webpack_require__(0)
  10467. , toIndex = __webpack_require__(41)
  10468. , fromCharCode = String.fromCharCode
  10469. , $fromCodePoint = String.fromCodePoint;
  10470. // length should be 1, old FF problem
  10471. $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  10472. // 21.1.2.2 String.fromCodePoint(...codePoints)
  10473. fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars
  10474. var res = []
  10475. , aLen = arguments.length
  10476. , i = 0
  10477. , code;
  10478. while(aLen > i){
  10479. code = +arguments[i++];
  10480. if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
  10481. res.push(code < 0x10000
  10482. ? fromCharCode(code)
  10483. : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
  10484. );
  10485. } return res.join('');
  10486. }
  10487. });
  10488. /***/ }),
  10489. /* 132 */
  10490. /***/ (function(module, exports, __webpack_require__) {
  10491. "use strict";
  10492. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  10493. var $export = __webpack_require__(0)
  10494. , context = __webpack_require__(56)
  10495. , INCLUDES = 'includes';
  10496. $export($export.P + $export.F * __webpack_require__(48)(INCLUDES), 'String', {
  10497. includes: function includes(searchString /*, position = 0 */){
  10498. return !!~context(this, searchString, INCLUDES)
  10499. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  10500. }
  10501. });
  10502. /***/ }),
  10503. /* 133 */
  10504. /***/ (function(module, exports, __webpack_require__) {
  10505. var $export = __webpack_require__(0)
  10506. , toIObject = __webpack_require__(9)
  10507. , toLength = __webpack_require__(10);
  10508. $export($export.S, 'String', {
  10509. // 21.1.2.4 String.raw(callSite, ...substitutions)
  10510. raw: function raw(callSite){
  10511. var tpl = toIObject(callSite.raw)
  10512. , len = toLength(tpl.length)
  10513. , aLen = arguments.length
  10514. , res = []
  10515. , i = 0;
  10516. while(len > i){
  10517. res.push(String(tpl[i++]));
  10518. if(i < aLen)res.push(String(arguments[i]));
  10519. } return res.join('');
  10520. }
  10521. });
  10522. /***/ }),
  10523. /* 134 */
  10524. /***/ (function(module, exports, __webpack_require__) {
  10525. var $export = __webpack_require__(0);
  10526. $export($export.P, 'String', {
  10527. // 21.1.3.13 String.prototype.repeat(count)
  10528. repeat: __webpack_require__(96)
  10529. });
  10530. /***/ }),
  10531. /* 135 */
  10532. /***/ (function(module, exports, __webpack_require__) {
  10533. "use strict";
  10534. // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
  10535. var $export = __webpack_require__(0)
  10536. , toLength = __webpack_require__(10)
  10537. , context = __webpack_require__(56)
  10538. , STARTS_WITH = 'startsWith'
  10539. , $startsWith = ''[STARTS_WITH];
  10540. $export($export.P + $export.F * __webpack_require__(48)(STARTS_WITH), 'String', {
  10541. startsWith: function startsWith(searchString /*, position = 0 */){
  10542. var that = context(this, searchString, STARTS_WITH)
  10543. , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))
  10544. , search = String(searchString);
  10545. return $startsWith
  10546. ? $startsWith.call(that, search, index)
  10547. : that.slice(index, index + search.length) === search;
  10548. }
  10549. });
  10550. /***/ }),
  10551. /* 136 */
  10552. /***/ (function(module, exports, __webpack_require__) {
  10553. "use strict";
  10554. // ECMAScript 6 symbols shim
  10555. var global = __webpack_require__(3)
  10556. , has = __webpack_require__(8)
  10557. , DESCRIPTORS = __webpack_require__(7)
  10558. , $export = __webpack_require__(0)
  10559. , redefine = __webpack_require__(16)
  10560. , META = __webpack_require__(28).KEY
  10561. , $fails = __webpack_require__(14)
  10562. , shared = __webpack_require__(55)
  10563. , setToStringTag = __webpack_require__(30)
  10564. , uid = __webpack_require__(31)
  10565. , wks = __webpack_require__(1)
  10566. , wksExt = __webpack_require__(97)
  10567. , wksDefine = __webpack_require__(169)
  10568. , keyOf = __webpack_require__(160)
  10569. , enumKeys = __webpack_require__(155)
  10570. , isArray = __webpack_require__(84)
  10571. , anObject = __webpack_require__(5)
  10572. , toIObject = __webpack_require__(9)
  10573. , toPrimitive = __webpack_require__(58)
  10574. , createDesc = __webpack_require__(20)
  10575. , _create = __webpack_require__(51)
  10576. , gOPNExt = __webpack_require__(163)
  10577. , $GOPD = __webpack_require__(52)
  10578. , $DP = __webpack_require__(6)
  10579. , $keys = __webpack_require__(19)
  10580. , gOPD = $GOPD.f
  10581. , dP = $DP.f
  10582. , gOPN = gOPNExt.f
  10583. , $Symbol = global.Symbol
  10584. , $JSON = global.JSON
  10585. , _stringify = $JSON && $JSON.stringify
  10586. , PROTOTYPE = 'prototype'
  10587. , HIDDEN = wks('_hidden')
  10588. , TO_PRIMITIVE = wks('toPrimitive')
  10589. , isEnum = {}.propertyIsEnumerable
  10590. , SymbolRegistry = shared('symbol-registry')
  10591. , AllSymbols = shared('symbols')
  10592. , OPSymbols = shared('op-symbols')
  10593. , ObjectProto = Object[PROTOTYPE]
  10594. , USE_NATIVE = typeof $Symbol == 'function'
  10595. , QObject = global.QObject;
  10596. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  10597. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  10598. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  10599. var setSymbolDesc = DESCRIPTORS && $fails(function(){
  10600. return _create(dP({}, 'a', {
  10601. get: function(){ return dP(this, 'a', {value: 7}).a; }
  10602. })).a != 7;
  10603. }) ? function(it, key, D){
  10604. var protoDesc = gOPD(ObjectProto, key);
  10605. if(protoDesc)delete ObjectProto[key];
  10606. dP(it, key, D);
  10607. if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
  10608. } : dP;
  10609. var wrap = function(tag){
  10610. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  10611. sym._k = tag;
  10612. return sym;
  10613. };
  10614. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
  10615. return typeof it == 'symbol';
  10616. } : function(it){
  10617. return it instanceof $Symbol;
  10618. };
  10619. var $defineProperty = function defineProperty(it, key, D){
  10620. if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
  10621. anObject(it);
  10622. key = toPrimitive(key, true);
  10623. anObject(D);
  10624. if(has(AllSymbols, key)){
  10625. if(!D.enumerable){
  10626. if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
  10627. it[HIDDEN][key] = true;
  10628. } else {
  10629. if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
  10630. D = _create(D, {enumerable: createDesc(0, false)});
  10631. } return setSymbolDesc(it, key, D);
  10632. } return dP(it, key, D);
  10633. };
  10634. var $defineProperties = function defineProperties(it, P){
  10635. anObject(it);
  10636. var keys = enumKeys(P = toIObject(P))
  10637. , i = 0
  10638. , l = keys.length
  10639. , key;
  10640. while(l > i)$defineProperty(it, key = keys[i++], P[key]);
  10641. return it;
  10642. };
  10643. var $create = function create(it, P){
  10644. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  10645. };
  10646. var $propertyIsEnumerable = function propertyIsEnumerable(key){
  10647. var E = isEnum.call(this, key = toPrimitive(key, true));
  10648. if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
  10649. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  10650. };
  10651. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
  10652. it = toIObject(it);
  10653. key = toPrimitive(key, true);
  10654. if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
  10655. var D = gOPD(it, key);
  10656. if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
  10657. return D;
  10658. };
  10659. var $getOwnPropertyNames = function getOwnPropertyNames(it){
  10660. var names = gOPN(toIObject(it))
  10661. , result = []
  10662. , i = 0
  10663. , key;
  10664. while(names.length > i){
  10665. if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
  10666. } return result;
  10667. };
  10668. var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
  10669. var IS_OP = it === ObjectProto
  10670. , names = gOPN(IS_OP ? OPSymbols : toIObject(it))
  10671. , result = []
  10672. , i = 0
  10673. , key;
  10674. while(names.length > i){
  10675. if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
  10676. } return result;
  10677. };
  10678. // 19.4.1.1 Symbol([description])
  10679. if(!USE_NATIVE){
  10680. $Symbol = function Symbol(){
  10681. if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
  10682. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  10683. var $set = function(value){
  10684. if(this === ObjectProto)$set.call(OPSymbols, value);
  10685. if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
  10686. setSymbolDesc(this, tag, createDesc(1, value));
  10687. };
  10688. if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
  10689. return wrap(tag);
  10690. };
  10691. redefine($Symbol[PROTOTYPE], 'toString', function toString(){
  10692. return this._k;
  10693. });
  10694. $GOPD.f = $getOwnPropertyDescriptor;
  10695. $DP.f = $defineProperty;
  10696. __webpack_require__(53).f = gOPNExt.f = $getOwnPropertyNames;
  10697. __webpack_require__(29).f = $propertyIsEnumerable;
  10698. __webpack_require__(39).f = $getOwnPropertySymbols;
  10699. if(DESCRIPTORS && !__webpack_require__(38)){
  10700. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  10701. }
  10702. wksExt.f = function(name){
  10703. return wrap(wks(name));
  10704. }
  10705. }
  10706. $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
  10707. for(var symbols = (
  10708. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  10709. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  10710. ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
  10711. for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
  10712. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  10713. // 19.4.2.1 Symbol.for(key)
  10714. 'for': function(key){
  10715. return has(SymbolRegistry, key += '')
  10716. ? SymbolRegistry[key]
  10717. : SymbolRegistry[key] = $Symbol(key);
  10718. },
  10719. // 19.4.2.5 Symbol.keyFor(sym)
  10720. keyFor: function keyFor(key){
  10721. if(isSymbol(key))return keyOf(SymbolRegistry, key);
  10722. throw TypeError(key + ' is not a symbol!');
  10723. },
  10724. useSetter: function(){ setter = true; },
  10725. useSimple: function(){ setter = false; }
  10726. });
  10727. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  10728. // 19.1.2.2 Object.create(O [, Properties])
  10729. create: $create,
  10730. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  10731. defineProperty: $defineProperty,
  10732. // 19.1.2.3 Object.defineProperties(O, Properties)
  10733. defineProperties: $defineProperties,
  10734. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  10735. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  10736. // 19.1.2.7 Object.getOwnPropertyNames(O)
  10737. getOwnPropertyNames: $getOwnPropertyNames,
  10738. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  10739. getOwnPropertySymbols: $getOwnPropertySymbols
  10740. });
  10741. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  10742. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
  10743. var S = $Symbol();
  10744. // MS Edge converts symbol values to JSON as {}
  10745. // WebKit converts symbol values to JSON as null
  10746. // V8 throws on boxed symbols
  10747. return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
  10748. })), 'JSON', {
  10749. stringify: function stringify(it){
  10750. if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
  10751. var args = [it]
  10752. , i = 1
  10753. , replacer, $replacer;
  10754. while(arguments.length > i)args.push(arguments[i++]);
  10755. replacer = args[1];
  10756. if(typeof replacer == 'function')$replacer = replacer;
  10757. if($replacer || !isArray(replacer))replacer = function(key, value){
  10758. if($replacer)value = $replacer.call(this, key, value);
  10759. if(!isSymbol(value))return value;
  10760. };
  10761. args[1] = replacer;
  10762. return _stringify.apply($JSON, args);
  10763. }
  10764. });
  10765. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  10766. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(15)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  10767. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  10768. setToStringTag($Symbol, 'Symbol');
  10769. // 20.2.1.9 Math[@@toStringTag]
  10770. setToStringTag(Math, 'Math', true);
  10771. // 24.3.3 JSON[@@toStringTag]
  10772. setToStringTag(global.JSON, 'JSON', true);
  10773. /***/ }),
  10774. /* 137 */
  10775. /***/ (function(module, exports, __webpack_require__) {
  10776. "use strict";
  10777. var each = __webpack_require__(34)(0)
  10778. , redefine = __webpack_require__(16)
  10779. , meta = __webpack_require__(28)
  10780. , assign = __webpack_require__(90)
  10781. , weak = __webpack_require__(80)
  10782. , isObject = __webpack_require__(4)
  10783. , getWeak = meta.getWeak
  10784. , isExtensible = Object.isExtensible
  10785. , uncaughtFrozenStore = weak.ufstore
  10786. , tmp = {}
  10787. , InternalMap;
  10788. var wrapper = function(get){
  10789. return function WeakMap(){
  10790. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  10791. };
  10792. };
  10793. var methods = {
  10794. // 23.3.3.3 WeakMap.prototype.get(key)
  10795. get: function get(key){
  10796. if(isObject(key)){
  10797. var data = getWeak(key);
  10798. if(data === true)return uncaughtFrozenStore(this).get(key);
  10799. return data ? data[this._i] : undefined;
  10800. }
  10801. },
  10802. // 23.3.3.5 WeakMap.prototype.set(key, value)
  10803. set: function set(key, value){
  10804. return weak.def(this, key, value);
  10805. }
  10806. };
  10807. // 23.3 WeakMap Objects
  10808. var $WeakMap = module.exports = __webpack_require__(35)('WeakMap', wrapper, methods, weak, true, true);
  10809. // IE11 WeakMap frozen keys fix
  10810. if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
  10811. InternalMap = weak.getConstructor(wrapper);
  10812. assign(InternalMap.prototype, methods);
  10813. meta.NEED = true;
  10814. each(['delete', 'has', 'get', 'set'], function(key){
  10815. var proto = $WeakMap.prototype
  10816. , method = proto[key];
  10817. redefine(proto, key, function(a, b){
  10818. // store frozen objects on internal weakmap shim
  10819. if(isObject(a) && !isExtensible(a)){
  10820. if(!this._f)this._f = new InternalMap;
  10821. var result = this._f[key](a, b);
  10822. return key == 'set' ? this : result;
  10823. // store all the rest on native weakmap
  10824. } return method.call(this, a, b);
  10825. });
  10826. });
  10827. }
  10828. /***/ }),
  10829. /* 138 */
  10830. /***/ (function(module, exports, __webpack_require__) {
  10831. "use strict";
  10832. var weak = __webpack_require__(80);
  10833. // 23.4 WeakSet Objects
  10834. __webpack_require__(35)('WeakSet', function(get){
  10835. return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  10836. }, {
  10837. // 23.4.3.1 WeakSet.prototype.add(value)
  10838. add: function add(value){
  10839. return weak.def(this, value, true);
  10840. }
  10841. }, weak, false, true);
  10842. /***/ }),
  10843. /* 139 */
  10844. /***/ (function(module, exports, __webpack_require__) {
  10845. "use strict";
  10846. // https://github.com/tc39/Array.prototype.includes
  10847. var $export = __webpack_require__(0)
  10848. , $includes = __webpack_require__(77)(true);
  10849. $export($export.P, 'Array', {
  10850. includes: function includes(el /*, fromIndex = 0 */){
  10851. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  10852. }
  10853. });
  10854. __webpack_require__(17)('includes');
  10855. /***/ }),
  10856. /* 140 */
  10857. /***/ (function(module, exports, __webpack_require__) {
  10858. // https://github.com/tc39/proposal-object-values-entries
  10859. var $export = __webpack_require__(0)
  10860. , $entries = __webpack_require__(92)(true);
  10861. $export($export.S, 'Object', {
  10862. entries: function entries(it){
  10863. return $entries(it);
  10864. }
  10865. });
  10866. /***/ }),
  10867. /* 141 */
  10868. /***/ (function(module, exports, __webpack_require__) {
  10869. // https://github.com/tc39/proposal-object-getownpropertydescriptors
  10870. var $export = __webpack_require__(0)
  10871. , ownKeys = __webpack_require__(165)
  10872. , toIObject = __webpack_require__(9)
  10873. , gOPD = __webpack_require__(52)
  10874. , createProperty = __webpack_require__(45);
  10875. $export($export.S, 'Object', {
  10876. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){
  10877. var O = toIObject(object)
  10878. , getDesc = gOPD.f
  10879. , keys = ownKeys(O)
  10880. , result = {}
  10881. , i = 0
  10882. , key;
  10883. while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));
  10884. return result;
  10885. }
  10886. });
  10887. /***/ }),
  10888. /* 142 */
  10889. /***/ (function(module, exports, __webpack_require__) {
  10890. // https://github.com/tc39/proposal-object-values-entries
  10891. var $export = __webpack_require__(0)
  10892. , $values = __webpack_require__(92)(false);
  10893. $export($export.S, 'Object', {
  10894. values: function values(it){
  10895. return $values(it);
  10896. }
  10897. });
  10898. /***/ }),
  10899. /* 143 */
  10900. /***/ (function(module, exports, __webpack_require__) {
  10901. "use strict";
  10902. // https://github.com/tc39/proposal-string-pad-start-end
  10903. var $export = __webpack_require__(0)
  10904. , $pad = __webpack_require__(95);
  10905. $export($export.P, 'String', {
  10906. padEnd: function padEnd(maxLength /*, fillString = ' ' */){
  10907. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
  10908. }
  10909. });
  10910. /***/ }),
  10911. /* 144 */
  10912. /***/ (function(module, exports, __webpack_require__) {
  10913. "use strict";
  10914. // https://github.com/tc39/proposal-string-pad-start-end
  10915. var $export = __webpack_require__(0)
  10916. , $pad = __webpack_require__(95);
  10917. $export($export.P, 'String', {
  10918. padStart: function padStart(maxLength /*, fillString = ' ' */){
  10919. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
  10920. }
  10921. });
  10922. /***/ }),
  10923. /* 145 */
  10924. /***/ (function(module, exports, __webpack_require__) {
  10925. var $iterators = __webpack_require__(72)
  10926. , redefine = __webpack_require__(16)
  10927. , global = __webpack_require__(3)
  10928. , hide = __webpack_require__(15)
  10929. , Iterators = __webpack_require__(27)
  10930. , wks = __webpack_require__(1)
  10931. , ITERATOR = wks('iterator')
  10932. , TO_STRING_TAG = wks('toStringTag')
  10933. , ArrayValues = Iterators.Array;
  10934. for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
  10935. var NAME = collections[i]
  10936. , Collection = global[NAME]
  10937. , proto = Collection && Collection.prototype
  10938. , key;
  10939. if(proto){
  10940. if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);
  10941. if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
  10942. Iterators[NAME] = ArrayValues;
  10943. for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);
  10944. }
  10945. }
  10946. /***/ }),
  10947. /* 146 */
  10948. /***/ (function(module, exports, __webpack_require__) {
  10949. var $export = __webpack_require__(0)
  10950. , $task = __webpack_require__(57);
  10951. $export($export.G + $export.B, {
  10952. setImmediate: $task.set,
  10953. clearImmediate: $task.clear
  10954. });
  10955. /***/ }),
  10956. /* 147 */
  10957. /***/ (function(module, exports, __webpack_require__) {
  10958. "use strict";
  10959. exports.__esModule = true;
  10960. exports.Viewport = exports.TableRenderer = exports.Table = exports.Settings = exports.Selection = exports.Scroll = exports.Overlays = exports.Event = exports.Core = exports.default = exports.Border = exports.TopLeftCornerOverlay = exports.TopOverlay = exports.LeftOverlay = exports.DebugOverlay = exports.RowFilter = exports.ColumnFilter = exports.CellRange = exports.CellCoords = exports.ViewportRowsCalculator = exports.ViewportColumnsCalculator = undefined;
  10961. __webpack_require__(111);
  10962. __webpack_require__(128);
  10963. __webpack_require__(137);
  10964. __webpack_require__(138);
  10965. __webpack_require__(122);
  10966. __webpack_require__(136);
  10967. __webpack_require__(119);
  10968. __webpack_require__(120);
  10969. __webpack_require__(121);
  10970. __webpack_require__(110);
  10971. __webpack_require__(133);
  10972. __webpack_require__(131);
  10973. __webpack_require__(129);
  10974. __webpack_require__(134);
  10975. __webpack_require__(135);
  10976. __webpack_require__(130);
  10977. __webpack_require__(132);
  10978. __webpack_require__(123);
  10979. __webpack_require__(124);
  10980. __webpack_require__(125);
  10981. __webpack_require__(127);
  10982. __webpack_require__(126);
  10983. __webpack_require__(108);
  10984. __webpack_require__(109);
  10985. __webpack_require__(104);
  10986. __webpack_require__(107);
  10987. __webpack_require__(106);
  10988. __webpack_require__(105);
  10989. __webpack_require__(72);
  10990. __webpack_require__(113);
  10991. __webpack_require__(114);
  10992. __webpack_require__(116);
  10993. __webpack_require__(115);
  10994. __webpack_require__(112);
  10995. __webpack_require__(118);
  10996. __webpack_require__(117);
  10997. __webpack_require__(139);
  10998. __webpack_require__(142);
  10999. __webpack_require__(140);
  11000. __webpack_require__(141);
  11001. __webpack_require__(144);
  11002. __webpack_require__(143);
  11003. __webpack_require__(146);
  11004. __webpack_require__(145);
  11005. var _viewportColumns = __webpack_require__(60);
  11006. var _viewportColumns2 = _interopRequireDefault(_viewportColumns);
  11007. var _viewportRows = __webpack_require__(61);
  11008. var _viewportRows2 = _interopRequireDefault(_viewportRows);
  11009. var _coords = __webpack_require__(22);
  11010. var _coords2 = _interopRequireDefault(_coords);
  11011. var _range = __webpack_require__(43);
  11012. var _range2 = _interopRequireDefault(_range);
  11013. var _column = __webpack_require__(64);
  11014. var _column2 = _interopRequireDefault(_column);
  11015. var _row = __webpack_require__(65);
  11016. var _row2 = _interopRequireDefault(_row);
  11017. var _debug = __webpack_require__(99);
  11018. var _debug2 = _interopRequireDefault(_debug);
  11019. var _left = __webpack_require__(100);
  11020. var _left2 = _interopRequireDefault(_left);
  11021. var _top = __webpack_require__(101);
  11022. var _top2 = _interopRequireDefault(_top);
  11023. var _topLeftCorner = __webpack_require__(102);
  11024. var _topLeftCorner2 = _interopRequireDefault(_topLeftCorner);
  11025. var _border = __webpack_require__(59);
  11026. var _border2 = _interopRequireDefault(_border);
  11027. var _core = __webpack_require__(62);
  11028. var _core2 = _interopRequireDefault(_core);
  11029. var _event = __webpack_require__(63);
  11030. var _event2 = _interopRequireDefault(_event);
  11031. var _overlays = __webpack_require__(66);
  11032. var _overlays2 = _interopRequireDefault(_overlays);
  11033. var _scroll = __webpack_require__(67);
  11034. var _scroll2 = _interopRequireDefault(_scroll);
  11035. var _selection = __webpack_require__(103);
  11036. var _selection2 = _interopRequireDefault(_selection);
  11037. var _settings = __webpack_require__(68);
  11038. var _settings2 = _interopRequireDefault(_settings);
  11039. var _table = __webpack_require__(69);
  11040. var _table2 = _interopRequireDefault(_table);
  11041. var _tableRenderer = __webpack_require__(70);
  11042. var _tableRenderer2 = _interopRequireDefault(_tableRenderer);
  11043. var _viewport = __webpack_require__(71);
  11044. var _viewport2 = _interopRequireDefault(_viewport);
  11045. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11046. exports.ViewportColumnsCalculator = _viewportColumns2.default;
  11047. exports.ViewportRowsCalculator = _viewportRows2.default;
  11048. exports.CellCoords = _coords2.default;
  11049. exports.CellRange = _range2.default;
  11050. exports.ColumnFilter = _column2.default;
  11051. exports.RowFilter = _row2.default;
  11052. exports.DebugOverlay = _debug2.default;
  11053. exports.LeftOverlay = _left2.default;
  11054. exports.TopOverlay = _top2.default;
  11055. exports.TopLeftCornerOverlay = _topLeftCorner2.default;
  11056. exports.Border = _border2.default;
  11057. exports.default = _core2.default;
  11058. exports.Core = _core2.default;
  11059. exports.Event = _event2.default;
  11060. exports.Overlays = _overlays2.default;
  11061. exports.Scroll = _scroll2.default;
  11062. exports.Selection = _selection2.default;
  11063. exports.Settings = _settings2.default;
  11064. exports.Table = _table2.default;
  11065. exports.TableRenderer = _tableRenderer2.default;
  11066. exports.Viewport = _viewport2.default;
  11067. /***/ }),
  11068. /* 148 */
  11069. /***/ (function(module, exports, __webpack_require__) {
  11070. "use strict";
  11071. exports.__esModule = true;
  11072. 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; };
  11073. exports.stringify = stringify;
  11074. exports.isDefined = isDefined;
  11075. exports.isUndefined = isUndefined;
  11076. exports.isEmpty = isEmpty;
  11077. exports.isRegExp = isRegExp;
  11078. /**
  11079. * Converts any value to string.
  11080. *
  11081. * @param {*} value
  11082. * @returns {String}
  11083. */
  11084. function stringify(value) {
  11085. var result = void 0;
  11086. switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) {
  11087. case 'string':
  11088. case 'number':
  11089. result = '' + value;
  11090. break;
  11091. case 'object':
  11092. result = value === null ? '' : value.toString();
  11093. break;
  11094. case 'undefined':
  11095. result = '';
  11096. break;
  11097. default:
  11098. result = value.toString();
  11099. break;
  11100. }
  11101. return result;
  11102. }
  11103. /**
  11104. * Checks if given variable is defined.
  11105. *
  11106. * @param {*} variable Variable to check.
  11107. * @returns {Boolean}
  11108. */
  11109. function isDefined(variable) {
  11110. return typeof variable !== 'undefined';
  11111. }
  11112. /**
  11113. * Checks if given variable is undefined.
  11114. *
  11115. * @param {*} variable Variable to check.
  11116. * @returns {Boolean}
  11117. */
  11118. function isUndefined(variable) {
  11119. return typeof variable === 'undefined';
  11120. }
  11121. /**
  11122. * Check if given variable is null, empty string or undefined.
  11123. *
  11124. * @param {*} variable Variable to check.
  11125. * @returns {Boolean}
  11126. */
  11127. function isEmpty(variable) {
  11128. return variable === null || variable === '' || isUndefined(variable);
  11129. }
  11130. /**
  11131. * Check if given variable is a regular expression.
  11132. *
  11133. * @param {*} variable Variable to check.
  11134. * @returns {Boolean}
  11135. */
  11136. function isRegExp(variable) {
  11137. return Object.prototype.toString.call(variable) === '[object RegExp]';
  11138. }
  11139. /***/ }),
  11140. /* 149 */
  11141. /***/ (function(module, exports, __webpack_require__) {
  11142. "use strict";
  11143. exports.__esModule = true;
  11144. exports.toUpperCaseFirst = toUpperCaseFirst;
  11145. exports.equalsIgnoreCase = equalsIgnoreCase;
  11146. exports.randomString = randomString;
  11147. exports.isPercentValue = isPercentValue;
  11148. exports.substitute = substitute;
  11149. exports.stripTags = stripTags;
  11150. var _mixed = __webpack_require__(148);
  11151. var _number = __webpack_require__(76);
  11152. /**
  11153. * Convert string to upper case first letter.
  11154. *
  11155. * @param {String} string String to convert.
  11156. * @returns {String}
  11157. */
  11158. function toUpperCaseFirst(string) {
  11159. return string[0].toUpperCase() + string.substr(1);
  11160. }
  11161. /**
  11162. * Compare strings case insensitively.
  11163. *
  11164. * @param {...String} strings Strings to compare.
  11165. * @returns {Boolean}
  11166. */
  11167. function equalsIgnoreCase() {
  11168. var unique = [];
  11169. for (var _len = arguments.length, strings = Array(_len), _key = 0; _key < _len; _key++) {
  11170. strings[_key] = arguments[_key];
  11171. }
  11172. var length = strings.length;
  11173. while (length--) {
  11174. var string = (0, _mixed.stringify)(strings[length]).toLowerCase();
  11175. if (unique.indexOf(string) === -1) {
  11176. unique.push(string);
  11177. }
  11178. }
  11179. return unique.length === 1;
  11180. }
  11181. /**
  11182. * Generates a random hex string. Used as namespace for Handsontable instance events.
  11183. *
  11184. * @return {String} Returns 16-long character random string (eq. `'92b1bfc74ec4'`).
  11185. */
  11186. function randomString() {
  11187. function s4() {
  11188. return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
  11189. }
  11190. return s4() + s4() + s4() + s4();
  11191. }
  11192. /**
  11193. * Checks if value is valid percent.
  11194. *
  11195. * @param {String} value
  11196. * @returns {Boolean}
  11197. */
  11198. function isPercentValue(value) {
  11199. return (/^([0-9][0-9]?%$)|(^100%$)/.test(value)
  11200. );
  11201. }
  11202. /**
  11203. * Substitute strings placed beetwen square brackets into value defined in `variables` object. String names defined in
  11204. * square brackets must be the same as property name of `variables` object.
  11205. *
  11206. * @param {String} template Template string.
  11207. * @param {Object} variables Object which contains all available values which can be injected into template.
  11208. * @returns {String}
  11209. */
  11210. function substitute(template) {
  11211. var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11212. return ('' + template).replace(/(?:\\)?\[([^[\]]+)]/g, function (match, name) {
  11213. if (match.charAt(0) === '\\') {
  11214. return match.substr(1, match.length - 1);
  11215. }
  11216. return variables[name] === void 0 ? '' : variables[name];
  11217. });
  11218. }
  11219. var STRIP_TAGS_REGEX = /<\/?\w+\/?>|<\w+[\s|/][^>]*>/gi;
  11220. /**
  11221. * Strip any HTML tag from the string.
  11222. *
  11223. * @param {String} string String to cut HTML from.
  11224. * @return {String}
  11225. */
  11226. function stripTags(string) {
  11227. string += '';
  11228. return string.replace(STRIP_TAGS_REGEX, '');
  11229. }
  11230. /***/ }),
  11231. /* 150 */
  11232. /***/ (function(module, exports, __webpack_require__) {
  11233. "use strict";
  11234. exports.__esModule = true;
  11235. exports.KEY_CODES = undefined;
  11236. exports.isPrintableChar = isPrintableChar;
  11237. exports.isMetaKey = isMetaKey;
  11238. exports.isCtrlKey = isCtrlKey;
  11239. exports.isKey = isKey;
  11240. var _array = __webpack_require__(24);
  11241. var KEY_CODES = exports.KEY_CODES = {
  11242. MOUSE_LEFT: 1,
  11243. MOUSE_RIGHT: 3,
  11244. MOUSE_MIDDLE: 2,
  11245. BACKSPACE: 8,
  11246. COMMA: 188,
  11247. INSERT: 45,
  11248. DELETE: 46,
  11249. END: 35,
  11250. ENTER: 13,
  11251. ESCAPE: 27,
  11252. CONTROL_LEFT: 91,
  11253. COMMAND_LEFT: 17,
  11254. COMMAND_RIGHT: 93,
  11255. ALT: 18,
  11256. HOME: 36,
  11257. PAGE_DOWN: 34,
  11258. PAGE_UP: 33,
  11259. PERIOD: 190,
  11260. SPACE: 32,
  11261. SHIFT: 16,
  11262. CAPS_LOCK: 20,
  11263. TAB: 9,
  11264. ARROW_RIGHT: 39,
  11265. ARROW_LEFT: 37,
  11266. ARROW_UP: 38,
  11267. ARROW_DOWN: 40,
  11268. F1: 112,
  11269. F2: 113,
  11270. F3: 114,
  11271. F4: 115,
  11272. F5: 116,
  11273. F6: 117,
  11274. F7: 118,
  11275. F8: 119,
  11276. F9: 120,
  11277. F10: 121,
  11278. F11: 122,
  11279. F12: 123,
  11280. A: 65,
  11281. X: 88,
  11282. C: 67,
  11283. V: 86
  11284. };
  11285. /**
  11286. * Returns true if keyCode represents a printable character.
  11287. *
  11288. * @param {Number} keyCode
  11289. * @returns {Boolean}
  11290. */
  11291. function isPrintableChar(keyCode) {
  11292. return keyCode == 32 || // space
  11293. keyCode >= 48 && keyCode <= 57 || // 0-9
  11294. keyCode >= 96 && keyCode <= 111 || // numpad
  11295. keyCode >= 186 && keyCode <= 192 || // ;=,-./`
  11296. keyCode >= 219 && keyCode <= 222 || // []{}\|"'
  11297. keyCode >= 226 || // special chars (229 for Asian chars)
  11298. keyCode >= 65 && keyCode <= 90; // a-z
  11299. }
  11300. /**
  11301. * @param {Number} keyCode
  11302. * @returns {Boolean}
  11303. */
  11304. function isMetaKey(keyCode) {
  11305. var metaKeys = [KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_RIGHT, KEY_CODES.HOME, KEY_CODES.END, KEY_CODES.DELETE, KEY_CODES.BACKSPACE, KEY_CODES.F1, KEY_CODES.F2, KEY_CODES.F3, KEY_CODES.F4, KEY_CODES.F5, KEY_CODES.F6, KEY_CODES.F7, KEY_CODES.F8, KEY_CODES.F9, KEY_CODES.F10, KEY_CODES.F11, KEY_CODES.F12, KEY_CODES.TAB, KEY_CODES.PAGE_DOWN, KEY_CODES.PAGE_UP, KEY_CODES.ENTER, KEY_CODES.ESCAPE, KEY_CODES.SHIFT, KEY_CODES.CAPS_LOCK, KEY_CODES.ALT];
  11306. return metaKeys.indexOf(keyCode) !== -1;
  11307. }
  11308. /**
  11309. * @param {Number} keyCode
  11310. * @returns {Boolean}
  11311. */
  11312. function isCtrlKey(keyCode) {
  11313. return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1;
  11314. }
  11315. /**
  11316. * @param {Number} keyCode
  11317. * @param {String} baseCode
  11318. * @returns {Boolean}
  11319. */
  11320. function isKey(keyCode, baseCode) {
  11321. var keys = baseCode.split('|');
  11322. var result = false;
  11323. (0, _array.arrayEach)(keys, function (key) {
  11324. if (keyCode === KEY_CODES[key]) {
  11325. result = true;
  11326. return false;
  11327. }
  11328. });
  11329. return result;
  11330. }
  11331. /***/ }),
  11332. /* 151 */
  11333. /***/ (function(module, exports, __webpack_require__) {
  11334. "use strict";
  11335. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  11336. var toObject = __webpack_require__(21)
  11337. , toIndex = __webpack_require__(41)
  11338. , toLength = __webpack_require__(10);
  11339. module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){
  11340. var O = toObject(this)
  11341. , len = toLength(O.length)
  11342. , to = toIndex(target, len)
  11343. , from = toIndex(start, len)
  11344. , end = arguments.length > 2 ? arguments[2] : undefined
  11345. , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)
  11346. , inc = 1;
  11347. if(from < to && to < from + count){
  11348. inc = -1;
  11349. from += count - 1;
  11350. to += count - 1;
  11351. }
  11352. while(count-- > 0){
  11353. if(from in O)O[to] = O[from];
  11354. else delete O[to];
  11355. to += inc;
  11356. from += inc;
  11357. } return O;
  11358. };
  11359. /***/ }),
  11360. /* 152 */
  11361. /***/ (function(module, exports, __webpack_require__) {
  11362. "use strict";
  11363. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  11364. var toObject = __webpack_require__(21)
  11365. , toIndex = __webpack_require__(41)
  11366. , toLength = __webpack_require__(10);
  11367. module.exports = function fill(value /*, start = 0, end = @length */){
  11368. var O = toObject(this)
  11369. , length = toLength(O.length)
  11370. , aLen = arguments.length
  11371. , index = toIndex(aLen > 1 ? arguments[1] : undefined, length)
  11372. , end = aLen > 2 ? arguments[2] : undefined
  11373. , endPos = end === undefined ? length : toIndex(end, length);
  11374. while(endPos > index)O[index++] = value;
  11375. return O;
  11376. };
  11377. /***/ }),
  11378. /* 153 */
  11379. /***/ (function(module, exports, __webpack_require__) {
  11380. var isObject = __webpack_require__(4)
  11381. , isArray = __webpack_require__(84)
  11382. , SPECIES = __webpack_require__(1)('species');
  11383. module.exports = function(original){
  11384. var C;
  11385. if(isArray(original)){
  11386. C = original.constructor;
  11387. // cross-realm fallback
  11388. if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;
  11389. if(isObject(C)){
  11390. C = C[SPECIES];
  11391. if(C === null)C = undefined;
  11392. }
  11393. } return C === undefined ? Array : C;
  11394. };
  11395. /***/ }),
  11396. /* 154 */
  11397. /***/ (function(module, exports, __webpack_require__) {
  11398. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  11399. var speciesConstructor = __webpack_require__(153);
  11400. module.exports = function(original, length){
  11401. return new (speciesConstructor(original))(length);
  11402. };
  11403. /***/ }),
  11404. /* 155 */
  11405. /***/ (function(module, exports, __webpack_require__) {
  11406. // all enumerable object keys, includes symbols
  11407. var getKeys = __webpack_require__(19)
  11408. , gOPS = __webpack_require__(39)
  11409. , pIE = __webpack_require__(29);
  11410. module.exports = function(it){
  11411. var result = getKeys(it)
  11412. , getSymbols = gOPS.f;
  11413. if(getSymbols){
  11414. var symbols = getSymbols(it)
  11415. , isEnum = pIE.f
  11416. , i = 0
  11417. , key;
  11418. while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
  11419. } return result;
  11420. };
  11421. /***/ }),
  11422. /* 156 */
  11423. /***/ (function(module, exports, __webpack_require__) {
  11424. "use strict";
  11425. // 21.2.5.3 get RegExp.prototype.flags
  11426. var anObject = __webpack_require__(5);
  11427. module.exports = function(){
  11428. var that = anObject(this)
  11429. , result = '';
  11430. if(that.global) result += 'g';
  11431. if(that.ignoreCase) result += 'i';
  11432. if(that.multiline) result += 'm';
  11433. if(that.unicode) result += 'u';
  11434. if(that.sticky) result += 'y';
  11435. return result;
  11436. };
  11437. /***/ }),
  11438. /* 157 */
  11439. /***/ (function(module, exports, __webpack_require__) {
  11440. var isObject = __webpack_require__(4)
  11441. , setPrototypeOf = __webpack_require__(93).set;
  11442. module.exports = function(that, target, C){
  11443. var P, S = target.constructor;
  11444. if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){
  11445. setPrototypeOf(that, P);
  11446. } return that;
  11447. };
  11448. /***/ }),
  11449. /* 158 */
  11450. /***/ (function(module, exports) {
  11451. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  11452. module.exports = function(fn, args, that){
  11453. var un = that === undefined;
  11454. switch(args.length){
  11455. case 0: return un ? fn()
  11456. : fn.call(that);
  11457. case 1: return un ? fn(args[0])
  11458. : fn.call(that, args[0]);
  11459. case 2: return un ? fn(args[0], args[1])
  11460. : fn.call(that, args[0], args[1]);
  11461. case 3: return un ? fn(args[0], args[1], args[2])
  11462. : fn.call(that, args[0], args[1], args[2]);
  11463. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  11464. : fn.call(that, args[0], args[1], args[2], args[3]);
  11465. } return fn.apply(that, args);
  11466. };
  11467. /***/ }),
  11468. /* 159 */
  11469. /***/ (function(module, exports, __webpack_require__) {
  11470. "use strict";
  11471. var create = __webpack_require__(51)
  11472. , descriptor = __webpack_require__(20)
  11473. , setToStringTag = __webpack_require__(30)
  11474. , IteratorPrototype = {};
  11475. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  11476. __webpack_require__(15)(IteratorPrototype, __webpack_require__(1)('iterator'), function(){ return this; });
  11477. module.exports = function(Constructor, NAME, next){
  11478. Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
  11479. setToStringTag(Constructor, NAME + ' Iterator');
  11480. };
  11481. /***/ }),
  11482. /* 160 */
  11483. /***/ (function(module, exports, __webpack_require__) {
  11484. var getKeys = __webpack_require__(19)
  11485. , toIObject = __webpack_require__(9);
  11486. module.exports = function(object, el){
  11487. var O = toIObject(object)
  11488. , keys = getKeys(O)
  11489. , length = keys.length
  11490. , index = 0
  11491. , key;
  11492. while(length > index)if(O[key = keys[index++]] === el)return key;
  11493. };
  11494. /***/ }),
  11495. /* 161 */
  11496. /***/ (function(module, exports, __webpack_require__) {
  11497. var global = __webpack_require__(3)
  11498. , macrotask = __webpack_require__(57).set
  11499. , Observer = global.MutationObserver || global.WebKitMutationObserver
  11500. , process = global.process
  11501. , Promise = global.Promise
  11502. , isNode = __webpack_require__(18)(process) == 'process';
  11503. module.exports = function(){
  11504. var head, last, notify;
  11505. var flush = function(){
  11506. var parent, fn;
  11507. if(isNode && (parent = process.domain))parent.exit();
  11508. while(head){
  11509. fn = head.fn;
  11510. head = head.next;
  11511. try {
  11512. fn();
  11513. } catch(e){
  11514. if(head)notify();
  11515. else last = undefined;
  11516. throw e;
  11517. }
  11518. } last = undefined;
  11519. if(parent)parent.enter();
  11520. };
  11521. // Node.js
  11522. if(isNode){
  11523. notify = function(){
  11524. process.nextTick(flush);
  11525. };
  11526. // browsers with MutationObserver
  11527. } else if(Observer){
  11528. var toggle = true
  11529. , node = document.createTextNode('');
  11530. new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
  11531. notify = function(){
  11532. node.data = toggle = !toggle;
  11533. };
  11534. // environments with maybe non-completely correct, but existent Promise
  11535. } else if(Promise && Promise.resolve){
  11536. var promise = Promise.resolve();
  11537. notify = function(){
  11538. promise.then(flush);
  11539. };
  11540. // for other environments - macrotask based on:
  11541. // - setImmediate
  11542. // - MessageChannel
  11543. // - window.postMessag
  11544. // - onreadystatechange
  11545. // - setTimeout
  11546. } else {
  11547. notify = function(){
  11548. // strange IE + webpack dev server bug - use .call(global)
  11549. macrotask.call(global, flush);
  11550. };
  11551. }
  11552. return function(fn){
  11553. var task = {fn: fn, next: undefined};
  11554. if(last)last.next = task;
  11555. if(!head){
  11556. head = task;
  11557. notify();
  11558. } last = task;
  11559. };
  11560. };
  11561. /***/ }),
  11562. /* 162 */
  11563. /***/ (function(module, exports, __webpack_require__) {
  11564. var dP = __webpack_require__(6)
  11565. , anObject = __webpack_require__(5)
  11566. , getKeys = __webpack_require__(19);
  11567. module.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties){
  11568. anObject(O);
  11569. var keys = getKeys(Properties)
  11570. , length = keys.length
  11571. , i = 0
  11572. , P;
  11573. while(length > i)dP.f(O, P = keys[i++], Properties[P]);
  11574. return O;
  11575. };
  11576. /***/ }),
  11577. /* 163 */
  11578. /***/ (function(module, exports, __webpack_require__) {
  11579. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  11580. var toIObject = __webpack_require__(9)
  11581. , gOPN = __webpack_require__(53).f
  11582. , toString = {}.toString;
  11583. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  11584. ? Object.getOwnPropertyNames(window) : [];
  11585. var getWindowNames = function(it){
  11586. try {
  11587. return gOPN(it);
  11588. } catch(e){
  11589. return windowNames.slice();
  11590. }
  11591. };
  11592. module.exports.f = function getOwnPropertyNames(it){
  11593. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  11594. };
  11595. /***/ }),
  11596. /* 164 */
  11597. /***/ (function(module, exports, __webpack_require__) {
  11598. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  11599. var has = __webpack_require__(8)
  11600. , toObject = __webpack_require__(21)
  11601. , IE_PROTO = __webpack_require__(54)('IE_PROTO')
  11602. , ObjectProto = Object.prototype;
  11603. module.exports = Object.getPrototypeOf || function(O){
  11604. O = toObject(O);
  11605. if(has(O, IE_PROTO))return O[IE_PROTO];
  11606. if(typeof O.constructor == 'function' && O instanceof O.constructor){
  11607. return O.constructor.prototype;
  11608. } return O instanceof Object ? ObjectProto : null;
  11609. };
  11610. /***/ }),
  11611. /* 165 */
  11612. /***/ (function(module, exports, __webpack_require__) {
  11613. // all object keys, includes non-enumerable and symbols
  11614. var gOPN = __webpack_require__(53)
  11615. , gOPS = __webpack_require__(39)
  11616. , anObject = __webpack_require__(5)
  11617. , Reflect = __webpack_require__(3).Reflect;
  11618. module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){
  11619. var keys = gOPN.f(anObject(it))
  11620. , getSymbols = gOPS.f;
  11621. return getSymbols ? keys.concat(getSymbols(it)) : keys;
  11622. };
  11623. /***/ }),
  11624. /* 166 */
  11625. /***/ (function(module, exports) {
  11626. // 7.2.9 SameValue(x, y)
  11627. module.exports = Object.is || function is(x, y){
  11628. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  11629. };
  11630. /***/ }),
  11631. /* 167 */
  11632. /***/ (function(module, exports, __webpack_require__) {
  11633. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  11634. var anObject = __webpack_require__(5)
  11635. , aFunction = __webpack_require__(44)
  11636. , SPECIES = __webpack_require__(1)('species');
  11637. module.exports = function(O, D){
  11638. var C = anObject(O).constructor, S;
  11639. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  11640. };
  11641. /***/ }),
  11642. /* 168 */
  11643. /***/ (function(module, exports, __webpack_require__) {
  11644. var toInteger = __webpack_require__(42)
  11645. , defined = __webpack_require__(13);
  11646. // true -> String#at
  11647. // false -> String#codePointAt
  11648. module.exports = function(TO_STRING){
  11649. return function(that, pos){
  11650. var s = String(defined(that))
  11651. , i = toInteger(pos)
  11652. , l = s.length
  11653. , a, b;
  11654. if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
  11655. a = s.charCodeAt(i);
  11656. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  11657. ? TO_STRING ? s.charAt(i) : a
  11658. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  11659. };
  11660. };
  11661. /***/ }),
  11662. /* 169 */
  11663. /***/ (function(module, exports, __webpack_require__) {
  11664. var global = __webpack_require__(3)
  11665. , core = __webpack_require__(26)
  11666. , LIBRARY = __webpack_require__(38)
  11667. , wksExt = __webpack_require__(97)
  11668. , defineProperty = __webpack_require__(6).f;
  11669. module.exports = function(name){
  11670. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  11671. if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
  11672. };
  11673. /***/ })
  11674. /******/ ]);
  11675. //# sourceMappingURL=walkontable.js.map