| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114 |
- var Walkontable =
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // identity function for calling harmony imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 147);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(3)
- , core = __webpack_require__(26)
- , hide = __webpack_require__(15)
- , redefine = __webpack_require__(16)
- , ctx = __webpack_require__(12)
- , PROTOTYPE = 'prototype';
- var $export = function(type, name, source){
- var IS_FORCED = type & $export.F
- , IS_GLOBAL = type & $export.G
- , IS_STATIC = type & $export.S
- , IS_PROTO = type & $export.P
- , IS_BIND = type & $export.B
- , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]
- , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
- , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {})
- , key, own, out, exp;
- if(IS_GLOBAL)source = name;
- for(key in source){
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- // export native or passed
- out = (own ? target : source)[key];
- // bind timers to global for call from export context
- exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- // extend global
- if(target)redefine(target, key, out, type & $export.U);
- // export
- if(exports[key] != out)hide(exports, key, exp);
- if(IS_PROTO && expProto[key] != out)expProto[key] = out;
- }
- };
- global.core = core;
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- module.exports = $export;
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
- var store = __webpack_require__(55)('wks')
- , uid = __webpack_require__(31)
- , Symbol = __webpack_require__(3).Symbol
- , USE_SYMBOL = typeof Symbol == 'function';
- var $exports = module.exports = function(name){
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
- };
- $exports.store = store;
- /***/ }),
- /* 2 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.HTML_CHARACTERS = undefined;
- exports.getParent = getParent;
- exports.closest = closest;
- exports.closestDown = closestDown;
- exports.isChildOf = isChildOf;
- exports.isChildOfWebComponentTable = isChildOfWebComponentTable;
- exports.polymerWrap = polymerWrap;
- exports.polymerUnwrap = polymerUnwrap;
- exports.index = index;
- exports.overlayContainsElement = overlayContainsElement;
- exports.hasClass = hasClass;
- exports.addClass = addClass;
- exports.removeClass = removeClass;
- exports.removeTextNodes = removeTextNodes;
- exports.empty = empty;
- exports.fastInnerHTML = fastInnerHTML;
- exports.fastInnerText = fastInnerText;
- exports.isVisible = isVisible;
- exports.offset = offset;
- exports.getWindowScrollTop = getWindowScrollTop;
- exports.getWindowScrollLeft = getWindowScrollLeft;
- exports.getScrollTop = getScrollTop;
- exports.getScrollLeft = getScrollLeft;
- exports.getScrollableElement = getScrollableElement;
- exports.getTrimmingContainer = getTrimmingContainer;
- exports.getStyle = getStyle;
- exports.getComputedStyle = getComputedStyle;
- exports.outerWidth = outerWidth;
- exports.outerHeight = outerHeight;
- exports.innerHeight = innerHeight;
- exports.innerWidth = innerWidth;
- exports.addEvent = addEvent;
- exports.removeEvent = removeEvent;
- exports.getCaretPosition = getCaretPosition;
- exports.getSelectionEndPosition = getSelectionEndPosition;
- exports.getSelectionText = getSelectionText;
- exports.setCaretPosition = setCaretPosition;
- exports.getScrollbarWidth = getScrollbarWidth;
- exports.hasVerticalScrollbar = hasVerticalScrollbar;
- exports.hasHorizontalScrollbar = hasHorizontalScrollbar;
- exports.setOverlayPosition = setOverlayPosition;
- exports.getCssTransform = getCssTransform;
- exports.resetCssTransform = resetCssTransform;
- exports.isInput = isInput;
- exports.isOutsideInput = isOutsideInput;
- var _browser = __webpack_require__(32);
- var _feature = __webpack_require__(74);
- /**
- * Get the parent of the specified node in the DOM tree.
- *
- * @param {HTMLElement} element Element from which traversing is started.
- * @param {Number} [level=0] Traversing deep level.
- * @return {HTMLElement|null}
- */
- function getParent(element) {
- var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var iteration = -1;
- var parent = null;
- while (element != null) {
- if (iteration === level) {
- parent = element;
- break;
- }
- if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- element = element.host;
- } else {
- iteration++;
- element = element.parentNode;
- }
- }
- return parent;
- }
- /**
- * Goes up the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.
- * This method goes up through web components.
- *
- * @param {HTMLElement} element Element from which traversing is started
- * @param {Array} nodes Array of elements or Array of elements name
- * @param {HTMLElement} [until]
- * @returns {HTMLElement|null}
- */
- function closest(element, nodes, until) {
- while (element != null && element !== until) {
- if (element.nodeType === Node.ELEMENT_NODE && (nodes.indexOf(element.nodeName) > -1 || nodes.indexOf(element) > -1)) {
- return element;
- }
- if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- element = element.host;
- } else {
- element = element.parentNode;
- }
- }
- return null;
- }
- /**
- * Goes "down" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.
- *
- * @param {HTMLElement} element Element from which traversing is started
- * @param {Array} nodes Array of elements or Array of elements name
- * @param {HTMLElement} [until]
- * @returns {HTMLElement|null}
- */
- function closestDown(element, nodes, until) {
- var matched = [];
- while (element) {
- element = closest(element, nodes, until);
- if (!element || until && !until.contains(element)) {
- break;
- }
- matched.push(element);
- if (element.host && element.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- element = element.host;
- } else {
- element = element.parentNode;
- }
- }
- var length = matched.length;
- return length ? matched[length - 1] : null;
- }
- /**
- * Goes up the DOM tree and checks if element is child of another element.
- *
- * @param child Child element
- * @param {Object|String} parent Parent element OR selector of the parent element.
- * If string provided, function returns `true` for the first occurrence of element with that class.
- * @returns {Boolean}
- */
- function isChildOf(child, parent) {
- var node = child.parentNode;
- var queriedParents = [];
- if (typeof parent === 'string') {
- queriedParents = Array.prototype.slice.call(document.querySelectorAll(parent), 0);
- } else {
- queriedParents.push(parent);
- }
- while (node != null) {
- if (queriedParents.indexOf(node) > -1) {
- return true;
- }
- node = node.parentNode;
- }
- return false;
- }
- /**
- * Check if an element is part of `hot-table` web component.
- *
- * @param {Element} element
- * @returns {Boolean}
- */
- function isChildOfWebComponentTable(element) {
- var hotTableName = 'hot-table',
- result = false,
- parentNode;
- parentNode = polymerWrap(element);
- function isHotTable(element) {
- return element.nodeType === Node.ELEMENT_NODE && element.nodeName === hotTableName.toUpperCase();
- }
- while (parentNode != null) {
- if (isHotTable(parentNode)) {
- result = true;
- break;
- } else if (parentNode.host && parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- result = isHotTable(parentNode.host);
- if (result) {
- break;
- }
- parentNode = parentNode.host;
- }
- parentNode = parentNode.parentNode;
- }
- return result;
- }
- /**
- * Wrap element into polymer/webcomponent container if exists
- *
- * @param element
- * @returns {*}
- */
- function polymerWrap(element) {
- /* global Polymer */
- return typeof Polymer !== 'undefined' && typeof wrap === 'function' ? wrap(element) : element;
- }
- /**
- * Unwrap element from polymer/webcomponent container if exists
- *
- * @param element
- * @returns {*}
- */
- function polymerUnwrap(element) {
- /* global Polymer */
- return typeof Polymer !== 'undefined' && typeof unwrap === 'function' ? unwrap(element) : element;
- }
- /**
- * Counts index of element within its parent
- * WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true for Walkotnable
- * Otherwise would need to check for nodeType or use previousElementSibling
- *
- * @see http://jsperf.com/sibling-index/10
- * @param {Element} element
- * @return {Number}
- */
- function index(element) {
- var i = 0;
- if (element.previousSibling) {
- /* eslint-disable no-cond-assign */
- while (element = element.previousSibling) {
- ++i;
- }
- }
- return i;
- }
- /**
- * Check if the provided overlay contains the provided element
- *
- * @param {String} overlay
- * @param {HTMLElement} element
- * @returns {boolean}
- */
- function overlayContainsElement(overlayType, element) {
- var overlayElement = document.querySelector('.ht_clone_' + overlayType);
- return overlayElement ? overlayElement.contains(element) : null;
- }
- var classListSupport = !!document.documentElement.classList;
- var _hasClass, _addClass, _removeClass;
- function filterEmptyClassNames(classNames) {
- var len = 0,
- result = [];
- if (!classNames || !classNames.length) {
- return result;
- }
- while (classNames[len]) {
- result.push(classNames[len]);
- len++;
- }
- return result;
- }
- if (classListSupport) {
- var isSupportMultipleClassesArg = function () {
- var element = document.createElement('div');
- element.classList.add('test', 'test2');
- return element.classList.contains('test2');
- }();
- _hasClass = function _hasClass(element, className) {
- if (className === '') {
- return false;
- }
- return element.classList.contains(className);
- };
- _addClass = function _addClass(element, className) {
- var len = 0;
- if (typeof className === 'string') {
- className = className.split(' ');
- }
- className = filterEmptyClassNames(className);
- if (isSupportMultipleClassesArg) {
- element.classList.add.apply(element.classList, className);
- } else {
- while (className && className[len]) {
- element.classList.add(className[len]);
- len++;
- }
- }
- };
- _removeClass = function _removeClass(element, className) {
- var len = 0;
- if (typeof className === 'string') {
- className = className.split(' ');
- }
- className = filterEmptyClassNames(className);
- if (isSupportMultipleClassesArg) {
- element.classList.remove.apply(element.classList, className);
- } else {
- while (className && className[len]) {
- element.classList.remove(className[len]);
- len++;
- }
- }
- };
- } else {
- var createClassNameRegExp = function createClassNameRegExp(className) {
- return new RegExp('(\\s|^)' + className + '(\\s|$)');
- };
- _hasClass = function _hasClass(element, className) {
- // http://snipplr.com/view/3561/addclass-removeclass-hasclass/
- return !!element.className.match(createClassNameRegExp(className));
- };
- _addClass = function _addClass(element, className) {
- var len = 0,
- _className = element.className;
- if (typeof className === 'string') {
- className = className.split(' ');
- }
- if (_className === '') {
- _className = className.join(' ');
- } else {
- while (className && className[len]) {
- if (!createClassNameRegExp(className[len]).test(_className)) {
- _className += ' ' + className[len];
- }
- len++;
- }
- }
- element.className = _className;
- };
- _removeClass = function _removeClass(element, className) {
- var len = 0,
- _className = element.className;
- if (typeof className === 'string') {
- className = className.split(' ');
- }
- while (className && className[len]) {
- // String.prototype.trim is defined in polyfill.js
- _className = _className.replace(createClassNameRegExp(className[len]), ' ').trim();
- len++;
- }
- if (element.className !== _className) {
- element.className = _className;
- }
- };
- }
- /**
- * Checks if element has class name
- *
- * @param {HTMLElement} element
- * @param {String} className Class name to check
- * @returns {Boolean}
- */
- function hasClass(element, className) {
- return _hasClass(element, className);
- }
- /**
- * Add class name to an element
- *
- * @param {HTMLElement} element
- * @param {String|Array} className Class name as string or array of strings
- */
- function addClass(element, className) {
- return _addClass(element, className);
- }
- /**
- * Remove class name from an element
- *
- * @param {HTMLElement} element
- * @param {String|Array} className Class name as string or array of strings
- */
- function removeClass(element, className) {
- return _removeClass(element, className);
- }
- function removeTextNodes(element, parent) {
- if (element.nodeType === 3) {
- parent.removeChild(element); // bye text nodes!
- } else if (['TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TR'].indexOf(element.nodeName) > -1) {
- var childs = element.childNodes;
- for (var i = childs.length - 1; i >= 0; i--) {
- removeTextNodes(childs[i], element);
- }
- }
- }
- /**
- * Remove childs function
- * WARNING - this doesn't unload events and data attached by jQuery
- * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9
- * http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method
- *
- * @param element
- * @returns {void}
- */
- //
- function empty(element) {
- var child;
- /* eslint-disable no-cond-assign */
- while (child = element.lastChild) {
- element.removeChild(child);
- }
- }
- var HTML_CHARACTERS = exports.HTML_CHARACTERS = /(<(.*)>|&(.*);)/;
- /**
- * Insert content into element trying avoid innerHTML method.
- * @return {void}
- */
- function fastInnerHTML(element, content) {
- if (HTML_CHARACTERS.test(content)) {
- element.innerHTML = content;
- } else {
- fastInnerText(element, content);
- }
- }
- /**
- * Insert text content into element
- * @return {void}
- */
- var textContextSupport = !!document.createTextNode('test').textContent;
- function fastInnerText(element, content) {
- var child = element.firstChild;
- if (child && child.nodeType === 3 && child.nextSibling === null) {
- // fast lane - replace existing text node
- if (textContextSupport) {
- // http://jsperf.com/replace-text-vs-reuse
- child.textContent = content;
- } else {
- // http://jsperf.com/replace-text-vs-reuse
- child.data = content;
- }
- } else {
- // slow lane - empty element and insert a text node
- empty(element);
- element.appendChild(document.createTextNode(content));
- }
- }
- /**
- * Returns true if element is attached to the DOM and visible, false otherwise
- * @param elem
- * @returns {boolean}
- */
- function isVisible(elem) {
- var next = elem;
- while (polymerUnwrap(next) !== document.documentElement) {
- // until <html> reached
- if (next === null) {
- // parent detached from DOM
- return false;
- } else if (next.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
- if (next.host) {
- // this is Web Components Shadow DOM
- // see: http://w3c.github.io/webcomponents/spec/shadow/#encapsulation
- // according to spec, should be if (next.ownerDocument !== window.document), but that doesn't work yet
- if (next.host.impl) {
- // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features disabled
- return isVisible(next.host.impl);
- } else if (next.host) {
- // Chrome 33.0.1723.0 canary (2013-11-29) Web Platform features enabled
- return isVisible(next.host);
- }
- throw new Error('Lost in Web Components world');
- } else {
- return false; // this is a node detached from document in IE8
- }
- } else if (next.style.display === 'none') {
- return false;
- }
- next = next.parentNode;
- }
- return true;
- }
- /**
- * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.
- *
- * @param {HTMLElement} elem
- * @return {Object} Returns object with `top` and `left` props
- */
- function offset(elem) {
- var offsetLeft, offsetTop, lastElem, docElem, box;
- docElem = document.documentElement;
- if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {
- // fixes problem with Firefox ignoring <caption> in TABLE offset (see also export outerHeight)
- // http://jsperf.com/offset-vs-getboundingclientrect/8
- box = elem.getBoundingClientRect();
- return {
- top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
- left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
- };
- }
- offsetLeft = elem.offsetLeft;
- offsetTop = elem.offsetTop;
- lastElem = elem;
- /* eslint-disable no-cond-assign */
- while (elem = elem.offsetParent) {
- // from my observation, document.body always has scrollLeft/scrollTop == 0
- if (elem === document.body) {
- break;
- }
- offsetLeft += elem.offsetLeft;
- offsetTop += elem.offsetTop;
- lastElem = elem;
- }
- // slow - http://jsperf.com/offset-vs-getboundingclientrect/6
- if (lastElem && lastElem.style.position === 'fixed') {
- // if(lastElem !== document.body) { //faster but does gives false positive in Firefox
- offsetLeft += window.pageXOffset || docElem.scrollLeft;
- offsetTop += window.pageYOffset || docElem.scrollTop;
- }
- return {
- left: offsetLeft,
- top: offsetTop
- };
- }
- /**
- * Returns the document's scrollTop property.
- *
- * @returns {Number}
- */
- function getWindowScrollTop() {
- var res = window.scrollY;
- if (res === void 0) {
- // IE8-11
- res = document.documentElement.scrollTop;
- }
- return res;
- }
- /**
- * Returns the document's scrollLeft property.
- *
- * @returns {Number}
- */
- function getWindowScrollLeft() {
- var res = window.scrollX;
- if (res === void 0) {
- // IE8-11
- res = document.documentElement.scrollLeft;
- }
- return res;
- }
- /**
- * Returns the provided element's scrollTop property.
- *
- * @param element
- * @returns {Number}
- */
- function getScrollTop(element) {
- if (element === window) {
- return getWindowScrollTop();
- }
- return element.scrollTop;
- }
- /**
- * Returns the provided element's scrollLeft property.
- *
- * @param element
- * @returns {Number}
- */
- function getScrollLeft(element) {
- if (element === window) {
- return getWindowScrollLeft();
- }
- return element.scrollLeft;
- }
- /**
- * Returns a DOM element responsible for scrolling of the provided element.
- *
- * @param {HTMLElement} element
- * @returns {HTMLElement} Element's scrollable parent
- */
- function getScrollableElement(element) {
- var el = element.parentNode,
- props = ['auto', 'scroll'],
- overflow,
- overflowX,
- overflowY,
- computedStyle = '',
- computedOverflow = '',
- computedOverflowY = '',
- computedOverflowX = '';
- while (el && el.style && document.body !== el) {
- overflow = el.style.overflow;
- overflowX = el.style.overflowX;
- overflowY = el.style.overflowY;
- if (overflow == 'scroll' || overflowX == 'scroll' || overflowY == 'scroll') {
- return el;
- } else if (window.getComputedStyle) {
- computedStyle = window.getComputedStyle(el);
- computedOverflow = computedStyle.getPropertyValue('overflow');
- computedOverflowY = computedStyle.getPropertyValue('overflow-y');
- computedOverflowX = computedStyle.getPropertyValue('overflow-x');
- if (computedOverflow === 'scroll' || computedOverflowX === 'scroll' || computedOverflowY === 'scroll') {
- return el;
- }
- }
- if (el.clientHeight <= el.scrollHeight && (props.indexOf(overflowY) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowY) !== -1)) {
- return el;
- }
- if (el.clientWidth <= el.scrollWidth && (props.indexOf(overflowX) !== -1 || props.indexOf(overflow) !== -1 || props.indexOf(computedOverflow) !== -1 || props.indexOf(computedOverflowX) !== -1)) {
- return el;
- }
- el = el.parentNode;
- }
- return window;
- }
- /**
- * Returns a DOM element responsible for trimming the provided element.
- *
- * @param {HTMLElement} base Base element
- * @returns {HTMLElement} Base element's trimming parent
- */
- function getTrimmingContainer(base) {
- var el = base.parentNode;
- while (el && el.style && document.body !== el) {
- if (el.style.overflow !== 'visible' && el.style.overflow !== '') {
- return el;
- } else if (window.getComputedStyle) {
- var computedStyle = window.getComputedStyle(el);
- if (computedStyle.getPropertyValue('overflow') !== 'visible' && computedStyle.getPropertyValue('overflow') !== '') {
- return el;
- }
- }
- el = el.parentNode;
- }
- return window;
- }
- /**
- * Returns a style property for the provided element. (Be it an inline or external style).
- *
- * @param {HTMLElement} element
- * @param {String} prop Wanted property
- * @returns {String|undefined} Element's style property
- */
- function getStyle(element, prop) {
- /* eslint-disable */
- if (!element) {
- return;
- } else if (element === window) {
- if (prop === 'width') {
- return window.innerWidth + 'px';
- } else if (prop === 'height') {
- return window.innerHeight + 'px';
- }
- return;
- }
- var styleProp = element.style[prop],
- computedStyle;
- if (styleProp !== '' && styleProp !== void 0) {
- return styleProp;
- } else {
- computedStyle = getComputedStyle(element);
- if (computedStyle[prop] !== '' && computedStyle[prop] !== void 0) {
- return computedStyle[prop];
- }
- }
- }
- /**
- * Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).
- *
- * @param element
- * @returns {IEElementStyle|CssStyle} Elements computed style object
- */
- function getComputedStyle(element) {
- return element.currentStyle || document.defaultView.getComputedStyle(element);
- }
- /**
- * Returns the element's outer width.
- *
- * @param element
- * @returns {number} Element's outer width
- */
- function outerWidth(element) {
- return element.offsetWidth;
- }
- /**
- * Returns the element's outer height
- *
- * @param elem
- * @returns {number} Element's outer height
- */
- function outerHeight(elem) {
- if ((0, _feature.hasCaptionProblem)() && elem.firstChild && elem.firstChild.nodeName === 'CAPTION') {
- // fixes problem with Firefox ignoring <caption> in TABLE.offsetHeight
- // jQuery (1.10.1) still has this unsolved
- // may be better to just switch to getBoundingClientRect
- // http://bililite.com/blog/2009/03/27/finding-the-size-of-a-table/
- // http://lists.w3.org/Archives/Public/www-style/2009Oct/0089.html
- // http://bugs.jquery.com/ticket/2196
- // http://lists.w3.org/Archives/Public/www-style/2009Oct/0140.html#start140
- return elem.offsetHeight + elem.firstChild.offsetHeight;
- }
- return elem.offsetHeight;
- }
- /**
- * Returns the element's inner height.
- *
- * @param element
- * @returns {number} Element's inner height
- */
- function innerHeight(element) {
- return element.clientHeight || element.innerHeight;
- }
- /**
- * Returns the element's inner width.
- *
- * @param element
- * @returns {number} Element's inner width
- */
- function innerWidth(element) {
- return element.clientWidth || element.innerWidth;
- }
- function addEvent(element, event, callback) {
- if (window.addEventListener) {
- element.addEventListener(event, callback, false);
- } else {
- element.attachEvent('on' + event, callback);
- }
- }
- function removeEvent(element, event, callback) {
- if (window.removeEventListener) {
- element.removeEventListener(event, callback, false);
- } else {
- element.detachEvent('on' + event, callback);
- }
- }
- /**
- * Returns caret position in text input
- *
- * @author http://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea
- * @return {Number}
- */
- function getCaretPosition(el) {
- if (el.selectionStart) {
- return el.selectionStart;
- } else if (document.selection) {
- // IE8
- el.focus();
- var r = document.selection.createRange();
- if (r == null) {
- return 0;
- }
- var re = el.createTextRange();
- var rc = re.duplicate();
- re.moveToBookmark(r.getBookmark());
- rc.setEndPoint('EndToStart', re);
- return rc.text.length;
- }
- return 0;
- }
- /**
- * Returns end of the selection in text input
- *
- * @return {Number}
- */
- function getSelectionEndPosition(el) {
- if (el.selectionEnd) {
- return el.selectionEnd;
- } else if (document.selection) {
- // IE8
- var r = document.selection.createRange();
- if (r == null) {
- return 0;
- }
- var re = el.createTextRange();
- return re.text.indexOf(r.text) + r.text.length;
- }
- return 0;
- }
- /**
- * Returns text under selection.
- *
- * @returns {String}
- */
- function getSelectionText() {
- var text = '';
- if (window.getSelection) {
- text = window.getSelection().toString();
- } else if (document.selection && document.selection.type !== 'Control') {
- text = document.selection.createRange().text;
- }
- return text;
- }
- /**
- * Sets caret position in text input.
- *
- * @author http://blog.vishalon.net/index.php/javascript-getting-and-setting-caret-position-in-textarea/
- * @param {Element} element
- * @param {Number} pos
- * @param {Number} endPos
- */
- function setCaretPosition(element, pos, endPos) {
- if (endPos === void 0) {
- endPos = pos;
- }
- if (element.setSelectionRange) {
- element.focus();
- try {
- element.setSelectionRange(pos, endPos);
- } catch (err) {
- var elementParent = element.parentNode;
- var parentDisplayValue = elementParent.style.display;
- elementParent.style.display = 'block';
- element.setSelectionRange(pos, endPos);
- elementParent.style.display = parentDisplayValue;
- }
- } else if (element.createTextRange) {
- // IE8
- var range = element.createTextRange();
- range.collapse(true);
- range.moveEnd('character', endPos);
- range.moveStart('character', pos);
- range.select();
- }
- }
- var cachedScrollbarWidth;
- // http://stackoverflow.com/questions/986937/how-can-i-get-the-browsers-scrollbar-sizes
- function walkontableCalculateScrollbarWidth() {
- var inner = document.createElement('div');
- inner.style.height = '200px';
- inner.style.width = '100%';
- var outer = document.createElement('div');
- outer.style.boxSizing = 'content-box';
- outer.style.height = '150px';
- outer.style.left = '0px';
- outer.style.overflow = 'hidden';
- outer.style.position = 'absolute';
- outer.style.top = '0px';
- outer.style.width = '200px';
- outer.style.visibility = 'hidden';
- outer.appendChild(inner);
- (document.body || document.documentElement).appendChild(outer);
- var w1 = inner.offsetWidth;
- outer.style.overflow = 'scroll';
- var w2 = inner.offsetWidth;
- if (w1 == w2) {
- w2 = outer.clientWidth;
- }
- (document.body || document.documentElement).removeChild(outer);
- return w1 - w2;
- }
- /**
- * Returns the computed width of the native browser scroll bar.
- *
- * @return {Number} width
- */
- function getScrollbarWidth() {
- if (cachedScrollbarWidth === void 0) {
- cachedScrollbarWidth = walkontableCalculateScrollbarWidth();
- }
- return cachedScrollbarWidth;
- }
- /**
- * Checks if the provided element has a vertical scrollbar.
- *
- * @param {HTMLElement} element
- * @returns {Boolean}
- */
- function hasVerticalScrollbar(element) {
- return element.offsetWidth !== element.clientWidth;
- }
- /**
- * Checks if the provided element has a vertical scrollbar.
- *
- * @param {HTMLElement} element
- * @returns {Boolean}
- */
- function hasHorizontalScrollbar(element) {
- return element.offsetHeight !== element.clientHeight;
- }
- /**
- * Sets overlay position depending on it's type and used browser
- */
- function setOverlayPosition(overlayElem, left, top) {
- if ((0, _browser.isIE8)() || (0, _browser.isIE9)()) {
- overlayElem.style.top = top;
- overlayElem.style.left = left;
- } else if ((0, _browser.isSafari)()) {
- overlayElem.style['-webkit-transform'] = 'translate3d(' + left + ',' + top + ',0)';
- } else {
- overlayElem.style.transform = 'translate3d(' + left + ',' + top + ',0)';
- }
- }
- function getCssTransform(element) {
- var transform;
- if (element.style.transform && (transform = element.style.transform) !== '') {
- return ['transform', transform];
- } else if (element.style['-webkit-transform'] && (transform = element.style['-webkit-transform']) !== '') {
- return ['-webkit-transform', transform];
- }
- return -1;
- }
- function resetCssTransform(element) {
- if (element.style.transform && element.style.transform !== '') {
- element.style.transform = '';
- } else if (element.style['-webkit-transform'] && element.style['-webkit-transform'] !== '') {
- element.style['-webkit-transform'] = '';
- }
- }
- /**
- * Determines if the given DOM element is an input field.
- * Notice: By 'input' we mean input, textarea and select nodes
- *
- * @param {HTMLElement} element - DOM element
- * @returns {Boolean}
- */
- function isInput(element) {
- var inputs = ['INPUT', 'SELECT', 'TEXTAREA'];
- return element && (inputs.indexOf(element.nodeName) > -1 || element.contentEditable === 'true');
- }
- /**
- * Determines if the given DOM element is an input field placed OUTSIDE of HOT.
- * Notice: By 'input' we mean input, textarea and select nodes
- *
- * @param {HTMLElement} element - DOM element
- * @returns {Boolean}
- */
- function isOutsideInput(element) {
- return isInput(element) && element.className.indexOf('handsontableInput') == -1 && element.className.indexOf('copyPaste') == -1;
- }
- /***/ }),
- /* 3 */
- /***/ (function(module, exports) {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
- if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
- /***/ }),
- /* 4 */
- /***/ (function(module, exports) {
- module.exports = function(it){
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /* 5 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(4);
- module.exports = function(it){
- if(!isObject(it))throw TypeError(it + ' is not an object!');
- return it;
- };
- /***/ }),
- /* 6 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(5)
- , IE8_DOM_DEFINE = __webpack_require__(82)
- , toPrimitive = __webpack_require__(58)
- , dP = Object.defineProperty;
- exports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes){
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if(IE8_DOM_DEFINE)try {
- return dP(O, P, Attributes);
- } catch(e){ /* empty */ }
- if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
- if('value' in Attributes)O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /* 7 */
- /***/ (function(module, exports, __webpack_require__) {
- // Thank's IE8 for his funny defineProperty
- module.exports = !__webpack_require__(14)(function(){
- return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
- });
- /***/ }),
- /* 8 */
- /***/ (function(module, exports) {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function(it, key){
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /* 9 */
- /***/ (function(module, exports, __webpack_require__) {
- // to indexed object, toObject with fallback for non-array-like ES3 strings
- var IObject = __webpack_require__(49)
- , defined = __webpack_require__(13);
- module.exports = function(it){
- return IObject(defined(it));
- };
- /***/ }),
- /* 10 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.15 ToLength
- var toInteger = __webpack_require__(42)
- , min = Math.min;
- module.exports = function(it){
- return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
- };
- /***/ }),
- /* 11 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _object = __webpack_require__(25);
- var _array = __webpack_require__(24);
- var _eventManager = __webpack_require__(23);
- var _eventManager2 = _interopRequireDefault(_eventManager);
- var _core = __webpack_require__(62);
- var _core2 = _interopRequireDefault(_core);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var registeredOverlays = {};
- /**
- * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable
- * and (optionally) implements behavior needed for native horizontal and vertical scrolling.
- *
- * @class Overlay
- */
- var Overlay = function () {
- _createClass(Overlay, null, [{
- key: 'registerOverlay',
- /**
- * Register overlay class.
- *
- * @param {String} type Overlay type, one of the CLONE_TYPES value
- * @param {Overlay} overlayClass Overlay class extended from base overlay class {@link Overlay}
- */
- value: function registerOverlay(type, overlayClass) {
- if (Overlay.CLONE_TYPES.indexOf(type) === -1) {
- throw new Error('Unsupported overlay (' + type + ').');
- }
- registeredOverlays[type] = overlayClass;
- }
- /**
- * Create new instance of overlay type.
- *
- * @param {String} type Overlay type, one of the CLONE_TYPES value
- * @param {Walkontable} wot Walkontable instance
- */
- }, {
- key: 'createOverlay',
- value: function createOverlay(type, wot) {
- return new registeredOverlays[type](wot);
- }
- /**
- * Check if specified overlay was registered.
- *
- * @param {String} type Overlay type, one of the CLONE_TYPES value
- * @returns {Boolean}
- */
- }, {
- key: 'hasOverlay',
- value: function hasOverlay(type) {
- return registeredOverlays[type] !== void 0;
- }
- /**
- * Checks if overlay object (`overlay`) is instance of overlay type (`type`).
- *
- * @param {Overlay} overlay Overlay object
- * @param {String} type Overlay type, one of the CLONE_TYPES value
- * @returns {Boolean}
- */
- }, {
- key: 'isOverlayTypeOf',
- value: function isOverlayTypeOf(overlay, type) {
- if (!overlay || !registeredOverlays[type]) {
- return false;
- }
- return overlay instanceof registeredOverlays[type];
- }
- /**
- * @param {Walkontable} wotInstance
- */
- }, {
- key: 'CLONE_TOP',
- /**
- * @type {String}
- */
- get: function get() {
- return 'top';
- }
- /**
- * @type {String}
- */
- }, {
- key: 'CLONE_BOTTOM',
- get: function get() {
- return 'bottom';
- }
- /**
- * @type {String}
- */
- }, {
- key: 'CLONE_LEFT',
- get: function get() {
- return 'left';
- }
- /**
- * @type {String}
- */
- }, {
- key: 'CLONE_TOP_LEFT_CORNER',
- get: function get() {
- return 'top_left_corner';
- }
- /**
- * @type {String}
- */
- }, {
- key: 'CLONE_BOTTOM_LEFT_CORNER',
- get: function get() {
- return 'bottom_left_corner';
- }
- /**
- * @type {String}
- */
- }, {
- key: 'CLONE_DEBUG',
- get: function get() {
- return 'debug';
- }
- /**
- * List of all availables clone types
- *
- * @type {Array}
- */
- }, {
- key: 'CLONE_TYPES',
- get: function get() {
- return [Overlay.CLONE_TOP, Overlay.CLONE_BOTTOM, Overlay.CLONE_LEFT, Overlay.CLONE_TOP_LEFT_CORNER, Overlay.CLONE_BOTTOM_LEFT_CORNER, Overlay.CLONE_DEBUG];
- }
- }]);
- function Overlay(wotInstance) {
- _classCallCheck(this, Overlay);
- (0, _object.defineGetter)(this, 'wot', wotInstance, {
- writable: false
- });
- // legacy support, deprecated in the future
- this.instance = this.wot;
- this.type = '';
- this.mainTableScrollableElement = null;
- this.TABLE = this.wot.wtTable.TABLE;
- this.hider = this.wot.wtTable.hider;
- this.spreader = this.wot.wtTable.spreader;
- this.holder = this.wot.wtTable.holder;
- this.wtRootElement = this.wot.wtTable.wtRootElement;
- this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
- this.areElementSizesAdjusted = false;
- this.updateStateOfRendering();
- }
- /**
- * Update internal state of object with an information about the need of full rendering of the overlay.
- *
- * @returns {Boolean} Returns `true` if the state has changed since the last check.
- */
- _createClass(Overlay, [{
- key: 'updateStateOfRendering',
- value: function updateStateOfRendering() {
- var previousState = this.needFullRender;
- this.needFullRender = this.shouldBeRendered();
- var changed = previousState !== this.needFullRender;
- if (changed && !this.needFullRender) {
- this.reset();
- }
- return changed;
- }
- /**
- * Checks if overlay should be fully rendered
- *
- * @returns {Boolean}
- */
- }, {
- key: 'shouldBeRendered',
- value: function shouldBeRendered() {
- return true;
- }
- /**
- * Update the trimming container.
- */
- }, {
- key: 'updateTrimmingContainer',
- value: function updateTrimmingContainer() {
- this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
- }
- /**
- * Update the main scrollable element.
- */
- }, {
- key: 'updateMainScrollableElement',
- value: function updateMainScrollableElement() {
- this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
- }
- /**
- * Make a clone of table for overlay
- *
- * @param {String} direction Can be `Overlay.CLONE_TOP`, `Overlay.CLONE_LEFT`,
- * `Overlay.CLONE_TOP_LEFT_CORNER`, `Overlay.CLONE_DEBUG`
- * @returns {Walkontable}
- */
- }, {
- key: 'makeClone',
- value: function makeClone(direction) {
- if (Overlay.CLONE_TYPES.indexOf(direction) === -1) {
- throw new Error('Clone type "' + direction + '" is not supported.');
- }
- var clone = document.createElement('DIV');
- var clonedTable = document.createElement('TABLE');
- clone.className = 'ht_clone_' + direction + ' handsontable';
- clone.style.position = 'absolute';
- clone.style.top = 0;
- clone.style.left = 0;
- clone.style.overflow = 'hidden';
- clonedTable.className = this.wot.wtTable.TABLE.className;
- clone.appendChild(clonedTable);
- this.type = direction;
- this.wot.wtTable.wtRootElement.parentNode.appendChild(clone);
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === Overlay.CLONE_TOP || preventOverflow === 'vertical' && this.type === Overlay.CLONE_LEFT) {
- this.mainTableScrollableElement = window;
- } else {
- this.mainTableScrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
- }
- return new _core2.default({
- cloneSource: this.wot,
- cloneOverlay: this,
- table: clonedTable
- });
- }
- /**
- * Refresh/Redraw overlay
- *
- * @param {Boolean} [fastDraw=false]
- */
- }, {
- key: 'refresh',
- value: function refresh() {
- var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- // When hot settings are changed we allow to refresh overlay once before blocking
- var nextCycleRenderFlag = this.shouldBeRendered();
- if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {
- this.clone.draw(fastDraw);
- }
- this.needFullRender = nextCycleRenderFlag;
- }
- /**
- * Reset overlay styles to initial values.
- */
- }, {
- key: 'reset',
- value: function reset() {
- if (!this.clone) {
- return;
- }
- var holder = this.clone.wtTable.holder;
- var hider = this.clone.wtTable.hider;
- var holderStyle = holder.style;
- var hidderStyle = hider.style;
- var rootStyle = holder.parentNode.style;
- (0, _array.arrayEach)([holderStyle, hidderStyle, rootStyle], function (style) {
- style.width = '';
- style.height = '';
- });
- }
- /**
- * Destroy overlay instance
- */
- }, {
- key: 'destroy',
- value: function destroy() {
- new _eventManager2.default(this.clone).destroy();
- }
- }]);
- return Overlay;
- }();
- exports.default = Overlay;
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
- // optional / simple context binding
- var aFunction = __webpack_require__(44);
- module.exports = function(fn, that, length){
- aFunction(fn);
- if(that === undefined)return fn;
- switch(length){
- case 1: return function(a){
- return fn.call(that, a);
- };
- case 2: return function(a, b){
- return fn.call(that, a, b);
- };
- case 3: return function(a, b, c){
- return fn.call(that, a, b, c);
- };
- }
- return function(/* ...args */){
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /* 13 */
- /***/ (function(module, exports) {
- // 7.2.1 RequireObjectCoercible(argument)
- module.exports = function(it){
- if(it == undefined)throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /* 14 */
- /***/ (function(module, exports) {
- module.exports = function(exec){
- try {
- return !!exec();
- } catch(e){
- return true;
- }
- };
- /***/ }),
- /* 15 */
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__(6)
- , createDesc = __webpack_require__(20);
- module.exports = __webpack_require__(7) ? function(object, key, value){
- return dP.f(object, key, createDesc(1, value));
- } : function(object, key, value){
- object[key] = value;
- return object;
- };
- /***/ }),
- /* 16 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(3)
- , hide = __webpack_require__(15)
- , has = __webpack_require__(8)
- , SRC = __webpack_require__(31)('src')
- , TO_STRING = 'toString'
- , $toString = Function[TO_STRING]
- , TPL = ('' + $toString).split(TO_STRING);
- __webpack_require__(26).inspectSource = function(it){
- return $toString.call(it);
- };
- (module.exports = function(O, key, val, safe){
- var isFunction = typeof val == 'function';
- if(isFunction)has(val, 'name') || hide(val, 'name', key);
- if(O[key] === val)return;
- if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
- if(O === global){
- O[key] = val;
- } else {
- if(!safe){
- delete O[key];
- hide(O, key, val);
- } else {
- if(O[key])O[key] = val;
- else hide(O, key, val);
- }
- }
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, TO_STRING, function toString(){
- return typeof this == 'function' && this[SRC] || $toString.call(this);
- });
- /***/ }),
- /* 17 */
- /***/ (function(module, exports, __webpack_require__) {
- // 22.1.3.31 Array.prototype[@@unscopables]
- var UNSCOPABLES = __webpack_require__(1)('unscopables')
- , ArrayProto = Array.prototype;
- if(ArrayProto[UNSCOPABLES] == undefined)__webpack_require__(15)(ArrayProto, UNSCOPABLES, {});
- module.exports = function(key){
- ArrayProto[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /* 18 */
- /***/ (function(module, exports) {
- var toString = {}.toString;
- module.exports = function(it){
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /* 19 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
- var $keys = __webpack_require__(91)
- , enumBugKeys = __webpack_require__(47);
- module.exports = Object.keys || function keys(O){
- return $keys(O, enumBugKeys);
- };
- /***/ }),
- /* 20 */
- /***/ (function(module, exports) {
- module.exports = function(bitmap, value){
- return {
- enumerable : !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable : !(bitmap & 4),
- value : value
- };
- };
- /***/ }),
- /* 21 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.13 ToObject(argument)
- var defined = __webpack_require__(13);
- module.exports = function(it){
- return Object(defined(it));
- };
- /***/ }),
- /* 22 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * CellCoords holds cell coordinates (row, column) and few method to validate them and
- * retrieve as an array or an object
- *
- * @class CellCoords
- */
- var CellCoords = function () {
- /**
- * @param {Number} row Row index
- * @param {Number} col Column index
- */
- function CellCoords(row, col) {
- _classCallCheck(this, CellCoords);
- if (typeof row !== 'undefined' && typeof col !== 'undefined') {
- this.row = row;
- this.col = col;
- } else {
- this.row = null;
- this.col = null;
- }
- }
- /**
- * Checks if given set of coordinates is valid in context of a given Walkontable instance
- *
- * @param {Walkontable} wotInstance
- * @returns {Boolean}
- */
- _createClass(CellCoords, [{
- key: 'isValid',
- value: function isValid(wotInstance) {
- // is it a valid cell index (0 or higher)
- if (this.row < 0 || this.col < 0) {
- return false;
- }
- // is selection within total rows and columns
- if (this.row >= wotInstance.getSetting('totalRows') || this.col >= wotInstance.getSetting('totalColumns')) {
- return false;
- }
- return true;
- }
- /**
- * Checks if this cell coords are the same as cell coords given as a parameter
- *
- * @param {CellCoords} cellCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isEqual',
- value: function isEqual(cellCoords) {
- if (cellCoords === this) {
- return true;
- }
- return this.row === cellCoords.row && this.col === cellCoords.col;
- }
- /**
- * Checks if tested coordinates are positioned in south-east from this cell coords
- *
- * @param {Object} testedCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isSouthEastOf',
- value: function isSouthEastOf(testedCoords) {
- return this.row >= testedCoords.row && this.col >= testedCoords.col;
- }
- /**
- * Checks if tested coordinates are positioned in north-east from this cell coords
- *
- * @param {Object} testedCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isNorthWestOf',
- value: function isNorthWestOf(testedCoords) {
- return this.row <= testedCoords.row && this.col <= testedCoords.col;
- }
- /**
- * Checks if tested coordinates are positioned in south-west from this cell coords
- *
- * @param {Object} testedCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isSouthWestOf',
- value: function isSouthWestOf(testedCoords) {
- return this.row >= testedCoords.row && this.col <= testedCoords.col;
- }
- /**
- * Checks if tested coordinates are positioned in north-east from this cell coords
- *
- * @param {Object} testedCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isNorthEastOf',
- value: function isNorthEastOf(testedCoords) {
- return this.row <= testedCoords.row && this.col >= testedCoords.col;
- }
- }]);
- return CellCoords;
- }();
- exports.default = CellCoords;
- /***/ }),
- /* 23 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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';
- exports.getListenersCounter = getListenersCounter;
- var _element = __webpack_require__(2);
- var _feature = __webpack_require__(74);
- var _event = __webpack_require__(73);
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * Counter which tracks unregistered listeners (useful for detecting memory leaks).
- *
- * @type {Number}
- */
- var listenersCounter = 0;
- /**
- * Event DOM manager for internal use in Handsontable.
- *
- * @class EventManager
- * @util
- */
- var EventManager = function () {
- /**
- * @param {Object} [context=null]
- * @private
- */
- function EventManager() {
- var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- _classCallCheck(this, EventManager);
- this.context = context || this;
- if (!this.context.eventListeners) {
- this.context.eventListeners = [];
- }
- }
- /**
- * Register specified listener (`eventName`) to the element.
- *
- * @param {Element} element Target element.
- * @param {String} eventName Event name.
- * @param {Function} callback Function which will be called after event occur.
- * @returns {Function} Returns function which you can easily call to remove that event
- */
- _createClass(EventManager, [{
- key: 'addEventListener',
- value: function addEventListener(element, eventName, callback) {
- var _this = this;
- var context = this.context;
- function callbackProxy(event) {
- event = extendEvent(context, event);
- callback.call(this, event);
- }
- this.context.eventListeners.push({
- element: element,
- event: eventName,
- callback: callback,
- callbackProxy: callbackProxy
- });
- if (window.addEventListener) {
- element.addEventListener(eventName, callbackProxy, false);
- } else {
- element.attachEvent('on' + eventName, callbackProxy);
- }
- listenersCounter++;
- return function () {
- _this.removeEventListener(element, eventName, callback);
- };
- }
- /**
- * Remove the event listener previously registered.
- *
- * @param {Element} element Target element.
- * @param {String} eventName Event name.
- * @param {Function} callback Function to remove from the event target. It must be the same as during registration listener.
- */
- }, {
- key: 'removeEventListener',
- value: function removeEventListener(element, eventName, callback) {
- var len = this.context.eventListeners.length;
- var tmpEvent = void 0;
- while (len--) {
- tmpEvent = this.context.eventListeners[len];
- if (tmpEvent.event == eventName && tmpEvent.element == element) {
- if (callback && callback != tmpEvent.callback) {
- /* eslint-disable no-continue */
- continue;
- }
- this.context.eventListeners.splice(len, 1);
- if (tmpEvent.element.removeEventListener) {
- tmpEvent.element.removeEventListener(tmpEvent.event, tmpEvent.callbackProxy, false);
- } else {
- tmpEvent.element.detachEvent('on' + tmpEvent.event, tmpEvent.callbackProxy);
- }
- listenersCounter--;
- }
- }
- }
- /**
- * Clear all previously registered events.
- *
- * @private
- * @since 0.15.0-beta3
- */
- }, {
- key: 'clearEvents',
- value: function clearEvents() {
- if (!this.context) {
- return;
- }
- var len = this.context.eventListeners.length;
- while (len--) {
- var event = this.context.eventListeners[len];
- if (event) {
- this.removeEventListener(event.element, event.event, event.callback);
- }
- }
- }
- /**
- * Clear all previously registered events.
- */
- }, {
- key: 'clear',
- value: function clear() {
- this.clearEvents();
- }
- /**
- * Destroy instance of EventManager.
- */
- }, {
- key: 'destroy',
- value: function destroy() {
- this.clearEvents();
- this.context = null;
- }
- /**
- * Trigger event at the specified target element.
- *
- * @param {Element} element Target element.
- * @param {String} eventName Event name.
- */
- }, {
- key: 'fireEvent',
- value: function fireEvent(element, eventName) {
- var options = {
- bubbles: true,
- cancelable: eventName !== 'mousemove',
- view: window,
- detail: 0,
- screenX: 0,
- screenY: 0,
- clientX: 1,
- clientY: 1,
- ctrlKey: false,
- altKey: false,
- shiftKey: false,
- metaKey: false,
- button: 0,
- relatedTarget: undefined
- };
- var event;
- if (document.createEvent) {
- event = document.createEvent('MouseEvents');
- 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);
- } else {
- event = document.createEventObject();
- }
- if (element.dispatchEvent) {
- element.dispatchEvent(event);
- } else {
- element.fireEvent('on' + eventName, event);
- }
- }
- }]);
- return EventManager;
- }();
- /**
- * @param {Object} context
- * @param {Event} event
- * @private
- * @returns {*}
- */
- function extendEvent(context, event) {
- var componentName = 'HOT-TABLE';
- var isHotTableSpotted = void 0;
- var fromElement = void 0;
- var realTarget = void 0;
- var target = void 0;
- var len = void 0;
- var nativeStopImmediatePropagation = void 0;
- event.isTargetWebComponent = false;
- event.realTarget = event.target;
- nativeStopImmediatePropagation = event.stopImmediatePropagation;
- event.stopImmediatePropagation = function () {
- nativeStopImmediatePropagation.apply(this);
- (0, _event.stopImmediatePropagation)(this);
- };
- if (!EventManager.isHotTableEnv) {
- return event;
- }
- event = (0, _element.polymerWrap)(event);
- len = event.path ? event.path.length : 0;
- while (len--) {
- if (event.path[len].nodeName === componentName) {
- isHotTableSpotted = true;
- } else if (isHotTableSpotted && event.path[len].shadowRoot) {
- target = event.path[len];
- break;
- }
- if (len === 0 && !target) {
- target = event.path[len];
- }
- }
- if (!target) {
- target = event.target;
- }
- event.isTargetWebComponent = true;
- if ((0, _feature.isWebComponentSupportedNatively)()) {
- event.realTarget = event.srcElement || event.toElement;
- } else if (context instanceof Core || context instanceof Walkontable) {
- // Polymer doesn't support `event.target` property properly we must emulate it ourselves
- if (context instanceof Core) {
- fromElement = context.view ? context.view.wt.wtTable.TABLE : null;
- } else if (context instanceof Walkontable) {
- // .wtHider
- fromElement = context.wtTable.TABLE.parentNode.parentNode;
- }
- realTarget = (0, _element.closest)(event.target, [componentName], fromElement);
- if (realTarget) {
- event.realTarget = fromElement.querySelector(componentName) || event.target;
- } else {
- event.realTarget = event.target;
- }
- }
- Object.defineProperty(event, 'target', {
- get: function get() {
- return (0, _element.polymerWrap)(target);
- },
- enumerable: true,
- configurable: true
- });
- return event;
- }
- exports.default = EventManager;
- function getListenersCounter() {
- return listenersCounter;
- };
- /***/ }),
- /* 24 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.to2dArray = to2dArray;
- exports.extendArray = extendArray;
- exports.pivot = pivot;
- exports.arrayReduce = arrayReduce;
- exports.arrayFilter = arrayFilter;
- exports.arrayMap = arrayMap;
- exports.arrayEach = arrayEach;
- exports.arraySum = arraySum;
- exports.arrayMax = arrayMax;
- exports.arrayMin = arrayMin;
- exports.arrayAvg = arrayAvg;
- exports.arrayFlatten = arrayFlatten;
- exports.arrayUnique = arrayUnique;
- function to2dArray(arr) {
- var i = 0,
- ilen = arr.length;
- while (i < ilen) {
- arr[i] = [arr[i]];
- i++;
- }
- }
- function extendArray(arr, extension) {
- var i = 0,
- ilen = extension.length;
- while (i < ilen) {
- arr.push(extension[i]);
- i++;
- }
- }
- function pivot(arr) {
- var pivotedArr = [];
- if (!arr || arr.length === 0 || !arr[0] || arr[0].length === 0) {
- return pivotedArr;
- }
- var rowCount = arr.length;
- var colCount = arr[0].length;
- for (var i = 0; i < rowCount; i++) {
- for (var j = 0; j < colCount; j++) {
- if (!pivotedArr[j]) {
- pivotedArr[j] = [];
- }
- pivotedArr[j][i] = arr[i][j];
- }
- }
- return pivotedArr;
- }
- /**
- * A specialized version of `.reduce` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * {@link https://github.com/lodash/lodash/blob/master/lodash.js}
- *
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {Boolean} [initFromArray] Specify using the first element of `array` as the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initFromArray) {
- var index = -1,
- length = array.length;
- if (initFromArray && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
- /**
- * A specialized version of `.filter` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * {@link https://github.com/lodash/lodash/blob/master/lodash.js}
- *
- * @param {Array} array The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[++resIndex] = value;
- }
- }
- return result;
- }
- /**
- * A specialized version of `.map` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array.length,
- resIndex = -1,
- result = [];
- while (++index < length) {
- var value = array[index];
- result[++resIndex] = iteratee(value, index, array);
- }
- return result;
- }
- /**
- * A specialized version of `.forEach` for arrays without support for callback
- * shorthands and `this` binding.
- *
- * {@link https://github.com/lodash/lodash/blob/master/lodash.js}
- *
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array.length;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- /**
- * Calculate sum value for each item of the array.
- *
- * @param {Array} array The array to process.
- * @returns {Number} Returns calculated sum value.
- */
- function arraySum(array) {
- return arrayReduce(array, function (a, b) {
- return a + b;
- }, 0);
- }
- /**
- * Returns the highest value from an array. Can be array of numbers or array of strings.
- * NOTICE: Mixed values is not supported.
- *
- * @param {Array} array The array to process.
- * @returns {Number} Returns the highest value from an array.
- */
- function arrayMax(array) {
- return arrayReduce(array, function (a, b) {
- return a > b ? a : b;
- }, Array.isArray(array) ? array[0] : void 0);
- }
- /**
- * Returns the lowest value from an array. Can be array of numbers or array of strings.
- * NOTICE: Mixed values is not supported.
- *
- * @param {Array} array The array to process.
- * @returns {Number} Returns the lowest value from an array.
- */
- function arrayMin(array) {
- return arrayReduce(array, function (a, b) {
- return a < b ? a : b;
- }, Array.isArray(array) ? array[0] : void 0);
- }
- /**
- * Calculate average value for each item of the array.
- *
- * @param {Array} array The array to process.
- * @returns {Number} Returns calculated average value.
- */
- function arrayAvg(array) {
- if (!array.length) {
- return 0;
- }
- return arraySum(array) / array.length;
- }
- /**
- * Flatten multidimensional array.
- *
- * @param {Array} array Array of Arrays
- * @returns {Array}
- */
- function arrayFlatten(array) {
- return arrayReduce(array, function (initial, value) {
- return initial.concat(Array.isArray(value) ? arrayFlatten(value) : value);
- }, []);
- }
- /**
- * Unique values in the array.
- *
- * @param {Array} array The array to process.
- * @returns {Array}
- */
- function arrayUnique(array) {
- var unique = [];
- arrayEach(array, function (value) {
- if (unique.indexOf(value) === -1) {
- unique.push(value);
- }
- });
- return unique;
- }
- /***/ }),
- /* 25 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; };
- exports.duckSchema = duckSchema;
- exports.inherit = inherit;
- exports.extend = extend;
- exports.deepExtend = deepExtend;
- exports.deepClone = deepClone;
- exports.clone = clone;
- exports.mixin = mixin;
- exports.isObjectEquals = isObjectEquals;
- exports.isObject = isObject;
- exports.defineGetter = defineGetter;
- exports.objectEach = objectEach;
- exports.getProperty = getProperty;
- exports.deepObjectSize = deepObjectSize;
- exports.createObjectPropListener = createObjectPropListener;
- exports.hasOwnProperty = hasOwnProperty;
- var _array = __webpack_require__(24);
- 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; }
- /**
- * Generate schema for passed object.
- *
- * @param {Array|Object} object
- * @returns {Array|Object}
- */
- function duckSchema(object) {
- var schema;
- if (Array.isArray(object)) {
- schema = [];
- } else {
- schema = {};
- objectEach(object, function (value, key) {
- if (key === '__children') {
- return;
- }
- if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !Array.isArray(value)) {
- schema[key] = duckSchema(value);
- } else if (Array.isArray(value)) {
- if (value.length && _typeof(value[0]) === 'object' && !Array.isArray(value[0])) {
- schema[key] = [duckSchema(value[0])];
- } else {
- schema[key] = [];
- }
- } else {
- schema[key] = null;
- }
- });
- }
- return schema;
- }
- /**
- * Inherit without without calling parent constructor, and setting `Child.prototype.constructor` to `Child` instead of `Parent`.
- * Creates temporary dummy function to call it as constructor.
- * Described in ticket: https://github.com/handsontable/handsontable/pull/516
- *
- * @param {Object} Child child class
- * @param {Object} Parent parent class
- * @return {Object} extended Child
- */
- function inherit(Child, Parent) {
- Parent.prototype.constructor = Parent;
- Child.prototype = new Parent();
- Child.prototype.constructor = Child;
- return Child;
- }
- /**
- * Perform shallow extend of a target object with extension's own properties.
- *
- * @param {Object} target An object that will receive the new properties.
- * @param {Object} extension An object containing additional properties to merge into the target.
- */
- function extend(target, extension) {
- objectEach(extension, function (value, key) {
- target[key] = value;
- });
- return target;
- }
- /**
- * Perform deep extend of a target object with extension's own properties.
- *
- * @param {Object} target An object that will receive the new properties.
- * @param {Object} extension An object containing additional properties to merge into the target.
- */
- function deepExtend(target, extension) {
- objectEach(extension, function (value, key) {
- if (extension[key] && _typeof(extension[key]) === 'object') {
- if (!target[key]) {
- if (Array.isArray(extension[key])) {
- target[key] = [];
- } else if (Object.prototype.toString.call(extension[key]) === '[object Date]') {
- target[key] = extension[key];
- } else {
- target[key] = {};
- }
- }
- deepExtend(target[key], extension[key]);
- } else {
- target[key] = extension[key];
- }
- });
- }
- /**
- * Perform deep clone of an object.
- * WARNING! Only clones JSON properties. Will cause error when `obj` contains a function, Date, etc.
- *
- * @param {Object} obj An object that will be cloned
- * @return {Object}
- */
- function deepClone(obj) {
- if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {
- return JSON.parse(JSON.stringify(obj));
- }
- return obj;
- }
- /**
- * Shallow clone object.
- *
- * @param {Object} object
- * @returns {Object}
- */
- function clone(object) {
- var result = {};
- objectEach(object, function (value, key) {
- result[key] = value;
- });
- return result;
- }
- /**
- * Extend the Base object (usually prototype) of the functionality the `mixins` objects.
- *
- * @param {Object} Base Base object which will be extended.
- * @param {Object} mixins The object of the functionality will be "copied".
- * @returns {Object}
- */
- function mixin(Base) {
- if (!Base.MIXINS) {
- Base.MIXINS = [];
- }
- for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- mixins[_key - 1] = arguments[_key];
- }
- (0, _array.arrayEach)(mixins, function (mixin) {
- Base.MIXINS.push(mixin.MIXIN_NAME);
- objectEach(mixin, function (value, key) {
- if (Base.prototype[key] !== void 0) {
- throw new Error('Mixin conflict. Property \'' + key + '\' already exist and cannot be overwritten.');
- }
- if (typeof value === 'function') {
- Base.prototype[key] = value;
- } else {
- var getter = function _getter(propertyName, initialValue) {
- propertyName = '_' + propertyName;
- var initValue = function initValue(value) {
- if (Array.isArray(value) || isObject(value)) {
- value = deepClone(value);
- }
- return value;
- };
- return function () {
- if (this[propertyName] === void 0) {
- this[propertyName] = initValue(initialValue);
- }
- return this[propertyName];
- };
- };
- var setter = function _setter(propertyName) {
- propertyName = '_' + propertyName;
- return function (value) {
- this[propertyName] = value;
- };
- };
- Object.defineProperty(Base.prototype, key, {
- get: getter(key, value),
- set: setter(key),
- configurable: true
- });
- }
- });
- });
- return Base;
- }
- /**
- * Checks if two objects or arrays are (deep) equal
- *
- * @param {Object|Array} object1
- * @param {Object|Array} object2
- * @returns {Boolean}
- */
- function isObjectEquals(object1, object2) {
- return JSON.stringify(object1) === JSON.stringify(object2);
- }
- /**
- * Determines whether given object is a plain Object.
- * Note: String and Array are not plain Objects
- * @param {*} obj
- * @returns {boolean}
- */
- function isObject(obj) {
- return Object.prototype.toString.call(obj) == '[object Object]';
- }
- function defineGetter(object, property, value, options) {
- options.value = value;
- options.writable = options.writable !== false;
- options.enumerable = options.enumerable !== false;
- options.configurable = options.configurable !== false;
- Object.defineProperty(object, property, options);
- }
- /**
- * A specialized version of `.forEach` for objects.
- *
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function objectEach(object, iteratee) {
- for (var key in object) {
- if (!object.hasOwnProperty || object.hasOwnProperty && Object.prototype.hasOwnProperty.call(object, key)) {
- if (iteratee(object[key], key, object) === false) {
- break;
- }
- }
- }
- return object;
- }
- /**
- * Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. `'foo.bar.baz'`).
- *
- * @param {Object} object Object which value will be exported.
- * @param {String} name Object property name.
- * @returns {*}
- */
- function getProperty(object, name) {
- var names = name.split('.');
- var result = object;
- objectEach(names, function (name) {
- result = result[name];
- if (result === void 0) {
- result = void 0;
- return false;
- }
- });
- return result;
- }
- /**
- * Return object length (recursively).
- *
- * @param {*} object Object for which we want get length.
- * @returns {Number}
- */
- function deepObjectSize(object) {
- if (!isObject(object)) {
- return 0;
- }
- var recursObjLen = function recursObjLen(obj) {
- var result = 0;
- if (isObject(obj)) {
- objectEach(obj, function (key) {
- result += recursObjLen(key);
- });
- } else {
- result++;
- }
- return result;
- };
- return recursObjLen(object);
- }
- /**
- * Create object with property where its value change will be observed.
- *
- * @param {*} [defaultValue=undefined] Default value.
- * @param {String} [propertyToListen='value'] Property to listen.
- * @returns {Object}
- */
- function createObjectPropListener(defaultValue) {
- var _holder;
- var propertyToListen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
- var privateProperty = '_' + propertyToListen;
- var holder = (_holder = {
- _touched: false
- }, _defineProperty(_holder, privateProperty, defaultValue), _defineProperty(_holder, 'isTouched', function isTouched() {
- return this._touched;
- }), _holder);
- Object.defineProperty(holder, propertyToListen, {
- get: function get() {
- return this[privateProperty];
- },
- set: function set(value) {
- this._touched = true;
- this[privateProperty] = value;
- },
- enumerable: true,
- configurable: true
- });
- return holder;
- }
- /**
- * Check if at specified `key` there is any value for `object`.
- *
- * @param {Object} object Object to search value at specyfic key.
- * @param {String} key String key to check.
- */
- function hasOwnProperty(object, key) {
- return Object.prototype.hasOwnProperty.call(object, key);
- }
- /***/ }),
- /* 26 */
- /***/ (function(module, exports) {
- var core = module.exports = {version: '2.4.0'};
- if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
- /***/ }),
- /* 27 */
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /* 28 */
- /***/ (function(module, exports, __webpack_require__) {
- var META = __webpack_require__(31)('meta')
- , isObject = __webpack_require__(4)
- , has = __webpack_require__(8)
- , setDesc = __webpack_require__(6).f
- , id = 0;
- var isExtensible = Object.isExtensible || function(){
- return true;
- };
- var FREEZE = !__webpack_require__(14)(function(){
- return isExtensible(Object.preventExtensions({}));
- });
- var setMeta = function(it){
- setDesc(it, META, {value: {
- i: 'O' + ++id, // object ID
- w: {} // weak collections IDs
- }});
- };
- var fastKey = function(it, create){
- // return primitive with prefix
- if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if(!has(it, META)){
- // can't set metadata to uncaught frozen object
- if(!isExtensible(it))return 'F';
- // not necessary to add metadata
- if(!create)return 'E';
- // add missing metadata
- setMeta(it);
- // return object ID
- } return it[META].i;
- };
- var getWeak = function(it, create){
- if(!has(it, META)){
- // can't set metadata to uncaught frozen object
- if(!isExtensible(it))return true;
- // not necessary to add metadata
- if(!create)return false;
- // add missing metadata
- setMeta(it);
- // return hash weak collections IDs
- } return it[META].w;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function(it){
- if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
- return it;
- };
- var meta = module.exports = {
- KEY: META,
- NEED: false,
- fastKey: fastKey,
- getWeak: getWeak,
- onFreeze: onFreeze
- };
- /***/ }),
- /* 29 */
- /***/ (function(module, exports) {
- exports.f = {}.propertyIsEnumerable;
- /***/ }),
- /* 30 */
- /***/ (function(module, exports, __webpack_require__) {
- var def = __webpack_require__(6).f
- , has = __webpack_require__(8)
- , TAG = __webpack_require__(1)('toStringTag');
- module.exports = function(it, tag, stat){
- if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
- };
- /***/ }),
- /* 31 */
- /***/ (function(module, exports) {
- var id = 0
- , px = Math.random();
- module.exports = function(key){
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
- /***/ }),
- /* 32 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.isIE8 = isIE8;
- exports.isIE9 = isIE9;
- exports.isSafari = isSafari;
- exports.isChrome = isChrome;
- exports.isMobileBrowser = isMobileBrowser;
- var _isIE8 = !document.createTextNode('test').textContent;
- function isIE8() {
- return _isIE8;
- }
- var _isIE9 = !!document.documentMode;
- function isIE9() {
- return _isIE9;
- }
- var _isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);
- function isSafari() {
- return _isSafari;
- }
- var _isChrome = /Chrome/.test(navigator.userAgent) && /Google/.test(navigator.vendor);
- function isChrome() {
- return _isChrome;
- }
- function isMobileBrowser(userAgent) {
- if (!userAgent) {
- userAgent = navigator.userAgent;
- }
- return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)
- );
- }
- /***/ }),
- /* 33 */
- /***/ (function(module, exports) {
- module.exports = function(it, Constructor, name, forbiddenField){
- if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
- throw TypeError(name + ': incorrect invocation!');
- } return it;
- };
- /***/ }),
- /* 34 */
- /***/ (function(module, exports, __webpack_require__) {
- // 0 -> Array#forEach
- // 1 -> Array#map
- // 2 -> Array#filter
- // 3 -> Array#some
- // 4 -> Array#every
- // 5 -> Array#find
- // 6 -> Array#findIndex
- var ctx = __webpack_require__(12)
- , IObject = __webpack_require__(49)
- , toObject = __webpack_require__(21)
- , toLength = __webpack_require__(10)
- , asc = __webpack_require__(154);
- module.exports = function(TYPE, $create){
- var IS_MAP = TYPE == 1
- , IS_FILTER = TYPE == 2
- , IS_SOME = TYPE == 3
- , IS_EVERY = TYPE == 4
- , IS_FIND_INDEX = TYPE == 6
- , NO_HOLES = TYPE == 5 || IS_FIND_INDEX
- , create = $create || asc;
- return function($this, callbackfn, that){
- var O = toObject($this)
- , self = IObject(O)
- , f = ctx(callbackfn, that, 3)
- , length = toLength(self.length)
- , index = 0
- , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
- , val, res;
- for(;length > index; index++)if(NO_HOLES || index in self){
- val = self[index];
- res = f(val, index, O);
- if(TYPE){
- if(IS_MAP)result[index] = res; // map
- else if(res)switch(TYPE){
- case 3: return true; // some
- case 5: return val; // find
- case 6: return index; // findIndex
- case 2: result.push(val); // filter
- } else if(IS_EVERY)return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
- };
- };
- /***/ }),
- /* 35 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(3)
- , $export = __webpack_require__(0)
- , redefine = __webpack_require__(16)
- , redefineAll = __webpack_require__(40)
- , meta = __webpack_require__(28)
- , forOf = __webpack_require__(37)
- , anInstance = __webpack_require__(33)
- , isObject = __webpack_require__(4)
- , fails = __webpack_require__(14)
- , $iterDetect = __webpack_require__(50)
- , setToStringTag = __webpack_require__(30)
- , inheritIfRequired = __webpack_require__(157);
- module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
- var Base = global[NAME]
- , C = Base
- , ADDER = IS_MAP ? 'set' : 'add'
- , proto = C && C.prototype
- , O = {};
- var fixMethod = function(KEY){
- var fn = proto[KEY];
- redefine(proto, KEY,
- KEY == 'delete' ? function(a){
- return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'has' ? function has(a){
- return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'get' ? function get(a){
- return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
- } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; }
- : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; }
- );
- };
- if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){
- new C().entries().next();
- }))){
- // create collection constructor
- C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
- redefineAll(C.prototype, methods);
- meta.NEED = true;
- } else {
- var instance = new C
- // early implementations not supports chaining
- , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
- , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); })
- // most early implementations doesn't supports iterables, most modern - not close it correctly
- , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new
- // for early implementations -0 and +0 not the same
- , BUGGY_ZERO = !IS_WEAK && fails(function(){
- // V8 ~ Chromium 42- fails only with 5+ elements
- var $instance = new C()
- , index = 5;
- while(index--)$instance[ADDER](index, index);
- return !$instance.has(-0);
- });
- if(!ACCEPT_ITERABLES){
- C = wrapper(function(target, iterable){
- anInstance(target, C, NAME);
- var that = inheritIfRequired(new Base, target, C);
- if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
- return that;
- });
- C.prototype = proto;
- proto.constructor = C;
- }
- if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){
- fixMethod('delete');
- fixMethod('has');
- IS_MAP && fixMethod('get');
- }
- if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER);
- // weak collections should not contains .clear method
- if(IS_WEAK && proto.clear)delete proto.clear;
- }
- setToStringTag(C, NAME);
- O[NAME] = C;
- $export($export.G + $export.W + $export.F * (C != Base), O);
- if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
- return C;
- };
- /***/ }),
- /* 36 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var hide = __webpack_require__(15)
- , redefine = __webpack_require__(16)
- , fails = __webpack_require__(14)
- , defined = __webpack_require__(13)
- , wks = __webpack_require__(1);
- module.exports = function(KEY, length, exec){
- var SYMBOL = wks(KEY)
- , fns = exec(defined, SYMBOL, ''[KEY])
- , strfn = fns[0]
- , rxfn = fns[1];
- if(fails(function(){
- var O = {};
- O[SYMBOL] = function(){ return 7; };
- return ''[KEY](O) != 7;
- })){
- redefine(String.prototype, KEY, strfn);
- hide(RegExp.prototype, SYMBOL, length == 2
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
- ? function(string, arg){ return rxfn.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function(string){ return rxfn.call(string, this); }
- );
- }
- };
- /***/ }),
- /* 37 */
- /***/ (function(module, exports, __webpack_require__) {
- var ctx = __webpack_require__(12)
- , call = __webpack_require__(87)
- , isArrayIter = __webpack_require__(83)
- , anObject = __webpack_require__(5)
- , toLength = __webpack_require__(10)
- , getIterFn = __webpack_require__(98)
- , BREAK = {}
- , RETURN = {};
- var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
- var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
- , f = ctx(fn, that, entries ? 2 : 1)
- , index = 0
- , length, step, iterator, result;
- if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
- // fast case for arrays with default iterator
- if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
- result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
- if(result === BREAK || result === RETURN)return result;
- } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
- result = call(iterator, f, step.value, entries);
- if(result === BREAK || result === RETURN)return result;
- }
- };
- exports.BREAK = BREAK;
- exports.RETURN = RETURN;
- /***/ }),
- /* 38 */
- /***/ (function(module, exports) {
- module.exports = false;
- /***/ }),
- /* 39 */
- /***/ (function(module, exports) {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /* 40 */
- /***/ (function(module, exports, __webpack_require__) {
- var redefine = __webpack_require__(16);
- module.exports = function(target, src, safe){
- for(var key in src)redefine(target, key, src[key], safe);
- return target;
- };
- /***/ }),
- /* 41 */
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__(42)
- , max = Math.max
- , min = Math.min;
- module.exports = function(index, length){
- index = toInteger(index);
- return index < 0 ? max(index + length, 0) : min(index, length);
- };
- /***/ }),
- /* 42 */
- /***/ (function(module, exports) {
- // 7.1.4 ToInteger
- var ceil = Math.ceil
- , floor = Math.floor;
- module.exports = function(it){
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
- /***/ }),
- /* 43 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _coords = __webpack_require__(22);
- var _coords2 = _interopRequireDefault(_coords);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * A cell range is a set of exactly two CellCoords (that can be the same or different)
- *
- * @class CellRange
- */
- var CellRange = function () {
- /**
- * @param {CellCoords} highlight Used to draw bold border around a cell where selection was
- * started and to edit the cell when you press Enter
- * @param {CellCoords} from Usually the same as highlight, but in Excel there is distinction - one can change
- * highlight within a selection
- * @param {CellCoords} to End selection
- */
- function CellRange(highlight, from, to) {
- _classCallCheck(this, CellRange);
- this.highlight = highlight;
- this.from = from;
- this.to = to;
- }
- /**
- * Checks if given coords are valid in context of a given Walkontable instance
- *
- * @param {Walkontable} wotInstance
- * @returns {Boolean}
- */
- _createClass(CellRange, [{
- key: 'isValid',
- value: function isValid(wotInstance) {
- return this.from.isValid(wotInstance) && this.to.isValid(wotInstance);
- }
- /**
- * Checks if this cell range is restricted to one cell
- *
- * @returns {Boolean}
- */
- }, {
- key: 'isSingle',
- value: function isSingle() {
- return this.from.row === this.to.row && this.from.col === this.to.col;
- }
- /**
- * Returns selected range height (in number of rows)
- *
- * @returns {Number}
- */
- }, {
- key: 'getHeight',
- value: function getHeight() {
- return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;
- }
- /**
- * Returns selected range width (in number of columns)
- *
- * @returns {Number}
- */
- }, {
- key: 'getWidth',
- value: function getWidth() {
- return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;
- }
- /**
- * Checks if given cell coords is within `from` and `to` cell coords of this range
- *
- * @param {CellCoords} cellCoords
- * @returns {Boolean}
- */
- }, {
- key: 'includes',
- value: function includes(cellCoords) {
- var row = cellCoords.row,
- col = cellCoords.col;
- var topLeft = this.getTopLeftCorner();
- var bottomRight = this.getBottomRightCorner();
- return topLeft.row <= row && bottomRight.row >= row && topLeft.col <= col && bottomRight.col >= col;
- }
- /**
- * Checks if given range is within of this range
- *
- * @param {CellRange} testedRange
- * @returns {Boolean}
- */
- }, {
- key: 'includesRange',
- value: function includesRange(testedRange) {
- return this.includes(testedRange.getTopLeftCorner()) && this.includes(testedRange.getBottomRightCorner());
- }
- /**
- * Checks if given range is equal to this range
- *
- * @param {CellRange} testedRange
- * @returns {Boolean}
- */
- }, {
- key: 'isEqual',
- value: function isEqual(testedRange) {
- 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);
- }
- /**
- * Checks if tested range overlaps with the range.
- * Range A is considered to to be overlapping with range B if intersection of A and B or B and A is not empty.
- *
- * @param {CellRange} testedRange
- * @returns {Boolean}
- */
- }, {
- key: 'overlaps',
- value: function overlaps(testedRange) {
- return testedRange.isSouthEastOf(this.getTopLeftCorner()) && testedRange.isNorthWestOf(this.getBottomRightCorner());
- }
- /**
- * @param {CellRange} testedCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isSouthEastOf',
- value: function isSouthEastOf(testedCoords) {
- return this.getTopLeftCorner().isSouthEastOf(testedCoords) || this.getBottomRightCorner().isSouthEastOf(testedCoords);
- }
- /**
- * @param {CellRange} testedCoords
- * @returns {Boolean}
- */
- }, {
- key: 'isNorthWestOf',
- value: function isNorthWestOf(testedCoords) {
- return this.getTopLeftCorner().isNorthWestOf(testedCoords) || this.getBottomRightCorner().isNorthWestOf(testedCoords);
- }
- /**
- * Adds a cell to a range (only if exceeds corners of the range). Returns information if range was expanded
- *
- * @param {CellCoords} cellCoords
- * @returns {Boolean}
- */
- }, {
- key: 'expand',
- value: function expand(cellCoords) {
- var topLeft = this.getTopLeftCorner();
- var bottomRight = this.getBottomRightCorner();
- if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {
- this.from = new _coords2.default(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));
- this.to = new _coords2.default(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));
- return true;
- }
- return false;
- }
- /**
- * @param {CellRange} expandingRange
- * @returns {Boolean}
- */
- }, {
- key: 'expandByRange',
- value: function expandByRange(expandingRange) {
- if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {
- return false;
- }
- var topLeft = this.getTopLeftCorner();
- var bottomRight = this.getBottomRightCorner();
- var topRight = this.getTopRightCorner();
- var bottomLeft = this.getBottomLeftCorner();
- var expandingTopLeft = expandingRange.getTopLeftCorner();
- var expandingBottomRight = expandingRange.getBottomRightCorner();
- var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);
- var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);
- var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);
- var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);
- var finalFrom = new _coords2.default(resultTopRow, resultTopCol),
- finalTo = new _coords2.default(resultBottomRow, resultBottomCol);
- var isCorner = new CellRange(finalFrom, finalFrom, finalTo).isCorner(this.from, expandingRange),
- onlyMerge = expandingRange.isEqual(new CellRange(finalFrom, finalFrom, finalTo));
- if (isCorner && !onlyMerge) {
- if (this.from.col > finalFrom.col) {
- finalFrom.col = resultBottomCol;
- finalTo.col = resultTopCol;
- }
- if (this.from.row > finalFrom.row) {
- finalFrom.row = resultBottomRow;
- finalTo.row = resultTopRow;
- }
- }
- this.from = finalFrom;
- this.to = finalTo;
- return true;
- }
- /**
- * @returns {String}
- */
- }, {
- key: 'getDirection',
- value: function getDirection() {
- if (this.from.isNorthWestOf(this.to)) {
- // NorthWest - SouthEast
- return 'NW-SE';
- } else if (this.from.isNorthEastOf(this.to)) {
- // NorthEast - SouthWest
- return 'NE-SW';
- } else if (this.from.isSouthEastOf(this.to)) {
- // SouthEast - NorthWest
- return 'SE-NW';
- } else if (this.from.isSouthWestOf(this.to)) {
- // SouthWest - NorthEast
- return 'SW-NE';
- }
- }
- /**
- * @param {String} direction
- */
- }, {
- key: 'setDirection',
- value: function setDirection(direction) {
- switch (direction) {
- case 'NW-SE':
- var _ref = [this.getTopLeftCorner(), this.getBottomRightCorner()];
- this.from = _ref[0];
- this.to = _ref[1];
- break;
- case 'NE-SW':
- var _ref2 = [this.getTopRightCorner(), this.getBottomLeftCorner()];
- this.from = _ref2[0];
- this.to = _ref2[1];
- break;
- case 'SE-NW':
- var _ref3 = [this.getBottomRightCorner(), this.getTopLeftCorner()];
- this.from = _ref3[0];
- this.to = _ref3[1];
- break;
- case 'SW-NE':
- var _ref4 = [this.getBottomLeftCorner(), this.getTopRightCorner()];
- this.from = _ref4[0];
- this.to = _ref4[1];
- break;
- default:
- break;
- }
- }
- /**
- * Get top left corner of this range
- *
- * @returns {CellCoords}
- */
- }, {
- key: 'getTopLeftCorner',
- value: function getTopLeftCorner() {
- return new _coords2.default(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));
- }
- /**
- * Get bottom right corner of this range
- *
- * @returns {CellCoords}
- */
- }, {
- key: 'getBottomRightCorner',
- value: function getBottomRightCorner() {
- return new _coords2.default(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));
- }
- /**
- * Get top right corner of this range
- *
- * @returns {CellCoords}
- */
- }, {
- key: 'getTopRightCorner',
- value: function getTopRightCorner() {
- return new _coords2.default(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));
- }
- /**
- * Get bottom left corner of this range
- *
- * @returns {CellCoords}
- */
- }, {
- key: 'getBottomLeftCorner',
- value: function getBottomLeftCorner() {
- return new _coords2.default(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));
- }
- /**
- * @param {CellCoords} coords
- * @param {CellRange} expandedRange
- * @returns {*}
- */
- }, {
- key: 'isCorner',
- value: function isCorner(coords, expandedRange) {
- if (expandedRange) {
- if (expandedRange.includes(coords)) {
- 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))) {
- return true;
- }
- }
- }
- return coords.isEqual(this.getTopLeftCorner()) || coords.isEqual(this.getTopRightCorner()) || coords.isEqual(this.getBottomLeftCorner()) || coords.isEqual(this.getBottomRightCorner());
- }
- /**
- * @param {CellCoords} coords
- * @param {CellRange} expandedRange
- * @returns {CellCoords}
- */
- }, {
- key: 'getOppositeCorner',
- value: function getOppositeCorner(coords, expandedRange) {
- if (!(coords instanceof _coords2.default)) {
- return false;
- }
- if (expandedRange) {
- if (expandedRange.includes(coords)) {
- if (this.getTopLeftCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.from.col))) {
- return this.getBottomRightCorner();
- }
- if (this.getTopRightCorner().isEqual(new _coords2.default(expandedRange.from.row, expandedRange.to.col))) {
- return this.getBottomLeftCorner();
- }
- if (this.getBottomLeftCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.from.col))) {
- return this.getTopRightCorner();
- }
- if (this.getBottomRightCorner().isEqual(new _coords2.default(expandedRange.to.row, expandedRange.to.col))) {
- return this.getTopLeftCorner();
- }
- }
- }
- if (coords.isEqual(this.getBottomRightCorner())) {
- return this.getTopLeftCorner();
- } else if (coords.isEqual(this.getTopLeftCorner())) {
- return this.getBottomRightCorner();
- } else if (coords.isEqual(this.getTopRightCorner())) {
- return this.getBottomLeftCorner();
- } else if (coords.isEqual(this.getBottomLeftCorner())) {
- return this.getTopRightCorner();
- }
- }
- /**
- * @param {CellRange} range
- * @returns {Array}
- */
- }, {
- key: 'getBordersSharedWith',
- value: function getBordersSharedWith(range) {
- if (!this.includesRange(range)) {
- return [];
- }
- var thisBorders = {
- top: Math.min(this.from.row, this.to.row),
- bottom: Math.max(this.from.row, this.to.row),
- left: Math.min(this.from.col, this.to.col),
- right: Math.max(this.from.col, this.to.col)
- };
- var rangeBorders = {
- top: Math.min(range.from.row, range.to.row),
- bottom: Math.max(range.from.row, range.to.row),
- left: Math.min(range.from.col, range.to.col),
- right: Math.max(range.from.col, range.to.col)
- };
- var result = [];
- if (thisBorders.top == rangeBorders.top) {
- result.push('top');
- }
- if (thisBorders.right == rangeBorders.right) {
- result.push('right');
- }
- if (thisBorders.bottom == rangeBorders.bottom) {
- result.push('bottom');
- }
- if (thisBorders.left == rangeBorders.left) {
- result.push('left');
- }
- return result;
- }
- /**
- * Get inner selected cell coords defined by this range
- *
- * @returns {Array}
- */
- }, {
- key: 'getInner',
- value: function getInner() {
- var topLeft = this.getTopLeftCorner();
- var bottomRight = this.getBottomRightCorner();
- var out = [];
- for (var r = topLeft.row; r <= bottomRight.row; r++) {
- for (var c = topLeft.col; c <= bottomRight.col; c++) {
- if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {
- out.push(new _coords2.default(r, c));
- }
- }
- }
- return out;
- }
- /**
- * Get all selected cell coords defined by this range
- *
- * @returns {Array}
- */
- }, {
- key: 'getAll',
- value: function getAll() {
- var topLeft = this.getTopLeftCorner();
- var bottomRight = this.getBottomRightCorner();
- var out = [];
- for (var r = topLeft.row; r <= bottomRight.row; r++) {
- for (var c = topLeft.col; c <= bottomRight.col; c++) {
- if (topLeft.row === r && topLeft.col === c) {
- out.push(topLeft);
- } else if (bottomRight.row === r && bottomRight.col === c) {
- out.push(bottomRight);
- } else {
- out.push(new _coords2.default(r, c));
- }
- }
- }
- return out;
- }
- /**
- * Runs a callback function against all cells in the range. You can break the iteration by returning
- * `false` in the callback function
- *
- * @param callback {Function}
- */
- }, {
- key: 'forAll',
- value: function forAll(callback) {
- var topLeft = this.getTopLeftCorner();
- var bottomRight = this.getBottomRightCorner();
- for (var r = topLeft.row; r <= bottomRight.row; r++) {
- for (var c = topLeft.col; c <= bottomRight.col; c++) {
- var breakIteration = callback(r, c);
- if (breakIteration === false) {
- return;
- }
- }
- }
- }
- }]);
- return CellRange;
- }();
- exports.default = CellRange;
- /***/ }),
- /* 44 */
- /***/ (function(module, exports) {
- module.exports = function(it){
- if(typeof it != 'function')throw TypeError(it + ' is not a function!');
- return it;
- };
- /***/ }),
- /* 45 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $defineProperty = __webpack_require__(6)
- , createDesc = __webpack_require__(20);
- module.exports = function(object, index, value){
- if(index in object)$defineProperty.f(object, index, createDesc(0, value));
- else object[index] = value;
- };
- /***/ }),
- /* 46 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(4)
- , document = __webpack_require__(3).document
- // in old IE typeof document.createElement is 'object'
- , is = isObject(document) && isObject(document.createElement);
- module.exports = function(it){
- return is ? document.createElement(it) : {};
- };
- /***/ }),
- /* 47 */
- /***/ (function(module, exports) {
- // IE 8- don't enum bug keys
- module.exports = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
- ).split(',');
- /***/ }),
- /* 48 */
- /***/ (function(module, exports, __webpack_require__) {
- var MATCH = __webpack_require__(1)('match');
- module.exports = function(KEY){
- var re = /./;
- try {
- '/./'[KEY](re);
- } catch(e){
- try {
- re[MATCH] = false;
- return !'/./'[KEY](re);
- } catch(f){ /* empty */ }
- } return true;
- };
- /***/ }),
- /* 49 */
- /***/ (function(module, exports, __webpack_require__) {
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- var cof = __webpack_require__(18);
- module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
- return cof(it) == 'String' ? it.split('') : Object(it);
- };
- /***/ }),
- /* 50 */
- /***/ (function(module, exports, __webpack_require__) {
- var ITERATOR = __webpack_require__(1)('iterator')
- , SAFE_CLOSING = false;
- try {
- var riter = [7][ITERATOR]();
- riter['return'] = function(){ SAFE_CLOSING = true; };
- Array.from(riter, function(){ throw 2; });
- } catch(e){ /* empty */ }
- module.exports = function(exec, skipClosing){
- if(!skipClosing && !SAFE_CLOSING)return false;
- var safe = false;
- try {
- var arr = [7]
- , iter = arr[ITERATOR]();
- iter.next = function(){ return {done: safe = true}; };
- arr[ITERATOR] = function(){ return iter; };
- exec(arr);
- } catch(e){ /* empty */ }
- return safe;
- };
- /***/ }),
- /* 51 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
- var anObject = __webpack_require__(5)
- , dPs = __webpack_require__(162)
- , enumBugKeys = __webpack_require__(47)
- , IE_PROTO = __webpack_require__(54)('IE_PROTO')
- , Empty = function(){ /* empty */ }
- , PROTOTYPE = 'prototype';
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var createDict = function(){
- // Thrash, waste and sodomy: IE GC bug
- var iframe = __webpack_require__(46)('iframe')
- , i = enumBugKeys.length
- , lt = '<'
- , gt = '>'
- , iframeDocument;
- iframe.style.display = 'none';
- __webpack_require__(81).appendChild(iframe);
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
- // createDict = iframe.contentWindow.Object;
- // html.removeChild(iframe);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
- return createDict();
- };
- module.exports = Object.create || function create(O, Properties){
- var result;
- if(O !== null){
- Empty[PROTOTYPE] = anObject(O);
- result = new Empty;
- Empty[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = createDict();
- return Properties === undefined ? result : dPs(result, Properties);
- };
- /***/ }),
- /* 52 */
- /***/ (function(module, exports, __webpack_require__) {
- var pIE = __webpack_require__(29)
- , createDesc = __webpack_require__(20)
- , toIObject = __webpack_require__(9)
- , toPrimitive = __webpack_require__(58)
- , has = __webpack_require__(8)
- , IE8_DOM_DEFINE = __webpack_require__(82)
- , gOPD = Object.getOwnPropertyDescriptor;
- exports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P){
- O = toIObject(O);
- P = toPrimitive(P, true);
- if(IE8_DOM_DEFINE)try {
- return gOPD(O, P);
- } catch(e){ /* empty */ }
- if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
- };
- /***/ }),
- /* 53 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
- var $keys = __webpack_require__(91)
- , hiddenKeys = __webpack_require__(47).concat('length', 'prototype');
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
- return $keys(O, hiddenKeys);
- };
- /***/ }),
- /* 54 */
- /***/ (function(module, exports, __webpack_require__) {
- var shared = __webpack_require__(55)('keys')
- , uid = __webpack_require__(31);
- module.exports = function(key){
- return shared[key] || (shared[key] = uid(key));
- };
- /***/ }),
- /* 55 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(3)
- , SHARED = '__core-js_shared__'
- , store = global[SHARED] || (global[SHARED] = {});
- module.exports = function(key){
- return store[key] || (store[key] = {});
- };
- /***/ }),
- /* 56 */
- /***/ (function(module, exports, __webpack_require__) {
- // helper for String#{startsWith, endsWith, includes}
- var isRegExp = __webpack_require__(86)
- , defined = __webpack_require__(13);
- module.exports = function(that, searchString, NAME){
- if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!");
- return String(defined(that));
- };
- /***/ }),
- /* 57 */
- /***/ (function(module, exports, __webpack_require__) {
- var ctx = __webpack_require__(12)
- , invoke = __webpack_require__(158)
- , html = __webpack_require__(81)
- , cel = __webpack_require__(46)
- , global = __webpack_require__(3)
- , process = global.process
- , setTask = global.setImmediate
- , clearTask = global.clearImmediate
- , MessageChannel = global.MessageChannel
- , counter = 0
- , queue = {}
- , ONREADYSTATECHANGE = 'onreadystatechange'
- , defer, channel, port;
- var run = function(){
- var id = +this;
- if(queue.hasOwnProperty(id)){
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var listener = function(event){
- run.call(event.data);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if(!setTask || !clearTask){
- setTask = function setImmediate(fn){
- var args = [], i = 1;
- while(arguments.length > i)args.push(arguments[i++]);
- queue[++counter] = function(){
- invoke(typeof fn == 'function' ? fn : Function(fn), args);
- };
- defer(counter);
- return counter;
- };
- clearTask = function clearImmediate(id){
- delete queue[id];
- };
- // Node.js 0.8-
- if(__webpack_require__(18)(process) == 'process'){
- defer = function(id){
- process.nextTick(ctx(run, id, 1));
- };
- // Browsers with MessageChannel, includes WebWorkers
- } else if(MessageChannel){
- channel = new MessageChannel;
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = ctx(port.postMessage, port, 1);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
- defer = function(id){
- global.postMessage(id + '', '*');
- };
- global.addEventListener('message', listener, false);
- // IE8-
- } else if(ONREADYSTATECHANGE in cel('script')){
- defer = function(id){
- html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
- html.removeChild(this);
- run.call(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function(id){
- setTimeout(ctx(run, id, 1), 0);
- };
- }
- }
- module.exports = {
- set: setTask,
- clear: clearTask
- };
- /***/ }),
- /* 58 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.1 ToPrimitive(input [, PreferredType])
- var isObject = __webpack_require__(4);
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
- // and the second argument - flag - preferred type is a string
- module.exports = function(it, S){
- if(!isObject(it))return it;
- var fn, val;
- if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
- if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
- if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /* 59 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _event = __webpack_require__(73);
- var _object = __webpack_require__(25);
- var _browser = __webpack_require__(32);
- var _eventManager = __webpack_require__(23);
- var _eventManager2 = _interopRequireDefault(_eventManager);
- var _coords = __webpack_require__(22);
- var _coords2 = _interopRequireDefault(_coords);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- *
- */
- var Border = function () {
- /**
- * @param {Walkontable} wotInstance
- * @param {Object} settings
- */
- function Border(wotInstance, settings) {
- _classCallCheck(this, Border);
- if (!settings) {
- return;
- }
- this.eventManager = new _eventManager2.default(wotInstance);
- this.instance = wotInstance;
- this.wot = wotInstance;
- this.settings = settings;
- this.mouseDown = false;
- this.main = null;
- this.top = null;
- this.left = null;
- this.bottom = null;
- this.right = null;
- this.topStyle = null;
- this.leftStyle = null;
- this.bottomStyle = null;
- this.rightStyle = null;
- this.cornerDefaultStyle = {
- width: '5px',
- height: '5px',
- borderWidth: '2px',
- borderStyle: 'solid',
- borderColor: '#FFF'
- };
- this.corner = null;
- this.cornerStyle = null;
- this.createBorders(settings);
- this.registerListeners();
- }
- /**
- * Register all necessary events
- */
- _createClass(Border, [{
- key: 'registerListeners',
- value: function registerListeners() {
- var _this2 = this;
- this.eventManager.addEventListener(document.body, 'mousedown', function () {
- return _this2.onMouseDown();
- });
- this.eventManager.addEventListener(document.body, 'mouseup', function () {
- return _this2.onMouseUp();
- });
- var _loop = function _loop(c, len) {
- _this2.eventManager.addEventListener(_this2.main.childNodes[c], 'mouseenter', function (event) {
- return _this2.onMouseEnter(event, _this2.main.childNodes[c]);
- });
- };
- for (var c = 0, len = this.main.childNodes.length; c < len; c++) {
- _loop(c, len);
- }
- }
- /**
- * Mouse down listener
- *
- * @private
- */
- }, {
- key: 'onMouseDown',
- value: function onMouseDown() {
- this.mouseDown = true;
- }
- /**
- * Mouse up listener
- *
- * @private
- */
- }, {
- key: 'onMouseUp',
- value: function onMouseUp() {
- this.mouseDown = false;
- }
- /**
- * Mouse enter listener for fragment selection functionality.
- *
- * @private
- * @param {Event} event Dom event
- * @param {HTMLElement} parentElement Part of border element.
- */
- }, {
- key: 'onMouseEnter',
- value: function onMouseEnter(event, parentElement) {
- if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {
- return;
- }
- event.preventDefault();
- (0, _event.stopImmediatePropagation)(event);
- var _this = this;
- var bounds = parentElement.getBoundingClientRect();
- // Hide border to prevents selection jumping when fragmentSelection is enabled.
- parentElement.style.display = 'none';
- function isOutside(event) {
- if (event.clientY < Math.floor(bounds.top)) {
- return true;
- }
- if (event.clientY > Math.ceil(bounds.top + bounds.height)) {
- return true;
- }
- if (event.clientX < Math.floor(bounds.left)) {
- return true;
- }
- if (event.clientX > Math.ceil(bounds.left + bounds.width)) {
- return true;
- }
- }
- function handler(event) {
- if (isOutside(event)) {
- _this.eventManager.removeEventListener(document.body, 'mousemove', handler);
- parentElement.style.display = 'block';
- }
- }
- this.eventManager.addEventListener(document.body, 'mousemove', handler);
- }
- /**
- * Create border elements
- *
- * @param {Object} settings
- */
- }, {
- key: 'createBorders',
- value: function createBorders(settings) {
- this.main = document.createElement('div');
- var borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];
- var style = this.main.style;
- style.position = 'absolute';
- style.top = 0;
- style.left = 0;
- for (var i = 0; i < 5; i++) {
- var position = borderDivs[i];
- var div = document.createElement('div');
- div.className = 'wtBorder ' + (this.settings.className || ''); // + borderDivs[i];
- if (this.settings[position] && this.settings[position].hide) {
- div.className += ' hidden';
- }
- style = div.style;
- style.backgroundColor = this.settings[position] && this.settings[position].color ? this.settings[position].color : settings.border.color;
- style.height = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';
- style.width = this.settings[position] && this.settings[position].width ? this.settings[position].width + 'px' : settings.border.width + 'px';
- this.main.appendChild(div);
- }
- this.top = this.main.childNodes[0];
- this.left = this.main.childNodes[1];
- this.bottom = this.main.childNodes[2];
- this.right = this.main.childNodes[3];
- this.topStyle = this.top.style;
- this.leftStyle = this.left.style;
- this.bottomStyle = this.bottom.style;
- this.rightStyle = this.right.style;
- this.corner = this.main.childNodes[4];
- this.corner.className += ' corner';
- this.cornerStyle = this.corner.style;
- this.cornerStyle.width = this.cornerDefaultStyle.width;
- this.cornerStyle.height = this.cornerDefaultStyle.height;
- this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
- if ((0, _browser.isMobileBrowser)()) {
- this.createMultipleSelectorHandles();
- }
- this.disappear();
- if (!this.wot.wtTable.bordersHolder) {
- this.wot.wtTable.bordersHolder = document.createElement('div');
- this.wot.wtTable.bordersHolder.className = 'htBorders';
- this.wot.wtTable.spreader.appendChild(this.wot.wtTable.bordersHolder);
- }
- this.wot.wtTable.bordersHolder.insertBefore(this.main, this.wot.wtTable.bordersHolder.firstChild);
- }
- /**
- * Create multiple selector handler for mobile devices
- */
- }, {
- key: 'createMultipleSelectorHandles',
- value: function createMultipleSelectorHandles() {
- this.selectionHandles = {
- topLeft: document.createElement('DIV'),
- topLeftHitArea: document.createElement('DIV'),
- bottomRight: document.createElement('DIV'),
- bottomRightHitArea: document.createElement('DIV')
- };
- var width = 10;
- var hitAreaWidth = 40;
- this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';
- this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';
- this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';
- this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';
- this.selectionHandles.styles = {
- topLeft: this.selectionHandles.topLeft.style,
- topLeftHitArea: this.selectionHandles.topLeftHitArea.style,
- bottomRight: this.selectionHandles.bottomRight.style,
- bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style
- };
- var hitAreaStyle = {
- position: 'absolute',
- height: hitAreaWidth + 'px',
- width: hitAreaWidth + 'px',
- 'border-radius': parseInt(hitAreaWidth / 1.5, 10) + 'px'
- };
- for (var prop in hitAreaStyle) {
- if ((0, _object.hasOwnProperty)(hitAreaStyle, prop)) {
- this.selectionHandles.styles.bottomRightHitArea[prop] = hitAreaStyle[prop];
- this.selectionHandles.styles.topLeftHitArea[prop] = hitAreaStyle[prop];
- }
- }
- var handleStyle = {
- position: 'absolute',
- height: width + 'px',
- width: width + 'px',
- 'border-radius': parseInt(width / 1.5, 10) + 'px',
- background: '#F5F5FF',
- border: '1px solid #4285c8'
- };
- for (var _prop in handleStyle) {
- if ((0, _object.hasOwnProperty)(handleStyle, _prop)) {
- this.selectionHandles.styles.bottomRight[_prop] = handleStyle[_prop];
- this.selectionHandles.styles.topLeft[_prop] = handleStyle[_prop];
- }
- }
- this.main.appendChild(this.selectionHandles.topLeft);
- this.main.appendChild(this.selectionHandles.bottomRight);
- this.main.appendChild(this.selectionHandles.topLeftHitArea);
- this.main.appendChild(this.selectionHandles.bottomRightHitArea);
- }
- }, {
- key: 'isPartRange',
- value: function isPartRange(row, col) {
- if (this.wot.selections.area.cellRange) {
- if (row != this.wot.selections.area.cellRange.to.row || col != this.wot.selections.area.cellRange.to.col) {
- return true;
- }
- }
- return false;
- }
- }, {
- key: 'updateMultipleSelectionHandlesPosition',
- value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {
- var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);
- var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);
- this.selectionHandles.styles.topLeft.top = parseInt(top - handleWidth, 10) + 'px';
- this.selectionHandles.styles.topLeft.left = parseInt(left - handleWidth, 10) + 'px';
- this.selectionHandles.styles.topLeftHitArea.top = parseInt(top - hitAreaWidth / 4 * 3, 10) + 'px';
- this.selectionHandles.styles.topLeftHitArea.left = parseInt(left - hitAreaWidth / 4 * 3, 10) + 'px';
- this.selectionHandles.styles.bottomRight.top = parseInt(top + height, 10) + 'px';
- this.selectionHandles.styles.bottomRight.left = parseInt(left + width, 10) + 'px';
- this.selectionHandles.styles.bottomRightHitArea.top = parseInt(top + height - hitAreaWidth / 4, 10) + 'px';
- this.selectionHandles.styles.bottomRightHitArea.left = parseInt(left + width - hitAreaWidth / 4, 10) + 'px';
- if (this.settings.border.multipleSelectionHandlesVisible && this.settings.border.multipleSelectionHandlesVisible()) {
- this.selectionHandles.styles.topLeft.display = 'block';
- this.selectionHandles.styles.topLeftHitArea.display = 'block';
- if (this.isPartRange(row, col)) {
- this.selectionHandles.styles.bottomRight.display = 'none';
- this.selectionHandles.styles.bottomRightHitArea.display = 'none';
- } else {
- this.selectionHandles.styles.bottomRight.display = 'block';
- this.selectionHandles.styles.bottomRightHitArea.display = 'block';
- }
- } else {
- this.selectionHandles.styles.topLeft.display = 'none';
- this.selectionHandles.styles.bottomRight.display = 'none';
- this.selectionHandles.styles.topLeftHitArea.display = 'none';
- this.selectionHandles.styles.bottomRightHitArea.display = 'none';
- }
- if (row == this.wot.wtSettings.getSetting('fixedRowsTop') || col == this.wot.wtSettings.getSetting('fixedColumnsLeft')) {
- this.selectionHandles.styles.topLeft.zIndex = '9999';
- this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';
- } else {
- this.selectionHandles.styles.topLeft.zIndex = '';
- this.selectionHandles.styles.topLeftHitArea.zIndex = '';
- }
- }
- /**
- * Show border around one or many cells
- *
- * @param {Array} corners
- */
- }, {
- key: 'appear',
- value: function appear(corners) {
- if (this.disabled) {
- return;
- }
- var isMultiple, fromTD, toTD, fromOffset, toOffset, containerOffset, top, minTop, left, minLeft, height, width, fromRow, fromColumn, toRow, toColumn, trimmingContainer, cornerOverlappingContainer, ilen;
- ilen = this.wot.wtTable.getRenderedRowsCount();
- for (var i = 0; i < ilen; i++) {
- var s = this.wot.wtTable.rowFilter.renderedToSource(i);
- if (s >= corners[0] && s <= corners[2]) {
- fromRow = s;
- break;
- }
- }
- for (var _i = ilen - 1; _i >= 0; _i--) {
- var _s = this.wot.wtTable.rowFilter.renderedToSource(_i);
- if (_s >= corners[0] && _s <= corners[2]) {
- toRow = _s;
- break;
- }
- }
- ilen = this.wot.wtTable.getRenderedColumnsCount();
- for (var _i2 = 0; _i2 < ilen; _i2++) {
- var _s2 = this.wot.wtTable.columnFilter.renderedToSource(_i2);
- if (_s2 >= corners[1] && _s2 <= corners[3]) {
- fromColumn = _s2;
- break;
- }
- }
- for (var _i3 = ilen - 1; _i3 >= 0; _i3--) {
- var _s3 = this.wot.wtTable.columnFilter.renderedToSource(_i3);
- if (_s3 >= corners[1] && _s3 <= corners[3]) {
- toColumn = _s3;
- break;
- }
- }
- if (fromRow === void 0 || fromColumn === void 0) {
- this.disappear();
- return;
- }
- isMultiple = fromRow !== toRow || fromColumn !== toColumn;
- fromTD = this.wot.wtTable.getCell(new _coords2.default(fromRow, fromColumn));
- toTD = isMultiple ? this.wot.wtTable.getCell(new _coords2.default(toRow, toColumn)) : fromTD;
- fromOffset = (0, _element.offset)(fromTD);
- toOffset = isMultiple ? (0, _element.offset)(toTD) : fromOffset;
- containerOffset = (0, _element.offset)(this.wot.wtTable.TABLE);
- minTop = fromOffset.top;
- height = toOffset.top + (0, _element.outerHeight)(toTD) - minTop;
- minLeft = fromOffset.left;
- width = toOffset.left + (0, _element.outerWidth)(toTD) - minLeft;
- top = minTop - containerOffset.top - 1;
- left = minLeft - containerOffset.left - 1;
- var style = (0, _element.getComputedStyle)(fromTD);
- if (parseInt(style.borderTopWidth, 10) > 0) {
- top += 1;
- height = height > 0 ? height - 1 : 0;
- }
- if (parseInt(style.borderLeftWidth, 10) > 0) {
- left += 1;
- width = width > 0 ? width - 1 : 0;
- }
- this.topStyle.top = top + 'px';
- this.topStyle.left = left + 'px';
- this.topStyle.width = width + 'px';
- this.topStyle.display = 'block';
- this.leftStyle.top = top + 'px';
- this.leftStyle.left = left + 'px';
- this.leftStyle.height = height + 'px';
- this.leftStyle.display = 'block';
- var delta = Math.floor(this.settings.border.width / 2);
- this.bottomStyle.top = top + height - delta + 'px';
- this.bottomStyle.left = left + 'px';
- this.bottomStyle.width = width + 'px';
- this.bottomStyle.display = 'block';
- this.rightStyle.top = top + 'px';
- this.rightStyle.left = left + width - delta + 'px';
- this.rightStyle.height = height + 1 + 'px';
- this.rightStyle.display = 'block';
- if ((0, _browser.isMobileBrowser)() || !this.hasSetting(this.settings.border.cornerVisible) || this.isPartRange(toRow, toColumn)) {
- this.cornerStyle.display = 'none';
- } else {
- this.cornerStyle.top = top + height - 4 + 'px';
- this.cornerStyle.left = left + width - 4 + 'px';
- this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;
- this.cornerStyle.width = this.cornerDefaultStyle.width;
- // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.
- this.cornerStyle.display = 'none';
- trimmingContainer = (0, _element.getTrimmingContainer)(this.wot.wtTable.TABLE);
- if (toColumn === this.wot.getSetting('totalColumns') - 1) {
- cornerOverlappingContainer = toTD.offsetLeft + (0, _element.outerWidth)(toTD) + parseInt(this.cornerDefaultStyle.width, 10) / 2 >= (0, _element.innerWidth)(trimmingContainer);
- if (cornerOverlappingContainer) {
- this.cornerStyle.left = Math.floor(left + width - 3 - parseInt(this.cornerDefaultStyle.width, 10) / 2) + 'px';
- this.cornerStyle.borderRightWidth = 0;
- }
- }
- if (toRow === this.wot.getSetting('totalRows') - 1) {
- cornerOverlappingContainer = toTD.offsetTop + (0, _element.outerHeight)(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2 >= (0, _element.innerHeight)(trimmingContainer);
- if (cornerOverlappingContainer) {
- this.cornerStyle.top = Math.floor(top + height - 3 - parseInt(this.cornerDefaultStyle.height, 10) / 2) + 'px';
- this.cornerStyle.borderBottomWidth = 0;
- }
- }
- this.cornerStyle.display = 'block';
- }
- if ((0, _browser.isMobileBrowser)()) {
- this.updateMultipleSelectionHandlesPosition(fromRow, fromColumn, top, left, width, height);
- }
- }
- /**
- * Hide border
- */
- }, {
- key: 'disappear',
- value: function disappear() {
- this.topStyle.display = 'none';
- this.leftStyle.display = 'none';
- this.bottomStyle.display = 'none';
- this.rightStyle.display = 'none';
- this.cornerStyle.display = 'none';
- if ((0, _browser.isMobileBrowser)()) {
- this.selectionHandles.styles.topLeft.display = 'none';
- this.selectionHandles.styles.bottomRight.display = 'none';
- }
- }
- /**
- * @param {Function} setting
- * @returns {*}
- */
- }, {
- key: 'hasSetting',
- value: function hasSetting(setting) {
- if (typeof setting === 'function') {
- return setting();
- }
- return !!setting;
- }
- }]);
- return Border;
- }();
- exports.default = Border;
- /***/ }),
- /* 60 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var privatePool = new WeakMap();
- /**
- * Calculates indexes of columns to render OR columns that are visible.
- * To redo the calculation, you need to create a new calculator.
- *
- * @class ViewportColumnsCalculator
- */
- var ViewportColumnsCalculator = function () {
- _createClass(ViewportColumnsCalculator, null, [{
- key: 'DEFAULT_WIDTH',
- /**
- * Default column width
- *
- * @type {Number}
- */
- get: function get() {
- return 50;
- }
- /**
- * @param {Number} viewportWidth Width of the viewport
- * @param {Number} scrollOffset Current horizontal scroll position of the viewport
- * @param {Number} totalColumns Total number of rows
- * @param {Function} columnWidthFn Function that returns the width of the column at a given index (in px)
- * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)
- * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport
- * @param {Boolean} stretchH
- * @param {Function} [stretchingColumnWidthFn] Function that returns the new width of the stretched column.
- */
- }]);
- function ViewportColumnsCalculator(viewportWidth, scrollOffset, totalColumns, columnWidthFn, overrideFn, onlyFullyVisible, stretchH) {
- var stretchingColumnWidthFn = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : function (width) {
- return width;
- };
- _classCallCheck(this, ViewportColumnsCalculator);
- privatePool.set(this, {
- viewportWidth: viewportWidth,
- scrollOffset: scrollOffset,
- totalColumns: totalColumns,
- columnWidthFn: columnWidthFn,
- overrideFn: overrideFn,
- onlyFullyVisible: onlyFullyVisible,
- stretchingColumnWidthFn: stretchingColumnWidthFn
- });
- /**
- * Number of rendered/visible columns
- *
- * @type {Number}
- */
- this.count = 0;
- /**
- * Index of the first rendered/visible column (can be overwritten using overrideFn)
- *
- * @type {Number|null}
- */
- this.startColumn = null;
- /**
- * Index of the last rendered/visible column (can be overwritten using overrideFn)
- *
- * @type {null}
- */
- this.endColumn = null;
- /**
- * Position of the first rendered/visible column (in px)
- *
- * @type {Number|null}
- */
- this.startPosition = null;
- this.stretchAllRatio = 0;
- this.stretchLastWidth = 0;
- this.stretch = stretchH;
- this.totalTargetWidth = 0;
- this.needVerifyLastColumnWidth = true;
- this.stretchAllColumnsWidth = [];
- this.calculate();
- }
- /**
- * Calculates viewport
- */
- _createClass(ViewportColumnsCalculator, [{
- key: 'calculate',
- value: function calculate() {
- var sum = 0;
- var needReverse = true;
- var startPositions = [];
- var columnWidth = void 0;
- var priv = privatePool.get(this);
- var onlyFullyVisible = priv.onlyFullyVisible;
- var overrideFn = priv.overrideFn;
- var scrollOffset = priv.scrollOffset;
- var totalColumns = priv.totalColumns;
- var viewportWidth = priv.viewportWidth;
- for (var i = 0; i < totalColumns; i++) {
- columnWidth = this._getColumnWidth(i);
- if (sum <= scrollOffset && !onlyFullyVisible) {
- this.startColumn = i;
- }
- // +1 pixel for row header width compensation for horizontal scroll > 0
- var compensatedViewportWidth = scrollOffset > 0 ? viewportWidth + 1 : viewportWidth;
- if (sum >= scrollOffset && sum + columnWidth <= scrollOffset + compensatedViewportWidth) {
- if (this.startColumn == null) {
- this.startColumn = i;
- }
- this.endColumn = i;
- }
- startPositions.push(sum);
- sum += columnWidth;
- if (!onlyFullyVisible) {
- this.endColumn = i;
- }
- if (sum >= scrollOffset + viewportWidth) {
- needReverse = false;
- break;
- }
- }
- if (this.endColumn === totalColumns - 1 && needReverse) {
- this.startColumn = this.endColumn;
- while (this.startColumn > 0) {
- var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];
- if (viewportSum <= viewportWidth || !onlyFullyVisible) {
- this.startColumn--;
- }
- if (viewportSum > viewportWidth) {
- break;
- }
- }
- }
- if (this.startColumn !== null && overrideFn) {
- overrideFn(this);
- }
- this.startPosition = startPositions[this.startColumn];
- if (this.startPosition == void 0) {
- this.startPosition = null;
- }
- if (this.startColumn !== null) {
- this.count = this.endColumn - this.startColumn + 1;
- }
- }
- /**
- * Recalculate columns stretching.
- *
- * @param {Number} totalWidth
- */
- }, {
- key: 'refreshStretching',
- value: function refreshStretching(totalWidth) {
- if (this.stretch === 'none') {
- return;
- }
- this.totalTargetWidth = totalWidth;
- var priv = privatePool.get(this);
- var totalColumns = priv.totalColumns;
- var sumAll = 0;
- for (var i = 0; i < totalColumns; i++) {
- var columnWidth = this._getColumnWidth(i);
- var permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);
- if (typeof permanentColumnWidth === 'number') {
- totalWidth -= permanentColumnWidth;
- } else {
- sumAll += columnWidth;
- }
- }
- var remainingSize = totalWidth - sumAll;
- if (this.stretch === 'all' && remainingSize > 0) {
- this.stretchAllRatio = totalWidth / sumAll;
- this.stretchAllColumnsWidth = [];
- this.needVerifyLastColumnWidth = true;
- } else if (this.stretch === 'last' && totalWidth !== Infinity) {
- var _columnWidth = this._getColumnWidth(totalColumns - 1);
- var lastColumnWidth = remainingSize + _columnWidth;
- this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : _columnWidth;
- }
- }
- /**
- * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.
- *
- * @param {Number} column
- * @param {Number} baseWidth
- * @returns {Number|null}
- */
- }, {
- key: 'getStretchedColumnWidth',
- value: function getStretchedColumnWidth(column, baseWidth) {
- var result = null;
- if (this.stretch === 'all' && this.stretchAllRatio !== 0) {
- result = this._getStretchedAllColumnWidth(column, baseWidth);
- } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {
- result = this._getStretchedLastColumnWidth(column);
- }
- return result;
- }
- /**
- * @param {Number} column
- * @param {Number} baseWidth
- * @returns {Number}
- * @private
- */
- }, {
- key: '_getStretchedAllColumnWidth',
- value: function _getStretchedAllColumnWidth(column, baseWidth) {
- var sumRatioWidth = 0;
- var priv = privatePool.get(this);
- var totalColumns = priv.totalColumns;
- if (!this.stretchAllColumnsWidth[column]) {
- var stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);
- var newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);
- if (newStretchedWidth === void 0) {
- this.stretchAllColumnsWidth[column] = stretchedWidth;
- } else {
- this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;
- }
- }
- if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {
- this.needVerifyLastColumnWidth = false;
- for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) {
- sumRatioWidth += this.stretchAllColumnsWidth[i];
- }
- if (sumRatioWidth !== this.totalTargetWidth) {
- this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;
- }
- }
- return this.stretchAllColumnsWidth[column];
- }
- /**
- * @param {Number} column
- * @returns {Number|null}
- * @private
- */
- }, {
- key: '_getStretchedLastColumnWidth',
- value: function _getStretchedLastColumnWidth(column) {
- var priv = privatePool.get(this);
- var totalColumns = priv.totalColumns;
- if (column === totalColumns - 1) {
- return this.stretchLastWidth;
- }
- return null;
- }
- /**
- * @param {Number} column Column index.
- * @returns {Number}
- * @private
- */
- }, {
- key: '_getColumnWidth',
- value: function _getColumnWidth(column) {
- var width = privatePool.get(this).columnWidthFn(column);
- if (width === void 0) {
- width = ViewportColumnsCalculator.DEFAULT_WIDTH;
- }
- return width;
- }
- }]);
- return ViewportColumnsCalculator;
- }();
- exports.default = ViewportColumnsCalculator;
- /***/ }),
- /* 61 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var privatePool = new WeakMap();
- /**
- * Calculates indexes of rows to render OR rows that are visible.
- * To redo the calculation, you need to create a new calculator.
- *
- * @class ViewportRowsCalculator
- */
- var ViewportRowsCalculator = function () {
- _createClass(ViewportRowsCalculator, null, [{
- key: "DEFAULT_HEIGHT",
- /**
- * Default row height
- *
- * @type {Number}
- */
- get: function get() {
- return 23;
- }
- /**
- * @param {Number} viewportHeight Height of the viewport
- * @param {Number} scrollOffset Current vertical scroll position of the viewport
- * @param {Number} totalRows Total number of rows
- * @param {Function} rowHeightFn Function that returns the height of the row at a given index (in px)
- * @param {Function} overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin)
- * @param {Boolean} onlyFullyVisible if `true`, only startRow and endRow will be indexes of rows that are fully in viewport
- * @param {Number} horizontalScrollbarHeight
- */
- }]);
- function ViewportRowsCalculator(viewportHeight, scrollOffset, totalRows, rowHeightFn, overrideFn, onlyFullyVisible, horizontalScrollbarHeight) {
- _classCallCheck(this, ViewportRowsCalculator);
- privatePool.set(this, {
- viewportHeight: viewportHeight,
- scrollOffset: scrollOffset,
- totalRows: totalRows,
- rowHeightFn: rowHeightFn,
- overrideFn: overrideFn,
- onlyFullyVisible: onlyFullyVisible,
- horizontalScrollbarHeight: horizontalScrollbarHeight
- });
- /**
- * Number of rendered/visible rows
- *
- * @type {Number}
- */
- this.count = 0;
- /**
- * Index of the first rendered/visible row (can be overwritten using overrideFn)
- *
- * @type {Number|null}
- */
- this.startRow = null;
- /**
- * Index of the last rendered/visible row (can be overwritten using overrideFn)
- *
- * @type {null}
- */
- this.endRow = null;
- /**
- * Position of the first rendered/visible row (in px)
- *
- * @type {Number|null}
- */
- this.startPosition = null;
- this.calculate();
- }
- /**
- * Calculates viewport
- */
- _createClass(ViewportRowsCalculator, [{
- key: "calculate",
- value: function calculate() {
- var sum = 0;
- var needReverse = true;
- var startPositions = [];
- var priv = privatePool.get(this);
- var onlyFullyVisible = priv.onlyFullyVisible;
- var overrideFn = priv.overrideFn;
- var rowHeightFn = priv.rowHeightFn;
- var scrollOffset = priv.scrollOffset;
- var totalRows = priv.totalRows;
- var viewportHeight = priv.viewportHeight;
- var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;
- var rowHeight = void 0;
- // Calculate the number (start and end index) of rows needed
- for (var i = 0; i < totalRows; i++) {
- rowHeight = rowHeightFn(i);
- if (rowHeight === undefined) {
- rowHeight = ViewportRowsCalculator.DEFAULT_HEIGHT;
- }
- if (sum <= scrollOffset && !onlyFullyVisible) {
- this.startRow = i;
- }
- // the row is within the "visible range"
- if (sum >= scrollOffset && sum + rowHeight <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {
- if (this.startRow === null) {
- this.startRow = i;
- }
- this.endRow = i;
- }
- startPositions.push(sum);
- sum += rowHeight;
- if (!onlyFullyVisible) {
- this.endRow = i;
- }
- if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {
- needReverse = false;
- break;
- }
- }
- // If the estimation has reached the last row and there is still some space available in the viewport,
- // we need to render in reverse in order to fill the whole viewport with rows
- if (this.endRow === totalRows - 1 && needReverse) {
- this.startRow = this.endRow;
- while (this.startRow > 0) {
- // rowHeight is the height of the last row
- var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];
- if (viewportSum <= viewportHeight - horizontalScrollbarHeight || !onlyFullyVisible) {
- this.startRow--;
- }
- if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {
- break;
- }
- }
- }
- if (this.startRow !== null && overrideFn) {
- overrideFn(this);
- }
- this.startPosition = startPositions[this.startRow];
- if (this.startPosition == void 0) {
- this.startPosition = null;
- }
- if (this.startRow !== null) {
- this.count = this.endRow - this.startRow + 1;
- }
- }
- }]);
- return ViewportRowsCalculator;
- }();
- exports.default = ViewportRowsCalculator;
- /***/ }),
- /* 62 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _object = __webpack_require__(25);
- var _string = __webpack_require__(149);
- var _event = __webpack_require__(63);
- var _event2 = _interopRequireDefault(_event);
- var _overlays = __webpack_require__(66);
- var _overlays2 = _interopRequireDefault(_overlays);
- var _scroll = __webpack_require__(67);
- var _scroll2 = _interopRequireDefault(_scroll);
- var _settings = __webpack_require__(68);
- var _settings2 = _interopRequireDefault(_settings);
- var _table = __webpack_require__(69);
- var _table2 = _interopRequireDefault(_table);
- var _viewport = __webpack_require__(71);
- var _viewport2 = _interopRequireDefault(_viewport);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class Walkontable
- */
- var Walkontable = function () {
- /**
- * @param {Object} settings
- */
- function Walkontable(settings) {
- _classCallCheck(this, Walkontable);
- var originalHeaders = [];
- // this is the namespace for global events
- this.guid = 'wt_' + (0, _string.randomString)();
- // bootstrap from settings
- if (settings.cloneSource) {
- this.cloneSource = settings.cloneSource;
- this.cloneOverlay = settings.cloneOverlay;
- this.wtSettings = settings.cloneSource.wtSettings;
- this.wtTable = new _table2.default(this, settings.table, settings.wtRootElement);
- this.wtScroll = new _scroll2.default(this);
- this.wtViewport = settings.cloneSource.wtViewport;
- this.wtEvent = new _event2.default(this);
- this.selections = this.cloneSource.selections;
- } else {
- this.wtSettings = new _settings2.default(this, settings);
- this.wtTable = new _table2.default(this, settings.table);
- this.wtScroll = new _scroll2.default(this);
- this.wtViewport = new _viewport2.default(this);
- this.wtEvent = new _event2.default(this);
- this.selections = this.getSetting('selections');
- this.wtOverlays = new _overlays2.default(this);
- this.exportSettingsAsClassNames();
- }
- // find original headers
- if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {
- for (var c = 0, clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {
- originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);
- }
- if (!this.getSetting('columnHeaders').length) {
- this.update('columnHeaders', [function (column, TH) {
- (0, _element.fastInnerText)(TH, originalHeaders[column]);
- }]);
- }
- }
- this.drawn = false;
- this.drawInterrupted = false;
- }
- /**
- * Force rerender of Walkontable
- *
- * @param {Boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering
- * the data. It will only work if Table.draw() does not force
- * rendering anyway
- * @returns {Walkontable}
- */
- _createClass(Walkontable, [{
- key: 'draw',
- value: function draw() {
- var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- this.drawInterrupted = false;
- if (!fastDraw && !(0, _element.isVisible)(this.wtTable.TABLE)) {
- // draw interrupted because TABLE is not visible
- this.drawInterrupted = true;
- } else {
- this.wtTable.draw(fastDraw);
- }
- return this;
- }
- /**
- * Returns the TD at coords. If topmost is set to true, returns TD from the topmost overlay layer,
- * if not set or set to false, returns TD from the master table.
- *
- * @param {CellCoords} coords
- * @param {Boolean} [topmost=false]
- * @returns {Object}
- */
- }, {
- key: 'getCell',
- value: function getCell(coords) {
- var topmost = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!topmost) {
- return this.wtTable.getCell(coords);
- }
- var totalRows = this.wtSettings.getSetting('totalRows');
- var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
- var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
- var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');
- if (coords.row < fixedRowsTop && coords.col < fixedColumns) {
- return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);
- } else if (coords.row < fixedRowsTop) {
- return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);
- } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {
- if (this.wtOverlays.bottomLeftCornerOverlay && this.wtOverlays.bottomLeftCornerOverlay.clone) {
- return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);
- }
- } else if (coords.col < fixedColumns) {
- return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);
- } else if (coords.row < totalRows && coords.row > totalRows - fixedRowsBottom) {
- if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {
- return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);
- }
- }
- return this.wtTable.getCell(coords);
- }
- /**
- * @param {Object} settings
- * @param {*} value
- * @returns {Walkontable}
- */
- }, {
- key: 'update',
- value: function update(settings, value) {
- return this.wtSettings.update(settings, value);
- }
- /**
- * Scroll the viewport to a row at the given index in the data source
- *
- * @param {Number} row
- * @returns {Walkontable}
- */
- }, {
- key: 'scrollVertical',
- value: function scrollVertical(row) {
- this.wtOverlays.topOverlay.scrollTo(row);
- this.getSetting('onScrollVertically');
- return this;
- }
- /**
- * Scroll the viewport to a column at the given index in the data source
- *
- * @param {Number} column
- * @returns {Walkontable}
- */
- }, {
- key: 'scrollHorizontal',
- value: function scrollHorizontal(column) {
- this.wtOverlays.leftOverlay.scrollTo(column);
- this.getSetting('onScrollHorizontally');
- return this;
- }
- /**
- * Scrolls the viewport to a cell (rerenders if needed)
- *
- * @param {CellCoords} coords
- * @returns {Walkontable}
- */
- }, {
- key: 'scrollViewport',
- value: function scrollViewport(coords) {
- this.wtScroll.scrollViewport(coords);
- return this;
- }
- /**
- * @returns {Array}
- */
- }, {
- key: 'getViewport',
- value: function getViewport() {
- return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()];
- }
- /**
- * Get overlay name
- *
- * @returns {String}
- */
- }, {
- key: 'getOverlayName',
- value: function getOverlayName() {
- return this.cloneOverlay ? this.cloneOverlay.type : 'master';
- }
- /**
- * Check overlay type of this Walkontable instance.
- *
- * @param {String} name Clone type @see {Overlay.CLONE_TYPES}.
- * @returns {Boolean}
- */
- }, {
- key: 'isOverlayName',
- value: function isOverlayName(name) {
- if (this.cloneOverlay) {
- return this.cloneOverlay.type === name;
- }
- return false;
- }
- /**
- * Export settings as class names added to the parent element of the table.
- */
- }, {
- key: 'exportSettingsAsClassNames',
- value: function exportSettingsAsClassNames() {
- var _this = this;
- var toExport = {
- rowHeaders: ['array'],
- columnHeaders: ['array']
- };
- var allClassNames = [];
- var newClassNames = [];
- (0, _object.objectEach)(toExport, function (optionType, key) {
- if (optionType.indexOf('array') > -1 && _this.getSetting(key).length) {
- newClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));
- }
- allClassNames.push('ht' + (0, _string.toUpperCaseFirst)(key));
- });
- (0, _element.removeClass)(this.wtTable.wtRootElement.parentNode, allClassNames);
- (0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);
- }
- /**
- * Get/Set Walkontable instance setting
- *
- * @param {String} key
- * @param {*} [param1]
- * @param {*} [param2]
- * @param {*} [param3]
- * @param {*} [param4]
- * @returns {*}
- */
- }, {
- key: 'getSetting',
- value: function getSetting(key, param1, param2, param3, param4) {
- // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
- return this.wtSettings.getSetting(key, param1, param2, param3, param4);
- }
- /**
- * Checks if setting exists
- *
- * @param {String} key
- * @returns {Boolean}
- */
- }, {
- key: 'hasSetting',
- value: function hasSetting(key) {
- return this.wtSettings.has(key);
- }
- /**
- * Destroy instance
- */
- }, {
- key: 'destroy',
- value: function destroy() {
- this.wtOverlays.destroy();
- this.wtEvent.destroy();
- }
- }]);
- return Walkontable;
- }();
- exports.default = Walkontable;
- /***/ }),
- /* 63 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _element = __webpack_require__(2);
- var _function = __webpack_require__(75);
- var _browser = __webpack_require__(32);
- var _eventManager = __webpack_require__(23);
- var _eventManager2 = _interopRequireDefault(_eventManager);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- /**
- *
- */
- function Event(instance) {
- var that = this;
- var eventManager = new _eventManager2.default(instance);
- this.instance = instance;
- var dblClickOrigin = [null, null];
- this.dblClickTimeout = [null, null];
- var onMouseDown = function onMouseDown(event) {
- var activeElement = document.activeElement;
- var getParentNode = (0, _function.partial)(_element.getParent, event.realTarget);
- var realTarget = event.realTarget;
- // ignore focusable element from mouse down processing (https://github.com/handsontable/handsontable/issues/3555)
- if (realTarget === activeElement || getParentNode(0) === activeElement || getParentNode(1) === activeElement) {
- return;
- }
- var cell = that.parentCell(realTarget);
- if ((0, _element.hasClass)(realTarget, 'corner')) {
- that.instance.getSetting('onCellCornerMouseDown', event, realTarget);
- } else if (cell.TD) {
- if (that.instance.hasSetting('onCellMouseDown')) {
- that.instance.getSetting('onCellMouseDown', event, cell.coords, cell.TD, that.instance);
- }
- }
- if (event.button !== 2) {
- // if not right mouse button
- if (cell.TD) {
- dblClickOrigin[0] = cell.TD;
- clearTimeout(that.dblClickTimeout[0]);
- that.dblClickTimeout[0] = setTimeout(function () {
- dblClickOrigin[0] = null;
- }, 1000);
- }
- }
- };
- var onTouchMove = function onTouchMove(event) {
- that.instance.touchMoving = true;
- };
- var longTouchTimeout;
- var onTouchStart = function onTouchStart(event) {
- var container = this;
- eventManager.addEventListener(this, 'touchmove', onTouchMove);
- // Prevent cell selection when scrolling with touch event - not the best solution performance-wise
- that.checkIfTouchMove = setTimeout(function () {
- if (that.instance.touchMoving === true) {
- that.instance.touchMoving = void 0;
- eventManager.removeEventListener('touchmove', onTouchMove, false);
- }
- onMouseDown(event);
- }, 30);
- };
- var onMouseOver = function onMouseOver(event) {
- var table, td, mainWOT;
- if (that.instance.hasSetting('onCellMouseOver')) {
- table = that.instance.wtTable.TABLE;
- td = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);
- mainWOT = that.instance.cloneSource || that.instance;
- if (td && td !== mainWOT.lastMouseOver && (0, _element.isChildOf)(td, table)) {
- mainWOT.lastMouseOver = td;
- that.instance.getSetting('onCellMouseOver', event, that.instance.wtTable.getCoords(td), td, that.instance);
- }
- }
- };
- var onMouseOut = function onMouseOut(event) {
- var table = void 0;
- var lastTD = void 0;
- var nextTD = void 0;
- if (that.instance.hasSetting('onCellMouseOut')) {
- table = that.instance.wtTable.TABLE;
- lastTD = (0, _element.closestDown)(event.realTarget, ['TD', 'TH'], table);
- nextTD = (0, _element.closestDown)(event.relatedTarget, ['TD', 'TH'], table);
- if (lastTD && lastTD !== nextTD && (0, _element.isChildOf)(lastTD, table)) {
- that.instance.getSetting('onCellMouseOut', event, that.instance.wtTable.getCoords(lastTD), lastTD, that.instance);
- }
- }
- };
- var onMouseUp = function onMouseUp(event) {
- if (event.button !== 2) {
- // if not right mouse button
- var cell = that.parentCell(event.realTarget);
- if (cell.TD === dblClickOrigin[0] && cell.TD === dblClickOrigin[1]) {
- if ((0, _element.hasClass)(event.realTarget, 'corner')) {
- that.instance.getSetting('onCellCornerDblClick', event, cell.coords, cell.TD, that.instance);
- } else {
- that.instance.getSetting('onCellDblClick', event, cell.coords, cell.TD, that.instance);
- }
- dblClickOrigin[0] = null;
- dblClickOrigin[1] = null;
- } else if (cell.TD === dblClickOrigin[0]) {
- that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);
- dblClickOrigin[1] = cell.TD;
- clearTimeout(that.dblClickTimeout[1]);
- that.dblClickTimeout[1] = setTimeout(function () {
- dblClickOrigin[1] = null;
- }, 500);
- } else if (cell.TD && that.instance.hasSetting('onCellMouseUp')) {
- that.instance.getSetting('onCellMouseUp', event, cell.coords, cell.TD, that.instance);
- }
- }
- };
- var onTouchEnd = function onTouchEnd(event) {
- clearTimeout(longTouchTimeout);
- // that.instance.longTouch == void 0;
- event.preventDefault();
- onMouseUp(event);
- // eventManager.removeEventListener(that.instance.wtTable.holder, "mouseup", onMouseUp);
- };
- eventManager.addEventListener(this.instance.wtTable.holder, 'mousedown', onMouseDown);
- eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseover', onMouseOver);
- eventManager.addEventListener(this.instance.wtTable.TABLE, 'mouseout', onMouseOut);
- eventManager.addEventListener(this.instance.wtTable.holder, 'mouseup', onMouseUp);
- // check if full HOT instance, or detached WOT AND run on mobile device
- if (this.instance.wtTable.holder.parentNode.parentNode && (0, _browser.isMobileBrowser)() && !that.instance.wtTable.isWorkingOnClone()) {
- var classSelector = '.' + this.instance.wtTable.holder.parentNode.className.split(' ').join('.');
- eventManager.addEventListener(this.instance.wtTable.holder, 'touchstart', function (event) {
- that.instance.touchApplied = true;
- if ((0, _element.isChildOf)(event.target, classSelector)) {
- onTouchStart.call(event.target, event);
- }
- });
- eventManager.addEventListener(this.instance.wtTable.holder, 'touchend', function (event) {
- that.instance.touchApplied = false;
- if ((0, _element.isChildOf)(event.target, classSelector)) {
- onTouchEnd.call(event.target, event);
- }
- });
- if (!that.instance.momentumScrolling) {
- that.instance.momentumScrolling = {};
- }
- eventManager.addEventListener(this.instance.wtTable.holder, 'scroll', function (event) {
- clearTimeout(that.instance.momentumScrolling._timeout);
- if (!that.instance.momentumScrolling.ongoing) {
- that.instance.getSetting('onBeforeTouchScroll');
- }
- that.instance.momentumScrolling.ongoing = true;
- that.instance.momentumScrolling._timeout = setTimeout(function () {
- if (!that.instance.touchApplied) {
- that.instance.momentumScrolling.ongoing = false;
- that.instance.getSetting('onAfterMomentumScroll');
- }
- }, 200);
- });
- }
- eventManager.addEventListener(window, 'resize', function () {
- if (that.instance.getSetting('stretchH') !== 'none') {
- that.instance.draw();
- }
- });
- this.destroy = function () {
- clearTimeout(this.dblClickTimeout[0]);
- clearTimeout(this.dblClickTimeout[1]);
- eventManager.destroy();
- };
- }
- Event.prototype.parentCell = function (elem) {
- var cell = {};
- var TABLE = this.instance.wtTable.TABLE;
- var TD = (0, _element.closestDown)(elem, ['TD', 'TH'], TABLE);
- if (TD) {
- cell.coords = this.instance.wtTable.getCoords(TD);
- cell.TD = TD;
- } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'current')) {
- cell.coords = this.instance.selections.current.cellRange.highlight; // selections.current is current selected cell
- cell.TD = this.instance.wtTable.getCell(cell.coords);
- } else if ((0, _element.hasClass)(elem, 'wtBorder') && (0, _element.hasClass)(elem, 'area')) {
- if (this.instance.selections.area.cellRange) {
- cell.coords = this.instance.selections.area.cellRange.to; // selections.area is area selected cells
- cell.TD = this.instance.wtTable.getCell(cell.coords);
- }
- }
- return cell;
- };
- exports.default = Event;
- /***/ }),
- /* 64 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class ColumnFilter
- */
- var ColumnFilter = function () {
- /**
- * @param {Number} offset
- * @param {Number} total
- * @param {Number} countTH
- */
- function ColumnFilter(offset, total, countTH) {
- _classCallCheck(this, ColumnFilter);
- this.offset = offset;
- this.total = total;
- this.countTH = countTH;
- }
- /**
- * @param index
- * @returns {Number}
- */
- _createClass(ColumnFilter, [{
- key: "offsetted",
- value: function offsetted(index) {
- return index + this.offset;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "unOffsetted",
- value: function unOffsetted(index) {
- return index - this.offset;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "renderedToSource",
- value: function renderedToSource(index) {
- return this.offsetted(index);
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "sourceToRendered",
- value: function sourceToRendered(index) {
- return this.unOffsetted(index);
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "offsettedTH",
- value: function offsettedTH(index) {
- return index - this.countTH;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "unOffsettedTH",
- value: function unOffsettedTH(index) {
- return index + this.countTH;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "visibleRowHeadedColumnToSourceColumn",
- value: function visibleRowHeadedColumnToSourceColumn(index) {
- return this.renderedToSource(this.offsettedTH(index));
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "sourceColumnToVisibleRowHeadedColumn",
- value: function sourceColumnToVisibleRowHeadedColumn(index) {
- return this.unOffsettedTH(this.sourceToRendered(index));
- }
- }]);
- return ColumnFilter;
- }();
- exports.default = ColumnFilter;
- /***/ }),
- /* 65 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class RowFilter
- */
- var RowFilter = function () {
- /**
- * @param {Number} offset
- * @param {Number} total
- * @param {Number} countTH
- */
- function RowFilter(offset, total, countTH) {
- _classCallCheck(this, RowFilter);
- this.offset = offset;
- this.total = total;
- this.countTH = countTH;
- }
- /**
- * @param index
- * @returns {Number}
- */
- _createClass(RowFilter, [{
- key: "offsetted",
- value: function offsetted(index) {
- return index + this.offset;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "unOffsetted",
- value: function unOffsetted(index) {
- return index - this.offset;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "renderedToSource",
- value: function renderedToSource(index) {
- return this.offsetted(index);
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "sourceToRendered",
- value: function sourceToRendered(index) {
- return this.unOffsetted(index);
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "offsettedTH",
- value: function offsettedTH(index) {
- return index - this.countTH;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "unOffsettedTH",
- value: function unOffsettedTH(index) {
- return index + this.countTH;
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "visibleColHeadedRowToSourceRow",
- value: function visibleColHeadedRowToSourceRow(index) {
- return this.renderedToSource(this.offsettedTH(index));
- }
- /**
- * @param index
- * @returns {Number}
- */
- }, {
- key: "sourceRowToVisibleColHeadedRow",
- value: function sourceRowToVisibleColHeadedRow(index) {
- return this.unOffsettedTH(this.sourceToRendered(index));
- }
- }]);
- return RowFilter;
- }();
- exports.default = RowFilter;
- /***/ }),
- /* 66 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _array = __webpack_require__(24);
- var _unicode = __webpack_require__(150);
- var _browser = __webpack_require__(32);
- var _eventManager = __webpack_require__(23);
- var _eventManager2 = _interopRequireDefault(_eventManager);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class Overlays
- */
- var Overlays = function () {
- /**
- * @param {Walkontable} wotInstance
- */
- function Overlays(wotInstance) {
- _classCallCheck(this, Overlays);
- this.wot = wotInstance;
- // legacy support
- this.instance = this.wot;
- this.eventManager = new _eventManager2.default(this.wot);
- this.wot.update('scrollbarWidth', (0, _element.getScrollbarWidth)());
- this.wot.update('scrollbarHeight', (0, _element.getScrollbarWidth)());
- this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
- this.prepareOverlays();
- this.destroyed = false;
- this.keyPressed = false;
- this.spreaderLastSize = {
- width: null,
- height: null
- };
- this.overlayScrollPositions = {
- master: {
- top: 0,
- left: 0
- },
- top: {
- top: null,
- left: 0
- },
- bottom: {
- top: null,
- left: 0
- },
- left: {
- top: 0,
- left: null
- }
- };
- this.pendingScrollCallbacks = {
- master: {
- top: 0,
- left: 0
- },
- top: {
- left: 0
- },
- bottom: {
- left: 0
- },
- left: {
- top: 0
- }
- };
- this.verticalScrolling = false;
- this.horizontalScrolling = false;
- this.delegatedScrollCallback = false;
- this.registeredListeners = [];
- this.registerListeners();
- }
- /**
- * Prepare overlays based on user settings.
- *
- * @returns {Boolean} Returns `true` if changes applied to overlay needs scroll synchronization.
- */
- _createClass(Overlays, [{
- key: 'prepareOverlays',
- value: function prepareOverlays() {
- var syncScroll = false;
- if (this.topOverlay) {
- syncScroll = this.topOverlay.updateStateOfRendering() || syncScroll;
- } else {
- this.topOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP, this.wot);
- }
- if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM)) {
- this.bottomOverlay = {
- needFullRender: false,
- updateStateOfRendering: function updateStateOfRendering() {
- return false;
- }
- };
- }
- if (!_base2.default.hasOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
- this.bottomLeftCornerOverlay = {
- needFullRender: false,
- updateStateOfRendering: function updateStateOfRendering() {
- return false;
- }
- };
- }
- if (this.bottomOverlay) {
- syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;
- } else {
- this.bottomOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM, this.wot);
- }
- if (this.leftOverlay) {
- syncScroll = this.leftOverlay.updateStateOfRendering() || syncScroll;
- } else {
- this.leftOverlay = _base2.default.createOverlay(_base2.default.CLONE_LEFT, this.wot);
- }
- if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {
- if (this.topLeftCornerOverlay) {
- syncScroll = this.topLeftCornerOverlay.updateStateOfRendering() || syncScroll;
- } else {
- this.topLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, this.wot);
- }
- }
- if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender) {
- if (this.bottomLeftCornerOverlay) {
- syncScroll = this.bottomLeftCornerOverlay.updateStateOfRendering() || syncScroll;
- } else {
- this.bottomLeftCornerOverlay = _base2.default.createOverlay(_base2.default.CLONE_BOTTOM_LEFT_CORNER, this.wot);
- }
- }
- if (this.wot.getSetting('debug') && !this.debug) {
- this.debug = _base2.default.createOverlay(_base2.default.CLONE_DEBUG, this.wot);
- }
- return syncScroll;
- }
- /**
- * Refresh and redraw table
- */
- }, {
- key: 'refreshAll',
- value: function refreshAll() {
- if (!this.wot.drawn) {
- return;
- }
- if (!this.wot.wtTable.holder.parentNode) {
- // Walkontable was detached from DOM, but this handler was not removed
- this.destroy();
- return;
- }
- this.wot.draw(true);
- if (this.verticalScrolling) {
- this.leftOverlay.onScroll();
- }
- if (this.horizontalScrolling) {
- this.topOverlay.onScroll();
- }
- this.verticalScrolling = false;
- this.horizontalScrolling = false;
- }
- /**
- * Register all necessary event listeners.
- */
- }, {
- key: 'registerListeners',
- value: function registerListeners() {
- var _this = this;
- var topOverlayScrollable = this.topOverlay.mainTableScrollableElement;
- var leftOverlayScrollable = this.leftOverlay.mainTableScrollableElement;
- var listenersToRegister = [];
- listenersToRegister.push([document.documentElement, 'keydown', function (event) {
- return _this.onKeyDown(event);
- }]);
- listenersToRegister.push([document.documentElement, 'keyup', function () {
- return _this.onKeyUp();
- }]);
- listenersToRegister.push([document, 'visibilitychange', function () {
- return _this.onKeyUp();
- }]);
- listenersToRegister.push([topOverlayScrollable, 'scroll', function (event) {
- return _this.onTableScroll(event);
- }]);
- if (topOverlayScrollable !== leftOverlayScrollable) {
- listenersToRegister.push([leftOverlayScrollable, 'scroll', function (event) {
- return _this.onTableScroll(event);
- }]);
- }
- if (this.topOverlay.needFullRender) {
- listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'scroll', function (event) {
- return _this.onTableScroll(event);
- }]);
- listenersToRegister.push([this.topOverlay.clone.wtTable.holder, 'wheel', function (event) {
- return _this.onTableScroll(event);
- }]);
- }
- if (this.bottomOverlay.needFullRender) {
- listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'scroll', function (event) {
- return _this.onTableScroll(event);
- }]);
- listenersToRegister.push([this.bottomOverlay.clone.wtTable.holder, 'wheel', function (event) {
- return _this.onTableScroll(event);
- }]);
- }
- if (this.leftOverlay.needFullRender) {
- listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'scroll', function (event) {
- return _this.onTableScroll(event);
- }]);
- listenersToRegister.push([this.leftOverlay.clone.wtTable.holder, 'wheel', function (event) {
- return _this.onTableScroll(event);
- }]);
- }
- if (this.topLeftCornerOverlay && this.topLeftCornerOverlay.needFullRender) {
- listenersToRegister.push([this.topLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {
- return _this.onTableScroll(event);
- }]);
- }
- if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.needFullRender) {
- listenersToRegister.push([this.bottomLeftCornerOverlay.clone.wtTable.holder, 'wheel', function (event) {
- return _this.onTableScroll(event);
- }]);
- }
- if (this.topOverlay.trimmingContainer !== window && this.leftOverlay.trimmingContainer !== window) {
- // This is necessary?
- // eventManager.addEventListener(window, 'scroll', (event) => this.refreshAll(event));
- listenersToRegister.push([window, 'wheel', function (event) {
- var overlay = void 0;
- var deltaY = event.wheelDeltaY || event.deltaY;
- var deltaX = event.wheelDeltaX || event.deltaX;
- if (_this.topOverlay.clone.wtTable.holder.contains(event.realTarget)) {
- overlay = 'top';
- } else if (_this.bottomOverlay.clone && _this.bottomOverlay.clone.wtTable.holder.contains(event.realTarget)) {
- overlay = 'bottom';
- } else if (_this.leftOverlay.clone.wtTable.holder.contains(event.realTarget)) {
- overlay = 'left';
- } else if (_this.topLeftCornerOverlay && _this.topLeftCornerOverlay.clone && _this.topLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {
- overlay = 'topLeft';
- } else if (_this.bottomLeftCornerOverlay && _this.bottomLeftCornerOverlay.clone && _this.bottomLeftCornerOverlay.clone.wtTable.holder.contains(event.realTarget)) {
- overlay = 'bottomLeft';
- }
- if (overlay == 'top' && deltaY !== 0 || overlay == 'left' && deltaX !== 0 || overlay == 'bottom' && deltaY !== 0 || (overlay === 'topLeft' || overlay === 'bottomLeft') && (deltaY !== 0 || deltaX !== 0)) {
- event.preventDefault();
- }
- }]);
- }
- while (listenersToRegister.length) {
- var listener = listenersToRegister.pop();
- this.eventManager.addEventListener(listener[0], listener[1], listener[2]);
- this.registeredListeners.push(listener);
- }
- }
- /**
- * Deregister all previously registered listeners.
- */
- }, {
- key: 'deregisterListeners',
- value: function deregisterListeners() {
- while (this.registeredListeners.length) {
- var listener = this.registeredListeners.pop();
- this.eventManager.removeEventListener(listener[0], listener[1], listener[2]);
- }
- }
- /**
- * Scroll listener
- *
- * @param {Event} event
- */
- }, {
- key: 'onTableScroll',
- value: function onTableScroll(event) {
- // if mobile browser, do not update scroll positions, as the overlays are hidden during the scroll
- if ((0, _browser.isMobileBrowser)()) {
- return;
- }
- var masterHorizontal = this.leftOverlay.mainTableScrollableElement;
- var masterVertical = this.topOverlay.mainTableScrollableElement;
- var target = event.target;
- // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered
- // by hot.refreshBorder
- if (this.keyPressed) {
- if (masterVertical !== window && target !== window && !event.target.contains(masterVertical) || masterHorizontal !== window && target !== window && !event.target.contains(masterHorizontal)) {
- return;
- }
- }
- if (event.type === 'scroll') {
- this.syncScrollPositions(event);
- } else {
- this.translateMouseWheelToScroll(event);
- }
- }
- /**
- * Key down listener
- */
- }, {
- key: 'onKeyDown',
- value: function onKeyDown(event) {
- this.keyPressed = (0, _unicode.isKey)(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');
- }
- /**
- * Key up listener
- */
- }, {
- key: 'onKeyUp',
- value: function onKeyUp() {
- this.keyPressed = false;
- }
- /**
- * Translate wheel event into scroll event and sync scroll overlays position
- *
- * @private
- * @param {Event} event
- * @returns {Boolean}
- */
- }, {
- key: 'translateMouseWheelToScroll',
- value: function translateMouseWheelToScroll(event) {
- var topOverlay = this.topOverlay.clone.wtTable.holder;
- var bottomOverlay = this.bottomOverlay.clone ? this.bottomOverlay.clone.wtTable.holder : null;
- var leftOverlay = this.leftOverlay.clone.wtTable.holder;
- var topLeftCornerOverlay = this.topLeftCornerOverlay && this.topLeftCornerOverlay.clone ? this.topLeftCornerOverlay.clone.wtTable.holder : null;
- var bottomLeftCornerOverlay = this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone ? this.bottomLeftCornerOverlay.clone.wtTable.holder : null;
- var mouseWheelSpeedRatio = -0.2;
- var deltaY = event.wheelDeltaY || -1 * event.deltaY;
- var deltaX = event.wheelDeltaX || -1 * event.deltaX;
- var parentHolder = null;
- var eventMockup = { type: 'wheel' };
- var tempElem = event.target;
- var delta = null;
- // Fix for extremely slow header scrolling with a mousewheel on Firefox
- if (event.deltaMode === 1) {
- deltaY *= 120;
- deltaX *= 120;
- }
- while (tempElem != document && tempElem != null) {
- if (tempElem.className.indexOf('wtHolder') > -1) {
- parentHolder = tempElem;
- break;
- }
- tempElem = tempElem.parentNode;
- }
- eventMockup.target = parentHolder;
- if (parentHolder === topLeftCornerOverlay || parentHolder === bottomLeftCornerOverlay) {
- this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaX, 'x');
- this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * deltaY, 'y');
- } else {
- if (parentHolder === topOverlay || parentHolder === bottomOverlay) {
- delta = deltaY;
- } else if (parentHolder === leftOverlay) {
- delta = deltaX;
- }
- this.syncScrollPositions(eventMockup, mouseWheelSpeedRatio * delta);
- }
- return false;
- }
- /**
- * Synchronize scroll position between master table and overlay table.
- *
- * @private
- * @param {Event|Object} event
- * @param {Number} [fakeScrollValue=null]
- * @param {String} [fakeScrollDirection=null] `x` or `y`.
- */
- }, {
- key: 'syncScrollPositions',
- value: function syncScrollPositions(event) {
- var fakeScrollValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- var fakeScrollDirection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- if (this.destroyed) {
- return;
- }
- if (arguments.length === 0) {
- this.syncScrollWithMaster();
- return;
- }
- var masterHorizontal = this.leftOverlay.mainTableScrollableElement;
- var masterVertical = this.topOverlay.mainTableScrollableElement;
- var target = event.target;
- var tempScrollValue = 0;
- var scrollValueChanged = false;
- var topOverlay = void 0;
- var leftOverlay = void 0;
- var topLeftCornerOverlay = void 0;
- var bottomLeftCornerOverlay = void 0;
- var bottomOverlay = void 0;
- var delegatedScroll = false;
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (this.topOverlay.needFullRender) {
- topOverlay = this.topOverlay.clone.wtTable.holder;
- }
- if (this.bottomOverlay.needFullRender) {
- bottomOverlay = this.bottomOverlay.clone.wtTable.holder;
- }
- if (this.leftOverlay.needFullRender) {
- leftOverlay = this.leftOverlay.clone.wtTable.holder;
- }
- if (this.leftOverlay.needFullRender && this.topOverlay.needFullRender) {
- topLeftCornerOverlay = this.topLeftCornerOverlay.clone.wtTable.holder;
- }
- if (this.leftOverlay.needFullRender && this.bottomOverlay.needFullRender) {
- bottomLeftCornerOverlay = this.bottomLeftCornerOverlay.clone.wtTable.holder;
- }
- if (target === document) {
- target = window;
- }
- if (target === masterHorizontal || target === masterVertical) {
- if (preventOverflow) {
- tempScrollValue = (0, _element.getScrollLeft)(this.scrollableElement);
- } else {
- tempScrollValue = (0, _element.getScrollLeft)(target);
- }
- // if scrolling the master table - populate the scroll values to both top and left overlays
- this.horizontalScrolling = true;
- this.overlayScrollPositions.master.left = tempScrollValue;
- scrollValueChanged = true;
- if (this.pendingScrollCallbacks.master.left > 0) {
- this.pendingScrollCallbacks.master.left--;
- } else {
- if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.top.left++;
- }
- topOverlay.scrollLeft = tempScrollValue;
- delegatedScroll = masterHorizontal !== window;
- }
- if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.bottom.left++;
- }
- bottomOverlay.scrollLeft = tempScrollValue;
- delegatedScroll = masterHorizontal !== window;
- }
- }
- tempScrollValue = (0, _element.getScrollTop)(target);
- this.verticalScrolling = true;
- this.overlayScrollPositions.master.top = tempScrollValue;
- scrollValueChanged = true;
- if (this.pendingScrollCallbacks.master.top > 0) {
- this.pendingScrollCallbacks.master.top--;
- } else if (leftOverlay && leftOverlay.scrollTop !== tempScrollValue) {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.left.top++;
- }
- leftOverlay.scrollTop = tempScrollValue;
- delegatedScroll = masterVertical !== window;
- }
- } else if (target === bottomOverlay) {
- tempScrollValue = (0, _element.getScrollLeft)(target);
- // if scrolling the bottom overlay - populate the horizontal scroll to the master table
- this.horizontalScrolling = true;
- this.overlayScrollPositions.bottom.left = tempScrollValue;
- scrollValueChanged = true;
- if (this.pendingScrollCallbacks.bottom.left > 0) {
- this.pendingScrollCallbacks.bottom.left--;
- } else {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.master.left++;
- }
- masterHorizontal.scrollLeft = tempScrollValue;
- if (topOverlay && topOverlay.scrollLeft !== tempScrollValue) {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.top.left++;
- }
- topOverlay.scrollLeft = tempScrollValue;
- delegatedScroll = masterVertical !== window;
- }
- }
- // "fake" scroll value calculated from the mousewheel event
- if (fakeScrollValue !== null) {
- scrollValueChanged = true;
- masterVertical.scrollTop += fakeScrollValue;
- }
- } else if (target === topOverlay) {
- tempScrollValue = (0, _element.getScrollLeft)(target);
- // if scrolling the top overlay - populate the horizontal scroll to the master table
- this.horizontalScrolling = true;
- this.overlayScrollPositions.top.left = tempScrollValue;
- scrollValueChanged = true;
- if (this.pendingScrollCallbacks.top.left > 0) {
- this.pendingScrollCallbacks.top.left--;
- } else {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.master.left++;
- }
- masterHorizontal.scrollLeft = tempScrollValue;
- }
- // "fake" scroll value calculated from the mousewheel event
- if (fakeScrollValue !== null) {
- scrollValueChanged = true;
- masterVertical.scrollTop += fakeScrollValue;
- }
- if (bottomOverlay && bottomOverlay.scrollLeft !== tempScrollValue) {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.bottom.left++;
- }
- bottomOverlay.scrollLeft = tempScrollValue;
- delegatedScroll = masterVertical !== window;
- }
- } else if (target === leftOverlay) {
- tempScrollValue = (0, _element.getScrollTop)(target);
- // if scrolling the left overlay - populate the vertical scroll to the master table
- if (this.overlayScrollPositions.left.top !== tempScrollValue) {
- this.verticalScrolling = true;
- this.overlayScrollPositions.left.top = tempScrollValue;
- scrollValueChanged = true;
- if (this.pendingScrollCallbacks.left.top > 0) {
- this.pendingScrollCallbacks.left.top--;
- } else {
- if (fakeScrollValue == null) {
- this.pendingScrollCallbacks.master.top++;
- }
- masterVertical.scrollTop = tempScrollValue;
- }
- }
- // "fake" scroll value calculated from the mousewheel event
- if (fakeScrollValue !== null) {
- scrollValueChanged = true;
- masterVertical.scrollLeft += fakeScrollValue;
- }
- } else if (target === topLeftCornerOverlay || target === bottomLeftCornerOverlay) {
- if (fakeScrollValue !== null) {
- scrollValueChanged = true;
- if (fakeScrollDirection === 'x') {
- masterVertical.scrollLeft += fakeScrollValue;
- } else if (fakeScrollDirection === 'y') {
- masterVertical.scrollTop += fakeScrollValue;
- }
- }
- }
- if (!this.keyPressed && scrollValueChanged && event.type === 'scroll') {
- if (this.delegatedScrollCallback) {
- this.delegatedScrollCallback = false;
- } else {
- this.refreshAll();
- }
- if (delegatedScroll) {
- this.delegatedScrollCallback = true;
- }
- }
- }
- /**
- * Synchronize overlay scrollbars with the master scrollbar
- */
- }, {
- key: 'syncScrollWithMaster',
- value: function syncScrollWithMaster() {
- var master = this.topOverlay.mainTableScrollableElement;
- var scrollLeft = master.scrollLeft,
- scrollTop = master.scrollTop;
- if (this.topOverlay.needFullRender) {
- this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;
- }
- if (this.bottomOverlay.needFullRender) {
- this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;
- }
- if (this.leftOverlay.needFullRender) {
- this.leftOverlay.clone.wtTable.holder.scrollTop = scrollTop;
- }
- }
- /**
- * Update the main scrollable elements for all the overlays.
- */
- }, {
- key: 'updateMainScrollableElements',
- value: function updateMainScrollableElements() {
- this.deregisterListeners();
- this.leftOverlay.updateMainScrollableElement();
- this.topOverlay.updateMainScrollableElement();
- if (this.bottomOverlay.needFullRender) {
- this.bottomOverlay.updateMainScrollableElement();
- }
- this.scrollableElement = (0, _element.getScrollableElement)(this.wot.wtTable.TABLE);
- this.registerListeners();
- }
- /**
- *
- */
- }, {
- key: 'destroy',
- value: function destroy() {
- this.eventManager.destroy();
- this.topOverlay.destroy();
- if (this.bottomOverlay.clone) {
- this.bottomOverlay.destroy();
- }
- this.leftOverlay.destroy();
- if (this.topLeftCornerOverlay) {
- this.topLeftCornerOverlay.destroy();
- }
- if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {
- this.bottomLeftCornerOverlay.destroy();
- }
- if (this.debug) {
- this.debug.destroy();
- }
- this.destroyed = true;
- }
- /**
- * @param {Boolean} [fastDraw=false]
- */
- }, {
- key: 'refresh',
- value: function refresh() {
- var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- if (this.topOverlay.areElementSizesAdjusted && this.leftOverlay.areElementSizesAdjusted) {
- var container = this.wot.wtTable.wtRootElement.parentNode || this.wot.wtTable.wtRootElement;
- var width = container.clientWidth;
- var height = container.clientHeight;
- if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {
- this.spreaderLastSize.width = width;
- this.spreaderLastSize.height = height;
- this.adjustElementsSize();
- }
- }
- if (this.bottomOverlay.clone) {
- this.bottomOverlay.refresh(fastDraw);
- }
- this.leftOverlay.refresh(fastDraw);
- this.topOverlay.refresh(fastDraw);
- if (this.topLeftCornerOverlay) {
- this.topLeftCornerOverlay.refresh(fastDraw);
- }
- if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {
- this.bottomLeftCornerOverlay.refresh(fastDraw);
- }
- if (this.debug) {
- this.debug.refresh(fastDraw);
- }
- }
- /**
- * Adjust overlays elements size and master table size
- *
- * @param {Boolean} [force=false]
- */
- }, {
- key: 'adjustElementsSize',
- value: function adjustElementsSize() {
- var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var totalColumns = this.wot.getSetting('totalColumns');
- var totalRows = this.wot.getSetting('totalRows');
- var headerRowSize = this.wot.wtViewport.getRowHeaderWidth();
- var headerColumnSize = this.wot.wtViewport.getColumnHeaderHeight();
- var hiderStyle = this.wot.wtTable.hider.style;
- hiderStyle.width = headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns) + 'px';
- hiderStyle.height = headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1 + 'px';
- this.topOverlay.adjustElementsSize(force);
- this.leftOverlay.adjustElementsSize(force);
- if (this.bottomOverlay.clone) {
- this.bottomOverlay.adjustElementsSize(force);
- }
- }
- /**
- *
- */
- }, {
- key: 'applyToDOM',
- value: function applyToDOM() {
- if (!this.topOverlay.areElementSizesAdjusted || !this.leftOverlay.areElementSizesAdjusted) {
- this.adjustElementsSize();
- }
- this.topOverlay.applyToDOM();
- if (this.bottomOverlay.clone) {
- this.bottomOverlay.applyToDOM();
- }
- this.leftOverlay.applyToDOM();
- }
- /**
- * Get the parent overlay of the provided element.
- *
- * @param {HTMLElement} element
- * @returns {Object|null}
- */
- }, {
- key: 'getParentOverlay',
- value: function getParentOverlay(element) {
- if (!element) {
- return null;
- }
- var overlays = [this.topOverlay, this.leftOverlay, this.bottomOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];
- var result = null;
- (0, _array.arrayEach)(overlays, function (elem, i) {
- if (!elem) {
- return;
- }
- if (elem.clone && elem.clone.wtTable.TABLE.contains(element)) {
- result = elem.clone;
- }
- });
- return result;
- }
- }]);
- return Overlays;
- }();
- exports.default = Overlays;
- /***/ }),
- /* 67 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _number = __webpack_require__(76);
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class Scroll
- */
- var Scroll = function () {
- /**
- * @param {Walkontable} wotInstance
- */
- function Scroll(wotInstance) {
- _classCallCheck(this, Scroll);
- this.wot = wotInstance;
- // legacy support
- this.instance = wotInstance;
- }
- /**
- * Scrolls viewport to a cell by minimum number of cells
- *
- * @param {CellCoords} coords
- */
- _createClass(Scroll, [{
- key: 'scrollViewport',
- value: function scrollViewport(coords) {
- if (!this.wot.drawn) {
- return;
- }
- var _getVariables2 = this._getVariables(),
- topOverlay = _getVariables2.topOverlay,
- leftOverlay = _getVariables2.leftOverlay,
- totalRows = _getVariables2.totalRows,
- totalColumns = _getVariables2.totalColumns,
- fixedRowsTop = _getVariables2.fixedRowsTop,
- fixedRowsBottom = _getVariables2.fixedRowsBottom,
- fixedColumnsLeft = _getVariables2.fixedColumnsLeft;
- if (coords.row < 0 || coords.row > Math.max(totalRows - 1, 0)) {
- throw new Error('row ' + coords.row + ' does not exist');
- }
- if (coords.col < 0 || coords.col > Math.max(totalColumns - 1, 0)) {
- throw new Error('column ' + coords.col + ' does not exist');
- }
- if (coords.row >= fixedRowsTop && coords.row < this.getFirstVisibleRow()) {
- topOverlay.scrollTo(coords.row);
- } else if (coords.row > this.getLastVisibleRow() && coords.row < totalRows - fixedRowsBottom) {
- topOverlay.scrollTo(coords.row, true);
- }
- if (coords.col >= fixedColumnsLeft && coords.col < this.getFirstVisibleColumn()) {
- leftOverlay.scrollTo(coords.col);
- } else if (coords.col > this.getLastVisibleColumn()) {
- leftOverlay.scrollTo(coords.col, true);
- }
- }
- /**
- * Get first visible row based on virtual dom and how table is visible in browser window viewport.
- *
- * @returns {Number}
- */
- }, {
- key: 'getFirstVisibleRow',
- value: function getFirstVisibleRow() {
- var _getVariables3 = this._getVariables(),
- topOverlay = _getVariables3.topOverlay,
- wtTable = _getVariables3.wtTable,
- wtViewport = _getVariables3.wtViewport,
- totalRows = _getVariables3.totalRows,
- fixedRowsTop = _getVariables3.fixedRowsTop;
- var firstVisibleRow = wtTable.getFirstVisibleRow();
- if (topOverlay.mainTableScrollableElement === window) {
- var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
- var totalTableHeight = (0, _element.innerHeight)(wtTable.hider);
- var windowHeight = (0, _element.innerHeight)(window);
- var windowScrollTop = (0, _element.getScrollTop)(window);
- // Only calculate firstVisibleRow when table didn't filled (from up) whole viewport space
- if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {
- var rowsHeight = wtViewport.getColumnHeaderHeight();
- rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);
- (0, _number.rangeEachReverse)(totalRows, 1, function (row) {
- rowsHeight += topOverlay.sumCellSizes(row - 1, row);
- if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {
- // Return physical row + 1
- firstVisibleRow = row;
- return false;
- }
- });
- }
- }
- return firstVisibleRow;
- }
- /**
- * Get last visible row based on virtual dom and how table is visible in browser window viewport.
- *
- * @returns {Number}
- */
- }, {
- key: 'getLastVisibleRow',
- value: function getLastVisibleRow() {
- var _getVariables4 = this._getVariables(),
- topOverlay = _getVariables4.topOverlay,
- wtTable = _getVariables4.wtTable,
- wtViewport = _getVariables4.wtViewport,
- totalRows = _getVariables4.totalRows;
- var lastVisibleRow = wtTable.getLastVisibleRow();
- if (topOverlay.mainTableScrollableElement === window) {
- var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
- var windowHeight = (0, _element.innerHeight)(window);
- var windowScrollTop = (0, _element.getScrollTop)(window);
- // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space
- if (rootElementOffset.top > windowScrollTop) {
- var rowsHeight = wtViewport.getColumnHeaderHeight();
- (0, _number.rangeEach)(1, totalRows, function (row) {
- rowsHeight += topOverlay.sumCellSizes(row - 1, row);
- if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {
- // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)
- lastVisibleRow = row - 2;
- return false;
- }
- });
- }
- }
- return lastVisibleRow;
- }
- /**
- * Get first visible column based on virtual dom and how table is visible in browser window viewport.
- *
- * @returns {Number}
- */
- }, {
- key: 'getFirstVisibleColumn',
- value: function getFirstVisibleColumn() {
- var _getVariables5 = this._getVariables(),
- leftOverlay = _getVariables5.leftOverlay,
- wtTable = _getVariables5.wtTable,
- wtViewport = _getVariables5.wtViewport,
- totalColumns = _getVariables5.totalColumns,
- fixedColumnsLeft = _getVariables5.fixedColumnsLeft;
- var firstVisibleColumn = wtTable.getFirstVisibleColumn();
- if (leftOverlay.mainTableScrollableElement === window) {
- var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
- var totalTableWidth = (0, _element.innerWidth)(wtTable.hider);
- var windowWidth = (0, _element.innerWidth)(window);
- var windowScrollLeft = (0, _element.getScrollLeft)(window);
- // Only calculate firstVisibleColumn when table didn't filled (from left) whole viewport space
- if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {
- var columnsWidth = wtViewport.getRowHeaderWidth();
- (0, _number.rangeEachReverse)(totalColumns, 1, function (column) {
- columnsWidth += leftOverlay.sumCellSizes(column - 1, column);
- if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {
- // Return physical column + 1
- firstVisibleColumn = column;
- return false;
- }
- });
- }
- }
- return firstVisibleColumn;
- }
- /**
- * Get last visible column based on virtual dom and how table is visible in browser window viewport.
- *
- * @returns {Number}
- */
- }, {
- key: 'getLastVisibleColumn',
- value: function getLastVisibleColumn() {
- var _getVariables6 = this._getVariables(),
- leftOverlay = _getVariables6.leftOverlay,
- wtTable = _getVariables6.wtTable,
- wtViewport = _getVariables6.wtViewport,
- totalColumns = _getVariables6.totalColumns;
- var lastVisibleColumn = wtTable.getLastVisibleColumn();
- if (leftOverlay.mainTableScrollableElement === window) {
- var rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
- var windowWidth = (0, _element.innerWidth)(window);
- var windowScrollLeft = (0, _element.getScrollLeft)(window);
- // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space
- if (rootElementOffset.left > windowScrollLeft) {
- var columnsWidth = wtViewport.getRowHeaderWidth();
- (0, _number.rangeEach)(1, totalColumns, function (column) {
- columnsWidth += leftOverlay.sumCellSizes(column - 1, column);
- if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {
- // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)
- lastVisibleColumn = column - 2;
- return false;
- }
- });
- }
- }
- return lastVisibleColumn;
- }
- /**
- * Returns collection of variables used to rows and columns visibility calculations.
- *
- * @returns {Object}
- * @private
- */
- }, {
- key: '_getVariables',
- value: function _getVariables() {
- var wot = this.wot;
- var topOverlay = wot.wtOverlays.topOverlay;
- var leftOverlay = wot.wtOverlays.leftOverlay;
- var wtTable = wot.wtTable;
- var wtViewport = wot.wtViewport;
- var totalRows = wot.getSetting('totalRows');
- var totalColumns = wot.getSetting('totalColumns');
- var fixedRowsTop = wot.getSetting('fixedRowsTop');
- var fixedRowsBottom = wot.getSetting('fixedRowsBottom');
- var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');
- return {
- topOverlay: topOverlay,
- leftOverlay: leftOverlay,
- wtTable: wtTable,
- wtViewport: wtViewport,
- totalRows: totalRows,
- totalColumns: totalColumns,
- fixedRowsTop: fixedRowsTop,
- fixedRowsBottom: fixedRowsBottom,
- fixedColumnsLeft: fixedColumnsLeft
- };
- }
- }]);
- return Scroll;
- }();
- exports.default = Scroll;
- /***/ }),
- /* 68 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _object = __webpack_require__(25);
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class Settings
- */
- var Settings = function () {
- /**
- * @param {Walkontable} wotInstance
- * @param {Object} settings
- */
- function Settings(wotInstance, settings) {
- var _this = this;
- _classCallCheck(this, Settings);
- this.wot = wotInstance;
- // legacy support
- this.instance = wotInstance;
- // default settings. void 0 means it is required, null means it can be empty
- this.defaults = {
- table: void 0,
- debug: false, // shows WalkontableDebugOverlay
- // presentation mode
- externalRowCalculator: false,
- stretchH: 'none', // values: all, last, none
- currentRowClassName: null,
- currentColumnClassName: null,
- preventOverflow: function preventOverflow() {
- return false;
- },
- // data source
- data: void 0,
- freezeOverlays: false,
- fixedColumnsLeft: 0,
- fixedRowsTop: 0,
- fixedRowsBottom: 0,
- minSpareRows: 0,
- // this must be array of functions: [function (row, TH) {}]
- rowHeaders: function rowHeaders() {
- return [];
- },
- // this must be array of functions: [function (column, TH) {}]
- columnHeaders: function columnHeaders() {
- return [];
- },
- totalRows: void 0,
- totalColumns: void 0,
- cellRenderer: function cellRenderer(row, column, TD) {
- var cellData = _this.getSetting('data', row, column);
- (0, _element.fastInnerText)(TD, cellData === void 0 || cellData === null ? '' : cellData);
- },
- // columnWidth: 50,
- columnWidth: function columnWidth(col) {
- // return undefined means use default size for the rendered cell content
- },
- rowHeight: function rowHeight(row) {
- // return undefined means use default size for the rendered cell content
- },
- defaultRowHeight: 23,
- defaultColumnWidth: 50,
- selections: null,
- hideBorderOnMouseDownOver: false,
- viewportRowCalculatorOverride: null,
- viewportColumnCalculatorOverride: null,
- // callbacks
- onCellMouseDown: null,
- onCellMouseOver: null,
- onCellMouseOut: null,
- onCellMouseUp: null,
- // onCellMouseOut: null,
- onCellDblClick: null,
- onCellCornerMouseDown: null,
- onCellCornerDblClick: null,
- beforeDraw: null,
- onDraw: null,
- onBeforeDrawBorders: null,
- onScrollVertically: null,
- onScrollHorizontally: null,
- onBeforeTouchScroll: null,
- onAfterMomentumScroll: null,
- onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(width) {
- return width;
- },
- onModifyRowHeaderWidth: null,
- // constants
- scrollbarWidth: 10,
- scrollbarHeight: 10,
- renderAllRows: false,
- groups: false,
- rowHeaderWidth: null,
- columnHeaderHeight: null,
- headerClassName: null
- };
- // reference to settings
- this.settings = {};
- for (var i in this.defaults) {
- if ((0, _object.hasOwnProperty)(this.defaults, i)) {
- if (settings[i] !== void 0) {
- this.settings[i] = settings[i];
- } else if (this.defaults[i] === void 0) {
- throw new Error('A required setting "' + i + '" was not provided');
- } else {
- this.settings[i] = this.defaults[i];
- }
- }
- }
- }
- /**
- * Update settings
- *
- * @param {Object} settings
- * @param {*} value
- * @returns {Walkontable}
- */
- _createClass(Settings, [{
- key: 'update',
- value: function update(settings, value) {
- if (value === void 0) {
- // settings is object
- for (var i in settings) {
- if ((0, _object.hasOwnProperty)(settings, i)) {
- this.settings[i] = settings[i];
- }
- }
- } else {
- // if value is defined then settings is the key
- this.settings[settings] = value;
- }
- return this.wot;
- }
- /**
- * Get setting by name
- *
- * @param {String} key
- * @param {*} param1
- * @param {*} param2
- * @param {*} param3
- * @param {*} param4
- * @returns {*}
- */
- }, {
- key: 'getSetting',
- value: function getSetting(key, param1, param2, param3, param4) {
- if (typeof this.settings[key] === 'function') {
- // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
- return this.settings[key](param1, param2, param3, param4);
- } else if (param1 !== void 0 && Array.isArray(this.settings[key])) {
- // perhaps this can be removed, it is only used in tests
- return this.settings[key][param1];
- }
- return this.settings[key];
- }
- /**
- * Checks if setting exists
- *
- * @param {Boolean} key
- * @returns {Boolean}
- */
- }, {
- key: 'has',
- value: function has(key) {
- return !!this.settings[key];
- }
- }]);
- return Settings;
- }();
- exports.default = Settings;
- /***/ }),
- /* 69 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; };
- 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; }; }();
- var _element = __webpack_require__(2);
- var _function = __webpack_require__(75);
- var _coords = __webpack_require__(22);
- var _coords2 = _interopRequireDefault(_coords);
- var _range = __webpack_require__(43);
- var _range2 = _interopRequireDefault(_range);
- var _column = __webpack_require__(64);
- var _column2 = _interopRequireDefault(_column);
- var _row = __webpack_require__(65);
- var _row2 = _interopRequireDefault(_row);
- var _tableRenderer = __webpack_require__(70);
- var _tableRenderer2 = _interopRequireDefault(_tableRenderer);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- 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); } }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- *
- */
- var Table = function () {
- /**
- * @param {Walkontable} wotInstance
- * @param {HTMLTableElement} table
- */
- function Table(wotInstance, table) {
- var _this = this;
- _classCallCheck(this, Table);
- this.wot = wotInstance;
- // legacy support
- this.instance = this.wot;
- this.TABLE = table;
- this.TBODY = null;
- this.THEAD = null;
- this.COLGROUP = null;
- this.tableOffset = 0;
- this.holderOffset = 0;
- (0, _element.removeTextNodes)(this.TABLE);
- this.spreader = this.createSpreader(this.TABLE);
- this.hider = this.createHider(this.spreader);
- this.holder = this.createHolder(this.hider);
- this.wtRootElement = this.holder.parentNode;
- this.alignOverlaysWithTrimmingContainer();
- this.fixTableDomTree();
- this.colgroupChildrenLength = this.COLGROUP.childNodes.length;
- this.theadChildrenLength = this.THEAD.firstChild ? this.THEAD.firstChild.childNodes.length : 0;
- this.tbodyChildrenLength = this.TBODY.childNodes.length;
- this.rowFilter = null;
- this.columnFilter = null;
- this.correctHeaderWidth = false;
- var origRowHeaderWidth = this.wot.wtSettings.settings.rowHeaderWidth;
- // Fix for jumping row headers (https://github.com/handsontable/handsontable/issues/3850)
- this.wot.wtSettings.settings.rowHeaderWidth = function () {
- return _this._modifyRowHeaderWidth(origRowHeaderWidth);
- };
- }
- /**
- *
- */
- _createClass(Table, [{
- key: 'fixTableDomTree',
- value: function fixTableDomTree() {
- this.TBODY = this.TABLE.querySelector('tbody');
- if (!this.TBODY) {
- this.TBODY = document.createElement('tbody');
- this.TABLE.appendChild(this.TBODY);
- }
- this.THEAD = this.TABLE.querySelector('thead');
- if (!this.THEAD) {
- this.THEAD = document.createElement('thead');
- this.TABLE.insertBefore(this.THEAD, this.TBODY);
- }
- this.COLGROUP = this.TABLE.querySelector('colgroup');
- if (!this.COLGROUP) {
- this.COLGROUP = document.createElement('colgroup');
- this.TABLE.insertBefore(this.COLGROUP, this.THEAD);
- }
- if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {
- this.THEAD.appendChild(document.createElement('TR'));
- }
- }
- /**
- * @param table
- * @returns {HTMLElement}
- */
- }, {
- key: 'createSpreader',
- value: function createSpreader(table) {
- var parent = table.parentNode;
- var spreader = void 0;
- if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {
- spreader = document.createElement('div');
- spreader.className = 'wtSpreader';
- if (parent) {
- // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
- parent.insertBefore(spreader, table);
- }
- spreader.appendChild(table);
- }
- spreader.style.position = 'relative';
- return spreader;
- }
- /**
- * @param spreader
- * @returns {HTMLElement}
- */
- }, {
- key: 'createHider',
- value: function createHider(spreader) {
- var parent = spreader.parentNode;
- var hider = void 0;
- if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {
- hider = document.createElement('div');
- hider.className = 'wtHider';
- if (parent) {
- // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
- parent.insertBefore(hider, spreader);
- }
- hider.appendChild(spreader);
- }
- return hider;
- }
- /**
- *
- * @param hider
- * @returns {HTMLElement}
- */
- }, {
- key: 'createHolder',
- value: function createHolder(hider) {
- var parent = hider.parentNode;
- var holder = void 0;
- if (!parent || parent.nodeType !== 1 || !(0, _element.hasClass)(parent, 'wtHolder')) {
- holder = document.createElement('div');
- holder.style.position = 'relative';
- holder.className = 'wtHolder';
- if (parent) {
- // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
- parent.insertBefore(holder, hider);
- }
- if (!this.isWorkingOnClone()) {
- holder.parentNode.className += 'ht_master handsontable';
- }
- holder.appendChild(hider);
- }
- return holder;
- }
- }, {
- key: 'alignOverlaysWithTrimmingContainer',
- value: function alignOverlaysWithTrimmingContainer() {
- var trimmingElement = (0, _element.getTrimmingContainer)(this.wtRootElement);
- if (!this.isWorkingOnClone()) {
- this.holder.parentNode.style.position = 'relative';
- if (trimmingElement === window) {
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (!preventOverflow) {
- this.holder.style.overflow = 'visible';
- this.wtRootElement.style.overflow = 'visible';
- }
- } else {
- this.holder.style.width = (0, _element.getStyle)(trimmingElement, 'width');
- this.holder.style.height = (0, _element.getStyle)(trimmingElement, 'height');
- this.holder.style.overflow = '';
- }
- }
- }
- }, {
- key: 'isWorkingOnClone',
- value: function isWorkingOnClone() {
- return !!this.wot.cloneSource;
- }
- /**
- * Redraws the table
- *
- * @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
- * @returns {Table}
- */
- }, {
- key: 'draw',
- value: function draw(fastDraw) {
- var _wot = this.wot,
- wtOverlays = _wot.wtOverlays,
- wtViewport = _wot.wtViewport;
- var totalRows = this.instance.getSetting('totalRows');
- var rowHeaders = this.wot.getSetting('rowHeaders').length;
- var columnHeaders = this.wot.getSetting('columnHeaders').length;
- var syncScroll = false;
- if (!this.isWorkingOnClone()) {
- this.holderOffset = (0, _element.offset)(this.holder);
- fastDraw = wtViewport.createRenderCalculators(fastDraw);
- if (rowHeaders && !this.wot.getSetting('fixedColumnsLeft')) {
- var leftScrollPos = wtOverlays.leftOverlay.getScrollPosition();
- var previousState = this.correctHeaderWidth;
- this.correctHeaderWidth = leftScrollPos > 0;
- if (previousState !== this.correctHeaderWidth) {
- fastDraw = false;
- }
- }
- }
- if (!this.isWorkingOnClone()) {
- syncScroll = wtOverlays.prepareOverlays();
- }
- if (fastDraw) {
- if (!this.isWorkingOnClone()) {
- // in case we only scrolled without redraw, update visible rows information in oldRowsCalculator
- wtViewport.createVisibleCalculators();
- }
- if (wtOverlays) {
- wtOverlays.refresh(true);
- }
- } else {
- if (this.isWorkingOnClone()) {
- this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;
- } else {
- this.tableOffset = (0, _element.offset)(this.TABLE);
- }
- var startRow = void 0;
- 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)) {
- startRow = 0;
- } else if (_base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.instance.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
- startRow = Math.max(totalRows - this.wot.getSetting('fixedRowsBottom'), 0);
- } else {
- startRow = wtViewport.rowsRenderCalculator.startRow;
- }
- var startColumn = void 0;
- 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)) {
- startColumn = 0;
- } else {
- startColumn = wtViewport.columnsRenderCalculator.startColumn;
- }
- this.rowFilter = new _row2.default(startRow, totalRows, columnHeaders);
- this.columnFilter = new _column2.default(startColumn, this.wot.getSetting('totalColumns'), rowHeaders);
- this.alignOverlaysWithTrimmingContainer();
- this._doDraw(); // creates calculator after draw
- }
- this.refreshSelections(fastDraw);
- if (!this.isWorkingOnClone()) {
- wtOverlays.topOverlay.resetFixedPosition();
- if (wtOverlays.bottomOverlay.clone) {
- wtOverlays.bottomOverlay.resetFixedPosition();
- }
- wtOverlays.leftOverlay.resetFixedPosition();
- if (wtOverlays.topLeftCornerOverlay) {
- wtOverlays.topLeftCornerOverlay.resetFixedPosition();
- }
- if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {
- wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();
- }
- }
- if (syncScroll) {
- wtOverlays.syncScrollWithMaster();
- }
- this.wot.drawn = true;
- return this;
- }
- }, {
- key: '_doDraw',
- value: function _doDraw() {
- var wtRenderer = new _tableRenderer2.default(this);
- wtRenderer.render();
- }
- }, {
- key: 'removeClassFromCells',
- value: function removeClassFromCells(className) {
- var nodes = this.TABLE.querySelectorAll('.' + className);
- for (var i = 0, len = nodes.length; i < len; i++) {
- (0, _element.removeClass)(nodes[i], className);
- }
- }
- }, {
- key: 'refreshSelections',
- value: function refreshSelections(fastDraw) {
- if (!this.wot.selections) {
- return;
- }
- var len = this.wot.selections.length;
- if (fastDraw) {
- for (var i = 0; i < len; i++) {
- // there was no rerender, so we need to remove classNames by ourselves
- if (this.wot.selections[i].settings.className) {
- this.removeClassFromCells(this.wot.selections[i].settings.className);
- }
- if (this.wot.selections[i].settings.highlightHeaderClassName) {
- this.removeClassFromCells(this.wot.selections[i].settings.highlightHeaderClassName);
- }
- if (this.wot.selections[i].settings.highlightRowClassName) {
- this.removeClassFromCells(this.wot.selections[i].settings.highlightRowClassName);
- }
- if (this.wot.selections[i].settings.highlightColumnClassName) {
- this.removeClassFromCells(this.wot.selections[i].settings.highlightColumnClassName);
- }
- }
- }
- for (var _i = 0; _i < len; _i++) {
- this.wot.selections[_i].draw(this.wot, fastDraw);
- }
- }
- /**
- * Get cell element at coords.
- *
- * @param {CellCoords} coords
- * @returns {HTMLElement|Number} HTMLElement on success or Number one of the exit codes on error:
- * -1 row before viewport
- * -2 row after viewport
- */
- }, {
- key: 'getCell',
- value: function getCell(coords) {
- if (this.isRowBeforeRenderedRows(coords.row)) {
- // row before rendered rows
- return -1;
- } else if (this.isRowAfterRenderedRows(coords.row)) {
- // row after rendered rows
- return -2;
- }
- var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(coords.row)];
- if (TR) {
- return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(coords.col)];
- }
- }
- /**
- * getColumnHeader
- *
- * @param {Number} col Column index
- * @param {Number} [level=0] Header level (0 = most distant to the table)
- * @returns {Object} HTMLElement on success or undefined on error
- */
- }, {
- key: 'getColumnHeader',
- value: function getColumnHeader(col) {
- var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var TR = this.THEAD.childNodes[level];
- if (TR) {
- return TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];
- }
- }
- /**
- * getRowHeader
- *
- * @param {Number} row Row index
- * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table doesn't have row headers`
- */
- }, {
- key: 'getRowHeader',
- value: function getRowHeader(row) {
- if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {
- return null;
- }
- var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];
- if (TR) {
- return TR.childNodes[0];
- }
- }
- /**
- * Returns cell coords object for a given TD (or a child element of a TD element).
- *
- * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one).
- * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or null, if the provided element is not applicable.
- */
- }, {
- key: 'getCoords',
- value: function getCoords(TD) {
- if (TD.nodeName !== 'TD' && TD.nodeName !== 'TH') {
- TD = (0, _element.closest)(TD, ['TD', 'TH']);
- }
- if (TD === null) {
- return null;
- }
- var TR = TD.parentNode;
- var CONTAINER = TR.parentNode;
- var row = (0, _element.index)(TR);
- var col = TD.cellIndex;
- if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_TOP, TD)) {
- if (CONTAINER.nodeName === 'THEAD') {
- row -= CONTAINER.childNodes.length;
- }
- } else if (CONTAINER === this.THEAD) {
- row = this.rowFilter.visibleColHeadedRowToSourceRow(row);
- } else {
- row = this.rowFilter.renderedToSource(row);
- }
- if ((0, _element.overlayContainsElement)(_base2.default.CLONE_TOP_LEFT_CORNER, TD) || (0, _element.overlayContainsElement)(_base2.default.CLONE_LEFT, TD)) {
- col = this.columnFilter.offsettedTH(col);
- } else {
- col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);
- }
- return new _coords2.default(row, col);
- }
- }, {
- key: 'getTrForRow',
- value: function getTrForRow(row) {
- return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];
- }
- }, {
- key: 'getFirstRenderedRow',
- value: function getFirstRenderedRow() {
- return this.wot.wtViewport.rowsRenderCalculator.startRow;
- }
- }, {
- key: 'getFirstVisibleRow',
- value: function getFirstVisibleRow() {
- return this.wot.wtViewport.rowsVisibleCalculator.startRow;
- }
- }, {
- key: 'getFirstRenderedColumn',
- value: function getFirstRenderedColumn() {
- return this.wot.wtViewport.columnsRenderCalculator.startColumn;
- }
- /**
- * @returns {Number} Returns -1 if no row is visible
- */
- }, {
- key: 'getFirstVisibleColumn',
- value: function getFirstVisibleColumn() {
- return this.wot.wtViewport.columnsVisibleCalculator.startColumn;
- }
- /**
- * @returns {Number} Returns -1 if no row is visible
- */
- }, {
- key: 'getLastRenderedRow',
- value: function getLastRenderedRow() {
- return this.wot.wtViewport.rowsRenderCalculator.endRow;
- }
- }, {
- key: 'getLastVisibleRow',
- value: function getLastVisibleRow() {
- return this.wot.wtViewport.rowsVisibleCalculator.endRow;
- }
- }, {
- key: 'getLastRenderedColumn',
- value: function getLastRenderedColumn() {
- return this.wot.wtViewport.columnsRenderCalculator.endColumn;
- }
- /**
- * @returns {Number} Returns -1 if no column is visible
- */
- }, {
- key: 'getLastVisibleColumn',
- value: function getLastVisibleColumn() {
- return this.wot.wtViewport.columnsVisibleCalculator.endColumn;
- }
- }, {
- key: 'isRowBeforeRenderedRows',
- value: function isRowBeforeRenderedRows(row) {
- return this.rowFilter && this.rowFilter.sourceToRendered(row) < 0 && row >= 0;
- }
- }, {
- key: 'isRowAfterViewport',
- value: function isRowAfterViewport(row) {
- return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastVisibleRow();
- }
- }, {
- key: 'isRowAfterRenderedRows',
- value: function isRowAfterRenderedRows(row) {
- return this.rowFilter && this.rowFilter.sourceToRendered(row) > this.getLastRenderedRow();
- }
- }, {
- key: 'isColumnBeforeViewport',
- value: function isColumnBeforeViewport(column) {
- return this.columnFilter && this.columnFilter.sourceToRendered(column) < 0 && column >= 0;
- }
- }, {
- key: 'isColumnAfterViewport',
- value: function isColumnAfterViewport(column) {
- return this.columnFilter && this.columnFilter.sourceToRendered(column) > this.getLastVisibleColumn();
- }
- }, {
- key: 'isLastRowFullyVisible',
- value: function isLastRowFullyVisible() {
- return this.getLastVisibleRow() === this.getLastRenderedRow();
- }
- }, {
- key: 'isLastColumnFullyVisible',
- value: function isLastColumnFullyVisible() {
- return this.getLastVisibleColumn() === this.getLastRenderedColumn();
- }
- }, {
- key: 'getRenderedColumnsCount',
- value: function getRenderedColumnsCount() {
- var columnsCount = this.wot.wtViewport.columnsRenderCalculator.count;
- var totalColumns = this.wot.getSetting('totalColumns');
- if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {
- columnsCount = totalColumns;
- } 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)) {
- return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);
- }
- return columnsCount;
- }
- }, {
- key: 'getRenderedRowsCount',
- value: function getRenderedRowsCount() {
- var rowsCount = this.wot.wtViewport.rowsRenderCalculator.count;
- var totalRows = this.wot.getSetting('totalRows');
- if (this.wot.isOverlayName(_base2.default.CLONE_DEBUG)) {
- rowsCount = totalRows;
- } else if (this.wot.isOverlayName(_base2.default.CLONE_TOP) || this.wot.isOverlayName(_base2.default.CLONE_TOP_LEFT_CORNER)) {
- rowsCount = Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);
- } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM) || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
- rowsCount = Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);
- }
- return rowsCount;
- }
- }, {
- key: 'getVisibleRowsCount',
- value: function getVisibleRowsCount() {
- return this.wot.wtViewport.rowsVisibleCalculator.count;
- }
- }, {
- key: 'allRowsInViewport',
- value: function allRowsInViewport() {
- return this.wot.getSetting('totalRows') == this.getVisibleRowsCount();
- }
- /**
- * Checks if any of the row's cells content exceeds its initial height, and if so, returns the oversized height
- *
- * @param {Number} sourceRow
- * @returns {Number}
- */
- }, {
- key: 'getRowHeight',
- value: function getRowHeight(sourceRow) {
- var height = this.wot.wtSettings.settings.rowHeight(sourceRow);
- var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceRow];
- if (oversizedHeight !== void 0) {
- height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);
- }
- return height;
- }
- }, {
- key: 'getColumnHeaderHeight',
- value: function getColumnHeaderHeight(level) {
- var height = this.wot.wtSettings.settings.defaultRowHeight;
- var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];
- if (oversizedHeight !== void 0) {
- height = height ? Math.max(height, oversizedHeight) : oversizedHeight;
- }
- return height;
- }
- }, {
- key: 'getVisibleColumnsCount',
- value: function getVisibleColumnsCount() {
- return this.wot.wtViewport.columnsVisibleCalculator.count;
- }
- }, {
- key: 'allColumnsInViewport',
- value: function allColumnsInViewport() {
- return this.wot.getSetting('totalColumns') == this.getVisibleColumnsCount();
- }
- }, {
- key: 'getColumnWidth',
- value: function getColumnWidth(sourceColumn) {
- var width = this.wot.wtSettings.settings.columnWidth;
- if (typeof width === 'function') {
- width = width(sourceColumn);
- } else if ((typeof width === 'undefined' ? 'undefined' : _typeof(width)) === 'object') {
- width = width[sourceColumn];
- }
- return width || this.wot.wtSettings.settings.defaultColumnWidth;
- }
- }, {
- key: 'getStretchedColumnWidth',
- value: function getStretchedColumnWidth(sourceColumn) {
- var columnWidth = this.getColumnWidth(sourceColumn);
- var width = columnWidth == null ? this.instance.wtSettings.settings.defaultColumnWidth : columnWidth;
- var calculator = this.wot.wtViewport.columnsRenderCalculator;
- if (calculator) {
- var stretchedWidth = calculator.getStretchedColumnWidth(sourceColumn, width);
- if (stretchedWidth) {
- width = stretchedWidth;
- }
- }
- return width;
- }
- /**
- * Modify row header widths provided by user in class contructor.
- *
- * @private
- */
- }, {
- key: '_modifyRowHeaderWidth',
- value: function _modifyRowHeaderWidth(rowHeaderWidthFactory) {
- var widths = (0, _function.isFunction)(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;
- if (Array.isArray(widths)) {
- widths = [].concat(_toConsumableArray(widths));
- widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);
- } else {
- widths = this._correctRowHeaderWidth(widths);
- }
- return widths;
- }
- /**
- * Correct row header width if necessary.
- *
- * @private
- */
- }, {
- key: '_correctRowHeaderWidth',
- value: function _correctRowHeaderWidth(width) {
- if (typeof width !== 'number') {
- width = this.wot.getSetting('defaultColumnWidth');
- }
- if (this.correctHeaderWidth) {
- width++;
- }
- return width;
- }
- }]);
- return Table;
- }();
- exports.default = Table;
- /***/ }),
- /* 70 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var performanceWarningAppeared = false;
- /**
- * @class TableRenderer
- */
- var TableRenderer = function () {
- /**
- * @param {WalkontableTable} wtTable
- */
- function TableRenderer(wtTable) {
- _classCallCheck(this, TableRenderer);
- this.wtTable = wtTable;
- this.wot = wtTable.instance;
- // legacy support
- this.instance = wtTable.instance;
- this.rowFilter = wtTable.rowFilter;
- this.columnFilter = wtTable.columnFilter;
- this.TABLE = wtTable.TABLE;
- this.THEAD = wtTable.THEAD;
- this.TBODY = wtTable.TBODY;
- this.COLGROUP = wtTable.COLGROUP;
- this.rowHeaders = [];
- this.rowHeaderCount = 0;
- this.columnHeaders = [];
- this.columnHeaderCount = 0;
- this.fixedRowsTop = 0;
- this.fixedRowsBottom = 0;
- }
- /**
- *
- */
- _createClass(TableRenderer, [{
- key: 'render',
- value: function render() {
- if (!this.wtTable.isWorkingOnClone()) {
- var skipRender = {};
- this.wot.getSetting('beforeDraw', true, skipRender);
- if (skipRender.skipRender === true) {
- return;
- }
- }
- this.rowHeaders = this.wot.getSetting('rowHeaders');
- this.rowHeaderCount = this.rowHeaders.length;
- this.fixedRowsTop = this.wot.getSetting('fixedRowsTop');
- this.fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
- this.columnHeaders = this.wot.getSetting('columnHeaders');
- this.columnHeaderCount = this.columnHeaders.length;
- var columnsToRender = this.wtTable.getRenderedColumnsCount();
- var rowsToRender = this.wtTable.getRenderedRowsCount();
- var totalColumns = this.wot.getSetting('totalColumns');
- var totalRows = this.wot.getSetting('totalRows');
- var workspaceWidth = void 0;
- var adjusted = false;
- if (_base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM) || _base2.default.isOverlayTypeOf(this.wot.cloneOverlay, _base2.default.CLONE_BOTTOM_LEFT_CORNER)) {
- // do NOT render headers on the bottom or bottom-left corner overlay
- this.columnHeaders = [];
- this.columnHeaderCount = 0;
- }
- if (totalColumns >= 0) {
- // prepare COL and TH elements for rendering
- this.adjustAvailableNodes();
- adjusted = true;
- // adjust column widths according to user widths settings
- this.renderColumnHeaders();
- // Render table rows
- this.renderRows(totalRows, rowsToRender, columnsToRender);
- if (!this.wtTable.isWorkingOnClone()) {
- workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();
- this.wot.wtViewport.containerWidth = null;
- }
- this.adjustColumnWidths(columnsToRender);
- this.markOversizedColumnHeaders();
- this.adjustColumnHeaderHeights();
- }
- if (!adjusted) {
- this.adjustAvailableNodes();
- }
- this.removeRedundantRows(rowsToRender);
- if (!this.wtTable.isWorkingOnClone() || this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {
- this.markOversizedRows();
- }
- if (!this.wtTable.isWorkingOnClone()) {
- this.wot.wtViewport.createVisibleCalculators();
- this.wot.wtOverlays.refresh(false);
- this.wot.wtOverlays.applyToDOM();
- var hiderWidth = (0, _element.outerWidth)(this.wtTable.hider);
- var tableWidth = (0, _element.outerWidth)(this.wtTable.TABLE);
- if (hiderWidth !== 0 && tableWidth !== hiderWidth) {
- // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.
- this.adjustColumnWidths(columnsToRender);
- }
- if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {
- // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching
- this.wot.wtViewport.containerWidth = null;
- var firstRendered = this.wtTable.getFirstRenderedColumn();
- var lastRendered = this.wtTable.getLastRenderedColumn();
- var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');
- var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');
- rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
- if (rowHeaderWidthSetting != null) {
- for (var i = 0; i < this.rowHeaderCount; i++) {
- var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;
- width = width == null ? defaultColumnWidth : width;
- this.COLGROUP.childNodes[i].style.width = width + 'px';
- }
- }
- for (var _i = firstRendered; _i < lastRendered; _i++) {
- var _width = this.wtTable.getStretchedColumnWidth(_i);
- var renderedIndex = this.columnFilter.sourceToRendered(_i);
- this.COLGROUP.childNodes[renderedIndex + this.rowHeaderCount].style.width = _width + 'px';
- }
- }
- this.wot.getSetting('onDraw', true);
- } else if (this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {
- this.wot.cloneSource.wtOverlays.adjustElementsSize();
- }
- }
- /**
- * @param {Number} renderedRowsCount
- */
- }, {
- key: 'removeRedundantRows',
- value: function removeRedundantRows(renderedRowsCount) {
- while (this.wtTable.tbodyChildrenLength > renderedRowsCount) {
- this.TBODY.removeChild(this.TBODY.lastChild);
- this.wtTable.tbodyChildrenLength--;
- }
- }
- /**
- * @param {Number} totalRows
- * @param {Number} rowsToRender
- * @param {Number} columnsToRender
- */
- }, {
- key: 'renderRows',
- value: function renderRows(totalRows, rowsToRender, columnsToRender) {
- var lastTD = void 0,
- TR = void 0;
- var visibleRowIndex = 0;
- var sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);
- var isWorkingOnClone = this.wtTable.isWorkingOnClone();
- while (sourceRowIndex < totalRows && sourceRowIndex >= 0) {
- if (!performanceWarningAppeared && visibleRowIndex > 1000) {
- performanceWarningAppeared = true;
- 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.');
- }
- if (rowsToRender !== void 0 && visibleRowIndex === rowsToRender) {
- // We have as much rows as needed for this clone
- break;
- }
- TR = this.getOrCreateTrForRow(visibleRowIndex, TR);
- // Render row headers
- this.renderRowHeaders(sourceRowIndex, TR);
- // Add and/or remove TDs to TR to match the desired number
- this.adjustColumns(TR, columnsToRender + this.rowHeaderCount);
- lastTD = this.renderCells(sourceRowIndex, TR, columnsToRender);
- if (!isWorkingOnClone ||
- // Necessary to refresh oversized row heights after editing cell in overlays
- this.wot.isOverlayName(_base2.default.CLONE_BOTTOM)) {
- // Reset the oversized row cache for this row
- this.resetOversizedRow(sourceRowIndex);
- }
- if (TR.firstChild) {
- // if I have 2 fixed columns with one-line content and the 3rd column has a multiline content, this is
- // the way to make sure that the overlay will has same row height
- var height = this.wot.wtTable.getRowHeight(sourceRowIndex);
- if (height) {
- // Decrease height. 1 pixel will be "replaced" by 1px border top
- height--;
- TR.firstChild.style.height = height + 'px';
- } else {
- TR.firstChild.style.height = '';
- }
- }
- visibleRowIndex++;
- sourceRowIndex = this.rowFilter.renderedToSource(visibleRowIndex);
- }
- }
- /**
- * Reset the oversized row cache for the provided index
- *
- * @param {Number} sourceRow Row index
- */
- }, {
- key: 'resetOversizedRow',
- value: function resetOversizedRow(sourceRow) {
- if (this.wot.getSetting('externalRowCalculator')) {
- return;
- }
- if (this.wot.wtViewport.oversizedRows && this.wot.wtViewport.oversizedRows[sourceRow]) {
- this.wot.wtViewport.oversizedRows[sourceRow] = void 0;
- }
- }
- /**
- * Check if any of the rendered rows is higher than expected, and if so, cache them
- */
- }, {
- key: 'markOversizedRows',
- value: function markOversizedRows() {
- if (this.wot.getSetting('externalRowCalculator')) {
- return;
- }
- var rowCount = this.instance.wtTable.TBODY.childNodes.length;
- var expectedTableHeight = rowCount * this.instance.wtSettings.settings.defaultRowHeight;
- var actualTableHeight = (0, _element.innerHeight)(this.instance.wtTable.TBODY) - 1;
- var previousRowHeight = void 0;
- var rowInnerHeight = void 0;
- var sourceRowIndex = void 0;
- var currentTr = void 0;
- var rowHeader = void 0;
- var totalRows = this.instance.getSetting('totalRows');
- if (expectedTableHeight === actualTableHeight && !this.instance.getSetting('fixedRowsBottom')) {
- // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them
- return;
- }
- while (rowCount) {
- rowCount--;
- sourceRowIndex = this.instance.wtTable.rowFilter.renderedToSource(rowCount);
- previousRowHeight = this.instance.wtTable.getRowHeight(sourceRowIndex);
- currentTr = this.instance.wtTable.getTrForRow(sourceRowIndex);
- rowHeader = currentTr.querySelector('th');
- if (rowHeader) {
- rowInnerHeight = (0, _element.innerHeight)(rowHeader);
- } else {
- rowInnerHeight = (0, _element.innerHeight)(currentTr) - 1;
- }
- if (!previousRowHeight && this.instance.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight) {
- this.instance.wtViewport.oversizedRows[sourceRowIndex] = ++rowInnerHeight;
- }
- }
- }
- /**
- * Check if any of the rendered columns is higher than expected, and if so, cache them.
- */
- }, {
- key: 'markOversizedColumnHeaders',
- value: function markOversizedColumnHeaders() {
- var overlayName = this.wot.getOverlayName();
- if (!this.columnHeaderCount || this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] || this.wtTable.isWorkingOnClone()) {
- return;
- }
- var columnCount = this.wtTable.getRenderedColumnsCount();
- for (var i = 0; i < this.columnHeaderCount; i++) {
- for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {
- this.markIfOversizedColumnHeader(renderedColumnIndex);
- }
- }
- this.wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] = true;
- }
- /**
- *
- */
- }, {
- key: 'adjustColumnHeaderHeights',
- value: function adjustColumnHeaderHeights() {
- var columnHeaders = this.wot.getSetting('columnHeaders');
- var children = this.wot.wtTable.THEAD.childNodes;
- var oversizedColumnHeaders = this.wot.wtViewport.oversizedColumnHeaders;
- for (var i = 0, len = columnHeaders.length; i < len; i++) {
- if (oversizedColumnHeaders[i]) {
- if (!children[i] || children[i].childNodes.length === 0) {
- return;
- }
- children[i].childNodes[0].style.height = oversizedColumnHeaders[i] + 'px';
- }
- }
- }
- /**
- * Check if column header for the specified column is higher than expected, and if so, cache it
- *
- * @param {Number} col Index of column
- */
- }, {
- key: 'markIfOversizedColumnHeader',
- value: function markIfOversizedColumnHeader(col) {
- var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);
- var level = this.columnHeaderCount;
- var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;
- var previousColHeaderHeight = void 0;
- var currentHeader = void 0;
- var currentHeaderHeight = void 0;
- var columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];
- while (level) {
- level--;
- previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);
- currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);
- if (!currentHeader) {
- /* eslint-disable no-continue */
- continue;
- }
- currentHeaderHeight = (0, _element.innerHeight)(currentHeader);
- if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {
- this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;
- }
- if (Array.isArray(columnHeaderHeightSetting)) {
- if (columnHeaderHeightSetting[level] != null) {
- this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];
- }
- } else if (!isNaN(columnHeaderHeightSetting)) {
- this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;
- }
- if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {
- this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level] || columnHeaderHeightSetting;
- }
- }
- }
- /**
- * @param {Number} sourceRowIndex
- * @param {HTMLTableRowElement} TR
- * @param {Number} columnsToRender
- * @returns {HTMLTableCellElement}
- */
- }, {
- key: 'renderCells',
- value: function renderCells(sourceRowIndex, TR, columnsToRender) {
- var TD = void 0;
- var sourceColIndex = void 0;
- for (var visibleColIndex = 0; visibleColIndex < columnsToRender; visibleColIndex++) {
- sourceColIndex = this.columnFilter.renderedToSource(visibleColIndex);
- if (visibleColIndex === 0) {
- TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(sourceColIndex)];
- } else {
- TD = TD.nextSibling; // http://jsperf.com/nextsibling-vs-indexed-childnodes
- }
- // If the number of headers has been reduced, we need to replace excess TH with TD
- if (TD.nodeName == 'TH') {
- TD = replaceThWithTd(TD, TR);
- }
- if (!(0, _element.hasClass)(TD, 'hide')) {
- TD.className = '';
- }
- TD.removeAttribute('style');
- this.wot.wtSettings.settings.cellRenderer(sourceRowIndex, sourceColIndex, TD);
- }
- return TD;
- }
- /**
- * @param {Number} columnsToRender Number of columns to render.
- */
- }, {
- key: 'adjustColumnWidths',
- value: function adjustColumnWidths(columnsToRender) {
- var scrollbarCompensation = 0;
- var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
- var mainHolder = sourceInstance.wtTable.holder;
- var defaultColumnWidth = this.wot.getSetting('defaultColumnWidth');
- var rowHeaderWidthSetting = this.wot.getSetting('rowHeaderWidth');
- if (mainHolder.offsetHeight < mainHolder.scrollHeight) {
- scrollbarCompensation = (0, _element.getScrollbarWidth)();
- }
- this.wot.wtViewport.columnsRenderCalculator.refreshStretching(this.wot.wtViewport.getViewportWidth() - scrollbarCompensation);
- rowHeaderWidthSetting = this.instance.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
- if (rowHeaderWidthSetting != null) {
- for (var i = 0; i < this.rowHeaderCount; i++) {
- var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[i] : rowHeaderWidthSetting;
- width = width == null ? defaultColumnWidth : width;
- this.COLGROUP.childNodes[i].style.width = width + 'px';
- }
- }
- for (var renderedColIndex = 0; renderedColIndex < columnsToRender; renderedColIndex++) {
- var _width2 = this.wtTable.getStretchedColumnWidth(this.columnFilter.renderedToSource(renderedColIndex));
- this.COLGROUP.childNodes[renderedColIndex + this.rowHeaderCount].style.width = _width2 + 'px';
- }
- }
- /**
- * @param {HTMLTableCellElement} TR
- */
- }, {
- key: 'appendToTbody',
- value: function appendToTbody(TR) {
- this.TBODY.appendChild(TR);
- this.wtTable.tbodyChildrenLength++;
- }
- /**
- * @param {Number} rowIndex
- * @param {HTMLTableRowElement} currentTr
- * @returns {HTMLTableCellElement}
- */
- }, {
- key: 'getOrCreateTrForRow',
- value: function getOrCreateTrForRow(rowIndex, currentTr) {
- var TR = void 0;
- if (rowIndex >= this.wtTable.tbodyChildrenLength) {
- TR = this.createRow();
- this.appendToTbody(TR);
- } else if (rowIndex === 0) {
- TR = this.TBODY.firstChild;
- } else {
- // http://jsperf.com/nextsibling-vs-indexed-childnodes
- TR = currentTr.nextSibling;
- }
- if (TR.className) {
- TR.removeAttribute('class');
- }
- return TR;
- }
- /**
- * @returns {HTMLTableCellElement}
- */
- }, {
- key: 'createRow',
- value: function createRow() {
- var TR = document.createElement('TR');
- for (var visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {
- TR.appendChild(document.createElement('TH'));
- }
- return TR;
- }
- /**
- * @param {Number} row
- * @param {Number} col
- * @param {HTMLTableCellElement} TH
- */
- }, {
- key: 'renderRowHeader',
- value: function renderRowHeader(row, col, TH) {
- TH.className = '';
- TH.removeAttribute('style');
- this.rowHeaders[col](row, TH, col);
- }
- /**
- * @param {Number} row
- * @param {HTMLTableCellElement} TR
- */
- }, {
- key: 'renderRowHeaders',
- value: function renderRowHeaders(row, TR) {
- for (var TH = TR.firstChild, visibleColIndex = 0; visibleColIndex < this.rowHeaderCount; visibleColIndex++) {
- // If the number of row headers increased we need to create TH or replace an existing TD node with TH
- if (!TH) {
- TH = document.createElement('TH');
- TR.appendChild(TH);
- } else if (TH.nodeName == 'TD') {
- TH = replaceTdWithTh(TH, TR);
- }
- this.renderRowHeader(row, visibleColIndex, TH);
- // http://jsperf.com/nextsibling-vs-indexed-childnodes
- TH = TH.nextSibling;
- }
- }
- /**
- * Adjust the number of COL and TH elements to match the number of columns and headers that need to be rendered
- */
- }, {
- key: 'adjustAvailableNodes',
- value: function adjustAvailableNodes() {
- this.adjustColGroups();
- this.adjustThead();
- }
- /**
- * Renders the column headers
- */
- }, {
- key: 'renderColumnHeaders',
- value: function renderColumnHeaders() {
- if (!this.columnHeaderCount) {
- return;
- }
- var columnCount = this.wtTable.getRenderedColumnsCount();
- for (var i = 0; i < this.columnHeaderCount; i++) {
- var TR = this.getTrForColumnHeaders(i);
- for (var renderedColumnIndex = -1 * this.rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {
- var sourceCol = this.columnFilter.renderedToSource(renderedColumnIndex);
- this.renderColumnHeader(i, sourceCol, TR.childNodes[renderedColumnIndex + this.rowHeaderCount]);
- }
- }
- }
- /**
- * Adjusts the number of COL elements to match the number of columns that need to be rendered
- */
- }, {
- key: 'adjustColGroups',
- value: function adjustColGroups() {
- var columnCount = this.wtTable.getRenderedColumnsCount();
- while (this.wtTable.colgroupChildrenLength < columnCount + this.rowHeaderCount) {
- this.COLGROUP.appendChild(document.createElement('COL'));
- this.wtTable.colgroupChildrenLength++;
- }
- while (this.wtTable.colgroupChildrenLength > columnCount + this.rowHeaderCount) {
- this.COLGROUP.removeChild(this.COLGROUP.lastChild);
- this.wtTable.colgroupChildrenLength--;
- }
- if (this.rowHeaderCount) {
- (0, _element.addClass)(this.COLGROUP.childNodes[0], 'rowHeader');
- }
- }
- /**
- * Adjusts the number of TH elements in THEAD to match the number of headers and columns that need to be rendered
- */
- }, {
- key: 'adjustThead',
- value: function adjustThead() {
- var columnCount = this.wtTable.getRenderedColumnsCount();
- var TR = this.THEAD.firstChild;
- if (this.columnHeaders.length) {
- for (var i = 0, len = this.columnHeaders.length; i < len; i++) {
- TR = this.THEAD.childNodes[i];
- if (!TR) {
- TR = document.createElement('TR');
- this.THEAD.appendChild(TR);
- }
- this.theadChildrenLength = TR.childNodes.length;
- while (this.theadChildrenLength < columnCount + this.rowHeaderCount) {
- TR.appendChild(document.createElement('TH'));
- this.theadChildrenLength++;
- }
- while (this.theadChildrenLength > columnCount + this.rowHeaderCount) {
- TR.removeChild(TR.lastChild);
- this.theadChildrenLength--;
- }
- }
- var theadChildrenLength = this.THEAD.childNodes.length;
- if (theadChildrenLength > this.columnHeaders.length) {
- for (var _i2 = this.columnHeaders.length; _i2 < theadChildrenLength; _i2++) {
- this.THEAD.removeChild(this.THEAD.lastChild);
- }
- }
- } else if (TR) {
- (0, _element.empty)(TR);
- }
- }
- /**
- * @param {Number} index
- * @returns {HTMLTableCellElement}
- */
- }, {
- key: 'getTrForColumnHeaders',
- value: function getTrForColumnHeaders(index) {
- return this.THEAD.childNodes[index];
- }
- /**
- * @param {Number} row
- * @param {Number} col
- * @param {HTMLTableCellElement} TH
- * @returns {*}
- */
- }, {
- key: 'renderColumnHeader',
- value: function renderColumnHeader(row, col, TH) {
- TH.className = '';
- TH.removeAttribute('style');
- return this.columnHeaders[row](col, TH, row);
- }
- /**
- * Add and/or remove the TDs to match the desired number
- *
- * @param {HTMLTableCellElement} TR Table row in question
- * @param {Number} desiredCount The desired number of TDs in the TR
- */
- }, {
- key: 'adjustColumns',
- value: function adjustColumns(TR, desiredCount) {
- var count = TR.childNodes.length;
- while (count < desiredCount) {
- var TD = document.createElement('TD');
- TR.appendChild(TD);
- count++;
- }
- while (count > desiredCount) {
- TR.removeChild(TR.lastChild);
- count--;
- }
- }
- /**
- * @param {Number} columnsToRender
- */
- }, {
- key: 'removeRedundantColumns',
- value: function removeRedundantColumns(columnsToRender) {
- while (this.wtTable.tbodyChildrenLength > columnsToRender) {
- this.TBODY.removeChild(this.TBODY.lastChild);
- this.wtTable.tbodyChildrenLength--;
- }
- }
- }]);
- return TableRenderer;
- }();
- function replaceTdWithTh(TD, TR) {
- var TH = document.createElement('TH');
- TR.insertBefore(TH, TD);
- TR.removeChild(TD);
- return TH;
- }
- function replaceThWithTd(TH, TR) {
- var TD = document.createElement('TD');
- TR.insertBefore(TD, TH);
- TR.removeChild(TH);
- return TD;
- }
- exports.default = TableRenderer;
- /***/ }),
- /* 71 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _object = __webpack_require__(25);
- var _eventManager = __webpack_require__(23);
- var _eventManager2 = _interopRequireDefault(_eventManager);
- var _viewportColumns = __webpack_require__(60);
- var _viewportColumns2 = _interopRequireDefault(_viewportColumns);
- var _viewportRows = __webpack_require__(61);
- var _viewportRows2 = _interopRequireDefault(_viewportRows);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class Viewport
- */
- var Viewport = function () {
- /**
- * @param wotInstance
- */
- function Viewport(wotInstance) {
- var _this = this;
- _classCallCheck(this, Viewport);
- this.wot = wotInstance;
- // legacy support
- this.instance = this.wot;
- this.oversizedRows = [];
- this.oversizedColumnHeaders = [];
- this.hasOversizedColumnHeadersMarked = {};
- this.clientHeight = 0;
- this.containerWidth = NaN;
- this.rowHeaderWidth = NaN;
- this.rowsVisibleCalculator = null;
- this.columnsVisibleCalculator = null;
- this.eventManager = new _eventManager2.default(this.wot);
- this.eventManager.addEventListener(window, 'resize', function () {
- _this.clientHeight = _this.getWorkspaceHeight();
- });
- }
- /**
- * @returns {number}
- */
- _createClass(Viewport, [{
- key: 'getWorkspaceHeight',
- value: function getWorkspaceHeight() {
- var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;
- var elemHeight = void 0;
- var height = 0;
- if (trimmingContainer === window) {
- height = document.documentElement.clientHeight;
- } else {
- elemHeight = (0, _element.outerHeight)(trimmingContainer);
- // returns height without DIV scrollbar
- height = elemHeight > 0 && trimmingContainer.clientHeight > 0 ? trimmingContainer.clientHeight : Infinity;
- }
- return height;
- }
- }, {
- key: 'getWorkspaceWidth',
- value: function getWorkspaceWidth() {
- var width = void 0;
- var totalColumns = this.wot.getSetting('totalColumns');
- var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;
- var overflow = void 0;
- var stretchSetting = this.wot.getSetting('stretchH');
- var docOffsetWidth = document.documentElement.offsetWidth;
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (preventOverflow) {
- return (0, _element.outerWidth)(this.instance.wtTable.wtRootElement);
- }
- if (this.wot.getSetting('freezeOverlays')) {
- width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);
- } else {
- width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);
- }
- if (trimmingContainer === window && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {
- // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window
- // otherwise continue below, which will allow stretching
- // this is used in `scroll_window.html`
- // TODO test me
- return document.documentElement.clientWidth;
- }
- if (trimmingContainer !== window) {
- overflow = (0, _element.getStyle)(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow');
- if (overflow == 'scroll' || overflow == 'hidden' || overflow == 'auto') {
- // this is used in `scroll.html`
- // TODO test me
- return Math.max(width, trimmingContainer.clientWidth);
- }
- }
- if (stretchSetting === 'none' || !stretchSetting) {
- // if no stretching is used, return the maximum used workspace width
- return Math.max(width, (0, _element.outerWidth)(this.instance.wtTable.TABLE));
- }
- // if stretching is used, return the actual container width, so the columns can fit inside it
- return width;
- }
- /**
- * Checks if viewport has vertical scroll
- *
- * @returns {Boolean}
- */
- }, {
- key: 'hasVerticalScroll',
- value: function hasVerticalScroll() {
- return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();
- }
- /**
- * Checks if viewport has horizontal scroll
- *
- * @returns {Boolean}
- */
- }, {
- key: 'hasHorizontalScroll',
- value: function hasHorizontalScroll() {
- return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();
- }
- /**
- * @param from
- * @param length
- * @returns {Number}
- */
- }, {
- key: 'sumColumnWidths',
- value: function sumColumnWidths(from, length) {
- var sum = 0;
- while (from < length) {
- sum += this.wot.wtTable.getColumnWidth(from);
- from++;
- }
- return sum;
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getContainerFillWidth',
- value: function getContainerFillWidth() {
- if (this.containerWidth) {
- return this.containerWidth;
- }
- var mainContainer = this.instance.wtTable.holder;
- var fillWidth = void 0;
- var dummyElement = void 0;
- dummyElement = document.createElement('div');
- dummyElement.style.width = '100%';
- dummyElement.style.height = '1px';
- mainContainer.appendChild(dummyElement);
- fillWidth = dummyElement.offsetWidth;
- this.containerWidth = fillWidth;
- mainContainer.removeChild(dummyElement);
- return fillWidth;
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getWorkspaceOffset',
- value: function getWorkspaceOffset() {
- return (0, _element.offset)(this.wot.wtTable.TABLE);
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getWorkspaceActualHeight',
- value: function getWorkspaceActualHeight() {
- return (0, _element.outerHeight)(this.wot.wtTable.TABLE);
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getWorkspaceActualWidth',
- value: function getWorkspaceActualWidth() {
- 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;
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getColumnHeaderHeight',
- value: function getColumnHeaderHeight() {
- if (isNaN(this.columnHeaderHeight)) {
- this.columnHeaderHeight = (0, _element.outerHeight)(this.wot.wtTable.THEAD);
- }
- return this.columnHeaderHeight;
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getViewportHeight',
- value: function getViewportHeight() {
- var containerHeight = this.getWorkspaceHeight();
- var columnHeaderHeight = void 0;
- if (containerHeight === Infinity) {
- return containerHeight;
- }
- columnHeaderHeight = this.getColumnHeaderHeight();
- if (columnHeaderHeight > 0) {
- containerHeight -= columnHeaderHeight;
- }
- return containerHeight;
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getRowHeaderWidth',
- value: function getRowHeaderWidth() {
- var rowHeadersHeightSetting = this.instance.getSetting('rowHeaderWidth');
- var rowHeaders = this.instance.getSetting('rowHeaders');
- if (rowHeadersHeightSetting) {
- this.rowHeaderWidth = 0;
- for (var i = 0, len = rowHeaders.length; i < len; i++) {
- this.rowHeaderWidth += rowHeadersHeightSetting[i] || rowHeadersHeightSetting;
- }
- }
- if (this.wot.cloneSource) {
- return this.wot.cloneSource.wtViewport.getRowHeaderWidth();
- }
- if (isNaN(this.rowHeaderWidth)) {
- if (rowHeaders.length) {
- var TH = this.instance.wtTable.TABLE.querySelector('TH');
- this.rowHeaderWidth = 0;
- for (var _i = 0, _len = rowHeaders.length; _i < _len; _i++) {
- if (TH) {
- this.rowHeaderWidth += (0, _element.outerWidth)(TH);
- TH = TH.nextSibling;
- } else {
- // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.
- // TODO: proper fix
- this.rowHeaderWidth += 50;
- }
- }
- } else {
- this.rowHeaderWidth = 0;
- }
- }
- this.rowHeaderWidth = this.instance.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;
- return this.rowHeaderWidth;
- }
- /**
- * @returns {Number}
- */
- }, {
- key: 'getViewportWidth',
- value: function getViewportWidth() {
- var containerWidth = this.getWorkspaceWidth();
- var rowHeaderWidth = void 0;
- if (containerWidth === Infinity) {
- return containerWidth;
- }
- rowHeaderWidth = this.getRowHeaderWidth();
- if (rowHeaderWidth > 0) {
- return containerWidth - rowHeaderWidth;
- }
- return containerWidth;
- }
- /**
- * Creates:
- * - rowsRenderCalculator (before draw, to qualify rows for rendering)
- * - rowsVisibleCalculator (after draw, to measure which rows are actually visible)
- *
- * @returns {ViewportRowsCalculator}
- */
- }, {
- key: 'createRowsCalculator',
- value: function createRowsCalculator() {
- var _this2 = this;
- var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var height = void 0;
- var pos = void 0;
- var fixedRowsTop = void 0;
- var scrollbarHeight = void 0;
- var fixedRowsBottom = void 0;
- var fixedRowsHeight = void 0;
- var totalRows = void 0;
- this.rowHeaderWidth = NaN;
- if (this.wot.wtSettings.settings.renderAllRows) {
- height = Infinity;
- } else {
- height = this.getViewportHeight();
- }
- pos = this.wot.wtOverlays.topOverlay.getScrollPosition() - this.wot.wtOverlays.topOverlay.getTableParentOffset();
- if (pos < 0) {
- pos = 0;
- }
- fixedRowsTop = this.wot.getSetting('fixedRowsTop');
- fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
- totalRows = this.wot.getSetting('totalRows');
- if (fixedRowsTop) {
- fixedRowsHeight = this.wot.wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);
- pos += fixedRowsHeight;
- height -= fixedRowsHeight;
- }
- if (fixedRowsBottom && this.wot.wtOverlays.bottomOverlay.clone) {
- fixedRowsHeight = this.wot.wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);
- height -= fixedRowsHeight;
- }
- if (this.wot.wtTable.holder.clientHeight === this.wot.wtTable.holder.offsetHeight) {
- scrollbarHeight = 0;
- } else {
- scrollbarHeight = (0, _element.getScrollbarWidth)();
- }
- return new _viewportRows2.default(height, pos, this.wot.getSetting('totalRows'), function (sourceRow) {
- return _this2.wot.wtTable.getRowHeight(sourceRow);
- }, visible ? null : this.wot.wtSettings.settings.viewportRowCalculatorOverride, visible, scrollbarHeight);
- }
- /**
- * Creates:
- * - columnsRenderCalculator (before draw, to qualify columns for rendering)
- * - columnsVisibleCalculator (after draw, to measure which columns are actually visible)
- *
- * @returns {ViewportRowsCalculator}
- */
- }, {
- key: 'createColumnsCalculator',
- value: function createColumnsCalculator() {
- var _this3 = this;
- var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var width = this.getViewportWidth();
- var pos = void 0;
- var fixedColumnsLeft = void 0;
- this.columnHeaderHeight = NaN;
- pos = this.wot.wtOverlays.leftOverlay.getScrollPosition() - this.wot.wtOverlays.leftOverlay.getTableParentOffset();
- if (pos < 0) {
- pos = 0;
- }
- fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');
- if (fixedColumnsLeft) {
- var fixedColumnsWidth = this.wot.wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);
- pos += fixedColumnsWidth;
- width -= fixedColumnsWidth;
- }
- if (this.wot.wtTable.holder.clientWidth !== this.wot.wtTable.holder.offsetWidth) {
- width -= (0, _element.getScrollbarWidth)();
- }
- return new _viewportColumns2.default(width, pos, this.wot.getSetting('totalColumns'), function (sourceCol) {
- return _this3.wot.wtTable.getColumnWidth(sourceCol);
- }, visible ? null : this.wot.wtSettings.settings.viewportColumnCalculatorOverride, visible, this.wot.getSetting('stretchH'), function (stretchedWidth, column) {
- return _this3.wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);
- });
- }
- /**
- * Creates rowsRenderCalculator and columnsRenderCalculator (before draw, to determine what rows and
- * cols should be rendered)
- *
- * @param fastDraw {Boolean} If `true`, will try to avoid full redraw and only update the border positions.
- * If `false` or `undefined`, will perform a full redraw
- * @returns fastDraw {Boolean} The fastDraw value, possibly modified
- */
- }, {
- key: 'createRenderCalculators',
- value: function createRenderCalculators() {
- var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- if (fastDraw) {
- var proposedRowsVisibleCalculator = this.createRowsCalculator(true);
- var proposedColumnsVisibleCalculator = this.createColumnsCalculator(true);
- if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {
- fastDraw = false;
- }
- }
- if (!fastDraw) {
- this.rowsRenderCalculator = this.createRowsCalculator();
- this.columnsRenderCalculator = this.createColumnsCalculator();
- }
- // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator
- this.rowsVisibleCalculator = null;
- this.columnsVisibleCalculator = null;
- return fastDraw;
- }
- /**
- * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are
- * the actually visible rows and columns)
- */
- }, {
- key: 'createVisibleCalculators',
- value: function createVisibleCalculators() {
- this.rowsVisibleCalculator = this.createRowsCalculator(true);
- this.columnsVisibleCalculator = this.createColumnsCalculator(true);
- }
- /**
- * Returns information whether proposedRowsVisibleCalculator viewport
- * is contained inside rows rendered in previous draw (cached in rowsRenderCalculator)
- *
- * @param {Object} proposedRowsVisibleCalculator
- * @returns {Boolean} Returns `true` if all proposed visible rows are already rendered (meaning: redraw is not needed).
- * Returns `false` if at least one proposed visible row is not already rendered (meaning: redraw is needed)
- */
- }, {
- key: 'areAllProposedVisibleRowsAlreadyRendered',
- value: function areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) {
- if (this.rowsVisibleCalculator) {
- if (proposedRowsVisibleCalculator.startRow < this.rowsRenderCalculator.startRow || proposedRowsVisibleCalculator.startRow === this.rowsRenderCalculator.startRow && proposedRowsVisibleCalculator.startRow > 0) {
- return false;
- } else if (proposedRowsVisibleCalculator.endRow > this.rowsRenderCalculator.endRow || proposedRowsVisibleCalculator.endRow === this.rowsRenderCalculator.endRow && proposedRowsVisibleCalculator.endRow < this.wot.getSetting('totalRows') - 1) {
- return false;
- }
- return true;
- }
- return false;
- }
- /**
- * Returns information whether proposedColumnsVisibleCalculator viewport
- * is contained inside column rendered in previous draw (cached in columnsRenderCalculator)
- *
- * @param {Object} proposedColumnsVisibleCalculator
- * @returns {Boolean} Returns `true` if all proposed visible columns are already rendered (meaning: redraw is not needed).
- * Returns `false` if at least one proposed visible column is not already rendered (meaning: redraw is needed)
- */
- }, {
- key: 'areAllProposedVisibleColumnsAlreadyRendered',
- value: function areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator) {
- if (this.columnsVisibleCalculator) {
- if (proposedColumnsVisibleCalculator.startColumn < this.columnsRenderCalculator.startColumn || proposedColumnsVisibleCalculator.startColumn === this.columnsRenderCalculator.startColumn && proposedColumnsVisibleCalculator.startColumn > 0) {
- return false;
- } else if (proposedColumnsVisibleCalculator.endColumn > this.columnsRenderCalculator.endColumn || proposedColumnsVisibleCalculator.endColumn === this.columnsRenderCalculator.endColumn && proposedColumnsVisibleCalculator.endColumn < this.wot.getSetting('totalColumns') - 1) {
- return false;
- }
- return true;
- }
- return false;
- }
- /**
- * Resets values in keys of the hasOversizedColumnHeadersMarked object after updateSettings.
- */
- }, {
- key: 'resetHasOversizedColumnHeadersMarked',
- value: function resetHasOversizedColumnHeadersMarked() {
- (0, _object.objectEach)(this.hasOversizedColumnHeadersMarked, function (value, key, object) {
- object[key] = void 0;
- });
- }
- }]);
- return Viewport;
- }();
- exports.default = Viewport;
- /***/ }),
- /* 72 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var addToUnscopables = __webpack_require__(17)
- , step = __webpack_require__(89)
- , Iterators = __webpack_require__(27)
- , toIObject = __webpack_require__(9);
- // 22.1.3.4 Array.prototype.entries()
- // 22.1.3.13 Array.prototype.keys()
- // 22.1.3.29 Array.prototype.values()
- // 22.1.3.30 Array.prototype[@@iterator]()
- module.exports = __webpack_require__(88)(Array, 'Array', function(iterated, kind){
- this._t = toIObject(iterated); // target
- this._i = 0; // next index
- this._k = kind; // kind
- // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
- }, function(){
- var O = this._t
- , kind = this._k
- , index = this._i++;
- if(!O || index >= O.length){
- this._t = undefined;
- return step(1);
- }
- if(kind == 'keys' )return step(0, index);
- if(kind == 'values')return step(0, O[index]);
- return step(0, [index, O[index]]);
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
- Iterators.Arguments = Iterators.Array;
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /* 73 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.stopImmediatePropagation = stopImmediatePropagation;
- exports.isImmediatePropagationStopped = isImmediatePropagationStopped;
- exports.stopPropagation = stopPropagation;
- exports.pageX = pageX;
- exports.pageY = pageY;
- exports.isRightClick = isRightClick;
- exports.isLeftClick = isLeftClick;
- var _element = __webpack_require__(2);
- /**
- * Prevent other listeners of the same event from being called.
- *
- * @param {Event} event
- */
- function stopImmediatePropagation(event) {
- event.isImmediatePropagationEnabled = false;
- event.cancelBubble = true;
- }
- /**
- * Check if event was stopped by `stopImmediatePropagation`.
- *
- * @param event {Event}
- * @returns {Boolean}
- */
- function isImmediatePropagationStopped(event) {
- return event.isImmediatePropagationEnabled === false;
- }
- /**
- * Prevent further propagation of the current event (prevent bubbling).
- *
- * @param event {Event}
- */
- function stopPropagation(event) {
- // ie8
- // http://msdn.microsoft.com/en-us/library/ie/ff975462(v=vs.85).aspx
- if (typeof event.stopPropagation === 'function') {
- event.stopPropagation();
- } else {
- event.cancelBubble = true;
- }
- }
- /**
- * Get horizontal coordinate of the event object relative to the whole document.
- *
- * @param {Event} event
- * @returns {Number}
- */
- function pageX(event) {
- if (event.pageX) {
- return event.pageX;
- }
- return event.clientX + (0, _element.getWindowScrollLeft)();
- }
- /**
- * Get vertical coordinate of the event object relative to the whole document.
- *
- * @param {Event} event
- * @returns {Number}
- */
- function pageY(event) {
- if (event.pageY) {
- return event.pageY;
- }
- return event.clientY + (0, _element.getWindowScrollTop)();
- }
- /**
- * Check if provided event was triggered by clicking the right mouse button.
- *
- * @param {Event} event DOM Event.
- * @returns {Boolean}
- */
- function isRightClick(event) {
- return event.button === 2;
- }
- /**
- * Check if provided event was triggered by clicking the left mouse button.
- *
- * @param {Event} event DOM Event.
- * @returns {Boolean}
- */
- function isLeftClick(event) {
- return event.button === 0;
- }
- /***/ }),
- /* 74 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; };
- exports.requestAnimationFrame = requestAnimationFrame;
- exports.cancelAnimationFrame = cancelAnimationFrame;
- exports.isTouchSupported = isTouchSupported;
- exports.isWebComponentSupportedNatively = isWebComponentSupportedNatively;
- exports.hasCaptionProblem = hasCaptionProblem;
- exports.getComparisonFunction = getComparisonFunction;
- // https://gist.github.com/paulirish/1579671
- var lastTime = 0;
- var vendors = ['ms', 'moz', 'webkit', 'o'];
- var _requestAnimationFrame = window.requestAnimationFrame;
- var _cancelAnimationFrame = window.cancelAnimationFrame;
- for (var x = 0; x < vendors.length && !_requestAnimationFrame; ++x) {
- _requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
- _cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
- }
- if (!_requestAnimationFrame) {
- _requestAnimationFrame = function _requestAnimationFrame(callback) {
- var currTime = new Date().getTime();
- var timeToCall = Math.max(0, 16 - (currTime - lastTime));
- var id = window.setTimeout(function () {
- callback(currTime + timeToCall);
- }, timeToCall);
- lastTime = currTime + timeToCall;
- return id;
- };
- }
- if (!_cancelAnimationFrame) {
- _cancelAnimationFrame = function _cancelAnimationFrame(id) {
- clearTimeout(id);
- };
- }
- /**
- * Polyfill for requestAnimationFrame
- *
- * @param {Function} callback
- * @returns {Number}
- */
- function requestAnimationFrame(callback) {
- return _requestAnimationFrame.call(window, callback);
- }
- /**
- * Polyfill for cancelAnimationFrame
- *
- * @param {Number} id
- */
- function cancelAnimationFrame(id) {
- _cancelAnimationFrame.call(window, id);
- }
- function isTouchSupported() {
- return 'ontouchstart' in window;
- }
- /**
- * Checks if browser is support web components natively
- *
- * @returns {Boolean}
- */
- function isWebComponentSupportedNatively() {
- var test = document.createElement('div');
- return !!(test.createShadowRoot && test.createShadowRoot.toString().match(/\[native code\]/));
- }
- var _hasCaptionProblem;
- function detectCaptionProblem() {
- var TABLE = document.createElement('TABLE');
- TABLE.style.borderSpacing = 0;
- TABLE.style.borderWidth = 0;
- TABLE.style.padding = 0;
- var TBODY = document.createElement('TBODY');
- TABLE.appendChild(TBODY);
- TBODY.appendChild(document.createElement('TR'));
- TBODY.firstChild.appendChild(document.createElement('TD'));
- TBODY.firstChild.firstChild.innerHTML = '<tr><td>t<br>t</td></tr>';
- var CAPTION = document.createElement('CAPTION');
- CAPTION.innerHTML = 'c<br>c<br>c<br>c';
- CAPTION.style.padding = 0;
- CAPTION.style.margin = 0;
- TABLE.insertBefore(CAPTION, TBODY);
- document.body.appendChild(TABLE);
- _hasCaptionProblem = TABLE.offsetHeight < 2 * TABLE.lastChild.offsetHeight; // boolean
- document.body.removeChild(TABLE);
- }
- function hasCaptionProblem() {
- if (_hasCaptionProblem === void 0) {
- detectCaptionProblem();
- }
- return _hasCaptionProblem;
- }
- var comparisonFunction = void 0;
- /**
- * Get string comparison function for sorting purposes. It supports multilingual string comparison base on Internationalization API.
- *
- * @param {String} [language]
- * @param {Object} [options]
- * @returns {*}
- */
- function getComparisonFunction(language) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (comparisonFunction) {
- return comparisonFunction;
- }
- if ((typeof Intl === 'undefined' ? 'undefined' : _typeof(Intl)) === 'object') {
- comparisonFunction = new Intl.Collator(language, options).compare;
- } else if (typeof String.prototype.localeCompare === 'function') {
- comparisonFunction = function comparisonFunction(a, b) {
- return ('' + a).localeCompare(b);
- };
- } else {
- comparisonFunction = function comparisonFunction(a, b) {
- if (a === b) {
- return 0;
- }
- return a > b ? -1 : 1;
- };
- }
- return comparisonFunction;
- }
- /***/ }),
- /* 75 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.isFunction = isFunction;
- exports.throttle = throttle;
- exports.throttleAfterHits = throttleAfterHits;
- exports.debounce = debounce;
- exports.pipe = pipe;
- exports.partial = partial;
- exports.curry = curry;
- exports.curryRight = curryRight;
- var _array = __webpack_require__(24);
- /**
- * Checks if given variable is function.
- *
- * @param {*} func Variable to check.
- * @returns {Boolean}
- */
- function isFunction(func) {
- return typeof func === 'function';
- }
- /**
- * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over time (`wait`).
- *
- * @param {Function} func Function to invoke.
- * @param {Number} wait Delay in miliseconds.
- * @returns {Function}
- */
- function throttle(func) {
- var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
- var lastCalled = 0;
- var result = {
- lastCallThrottled: true
- };
- var lastTimer = null;
- function _throttle() {
- var _this = this;
- var args = arguments;
- var stamp = Date.now();
- var needCall = false;
- result.lastCallThrottled = true;
- if (!lastCalled) {
- lastCalled = stamp;
- needCall = true;
- }
- var remaining = wait - (stamp - lastCalled);
- if (needCall) {
- result.lastCallThrottled = false;
- func.apply(this, args);
- } else {
- if (lastTimer) {
- clearTimeout(lastTimer);
- }
- lastTimer = setTimeout(function () {
- result.lastCallThrottled = false;
- func.apply(_this, args);
- lastCalled = 0;
- lastTimer = void 0;
- }, remaining);
- }
- return result;
- }
- return _throttle;
- }
- /**
- * Creates throttle function that enforces a maximum number of times a function (`func`) can be called over
- * time (`wait`) after specified hits.
- *
- * @param {Function} func Function to invoke.
- * @param {Number} wait Delay in miliseconds.
- * @param {Number} hits Number of hits after throttling will be applied.
- * @returns {Function}
- */
- function throttleAfterHits(func) {
- var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
- var hits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
- var funcThrottle = throttle(func, wait);
- var remainHits = hits;
- function _clearHits() {
- remainHits = hits;
- }
- function _throttleAfterHits() {
- if (remainHits) {
- remainHits--;
- return func.apply(this, arguments);
- }
- return funcThrottle.apply(this, arguments);
- }
- _throttleAfterHits.clearHits = _clearHits;
- return _throttleAfterHits;
- }
- /**
- * Creates debounce function that enforces a function (`func`) not be called again until a certain amount of time (`wait`)
- * has passed without it being called.
- *
- * @param {Function} func Function to invoke.
- * @param {Number} wait Delay in milliseconds.
- * @returns {Function}
- */
- function debounce(func) {
- var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
- var lastTimer = null;
- var result = void 0;
- function _debounce() {
- var _this2 = this;
- var args = arguments;
- if (lastTimer) {
- clearTimeout(lastTimer);
- }
- lastTimer = setTimeout(function () {
- result = func.apply(_this2, args);
- }, wait);
- return result;
- }
- return _debounce;
- }
- /**
- * Creates the function that returns the result of calling the given functions. Result of the first function is passed to
- * the second as an argument and so on. Only first function in the chain can handle multiple arguments.
- *
- * @param {Function} functions Functions to compose.
- * @returns {Function}
- */
- function pipe() {
- for (var _len = arguments.length, functions = Array(_len), _key = 0; _key < _len; _key++) {
- functions[_key] = arguments[_key];
- }
- var firstFunc = functions[0],
- restFunc = functions.slice(1);
- return function _pipe() {
- return (0, _array.arrayReduce)(restFunc, function (acc, fn) {
- return fn(acc);
- }, firstFunc.apply(this, arguments));
- };
- }
- /**
- * Creates the function that returns the function with cached arguments.
- *
- * @param {Function} func Function to partialization.
- * @param {Array} params Function arguments to cache.
- * @returns {Function}
- */
- function partial(func) {
- for (var _len2 = arguments.length, params = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- params[_key2 - 1] = arguments[_key2];
- }
- return function _partial() {
- for (var _len3 = arguments.length, restParams = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- restParams[_key3] = arguments[_key3];
- }
- return func.apply(this, params.concat(restParams));
- };
- }
- /**
- * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
- * to the arguments defined in `func` then function will be invoked.
- * Arguments are added to the stack in direction from the left to the right.
- *
- * @example
- * ```
- * var replace = curry(function(find, replace, string) {
- * return string.replace(find, replace);
- * });
- *
- * // returns function with bounded first argument
- * var replace = replace('foo')
- *
- * // returns replaced string - all arguments was passed so function was invoked
- * replace('bar', 'Some test with foo...');
- *
- * ```
- *
- * @param {Function} func Function to currying.
- * @returns {Function}
- */
- function curry(func) {
- var argsLength = func.length;
- function given(argsSoFar) {
- return function _curry() {
- for (var _len4 = arguments.length, params = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- params[_key4] = arguments[_key4];
- }
- var passedArgsSoFar = argsSoFar.concat(params);
- var result = void 0;
- if (passedArgsSoFar.length >= argsLength) {
- result = func.apply(this, passedArgsSoFar);
- } else {
- result = given(passedArgsSoFar);
- }
- return result;
- };
- }
- return given([]);
- }
- /**
- * Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
- * to the arguments defined in `func` then function will be invoked.
- * Arguments are added to the stack in direction from the right to the left.
- *
- * @example
- * ```
- * var replace = curry(function(find, replace, string) {
- * return string.replace(find, replace);
- * });
- *
- * // returns function with bounded first argument
- * var replace = replace('Some test with foo...')
- *
- * // returns replaced string - all arguments was passed so function was invoked
- * replace('bar', 'foo');
- *
- * ```
- *
- * @param {Function} func Function to currying.
- * @returns {Function}
- */
- function curryRight(func) {
- var argsLength = func.length;
- function given(argsSoFar) {
- return function _curry() {
- for (var _len5 = arguments.length, params = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
- params[_key5] = arguments[_key5];
- }
- var passedArgsSoFar = argsSoFar.concat(params.reverse());
- var result = void 0;
- if (passedArgsSoFar.length >= argsLength) {
- result = func.apply(this, passedArgsSoFar);
- } else {
- result = given(passedArgsSoFar);
- }
- return result;
- };
- }
- return given([]);
- }
- /***/ }),
- /* 76 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; };
- exports.isNumeric = isNumeric;
- exports.rangeEach = rangeEach;
- exports.rangeEachReverse = rangeEachReverse;
- exports.valueAccordingPercent = valueAccordingPercent;
- /**
- * Checks if value of n is a numeric one
- * http://jsperf.com/isnan-vs-isnumeric/4
- * @param n
- * @returns {boolean}
- */
- function isNumeric(n) {
- /* eslint-disable */
- var t = typeof n === 'undefined' ? 'undefined' : _typeof(n);
- 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;
- }
- /**
- * A specialized version of `.forEach` defined by ranges.
- *
- * @param {Number} rangeFrom The number from start iterate.
- * @param {Number|Function} rangeTo The number where finish iterate or function as a iteratee.
- * @param {Function} [iteratee] The function invoked per iteration.
- */
- function rangeEach(rangeFrom, rangeTo, iteratee) {
- var index = -1;
- if (typeof rangeTo === 'function') {
- iteratee = rangeTo;
- rangeTo = rangeFrom;
- } else {
- index = rangeFrom - 1;
- }
- while (++index <= rangeTo) {
- if (iteratee(index) === false) {
- break;
- }
- }
- }
- /**
- * A specialized version of `.forEach` defined by ranges iterable in reverse order.
- *
- * @param {Number} rangeFrom The number from start iterate.
- * @param {Number} rangeTo The number where finish iterate.
- * @param {Function} iteratee The function invoked per iteration.
- */
- function rangeEachReverse(rangeFrom, rangeTo, iteratee) {
- var index = rangeFrom + 1;
- if (typeof rangeTo === 'function') {
- iteratee = rangeTo;
- rangeTo = 0;
- }
- while (--index >= rangeTo) {
- if (iteratee(index) === false) {
- break;
- }
- }
- }
- /**
- * Calculate value from percent.
- *
- * @param {Number} value Base value from percent will be calculated.
- * @param {String|Number} percent Can be Number or String (eq. `'33%'`).
- * @returns {Number}
- */
- function valueAccordingPercent(value, percent) {
- percent = parseInt(percent.toString().replace('%', ''), 10);
- percent = parseInt(value * percent / 100, 10);
- return percent;
- }
- /***/ }),
- /* 77 */
- /***/ (function(module, exports, __webpack_require__) {
- // false -> Array#indexOf
- // true -> Array#includes
- var toIObject = __webpack_require__(9)
- , toLength = __webpack_require__(10)
- , toIndex = __webpack_require__(41);
- module.exports = function(IS_INCLUDES){
- return function($this, el, fromIndex){
- var O = toIObject($this)
- , length = toLength(O.length)
- , index = toIndex(fromIndex, length)
- , value;
- // Array#includes uses SameValueZero equality algorithm
- if(IS_INCLUDES && el != el)while(length > index){
- value = O[index++];
- if(value != value)return true;
- // Array#toIndex ignores holes, Array#includes - not
- } else for(;length > index; index++)if(IS_INCLUDES || index in O){
- if(O[index] === el)return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- /***/ }),
- /* 78 */
- /***/ (function(module, exports, __webpack_require__) {
- // getting tag from 19.1.3.6 Object.prototype.toString()
- var cof = __webpack_require__(18)
- , TAG = __webpack_require__(1)('toStringTag')
- // ES3 wrong here
- , ARG = cof(function(){ return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function(it, key){
- try {
- return it[key];
- } catch(e){ /* empty */ }
- };
- module.exports = function(it){
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
- // builtinTag case
- : ARG ? cof(O)
- // ES3 arguments fallback
- : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
- };
- /***/ }),
- /* 79 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var dP = __webpack_require__(6).f
- , create = __webpack_require__(51)
- , redefineAll = __webpack_require__(40)
- , ctx = __webpack_require__(12)
- , anInstance = __webpack_require__(33)
- , defined = __webpack_require__(13)
- , forOf = __webpack_require__(37)
- , $iterDefine = __webpack_require__(88)
- , step = __webpack_require__(89)
- , setSpecies = __webpack_require__(94)
- , DESCRIPTORS = __webpack_require__(7)
- , fastKey = __webpack_require__(28).fastKey
- , SIZE = DESCRIPTORS ? '_s' : 'size';
- var getEntry = function(that, key){
- // fast case
- var index = fastKey(key), entry;
- if(index !== 'F')return that._i[index];
- // frozen object case
- for(entry = that._f; entry; entry = entry.n){
- if(entry.k == key)return entry;
- }
- };
- module.exports = {
- getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
- var C = wrapper(function(that, iterable){
- anInstance(that, C, NAME, '_i');
- that._i = create(null); // index
- that._f = undefined; // first entry
- that._l = undefined; // last entry
- that[SIZE] = 0; // size
- if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
- });
- redefineAll(C.prototype, {
- // 23.1.3.1 Map.prototype.clear()
- // 23.2.3.2 Set.prototype.clear()
- clear: function clear(){
- for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
- entry.r = true;
- if(entry.p)entry.p = entry.p.n = undefined;
- delete data[entry.i];
- }
- that._f = that._l = undefined;
- that[SIZE] = 0;
- },
- // 23.1.3.3 Map.prototype.delete(key)
- // 23.2.3.4 Set.prototype.delete(value)
- 'delete': function(key){
- var that = this
- , entry = getEntry(that, key);
- if(entry){
- var next = entry.n
- , prev = entry.p;
- delete that._i[entry.i];
- entry.r = true;
- if(prev)prev.n = next;
- if(next)next.p = prev;
- if(that._f == entry)that._f = next;
- if(that._l == entry)that._l = prev;
- that[SIZE]--;
- } return !!entry;
- },
- // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
- // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
- forEach: function forEach(callbackfn /*, that = undefined */){
- anInstance(this, C, 'forEach');
- var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)
- , entry;
- while(entry = entry ? entry.n : this._f){
- f(entry.v, entry.k, this);
- // revert to the last existing entry
- while(entry && entry.r)entry = entry.p;
- }
- },
- // 23.1.3.7 Map.prototype.has(key)
- // 23.2.3.7 Set.prototype.has(value)
- has: function has(key){
- return !!getEntry(this, key);
- }
- });
- if(DESCRIPTORS)dP(C.prototype, 'size', {
- get: function(){
- return defined(this[SIZE]);
- }
- });
- return C;
- },
- def: function(that, key, value){
- var entry = getEntry(that, key)
- , prev, index;
- // change existing entry
- if(entry){
- entry.v = value;
- // create new entry
- } else {
- that._l = entry = {
- i: index = fastKey(key, true), // <- index
- k: key, // <- key
- v: value, // <- value
- p: prev = that._l, // <- previous entry
- n: undefined, // <- next entry
- r: false // <- removed
- };
- if(!that._f)that._f = entry;
- if(prev)prev.n = entry;
- that[SIZE]++;
- // add to index
- if(index !== 'F')that._i[index] = entry;
- } return that;
- },
- getEntry: getEntry,
- setStrong: function(C, NAME, IS_MAP){
- // add .keys, .values, .entries, [@@iterator]
- // 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
- $iterDefine(C, NAME, function(iterated, kind){
- this._t = iterated; // target
- this._k = kind; // kind
- this._l = undefined; // previous
- }, function(){
- var that = this
- , kind = that._k
- , entry = that._l;
- // revert to the last existing entry
- while(entry && entry.r)entry = entry.p;
- // get next entry
- if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
- // or finish the iteration
- that._t = undefined;
- return step(1);
- }
- // return step by kind
- if(kind == 'keys' )return step(0, entry.k);
- if(kind == 'values')return step(0, entry.v);
- return step(0, [entry.k, entry.v]);
- }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
- // add [@@species], 23.1.2.2, 23.2.2.2
- setSpecies(NAME);
- }
- };
- /***/ }),
- /* 80 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var redefineAll = __webpack_require__(40)
- , getWeak = __webpack_require__(28).getWeak
- , anObject = __webpack_require__(5)
- , isObject = __webpack_require__(4)
- , anInstance = __webpack_require__(33)
- , forOf = __webpack_require__(37)
- , createArrayMethod = __webpack_require__(34)
- , $has = __webpack_require__(8)
- , arrayFind = createArrayMethod(5)
- , arrayFindIndex = createArrayMethod(6)
- , id = 0;
- // fallback for uncaught frozen keys
- var uncaughtFrozenStore = function(that){
- return that._l || (that._l = new UncaughtFrozenStore);
- };
- var UncaughtFrozenStore = function(){
- this.a = [];
- };
- var findUncaughtFrozen = function(store, key){
- return arrayFind(store.a, function(it){
- return it[0] === key;
- });
- };
- UncaughtFrozenStore.prototype = {
- get: function(key){
- var entry = findUncaughtFrozen(this, key);
- if(entry)return entry[1];
- },
- has: function(key){
- return !!findUncaughtFrozen(this, key);
- },
- set: function(key, value){
- var entry = findUncaughtFrozen(this, key);
- if(entry)entry[1] = value;
- else this.a.push([key, value]);
- },
- 'delete': function(key){
- var index = arrayFindIndex(this.a, function(it){
- return it[0] === key;
- });
- if(~index)this.a.splice(index, 1);
- return !!~index;
- }
- };
- module.exports = {
- getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
- var C = wrapper(function(that, iterable){
- anInstance(that, C, NAME, '_i');
- that._i = id++; // collection id
- that._l = undefined; // leak store for uncaught frozen objects
- if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
- });
- redefineAll(C.prototype, {
- // 23.3.3.2 WeakMap.prototype.delete(key)
- // 23.4.3.3 WeakSet.prototype.delete(value)
- 'delete': function(key){
- if(!isObject(key))return false;
- var data = getWeak(key);
- if(data === true)return uncaughtFrozenStore(this)['delete'](key);
- return data && $has(data, this._i) && delete data[this._i];
- },
- // 23.3.3.4 WeakMap.prototype.has(key)
- // 23.4.3.4 WeakSet.prototype.has(value)
- has: function has(key){
- if(!isObject(key))return false;
- var data = getWeak(key);
- if(data === true)return uncaughtFrozenStore(this).has(key);
- return data && $has(data, this._i);
- }
- });
- return C;
- },
- def: function(that, key, value){
- var data = getWeak(anObject(key), true);
- if(data === true)uncaughtFrozenStore(that).set(key, value);
- else data[that._i] = value;
- return that;
- },
- ufstore: uncaughtFrozenStore
- };
- /***/ }),
- /* 81 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(3).document && document.documentElement;
- /***/ }),
- /* 82 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = !__webpack_require__(7) && !__webpack_require__(14)(function(){
- return Object.defineProperty(__webpack_require__(46)('div'), 'a', {get: function(){ return 7; }}).a != 7;
- });
- /***/ }),
- /* 83 */
- /***/ (function(module, exports, __webpack_require__) {
- // check on default Array iterator
- var Iterators = __webpack_require__(27)
- , ITERATOR = __webpack_require__(1)('iterator')
- , ArrayProto = Array.prototype;
- module.exports = function(it){
- return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
- };
- /***/ }),
- /* 84 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.2.2 IsArray(argument)
- var cof = __webpack_require__(18);
- module.exports = Array.isArray || function isArray(arg){
- return cof(arg) == 'Array';
- };
- /***/ }),
- /* 85 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.3 Number.isInteger(number)
- var isObject = __webpack_require__(4)
- , floor = Math.floor;
- module.exports = function isInteger(it){
- return !isObject(it) && isFinite(it) && floor(it) === it;
- };
- /***/ }),
- /* 86 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.2.8 IsRegExp(argument)
- var isObject = __webpack_require__(4)
- , cof = __webpack_require__(18)
- , MATCH = __webpack_require__(1)('match');
- module.exports = function(it){
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
- };
- /***/ }),
- /* 87 */
- /***/ (function(module, exports, __webpack_require__) {
- // call something on iterator step with safe closing on error
- var anObject = __webpack_require__(5);
- module.exports = function(iterator, fn, value, entries){
- try {
- return entries ? fn(anObject(value)[0], value[1]) : fn(value);
- // 7.4.6 IteratorClose(iterator, completion)
- } catch(e){
- var ret = iterator['return'];
- if(ret !== undefined)anObject(ret.call(iterator));
- throw e;
- }
- };
- /***/ }),
- /* 88 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var LIBRARY = __webpack_require__(38)
- , $export = __webpack_require__(0)
- , redefine = __webpack_require__(16)
- , hide = __webpack_require__(15)
- , has = __webpack_require__(8)
- , Iterators = __webpack_require__(27)
- , $iterCreate = __webpack_require__(159)
- , setToStringTag = __webpack_require__(30)
- , getPrototypeOf = __webpack_require__(164)
- , ITERATOR = __webpack_require__(1)('iterator')
- , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
- , FF_ITERATOR = '@@iterator'
- , KEYS = 'keys'
- , VALUES = 'values';
- var returnThis = function(){ return this; };
- module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
- $iterCreate(Constructor, NAME, next);
- var getMethod = function(kind){
- if(!BUGGY && kind in proto)return proto[kind];
- switch(kind){
- case KEYS: return function keys(){ return new Constructor(this, kind); };
- case VALUES: return function values(){ return new Constructor(this, kind); };
- } return function entries(){ return new Constructor(this, kind); };
- };
- var TAG = NAME + ' Iterator'
- , DEF_VALUES = DEFAULT == VALUES
- , VALUES_BUG = false
- , proto = Base.prototype
- , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
- , $default = $native || getMethod(DEFAULT)
- , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
- , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
- , methods, key, IteratorPrototype;
- // Fix native
- if($anyNative){
- IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
- if(IteratorPrototype !== Object.prototype){
- // Set @@toStringTag to native iterators
- setToStringTag(IteratorPrototype, TAG, true);
- // fix for some old engines
- if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if(DEF_VALUES && $native && $native.name !== VALUES){
- VALUES_BUG = true;
- $default = function values(){ return $native.call(this); };
- }
- // Define iterator
- if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
- hide(proto, ITERATOR, $default);
- }
- // Plug for library
- Iterators[NAME] = $default;
- Iterators[TAG] = returnThis;
- if(DEFAULT){
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if(FORCED)for(key in methods){
- if(!(key in proto))redefine(proto, key, methods[key]);
- } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
- };
- /***/ }),
- /* 89 */
- /***/ (function(module, exports) {
- module.exports = function(done, value){
- return {value: value, done: !!done};
- };
- /***/ }),
- /* 90 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 19.1.2.1 Object.assign(target, source, ...)
- var getKeys = __webpack_require__(19)
- , gOPS = __webpack_require__(39)
- , pIE = __webpack_require__(29)
- , toObject = __webpack_require__(21)
- , IObject = __webpack_require__(49)
- , $assign = Object.assign;
- // should work with symbols and should have deterministic property order (V8 bug)
- module.exports = !$assign || __webpack_require__(14)(function(){
- var A = {}
- , B = {}
- , S = Symbol()
- , K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function(k){ B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
- var T = toObject(target)
- , aLen = arguments.length
- , index = 1
- , getSymbols = gOPS.f
- , isEnum = pIE.f;
- while(aLen > index){
- var S = IObject(arguments[index++])
- , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
- , length = keys.length
- , j = 0
- , key;
- while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
- } return T;
- } : $assign;
- /***/ }),
- /* 91 */
- /***/ (function(module, exports, __webpack_require__) {
- var has = __webpack_require__(8)
- , toIObject = __webpack_require__(9)
- , arrayIndexOf = __webpack_require__(77)(false)
- , IE_PROTO = __webpack_require__(54)('IE_PROTO');
- module.exports = function(object, names){
- var O = toIObject(object)
- , i = 0
- , result = []
- , key;
- for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while(names.length > i)if(has(O, key = names[i++])){
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /* 92 */
- /***/ (function(module, exports, __webpack_require__) {
- var getKeys = __webpack_require__(19)
- , toIObject = __webpack_require__(9)
- , isEnum = __webpack_require__(29).f;
- module.exports = function(isEntries){
- return function(it){
- var O = toIObject(it)
- , keys = getKeys(O)
- , length = keys.length
- , i = 0
- , result = []
- , key;
- while(length > i)if(isEnum.call(O, key = keys[i++])){
- result.push(isEntries ? [key, O[key]] : O[key]);
- } return result;
- };
- };
- /***/ }),
- /* 93 */
- /***/ (function(module, exports, __webpack_require__) {
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- /* eslint-disable no-proto */
- var isObject = __webpack_require__(4)
- , anObject = __webpack_require__(5);
- var check = function(O, proto){
- anObject(O);
- if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
- };
- module.exports = {
- set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
- function(test, buggy, set){
- try {
- set = __webpack_require__(12)(Function.call, __webpack_require__(52).f(Object.prototype, '__proto__').set, 2);
- set(test, []);
- buggy = !(test instanceof Array);
- } catch(e){ buggy = true; }
- return function setPrototypeOf(O, proto){
- check(O, proto);
- if(buggy)O.__proto__ = proto;
- else set(O, proto);
- return O;
- };
- }({}, false) : undefined),
- check: check
- };
- /***/ }),
- /* 94 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(3)
- , dP = __webpack_require__(6)
- , DESCRIPTORS = __webpack_require__(7)
- , SPECIES = __webpack_require__(1)('species');
- module.exports = function(KEY){
- var C = global[KEY];
- if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
- configurable: true,
- get: function(){ return this; }
- });
- };
- /***/ }),
- /* 95 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/tc39/proposal-string-pad-start-end
- var toLength = __webpack_require__(10)
- , repeat = __webpack_require__(96)
- , defined = __webpack_require__(13);
- module.exports = function(that, maxLength, fillString, left){
- var S = String(defined(that))
- , stringLength = S.length
- , fillStr = fillString === undefined ? ' ' : String(fillString)
- , intMaxLength = toLength(maxLength);
- if(intMaxLength <= stringLength || fillStr == '')return S;
- var fillLen = intMaxLength - stringLength
- , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
- if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);
- return left ? stringFiller + S : S + stringFiller;
- };
- /***/ }),
- /* 96 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toInteger = __webpack_require__(42)
- , defined = __webpack_require__(13);
- module.exports = function repeat(count){
- var str = String(defined(this))
- , res = ''
- , n = toInteger(count);
- if(n < 0 || n == Infinity)throw RangeError("Count can't be negative");
- for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str;
- return res;
- };
- /***/ }),
- /* 97 */
- /***/ (function(module, exports, __webpack_require__) {
- exports.f = __webpack_require__(1);
- /***/ }),
- /* 98 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(78)
- , ITERATOR = __webpack_require__(1)('iterator')
- , Iterators = __webpack_require__(27);
- module.exports = __webpack_require__(26).getIteratorMethod = function(it){
- if(it != undefined)return it[ITERATOR]
- || it['@@iterator']
- || Iterators[classof(it)];
- };
- /***/ }),
- /* 99 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _element = __webpack_require__(2);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- /**
- * A overlay that renders ALL available rows & columns positioned on top of the original Walkontable instance and all other overlays.
- * Used for debugging purposes to see if the other overlays (that render only part of the rows & columns) are positioned correctly
- *
- * @class DebugOverlay
- */
- var DebugOverlay = function (_Overlay) {
- _inherits(DebugOverlay, _Overlay);
- /**
- * @param {Walkontable} wotInstance
- */
- function DebugOverlay(wotInstance) {
- _classCallCheck(this, DebugOverlay);
- var _this = _possibleConstructorReturn(this, (DebugOverlay.__proto__ || Object.getPrototypeOf(DebugOverlay)).call(this, wotInstance));
- _this.clone = _this.makeClone(_base2.default.CLONE_DEBUG);
- _this.clone.wtTable.holder.style.opacity = 0.4;
- _this.clone.wtTable.holder.style.textShadow = '0 0 2px #ff0000';
- (0, _element.addClass)(_this.clone.wtTable.holder.parentNode, 'wtDebugVisible');
- return _this;
- }
- return DebugOverlay;
- }(_base2.default);
- _base2.default.registerOverlay(_base2.default.CLONE_DEBUG, DebugOverlay);
- exports.default = DebugOverlay;
- /***/ }),
- /* 100 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- /**
- * @class LeftOverlay
- */
- var LeftOverlay = function (_Overlay) {
- _inherits(LeftOverlay, _Overlay);
- /**
- * @param {Walkontable} wotInstance
- */
- function LeftOverlay(wotInstance) {
- _classCallCheck(this, LeftOverlay);
- var _this = _possibleConstructorReturn(this, (LeftOverlay.__proto__ || Object.getPrototypeOf(LeftOverlay)).call(this, wotInstance));
- _this.clone = _this.makeClone(_base2.default.CLONE_LEFT);
- return _this;
- }
- /**
- * Checks if overlay should be fully rendered
- *
- * @returns {Boolean}
- */
- _createClass(LeftOverlay, [{
- key: 'shouldBeRendered',
- value: function shouldBeRendered() {
- return !!(this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length);
- }
- /**
- * Updates the left overlay position
- */
- }, {
- key: 'resetFixedPosition',
- value: function resetFixedPosition() {
- if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
- // removed from DOM
- return;
- }
- var overlayRoot = this.clone.wtTable.holder.parentNode;
- var headerPosition = 0;
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'horizontal')) {
- var box = this.wot.wtTable.hider.getBoundingClientRect();
- var left = Math.ceil(box.left);
- var right = Math.ceil(box.right);
- var finalLeft = void 0;
- var finalTop = void 0;
- finalTop = this.wot.wtTable.hider.style.top;
- finalTop = finalTop === '' ? 0 : finalTop;
- if (left < 0 && right - overlayRoot.offsetWidth > 0) {
- finalLeft = -left;
- } else {
- finalLeft = 0;
- }
- headerPosition = finalLeft;
- finalLeft += 'px';
- (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);
- } else {
- headerPosition = this.getScrollPosition();
- (0, _element.resetCssTransform)(overlayRoot);
- }
- this.adjustHeaderBordersPosition(headerPosition);
- this.adjustElementsSize();
- }
- /**
- * Sets the main overlay's horizontal scroll position
- *
- * @param {Number} pos
- */
- }, {
- key: 'setScrollPosition',
- value: function setScrollPosition(pos) {
- if (this.mainTableScrollableElement === window) {
- window.scrollTo(pos, (0, _element.getWindowScrollTop)());
- } else {
- this.mainTableScrollableElement.scrollLeft = pos;
- }
- }
- /**
- * Triggers onScroll hook callback
- */
- }, {
- key: 'onScroll',
- value: function onScroll() {
- this.wot.getSetting('onScrollVertically');
- }
- /**
- * Calculates total sum cells width
- *
- * @param {Number} from Column index which calculates started from
- * @param {Number} to Column index where calculation is finished
- * @returns {Number} Width sum
- */
- }, {
- key: 'sumCellSizes',
- value: function sumCellSizes(from, to) {
- var sum = 0;
- var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;
- while (from < to) {
- sum += this.wot.wtTable.getStretchedColumnWidth(from) || defaultColumnWidth;
- from++;
- }
- return sum;
- }
- /**
- * Adjust overlay root element, childs and master table element sizes (width, height).
- *
- * @param {Boolean} [force=false]
- */
- }, {
- key: 'adjustElementsSize',
- value: function adjustElementsSize() {
- var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- this.updateTrimmingContainer();
- if (this.needFullRender || force) {
- this.adjustRootElementSize();
- this.adjustRootChildrenSize();
- if (!force) {
- this.areElementSizesAdjusted = true;
- }
- }
- }
- /**
- * Adjust overlay root element size (width and height).
- */
- }, {
- key: 'adjustRootElementSize',
- value: function adjustRootElementSize() {
- var masterHolder = this.wot.wtTable.holder;
- var scrollbarHeight = masterHolder.clientHeight === masterHolder.offsetHeight ? 0 : (0, _element.getScrollbarWidth)();
- var overlayRoot = this.clone.wtTable.holder.parentNode;
- var overlayRootStyle = overlayRoot.style;
- var preventOverflow = this.wot.getSetting('preventOverflow');
- var tableWidth = void 0;
- if (this.trimmingContainer !== window || preventOverflow === 'vertical') {
- var height = this.wot.wtViewport.getWorkspaceHeight() - scrollbarHeight;
- height = Math.min(height, (0, _element.innerHeight)(this.wot.wtTable.wtRootElement));
- overlayRootStyle.height = height + 'px';
- } else {
- overlayRootStyle.height = '';
- }
- this.clone.wtTable.holder.style.height = overlayRootStyle.height;
- tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);
- overlayRootStyle.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';
- }
- /**
- * Adjust overlay root childs size
- */
- }, {
- key: 'adjustRootChildrenSize',
- value: function adjustRootChildrenSize() {
- var scrollbarWidth = (0, _element.getScrollbarWidth)();
- this.clone.wtTable.hider.style.height = this.hider.style.height;
- this.clone.wtTable.holder.style.height = this.clone.wtTable.holder.parentNode.style.height;
- if (scrollbarWidth === 0) {
- scrollbarWidth = 30;
- }
- this.clone.wtTable.holder.style.width = parseInt(this.clone.wtTable.holder.parentNode.style.width, 10) + scrollbarWidth + 'px';
- }
- /**
- * Adjust the overlay dimensions and position
- */
- }, {
- key: 'applyToDOM',
- value: function applyToDOM() {
- var total = this.wot.getSetting('totalColumns');
- if (!this.areElementSizesAdjusted) {
- this.adjustElementsSize();
- }
- if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
- this.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';
- } else if (total === 0) {
- this.spreader.style.left = '0';
- } else {
- throw new Error('Incorrect value of the columnsRenderCalculator');
- }
- this.spreader.style.right = '';
- if (this.needFullRender) {
- this.syncOverlayOffset();
- }
- }
- /**
- * Synchronize calculated top position to an element
- */
- }, {
- key: 'syncOverlayOffset',
- value: function syncOverlayOffset() {
- if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
- this.clone.wtTable.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';
- } else {
- this.clone.wtTable.spreader.style.top = '';
- }
- }
- /**
- * Scrolls horizontally to a column at the left edge of the viewport
- *
- * @param sourceCol {Number} Column index which you want to scroll to
- * @param [beyondRendered=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)
- */
- }, {
- key: 'scrollTo',
- value: function scrollTo(sourceCol, beyondRendered) {
- var newX = this.getTableParentOffset();
- var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
- var mainHolder = sourceInstance.wtTable.holder;
- var scrollbarCompensation = 0;
- if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {
- scrollbarCompensation = (0, _element.getScrollbarWidth)();
- }
- if (beyondRendered) {
- newX += this.sumCellSizes(0, sourceCol + 1);
- newX -= this.wot.wtViewport.getViewportWidth();
- } else {
- newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);
- }
- newX += scrollbarCompensation;
- this.setScrollPosition(newX);
- }
- /**
- * Gets table parent left position
- *
- * @returns {Number}
- */
- }, {
- key: 'getTableParentOffset',
- value: function getTableParentOffset() {
- var preventOverflow = this.wot.getSetting('preventOverflow');
- var offset = 0;
- if (!preventOverflow && this.trimmingContainer === window) {
- offset = this.wot.wtTable.holderOffset.left;
- }
- return offset;
- }
- /**
- * Gets the main overlay's horizontal scroll position
- *
- * @returns {Number} Main table's vertical scroll position
- */
- }, {
- key: 'getScrollPosition',
- value: function getScrollPosition() {
- return (0, _element.getScrollLeft)(this.mainTableScrollableElement);
- }
- /**
- * Adds css classes to hide the header border's header (cell-selection border hiding issue)
- *
- * @param {Number} position Header X position if trimming container is window or scroll top if not
- */
- }, {
- key: 'adjustHeaderBordersPosition',
- value: function adjustHeaderBordersPosition(position) {
- var masterParent = this.wot.wtTable.holder.parentNode;
- var rowHeaders = this.wot.getSetting('rowHeaders');
- var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');
- var totalRows = this.wot.getSetting('totalRows');
- if (totalRows) {
- (0, _element.removeClass)(masterParent, 'emptyRows');
- } else {
- (0, _element.addClass)(masterParent, 'emptyRows');
- }
- if (fixedColumnsLeft && !rowHeaders.length) {
- (0, _element.addClass)(masterParent, 'innerBorderLeft');
- } else if (!fixedColumnsLeft && rowHeaders.length) {
- var previousState = (0, _element.hasClass)(masterParent, 'innerBorderLeft');
- if (position) {
- (0, _element.addClass)(masterParent, 'innerBorderLeft');
- } else {
- (0, _element.removeClass)(masterParent, 'innerBorderLeft');
- }
- if (!previousState && position || previousState && !position) {
- this.wot.wtOverlays.adjustElementsSize();
- }
- }
- }
- }]);
- return LeftOverlay;
- }(_base2.default);
- _base2.default.registerOverlay(_base2.default.CLONE_LEFT, LeftOverlay);
- exports.default = LeftOverlay;
- /***/ }),
- /* 101 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- /**
- * @class TopOverlay
- */
- var TopOverlay = function (_Overlay) {
- _inherits(TopOverlay, _Overlay);
- /**
- * @param {Walkontable} wotInstance
- */
- function TopOverlay(wotInstance) {
- _classCallCheck(this, TopOverlay);
- var _this = _possibleConstructorReturn(this, (TopOverlay.__proto__ || Object.getPrototypeOf(TopOverlay)).call(this, wotInstance));
- _this.clone = _this.makeClone(_base2.default.CLONE_TOP);
- return _this;
- }
- /**
- * Checks if overlay should be fully rendered
- *
- * @returns {Boolean}
- */
- _createClass(TopOverlay, [{
- key: 'shouldBeRendered',
- value: function shouldBeRendered() {
- return !!(this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length);
- }
- /**
- * Updates the top overlay position
- */
- }, {
- key: 'resetFixedPosition',
- value: function resetFixedPosition() {
- if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
- // removed from DOM
- return;
- }
- var overlayRoot = this.clone.wtTable.holder.parentNode;
- var headerPosition = 0;
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (this.trimmingContainer === window && (!preventOverflow || preventOverflow !== 'vertical')) {
- var box = this.wot.wtTable.hider.getBoundingClientRect();
- var top = Math.ceil(box.top);
- var bottom = Math.ceil(box.bottom);
- var finalLeft = void 0;
- var finalTop = void 0;
- finalLeft = this.wot.wtTable.hider.style.left;
- finalLeft = finalLeft === '' ? 0 : finalLeft;
- if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {
- finalTop = -top;
- } else {
- finalTop = 0;
- }
- headerPosition = finalTop;
- finalTop += 'px';
- (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);
- } else {
- headerPosition = this.getScrollPosition();
- (0, _element.resetCssTransform)(overlayRoot);
- }
- this.adjustHeaderBordersPosition(headerPosition);
- this.adjustElementsSize();
- }
- /**
- * Sets the main overlay's vertical scroll position
- *
- * @param {Number} pos
- */
- }, {
- key: 'setScrollPosition',
- value: function setScrollPosition(pos) {
- if (this.mainTableScrollableElement === window) {
- window.scrollTo((0, _element.getWindowScrollLeft)(), pos);
- } else {
- this.mainTableScrollableElement.scrollTop = pos;
- }
- }
- /**
- * Triggers onScroll hook callback
- */
- }, {
- key: 'onScroll',
- value: function onScroll() {
- this.wot.getSetting('onScrollHorizontally');
- }
- /**
- * Calculates total sum cells height
- *
- * @param {Number} from Row index which calculates started from
- * @param {Number} to Row index where calculation is finished
- * @returns {Number} Height sum
- */
- }, {
- key: 'sumCellSizes',
- value: function sumCellSizes(from, to) {
- var sum = 0;
- var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;
- while (from < to) {
- var height = this.wot.wtTable.getRowHeight(from);
- sum += height === void 0 ? defaultRowHeight : height;
- from++;
- }
- return sum;
- }
- /**
- * Adjust overlay root element, childs and master table element sizes (width, height).
- *
- * @param {Boolean} [force=false]
- */
- }, {
- key: 'adjustElementsSize',
- value: function adjustElementsSize() {
- var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- this.updateTrimmingContainer();
- if (this.needFullRender || force) {
- this.adjustRootElementSize();
- this.adjustRootChildrenSize();
- if (!force) {
- this.areElementSizesAdjusted = true;
- }
- }
- }
- /**
- * Adjust overlay root element size (width and height).
- */
- }, {
- key: 'adjustRootElementSize',
- value: function adjustRootElementSize() {
- var masterHolder = this.wot.wtTable.holder;
- var scrollbarWidth = masterHolder.clientWidth === masterHolder.offsetWidth ? 0 : (0, _element.getScrollbarWidth)();
- var overlayRoot = this.clone.wtTable.holder.parentNode;
- var overlayRootStyle = overlayRoot.style;
- var preventOverflow = this.wot.getSetting('preventOverflow');
- var tableHeight = void 0;
- if (this.trimmingContainer !== window || preventOverflow === 'horizontal') {
- var width = this.wot.wtViewport.getWorkspaceWidth() - scrollbarWidth;
- width = Math.min(width, (0, _element.innerWidth)(this.wot.wtTable.wtRootElement));
- overlayRootStyle.width = width + 'px';
- } else {
- overlayRootStyle.width = '';
- }
- this.clone.wtTable.holder.style.width = overlayRootStyle.width;
- tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);
- overlayRootStyle.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';
- }
- /**
- * Adjust overlay root childs size
- */
- }, {
- key: 'adjustRootChildrenSize',
- value: function adjustRootChildrenSize() {
- var scrollbarWidth = (0, _element.getScrollbarWidth)();
- this.clone.wtTable.hider.style.width = this.hider.style.width;
- this.clone.wtTable.holder.style.width = this.clone.wtTable.holder.parentNode.style.width;
- if (scrollbarWidth === 0) {
- scrollbarWidth = 30;
- }
- this.clone.wtTable.holder.style.height = parseInt(this.clone.wtTable.holder.parentNode.style.height, 10) + scrollbarWidth + 'px';
- }
- /**
- * Adjust the overlay dimensions and position
- */
- }, {
- key: 'applyToDOM',
- value: function applyToDOM() {
- var total = this.wot.getSetting('totalRows');
- if (!this.areElementSizesAdjusted) {
- this.adjustElementsSize();
- }
- if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
- this.spreader.style.top = this.wot.wtViewport.rowsRenderCalculator.startPosition + 'px';
- } else if (total === 0) {
- // can happen if there are 0 rows
- this.spreader.style.top = '0';
- } else {
- throw new Error('Incorrect value of the rowsRenderCalculator');
- }
- this.spreader.style.bottom = '';
- if (this.needFullRender) {
- this.syncOverlayOffset();
- }
- }
- /**
- * Synchronize calculated left position to an element
- */
- }, {
- key: 'syncOverlayOffset',
- value: function syncOverlayOffset() {
- if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
- this.clone.wtTable.spreader.style.left = this.wot.wtViewport.columnsRenderCalculator.startPosition + 'px';
- } else {
- this.clone.wtTable.spreader.style.left = '';
- }
- }
- /**
- * Scrolls vertically to a row
- *
- * @param sourceRow {Number} Row index which you want to scroll to
- * @param [bottomEdge=false] {Boolean} if `true`, scrolls according to the bottom edge (top edge is by default)
- */
- }, {
- key: 'scrollTo',
- value: function scrollTo(sourceRow, bottomEdge) {
- var newY = this.getTableParentOffset();
- var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;
- var mainHolder = sourceInstance.wtTable.holder;
- var scrollbarCompensation = 0;
- if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {
- scrollbarCompensation = (0, _element.getScrollbarWidth)();
- }
- if (bottomEdge) {
- var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');
- var fixedRowsTop = this.wot.getSetting('fixedRowsTop');
- var totalRows = this.wot.getSetting('totalRows');
- newY += this.sumCellSizes(0, sourceRow + 1);
- newY -= this.wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows);
- // Fix 1 pixel offset when cell is selected
- newY += 1;
- } else {
- newY += this.sumCellSizes(this.wot.getSetting('fixedRowsTop'), sourceRow);
- }
- newY += scrollbarCompensation;
- this.setScrollPosition(newY);
- }
- /**
- * Gets table parent top position
- *
- * @returns {Number}
- */
- }, {
- key: 'getTableParentOffset',
- value: function getTableParentOffset() {
- if (this.mainTableScrollableElement === window) {
- return this.wot.wtTable.holderOffset.top;
- }
- return 0;
- }
- /**
- * Gets the main overlay's vertical scroll position
- *
- * @returns {Number} Main table's vertical scroll position
- */
- }, {
- key: 'getScrollPosition',
- value: function getScrollPosition() {
- return (0, _element.getScrollTop)(this.mainTableScrollableElement);
- }
- /**
- * Redraw borders of selection
- *
- * @param {WalkontableSelection} selection Selection for redraw
- */
- }, {
- key: 'redrawSelectionBorders',
- value: function redrawSelectionBorders(selection) {
- if (selection && selection.cellRange) {
- var border = selection.getBorder(this.wot);
- if (border) {
- var corners = selection.getCorners();
- border.disappear();
- border.appear(corners);
- }
- }
- }
- /**
- * Redrawing borders of all selections
- */
- }, {
- key: 'redrawAllSelectionsBorders',
- value: function redrawAllSelectionsBorders() {
- var selections = this.wot.selections;
- this.redrawSelectionBorders(selections.current);
- this.redrawSelectionBorders(selections.area);
- this.redrawSelectionBorders(selections.fill);
- this.wot.wtTable.wot.wtOverlays.leftOverlay.refresh();
- }
- /**
- * Adds css classes to hide the header border's header (cell-selection border hiding issue)
- *
- * @param {Number} position Header Y position if trimming container is window or scroll top if not
- */
- }, {
- key: 'adjustHeaderBordersPosition',
- value: function adjustHeaderBordersPosition(position) {
- var masterParent = this.wot.wtTable.holder.parentNode;
- var totalColumns = this.wot.getSetting('totalColumns');
- if (totalColumns) {
- (0, _element.removeClass)(masterParent, 'emptyColumns');
- } else {
- (0, _element.addClass)(masterParent, 'emptyColumns');
- }
- if (this.wot.getSetting('fixedRowsTop') === 0 && this.wot.getSetting('columnHeaders').length > 0) {
- var previousState = (0, _element.hasClass)(masterParent, 'innerBorderTop');
- if (position || this.wot.getSetting('totalRows') === 0) {
- (0, _element.addClass)(masterParent, 'innerBorderTop');
- } else {
- (0, _element.removeClass)(masterParent, 'innerBorderTop');
- }
- if (!previousState && position || previousState && !position) {
- this.wot.wtOverlays.adjustElementsSize();
- // cell borders should be positioned once again,
- // because we added / removed 1px border from table header
- this.redrawAllSelectionsBorders();
- }
- }
- // nasty workaround for double border in the header, TODO: find a pure-css solution
- if (this.wot.getSetting('rowHeaders').length === 0) {
- var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');
- if (secondHeaderCell) {
- for (var i = 0; i < secondHeaderCell.length; i++) {
- secondHeaderCell[i].style['border-left-width'] = 0;
- }
- }
- }
- }
- }]);
- return TopOverlay;
- }(_base2.default);
- _base2.default.registerOverlay(_base2.default.CLONE_TOP, TopOverlay);
- exports.default = TopOverlay;
- /***/ }),
- /* 102 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; }; }();
- var _element = __webpack_require__(2);
- var _base = __webpack_require__(11);
- var _base2 = _interopRequireDefault(_base);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- 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; }
- 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; }
- /**
- * @class TopLeftCornerOverlay
- */
- var TopLeftCornerOverlay = function (_Overlay) {
- _inherits(TopLeftCornerOverlay, _Overlay);
- /**
- * @param {Walkontable} wotInstance
- */
- function TopLeftCornerOverlay(wotInstance) {
- _classCallCheck(this, TopLeftCornerOverlay);
- var _this = _possibleConstructorReturn(this, (TopLeftCornerOverlay.__proto__ || Object.getPrototypeOf(TopLeftCornerOverlay)).call(this, wotInstance));
- _this.clone = _this.makeClone(_base2.default.CLONE_TOP_LEFT_CORNER);
- return _this;
- }
- /**
- * Checks if overlay should be fully rendered
- *
- * @returns {Boolean}
- */
- _createClass(TopLeftCornerOverlay, [{
- key: 'shouldBeRendered',
- value: function shouldBeRendered() {
- return !!((this.wot.getSetting('fixedRowsTop') || this.wot.getSetting('columnHeaders').length) && (this.wot.getSetting('fixedColumnsLeft') || this.wot.getSetting('rowHeaders').length));
- }
- /**
- * Updates the corner overlay position
- */
- }, {
- key: 'resetFixedPosition',
- value: function resetFixedPosition() {
- this.updateTrimmingContainer();
- if (!this.wot.wtTable.holder.parentNode) {
- // removed from DOM
- return;
- }
- var overlayRoot = this.clone.wtTable.holder.parentNode;
- var tableHeight = (0, _element.outerHeight)(this.clone.wtTable.TABLE);
- var tableWidth = (0, _element.outerWidth)(this.clone.wtTable.TABLE);
- var preventOverflow = this.wot.getSetting('preventOverflow');
- if (this.trimmingContainer === window) {
- var box = this.wot.wtTable.hider.getBoundingClientRect();
- var top = Math.ceil(box.top);
- var left = Math.ceil(box.left);
- var bottom = Math.ceil(box.bottom);
- var right = Math.ceil(box.right);
- var finalLeft = '0';
- var finalTop = '0';
- if (!preventOverflow || preventOverflow === 'vertical') {
- if (left < 0 && right - overlayRoot.offsetWidth > 0) {
- finalLeft = -left + 'px';
- }
- }
- if (!preventOverflow || preventOverflow === 'horizontal') {
- if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {
- finalTop = -top + 'px';
- }
- }
- (0, _element.setOverlayPosition)(overlayRoot, finalLeft, finalTop);
- } else {
- (0, _element.resetCssTransform)(overlayRoot);
- }
- overlayRoot.style.height = (tableHeight === 0 ? tableHeight : tableHeight + 4) + 'px';
- overlayRoot.style.width = (tableWidth === 0 ? tableWidth : tableWidth + 4) + 'px';
- }
- }]);
- return TopLeftCornerOverlay;
- }(_base2.default);
- _base2.default.registerOverlay(_base2.default.CLONE_TOP_LEFT_CORNER, TopLeftCornerOverlay);
- exports.default = TopLeftCornerOverlay;
- /***/ }),
- /* 103 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; };
- 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; }; }();
- var _element = __webpack_require__(2);
- var _border2 = __webpack_require__(59);
- var _border3 = _interopRequireDefault(_border2);
- var _coords = __webpack_require__(22);
- var _coords2 = _interopRequireDefault(_coords);
- var _range = __webpack_require__(43);
- var _range2 = _interopRequireDefault(_range);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * @class Selection
- */
- var Selection = function () {
- /**
- * @param {Object} settings
- * @param {CellRange} cellRange
- */
- function Selection(settings, cellRange) {
- _classCallCheck(this, Selection);
- this.settings = settings;
- this.cellRange = cellRange || null;
- this.instanceBorders = {};
- }
- /**
- * Each Walkontable clone requires it's own border for every selection. This method creates and returns selection
- * borders per instance
- *
- * @param {Walkontable} wotInstance
- * @returns {Border}
- */
- _createClass(Selection, [{
- key: 'getBorder',
- value: function getBorder(wotInstance) {
- if (this.instanceBorders[wotInstance.guid]) {
- return this.instanceBorders[wotInstance.guid];
- }
- // where is this returned?
- this.instanceBorders[wotInstance.guid] = new _border3.default(wotInstance, this.settings);
- }
- /**
- * Checks if selection is empty
- *
- * @returns {Boolean}
- */
- }, {
- key: 'isEmpty',
- value: function isEmpty() {
- return this.cellRange === null;
- }
- /**
- * Adds a cell coords to the selection
- *
- * @param {CellCoords} coords
- */
- }, {
- key: 'add',
- value: function add(coords) {
- if (this.isEmpty()) {
- this.cellRange = new _range2.default(coords, coords, coords);
- } else {
- this.cellRange.expand(coords);
- }
- }
- /**
- * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean
- * information about success
- *
- * @param {CellCoords} oldCoords
- * @param {CellCoords} newCoords
- * @returns {Boolean}
- */
- }, {
- key: 'replace',
- value: function replace(oldCoords, newCoords) {
- if (!this.isEmpty()) {
- if (this.cellRange.from.isEqual(oldCoords)) {
- this.cellRange.from = newCoords;
- return true;
- }
- if (this.cellRange.to.isEqual(oldCoords)) {
- this.cellRange.to = newCoords;
- return true;
- }
- }
- return false;
- }
- /**
- * Clears selection
- */
- }, {
- key: 'clear',
- value: function clear() {
- this.cellRange = null;
- }
- /**
- * Returns the top left (TL) and bottom right (BR) selection coordinates
- *
- * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`
- */
- }, {
- key: 'getCorners',
- value: function getCorners() {
- var topLeft = this.cellRange.getTopLeftCorner();
- var bottomRight = this.cellRange.getBottomRightCorner();
- return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];
- }
- /**
- * Adds class name to cell element at given coords
- *
- * @param {Walkontable} wotInstance Walkontable instance
- * @param {Number} sourceRow Cell row coord
- * @param {Number} sourceColumn Cell column coord
- * @param {String} className Class name
- */
- }, {
- key: 'addClassAtCoords',
- value: function addClassAtCoords(wotInstance, sourceRow, sourceColumn, className) {
- var TD = wotInstance.wtTable.getCell(new _coords2.default(sourceRow, sourceColumn));
- if ((typeof TD === 'undefined' ? 'undefined' : _typeof(TD)) === 'object') {
- (0, _element.addClass)(TD, className);
- }
- }
- /**
- * @param wotInstance
- */
- }, {
- key: 'draw',
- value: function draw(wotInstance) {
- if (this.isEmpty()) {
- if (this.settings.border) {
- var border = this.getBorder(wotInstance);
- if (border) {
- border.disappear();
- }
- }
- return;
- }
- var renderedRows = wotInstance.wtTable.getRenderedRowsCount();
- var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();
- var corners = this.getCorners();
- var sourceRow = void 0,
- sourceCol = void 0,
- TH = void 0;
- for (var column = 0; column < renderedColumns; column++) {
- sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);
- if (sourceCol >= corners[1] && sourceCol <= corners[3]) {
- TH = wotInstance.wtTable.getColumnHeader(sourceCol);
- if (TH) {
- var newClasses = [];
- if (this.settings.highlightHeaderClassName) {
- newClasses.push(this.settings.highlightHeaderClassName);
- }
- if (this.settings.highlightColumnClassName) {
- newClasses.push(this.settings.highlightColumnClassName);
- }
- (0, _element.addClass)(TH, newClasses);
- }
- }
- }
- for (var row = 0; row < renderedRows; row++) {
- sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);
- if (sourceRow >= corners[0] && sourceRow <= corners[2]) {
- TH = wotInstance.wtTable.getRowHeader(sourceRow);
- if (TH) {
- var _newClasses = [];
- if (this.settings.highlightHeaderClassName) {
- _newClasses.push(this.settings.highlightHeaderClassName);
- }
- if (this.settings.highlightRowClassName) {
- _newClasses.push(this.settings.highlightRowClassName);
- }
- (0, _element.addClass)(TH, _newClasses);
- }
- }
- for (var _column = 0; _column < renderedColumns; _column++) {
- sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(_column);
- if (sourceRow >= corners[0] && sourceRow <= corners[2] && sourceCol >= corners[1] && sourceCol <= corners[3]) {
- // selected cell
- if (this.settings.className) {
- this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.className);
- }
- } else if (sourceRow >= corners[0] && sourceRow <= corners[2]) {
- // selection is in this row
- if (this.settings.highlightRowClassName) {
- this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightRowClassName);
- }
- } else if (sourceCol >= corners[1] && sourceCol <= corners[3]) {
- // selection is in this column
- if (this.settings.highlightColumnClassName) {
- this.addClassAtCoords(wotInstance, sourceRow, sourceCol, this.settings.highlightColumnClassName);
- }
- }
- }
- }
- wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);
- if (this.settings.border) {
- var _border = this.getBorder(wotInstance);
- if (_border) {
- // warning! border.appear modifies corners!
- _border.appear(corners);
- }
- }
- }
- }]);
- return Selection;
- }();
- exports.default = Selection;
- /***/ }),
- /* 104 */
- /***/ (function(module, exports, __webpack_require__) {
- // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
- var $export = __webpack_require__(0);
- $export($export.P, 'Array', {copyWithin: __webpack_require__(151)});
- __webpack_require__(17)('copyWithin');
- /***/ }),
- /* 105 */
- /***/ (function(module, exports, __webpack_require__) {
- // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
- var $export = __webpack_require__(0);
- $export($export.P, 'Array', {fill: __webpack_require__(152)});
- __webpack_require__(17)('fill');
- /***/ }),
- /* 106 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
- var $export = __webpack_require__(0)
- , $find = __webpack_require__(34)(6)
- , KEY = 'findIndex'
- , forced = true;
- // Shouldn't skip holes
- if(KEY in [])Array(1)[KEY](function(){ forced = false; });
- $export($export.P + $export.F * forced, 'Array', {
- findIndex: function findIndex(callbackfn/*, that = undefined */){
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__(17)(KEY);
- /***/ }),
- /* 107 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
- var $export = __webpack_require__(0)
- , $find = __webpack_require__(34)(5)
- , KEY = 'find'
- , forced = true;
- // Shouldn't skip holes
- if(KEY in [])Array(1)[KEY](function(){ forced = false; });
- $export($export.P + $export.F * forced, 'Array', {
- find: function find(callbackfn/*, that = undefined */){
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__(17)(KEY);
- /***/ }),
- /* 108 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var ctx = __webpack_require__(12)
- , $export = __webpack_require__(0)
- , toObject = __webpack_require__(21)
- , call = __webpack_require__(87)
- , isArrayIter = __webpack_require__(83)
- , toLength = __webpack_require__(10)
- , createProperty = __webpack_require__(45)
- , getIterFn = __webpack_require__(98);
- $export($export.S + $export.F * !__webpack_require__(50)(function(iter){ Array.from(iter); }), 'Array', {
- // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
- from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
- var O = toObject(arrayLike)
- , C = typeof this == 'function' ? this : Array
- , aLen = arguments.length
- , mapfn = aLen > 1 ? arguments[1] : undefined
- , mapping = mapfn !== undefined
- , index = 0
- , iterFn = getIterFn(O)
- , length, result, step, iterator;
- if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
- // if object isn't iterable or it's array with default iterator - use simple case
- if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
- for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
- createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
- }
- } else {
- length = toLength(O.length);
- for(result = new C(length); length > index; index++){
- createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
- }
- }
- result.length = index;
- return result;
- }
- });
- /***/ }),
- /* 109 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $export = __webpack_require__(0)
- , createProperty = __webpack_require__(45);
- // WebKit Array.of isn't generic
- $export($export.S + $export.F * __webpack_require__(14)(function(){
- function F(){}
- return !(Array.of.call(F) instanceof F);
- }), 'Array', {
- // 22.1.2.3 Array.of( ...items)
- of: function of(/* ...args */){
- var index = 0
- , aLen = arguments.length
- , result = new (typeof this == 'function' ? this : Array)(aLen);
- while(aLen > index)createProperty(result, index, arguments[index++]);
- result.length = aLen;
- return result;
- }
- });
- /***/ }),
- /* 110 */
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__(6).f
- , createDesc = __webpack_require__(20)
- , has = __webpack_require__(8)
- , FProto = Function.prototype
- , nameRE = /^\s*function ([^ (]*)/
- , NAME = 'name';
- var isExtensible = Object.isExtensible || function(){
- return true;
- };
- // 19.2.4.2 name
- NAME in FProto || __webpack_require__(7) && dP(FProto, NAME, {
- configurable: true,
- get: function(){
- try {
- var that = this
- , name = ('' + that).match(nameRE)[1];
- has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name));
- return name;
- } catch(e){
- return '';
- }
- }
- });
- /***/ }),
- /* 111 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var strong = __webpack_require__(79);
- // 23.1 Map Objects
- module.exports = __webpack_require__(35)('Map', function(get){
- return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.1.3.6 Map.prototype.get(key)
- get: function get(key){
- var entry = strong.getEntry(this, key);
- return entry && entry.v;
- },
- // 23.1.3.9 Map.prototype.set(key, value)
- set: function set(key, value){
- return strong.def(this, key === 0 ? 0 : key, value);
- }
- }, strong, true);
- /***/ }),
- /* 112 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.1 Number.EPSILON
- var $export = __webpack_require__(0);
- $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)});
- /***/ }),
- /* 113 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.2 Number.isFinite(number)
- var $export = __webpack_require__(0)
- , _isFinite = __webpack_require__(3).isFinite;
- $export($export.S, 'Number', {
- isFinite: function isFinite(it){
- return typeof it == 'number' && _isFinite(it);
- }
- });
- /***/ }),
- /* 114 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.3 Number.isInteger(number)
- var $export = __webpack_require__(0);
- $export($export.S, 'Number', {isInteger: __webpack_require__(85)});
- /***/ }),
- /* 115 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.4 Number.isNaN(number)
- var $export = __webpack_require__(0);
- $export($export.S, 'Number', {
- isNaN: function isNaN(number){
- return number != number;
- }
- });
- /***/ }),
- /* 116 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.5 Number.isSafeInteger(number)
- var $export = __webpack_require__(0)
- , isInteger = __webpack_require__(85)
- , abs = Math.abs;
- $export($export.S, 'Number', {
- isSafeInteger: function isSafeInteger(number){
- return isInteger(number) && abs(number) <= 0x1fffffffffffff;
- }
- });
- /***/ }),
- /* 117 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.6 Number.MAX_SAFE_INTEGER
- var $export = __webpack_require__(0);
- $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});
- /***/ }),
- /* 118 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.10 Number.MIN_SAFE_INTEGER
- var $export = __webpack_require__(0);
- $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff});
- /***/ }),
- /* 119 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.3.1 Object.assign(target, source)
- var $export = __webpack_require__(0);
- $export($export.S + $export.F, 'Object', {assign: __webpack_require__(90)});
- /***/ }),
- /* 120 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.3.10 Object.is(value1, value2)
- var $export = __webpack_require__(0);
- $export($export.S, 'Object', {is: __webpack_require__(166)});
- /***/ }),
- /* 121 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.3.19 Object.setPrototypeOf(O, proto)
- var $export = __webpack_require__(0);
- $export($export.S, 'Object', {setPrototypeOf: __webpack_require__(93).set});
- /***/ }),
- /* 122 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var LIBRARY = __webpack_require__(38)
- , global = __webpack_require__(3)
- , ctx = __webpack_require__(12)
- , classof = __webpack_require__(78)
- , $export = __webpack_require__(0)
- , isObject = __webpack_require__(4)
- , aFunction = __webpack_require__(44)
- , anInstance = __webpack_require__(33)
- , forOf = __webpack_require__(37)
- , speciesConstructor = __webpack_require__(167)
- , task = __webpack_require__(57).set
- , microtask = __webpack_require__(161)()
- , PROMISE = 'Promise'
- , TypeError = global.TypeError
- , process = global.process
- , $Promise = global[PROMISE]
- , process = global.process
- , isNode = classof(process) == 'process'
- , empty = function(){ /* empty */ }
- , Internal, GenericPromiseCapability, Wrapper;
- var USE_NATIVE = !!function(){
- try {
- // correct subclassing with @@species support
- var promise = $Promise.resolve(1)
- , FakePromise = (promise.constructor = {})[__webpack_require__(1)('species')] = function(exec){ exec(empty, empty); };
- // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
- } catch(e){ /* empty */ }
- }();
- // helpers
- var sameConstructor = function(a, b){
- // with library wrapper special case
- return a === b || a === $Promise && b === Wrapper;
- };
- var isThenable = function(it){
- var then;
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
- };
- var newPromiseCapability = function(C){
- return sameConstructor($Promise, C)
- ? new PromiseCapability(C)
- : new GenericPromiseCapability(C);
- };
- var PromiseCapability = GenericPromiseCapability = function(C){
- var resolve, reject;
- this.promise = new C(function($$resolve, $$reject){
- if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aFunction(resolve);
- this.reject = aFunction(reject);
- };
- var perform = function(exec){
- try {
- exec();
- } catch(e){
- return {error: e};
- }
- };
- var notify = function(promise, isReject){
- if(promise._n)return;
- promise._n = true;
- var chain = promise._c;
- microtask(function(){
- var value = promise._v
- , ok = promise._s == 1
- , i = 0;
- var run = function(reaction){
- var handler = ok ? reaction.ok : reaction.fail
- , resolve = reaction.resolve
- , reject = reaction.reject
- , domain = reaction.domain
- , result, then;
- try {
- if(handler){
- if(!ok){
- if(promise._h == 2)onHandleUnhandled(promise);
- promise._h = 1;
- }
- if(handler === true)result = value;
- else {
- if(domain)domain.enter();
- result = handler(value);
- if(domain)domain.exit();
- }
- if(result === reaction.promise){
- reject(TypeError('Promise-chain cycle'));
- } else if(then = isThenable(result)){
- then.call(result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch(e){
- reject(e);
- }
- };
- while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
- promise._c = [];
- promise._n = false;
- if(isReject && !promise._h)onUnhandled(promise);
- });
- };
- var onUnhandled = function(promise){
- task.call(global, function(){
- var value = promise._v
- , abrupt, handler, console;
- if(isUnhandled(promise)){
- abrupt = perform(function(){
- if(isNode){
- process.emit('unhandledRejection', value, promise);
- } else if(handler = global.onunhandledrejection){
- handler({promise: promise, reason: value});
- } else if((console = global.console) && console.error){
- console.error('Unhandled promise rejection', value);
- }
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- promise._h = isNode || isUnhandled(promise) ? 2 : 1;
- } promise._a = undefined;
- if(abrupt)throw abrupt.error;
- });
- };
- var isUnhandled = function(promise){
- if(promise._h == 1)return false;
- var chain = promise._a || promise._c
- , i = 0
- , reaction;
- while(chain.length > i){
- reaction = chain[i++];
- if(reaction.fail || !isUnhandled(reaction.promise))return false;
- } return true;
- };
- var onHandleUnhandled = function(promise){
- task.call(global, function(){
- var handler;
- if(isNode){
- process.emit('rejectionHandled', promise);
- } else if(handler = global.onrejectionhandled){
- handler({promise: promise, reason: promise._v});
- }
- });
- };
- var $reject = function(value){
- var promise = this;
- if(promise._d)return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- promise._v = value;
- promise._s = 2;
- if(!promise._a)promise._a = promise._c.slice();
- notify(promise, true);
- };
- var $resolve = function(value){
- var promise = this
- , then;
- if(promise._d)return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- try {
- if(promise === value)throw TypeError("Promise can't be resolved itself");
- if(then = isThenable(value)){
- microtask(function(){
- var wrapper = {_w: promise, _d: false}; // wrap
- try {
- then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
- } catch(e){
- $reject.call(wrapper, e);
- }
- });
- } else {
- promise._v = value;
- promise._s = 1;
- notify(promise, false);
- }
- } catch(e){
- $reject.call({_w: promise, _d: false}, e); // wrap
- }
- };
- // constructor polyfill
- if(!USE_NATIVE){
- // 25.4.3.1 Promise(executor)
- $Promise = function Promise(executor){
- anInstance(this, $Promise, PROMISE, '_h');
- aFunction(executor);
- Internal.call(this);
- try {
- executor(ctx($resolve, this, 1), ctx($reject, this, 1));
- } catch(err){
- $reject.call(this, err);
- }
- };
- Internal = function Promise(executor){
- this._c = []; // <- awaiting reactions
- this._a = undefined; // <- checked in isUnhandled reactions
- this._s = 0; // <- state
- this._d = false; // <- done
- this._v = undefined; // <- value
- this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
- this._n = false; // <- notify
- };
- Internal.prototype = __webpack_require__(40)($Promise.prototype, {
- // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
- then: function then(onFulfilled, onRejected){
- var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
- reaction.fail = typeof onRejected == 'function' && onRejected;
- reaction.domain = isNode ? process.domain : undefined;
- this._c.push(reaction);
- if(this._a)this._a.push(reaction);
- if(this._s)notify(this, false);
- return reaction.promise;
- },
- // 25.4.5.1 Promise.prototype.catch(onRejected)
- 'catch': function(onRejected){
- return this.then(undefined, onRejected);
- }
- });
- PromiseCapability = function(){
- var promise = new Internal;
- this.promise = promise;
- this.resolve = ctx($resolve, promise, 1);
- this.reject = ctx($reject, promise, 1);
- };
- }
- $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
- __webpack_require__(30)($Promise, PROMISE);
- __webpack_require__(94)(PROMISE);
- Wrapper = __webpack_require__(26)[PROMISE];
- // statics
- $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
- // 25.4.4.5 Promise.reject(r)
- reject: function reject(r){
- var capability = newPromiseCapability(this)
- , $$reject = capability.reject;
- $$reject(r);
- return capability.promise;
- }
- });
- $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
- // 25.4.4.6 Promise.resolve(x)
- resolve: function resolve(x){
- // instanceof instead of internal slot check because we should fix it without replacement native Promise core
- if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
- var capability = newPromiseCapability(this)
- , $$resolve = capability.resolve;
- $$resolve(x);
- return capability.promise;
- }
- });
- $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(50)(function(iter){
- $Promise.all(iter)['catch'](empty);
- })), PROMISE, {
- // 25.4.4.1 Promise.all(iterable)
- all: function all(iterable){
- var C = this
- , capability = newPromiseCapability(C)
- , resolve = capability.resolve
- , reject = capability.reject;
- var abrupt = perform(function(){
- var values = []
- , index = 0
- , remaining = 1;
- forOf(iterable, false, function(promise){
- var $index = index++
- , alreadyCalled = false;
- values.push(undefined);
- remaining++;
- C.resolve(promise).then(function(value){
- if(alreadyCalled)return;
- alreadyCalled = true;
- values[$index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if(abrupt)reject(abrupt.error);
- return capability.promise;
- },
- // 25.4.4.4 Promise.race(iterable)
- race: function race(iterable){
- var C = this
- , capability = newPromiseCapability(C)
- , reject = capability.reject;
- var abrupt = perform(function(){
- forOf(iterable, false, function(promise){
- C.resolve(promise).then(capability.resolve, reject);
- });
- });
- if(abrupt)reject(abrupt.error);
- return capability.promise;
- }
- });
- /***/ }),
- /* 123 */
- /***/ (function(module, exports, __webpack_require__) {
- // 21.2.5.3 get RegExp.prototype.flags()
- if(__webpack_require__(7) && /./g.flags != 'g')__webpack_require__(6).f(RegExp.prototype, 'flags', {
- configurable: true,
- get: __webpack_require__(156)
- });
- /***/ }),
- /* 124 */
- /***/ (function(module, exports, __webpack_require__) {
- // @@match logic
- __webpack_require__(36)('match', 1, function(defined, MATCH, $match){
- // 21.1.3.11 String.prototype.match(regexp)
- return [function match(regexp){
- 'use strict';
- var O = defined(this)
- , fn = regexp == undefined ? undefined : regexp[MATCH];
- return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
- }, $match];
- });
- /***/ }),
- /* 125 */
- /***/ (function(module, exports, __webpack_require__) {
- // @@replace logic
- __webpack_require__(36)('replace', 2, function(defined, REPLACE, $replace){
- // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
- return [function replace(searchValue, replaceValue){
- 'use strict';
- var O = defined(this)
- , fn = searchValue == undefined ? undefined : searchValue[REPLACE];
- return fn !== undefined
- ? fn.call(searchValue, O, replaceValue)
- : $replace.call(String(O), searchValue, replaceValue);
- }, $replace];
- });
- /***/ }),
- /* 126 */
- /***/ (function(module, exports, __webpack_require__) {
- // @@search logic
- __webpack_require__(36)('search', 1, function(defined, SEARCH, $search){
- // 21.1.3.15 String.prototype.search(regexp)
- return [function search(regexp){
- 'use strict';
- var O = defined(this)
- , fn = regexp == undefined ? undefined : regexp[SEARCH];
- return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
- }, $search];
- });
- /***/ }),
- /* 127 */
- /***/ (function(module, exports, __webpack_require__) {
- // @@split logic
- __webpack_require__(36)('split', 2, function(defined, SPLIT, $split){
- 'use strict';
- var isRegExp = __webpack_require__(86)
- , _split = $split
- , $push = [].push
- , $SPLIT = 'split'
- , LENGTH = 'length'
- , LAST_INDEX = 'lastIndex';
- if(
- 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
- 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
- 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
- '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
- '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
- ''[$SPLIT](/.?/)[LENGTH]
- ){
- var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
- // based on es5-shim implementation, need to rework it
- $split = function(separator, limit){
- var string = String(this);
- if(separator === undefined && limit === 0)return [];
- // If `separator` is not a regex, use native split
- if(!isRegExp(separator))return _split.call(string, separator, limit);
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') +
- (separator.sticky ? 'y' : '');
- var lastLastIndex = 0;
- var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
- // Make `global` and avoid `lastIndex` issues by working with a copy
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- var separator2, match, lastIndex, lastLength, i;
- // Doesn't need flags gy, but they don't hurt
- if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
- while(match = separatorCopy.exec(string)){
- // `separatorCopy.lastIndex` is not reliable cross-browser
- lastIndex = match.index + match[0][LENGTH];
- if(lastIndex > lastLastIndex){
- output.push(string.slice(lastLastIndex, match.index));
- // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
- if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){
- for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined;
- });
- if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1));
- lastLength = match[0][LENGTH];
- lastLastIndex = lastIndex;
- if(output[LENGTH] >= splitLimit)break;
- }
- if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
- }
- if(lastLastIndex === string[LENGTH]){
- if(lastLength || !separatorCopy.test(''))output.push('');
- } else output.push(string.slice(lastLastIndex));
- return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
- };
- // Chakra, V8
- } else if('0'[$SPLIT](undefined, 0)[LENGTH]){
- $split = function(separator, limit){
- return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
- };
- }
- // 21.1.3.17 String.prototype.split(separator, limit)
- return [function split(separator, limit){
- var O = defined(this)
- , fn = separator == undefined ? undefined : separator[SPLIT];
- return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
- }, $split];
- });
- /***/ }),
- /* 128 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var strong = __webpack_require__(79);
- // 23.2 Set Objects
- module.exports = __webpack_require__(35)('Set', function(get){
- return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.2.3.1 Set.prototype.add(value)
- add: function add(value){
- return strong.def(this, value = value === 0 ? 0 : value, value);
- }
- }, strong);
- /***/ }),
- /* 129 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $export = __webpack_require__(0)
- , $at = __webpack_require__(168)(false);
- $export($export.P, 'String', {
- // 21.1.3.3 String.prototype.codePointAt(pos)
- codePointAt: function codePointAt(pos){
- return $at(this, pos);
- }
- });
- /***/ }),
- /* 130 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
- var $export = __webpack_require__(0)
- , toLength = __webpack_require__(10)
- , context = __webpack_require__(56)
- , ENDS_WITH = 'endsWith'
- , $endsWith = ''[ENDS_WITH];
- $export($export.P + $export.F * __webpack_require__(48)(ENDS_WITH), 'String', {
- endsWith: function endsWith(searchString /*, endPosition = @length */){
- var that = context(this, searchString, ENDS_WITH)
- , endPosition = arguments.length > 1 ? arguments[1] : undefined
- , len = toLength(that.length)
- , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len)
- , search = String(searchString);
- return $endsWith
- ? $endsWith.call(that, search, end)
- : that.slice(end - search.length, end) === search;
- }
- });
- /***/ }),
- /* 131 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(0)
- , toIndex = __webpack_require__(41)
- , fromCharCode = String.fromCharCode
- , $fromCodePoint = String.fromCodePoint;
- // length should be 1, old FF problem
- $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
- // 21.1.2.2 String.fromCodePoint(...codePoints)
- fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars
- var res = []
- , aLen = arguments.length
- , i = 0
- , code;
- while(aLen > i){
- code = +arguments[i++];
- if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point');
- res.push(code < 0x10000
- ? fromCharCode(code)
- : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
- );
- } return res.join('');
- }
- });
- /***/ }),
- /* 132 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.1.3.7 String.prototype.includes(searchString, position = 0)
- var $export = __webpack_require__(0)
- , context = __webpack_require__(56)
- , INCLUDES = 'includes';
- $export($export.P + $export.F * __webpack_require__(48)(INCLUDES), 'String', {
- includes: function includes(searchString /*, position = 0 */){
- return !!~context(this, searchString, INCLUDES)
- .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /* 133 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(0)
- , toIObject = __webpack_require__(9)
- , toLength = __webpack_require__(10);
- $export($export.S, 'String', {
- // 21.1.2.4 String.raw(callSite, ...substitutions)
- raw: function raw(callSite){
- var tpl = toIObject(callSite.raw)
- , len = toLength(tpl.length)
- , aLen = arguments.length
- , res = []
- , i = 0;
- while(len > i){
- res.push(String(tpl[i++]));
- if(i < aLen)res.push(String(arguments[i]));
- } return res.join('');
- }
- });
- /***/ }),
- /* 134 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(0);
- $export($export.P, 'String', {
- // 21.1.3.13 String.prototype.repeat(count)
- repeat: __webpack_require__(96)
- });
- /***/ }),
- /* 135 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
- var $export = __webpack_require__(0)
- , toLength = __webpack_require__(10)
- , context = __webpack_require__(56)
- , STARTS_WITH = 'startsWith'
- , $startsWith = ''[STARTS_WITH];
- $export($export.P + $export.F * __webpack_require__(48)(STARTS_WITH), 'String', {
- startsWith: function startsWith(searchString /*, position = 0 */){
- var that = context(this, searchString, STARTS_WITH)
- , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length))
- , search = String(searchString);
- return $startsWith
- ? $startsWith.call(that, search, index)
- : that.slice(index, index + search.length) === search;
- }
- });
- /***/ }),
- /* 136 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // ECMAScript 6 symbols shim
- var global = __webpack_require__(3)
- , has = __webpack_require__(8)
- , DESCRIPTORS = __webpack_require__(7)
- , $export = __webpack_require__(0)
- , redefine = __webpack_require__(16)
- , META = __webpack_require__(28).KEY
- , $fails = __webpack_require__(14)
- , shared = __webpack_require__(55)
- , setToStringTag = __webpack_require__(30)
- , uid = __webpack_require__(31)
- , wks = __webpack_require__(1)
- , wksExt = __webpack_require__(97)
- , wksDefine = __webpack_require__(169)
- , keyOf = __webpack_require__(160)
- , enumKeys = __webpack_require__(155)
- , isArray = __webpack_require__(84)
- , anObject = __webpack_require__(5)
- , toIObject = __webpack_require__(9)
- , toPrimitive = __webpack_require__(58)
- , createDesc = __webpack_require__(20)
- , _create = __webpack_require__(51)
- , gOPNExt = __webpack_require__(163)
- , $GOPD = __webpack_require__(52)
- , $DP = __webpack_require__(6)
- , $keys = __webpack_require__(19)
- , gOPD = $GOPD.f
- , dP = $DP.f
- , gOPN = gOPNExt.f
- , $Symbol = global.Symbol
- , $JSON = global.JSON
- , _stringify = $JSON && $JSON.stringify
- , PROTOTYPE = 'prototype'
- , HIDDEN = wks('_hidden')
- , TO_PRIMITIVE = wks('toPrimitive')
- , isEnum = {}.propertyIsEnumerable
- , SymbolRegistry = shared('symbol-registry')
- , AllSymbols = shared('symbols')
- , OPSymbols = shared('op-symbols')
- , ObjectProto = Object[PROTOTYPE]
- , USE_NATIVE = typeof $Symbol == 'function'
- , QObject = global.QObject;
- // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
- var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
- var setSymbolDesc = DESCRIPTORS && $fails(function(){
- return _create(dP({}, 'a', {
- get: function(){ return dP(this, 'a', {value: 7}).a; }
- })).a != 7;
- }) ? function(it, key, D){
- var protoDesc = gOPD(ObjectProto, key);
- if(protoDesc)delete ObjectProto[key];
- dP(it, key, D);
- if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
- } : dP;
- var wrap = function(tag){
- var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
- sym._k = tag;
- return sym;
- };
- var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
- return typeof it == 'symbol';
- } : function(it){
- return it instanceof $Symbol;
- };
- var $defineProperty = function defineProperty(it, key, D){
- if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
- anObject(it);
- key = toPrimitive(key, true);
- anObject(D);
- if(has(AllSymbols, key)){
- if(!D.enumerable){
- if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
- it[HIDDEN][key] = true;
- } else {
- if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
- D = _create(D, {enumerable: createDesc(0, false)});
- } return setSymbolDesc(it, key, D);
- } return dP(it, key, D);
- };
- var $defineProperties = function defineProperties(it, P){
- anObject(it);
- var keys = enumKeys(P = toIObject(P))
- , i = 0
- , l = keys.length
- , key;
- while(l > i)$defineProperty(it, key = keys[i++], P[key]);
- return it;
- };
- var $create = function create(it, P){
- return P === undefined ? _create(it) : $defineProperties(_create(it), P);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(key){
- var E = isEnum.call(this, key = toPrimitive(key, true));
- if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
- return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
- it = toIObject(it);
- key = toPrimitive(key, true);
- if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
- var D = gOPD(it, key);
- if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
- return D;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(it){
- var names = gOPN(toIObject(it))
- , result = []
- , i = 0
- , key;
- while(names.length > i){
- if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
- } return result;
- };
- var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
- var IS_OP = it === ObjectProto
- , names = gOPN(IS_OP ? OPSymbols : toIObject(it))
- , result = []
- , i = 0
- , key;
- while(names.length > i){
- if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
- } return result;
- };
- // 19.4.1.1 Symbol([description])
- if(!USE_NATIVE){
- $Symbol = function Symbol(){
- if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
- var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
- var $set = function(value){
- if(this === ObjectProto)$set.call(OPSymbols, value);
- if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
- setSymbolDesc(this, tag, createDesc(1, value));
- };
- if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
- return wrap(tag);
- };
- redefine($Symbol[PROTOTYPE], 'toString', function toString(){
- return this._k;
- });
- $GOPD.f = $getOwnPropertyDescriptor;
- $DP.f = $defineProperty;
- __webpack_require__(53).f = gOPNExt.f = $getOwnPropertyNames;
- __webpack_require__(29).f = $propertyIsEnumerable;
- __webpack_require__(39).f = $getOwnPropertySymbols;
- if(DESCRIPTORS && !__webpack_require__(38)){
- redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
- }
- wksExt.f = function(name){
- return wrap(wks(name));
- }
- }
- $export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
- for(var symbols = (
- // 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
- 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
- ).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
- for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
- $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
- // 19.4.2.1 Symbol.for(key)
- 'for': function(key){
- return has(SymbolRegistry, key += '')
- ? SymbolRegistry[key]
- : SymbolRegistry[key] = $Symbol(key);
- },
- // 19.4.2.5 Symbol.keyFor(sym)
- keyFor: function keyFor(key){
- if(isSymbol(key))return keyOf(SymbolRegistry, key);
- throw TypeError(key + ' is not a symbol!');
- },
- useSetter: function(){ setter = true; },
- useSimple: function(){ setter = false; }
- });
- $export($export.S + $export.F * !USE_NATIVE, 'Object', {
- // 19.1.2.2 Object.create(O [, Properties])
- create: $create,
- // 19.1.2.4 Object.defineProperty(O, P, Attributes)
- defineProperty: $defineProperty,
- // 19.1.2.3 Object.defineProperties(O, Properties)
- defineProperties: $defineProperties,
- // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
- // 19.1.2.7 Object.getOwnPropertyNames(O)
- getOwnPropertyNames: $getOwnPropertyNames,
- // 19.1.2.8 Object.getOwnPropertySymbols(O)
- getOwnPropertySymbols: $getOwnPropertySymbols
- });
- // 24.3.2 JSON.stringify(value [, replacer [, space]])
- $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
- var S = $Symbol();
- // MS Edge converts symbol values to JSON as {}
- // WebKit converts symbol values to JSON as null
- // V8 throws on boxed symbols
- return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
- })), 'JSON', {
- stringify: function stringify(it){
- if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
- var args = [it]
- , i = 1
- , replacer, $replacer;
- while(arguments.length > i)args.push(arguments[i++]);
- replacer = args[1];
- if(typeof replacer == 'function')$replacer = replacer;
- if($replacer || !isArray(replacer))replacer = function(key, value){
- if($replacer)value = $replacer.call(this, key, value);
- if(!isSymbol(value))return value;
- };
- args[1] = replacer;
- return _stringify.apply($JSON, args);
- }
- });
- // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
- $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(15)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
- // 19.4.3.5 Symbol.prototype[@@toStringTag]
- setToStringTag($Symbol, 'Symbol');
- // 20.2.1.9 Math[@@toStringTag]
- setToStringTag(Math, 'Math', true);
- // 24.3.3 JSON[@@toStringTag]
- setToStringTag(global.JSON, 'JSON', true);
- /***/ }),
- /* 137 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var each = __webpack_require__(34)(0)
- , redefine = __webpack_require__(16)
- , meta = __webpack_require__(28)
- , assign = __webpack_require__(90)
- , weak = __webpack_require__(80)
- , isObject = __webpack_require__(4)
- , getWeak = meta.getWeak
- , isExtensible = Object.isExtensible
- , uncaughtFrozenStore = weak.ufstore
- , tmp = {}
- , InternalMap;
- var wrapper = function(get){
- return function WeakMap(){
- return get(this, arguments.length > 0 ? arguments[0] : undefined);
- };
- };
- var methods = {
- // 23.3.3.3 WeakMap.prototype.get(key)
- get: function get(key){
- if(isObject(key)){
- var data = getWeak(key);
- if(data === true)return uncaughtFrozenStore(this).get(key);
- return data ? data[this._i] : undefined;
- }
- },
- // 23.3.3.5 WeakMap.prototype.set(key, value)
- set: function set(key, value){
- return weak.def(this, key, value);
- }
- };
- // 23.3 WeakMap Objects
- var $WeakMap = module.exports = __webpack_require__(35)('WeakMap', wrapper, methods, weak, true, true);
- // IE11 WeakMap frozen keys fix
- if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
- InternalMap = weak.getConstructor(wrapper);
- assign(InternalMap.prototype, methods);
- meta.NEED = true;
- each(['delete', 'has', 'get', 'set'], function(key){
- var proto = $WeakMap.prototype
- , method = proto[key];
- redefine(proto, key, function(a, b){
- // store frozen objects on internal weakmap shim
- if(isObject(a) && !isExtensible(a)){
- if(!this._f)this._f = new InternalMap;
- var result = this._f[key](a, b);
- return key == 'set' ? this : result;
- // store all the rest on native weakmap
- } return method.call(this, a, b);
- });
- });
- }
- /***/ }),
- /* 138 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var weak = __webpack_require__(80);
- // 23.4 WeakSet Objects
- __webpack_require__(35)('WeakSet', function(get){
- return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.4.3.1 WeakSet.prototype.add(value)
- add: function add(value){
- return weak.def(this, value, true);
- }
- }, weak, false, true);
- /***/ }),
- /* 139 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://github.com/tc39/Array.prototype.includes
- var $export = __webpack_require__(0)
- , $includes = __webpack_require__(77)(true);
- $export($export.P, 'Array', {
- includes: function includes(el /*, fromIndex = 0 */){
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__(17)('includes');
- /***/ }),
- /* 140 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/tc39/proposal-object-values-entries
- var $export = __webpack_require__(0)
- , $entries = __webpack_require__(92)(true);
- $export($export.S, 'Object', {
- entries: function entries(it){
- return $entries(it);
- }
- });
- /***/ }),
- /* 141 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/tc39/proposal-object-getownpropertydescriptors
- var $export = __webpack_require__(0)
- , ownKeys = __webpack_require__(165)
- , toIObject = __webpack_require__(9)
- , gOPD = __webpack_require__(52)
- , createProperty = __webpack_require__(45);
- $export($export.S, 'Object', {
- getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){
- var O = toIObject(object)
- , getDesc = gOPD.f
- , keys = ownKeys(O)
- , result = {}
- , i = 0
- , key;
- while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key));
- return result;
- }
- });
- /***/ }),
- /* 142 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/tc39/proposal-object-values-entries
- var $export = __webpack_require__(0)
- , $values = __webpack_require__(92)(false);
- $export($export.S, 'Object', {
- values: function values(it){
- return $values(it);
- }
- });
- /***/ }),
- /* 143 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://github.com/tc39/proposal-string-pad-start-end
- var $export = __webpack_require__(0)
- , $pad = __webpack_require__(95);
- $export($export.P, 'String', {
- padEnd: function padEnd(maxLength /*, fillString = ' ' */){
- return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
- }
- });
- /***/ }),
- /* 144 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://github.com/tc39/proposal-string-pad-start-end
- var $export = __webpack_require__(0)
- , $pad = __webpack_require__(95);
- $export($export.P, 'String', {
- padStart: function padStart(maxLength /*, fillString = ' ' */){
- return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
- }
- });
- /***/ }),
- /* 145 */
- /***/ (function(module, exports, __webpack_require__) {
- var $iterators = __webpack_require__(72)
- , redefine = __webpack_require__(16)
- , global = __webpack_require__(3)
- , hide = __webpack_require__(15)
- , Iterators = __webpack_require__(27)
- , wks = __webpack_require__(1)
- , ITERATOR = wks('iterator')
- , TO_STRING_TAG = wks('toStringTag')
- , ArrayValues = Iterators.Array;
- for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
- var NAME = collections[i]
- , Collection = global[NAME]
- , proto = Collection && Collection.prototype
- , key;
- if(proto){
- if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues);
- if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
- Iterators[NAME] = ArrayValues;
- for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true);
- }
- }
- /***/ }),
- /* 146 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(0)
- , $task = __webpack_require__(57);
- $export($export.G + $export.B, {
- setImmediate: $task.set,
- clearImmediate: $task.clear
- });
- /***/ }),
- /* 147 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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;
- __webpack_require__(111);
- __webpack_require__(128);
- __webpack_require__(137);
- __webpack_require__(138);
- __webpack_require__(122);
- __webpack_require__(136);
- __webpack_require__(119);
- __webpack_require__(120);
- __webpack_require__(121);
- __webpack_require__(110);
- __webpack_require__(133);
- __webpack_require__(131);
- __webpack_require__(129);
- __webpack_require__(134);
- __webpack_require__(135);
- __webpack_require__(130);
- __webpack_require__(132);
- __webpack_require__(123);
- __webpack_require__(124);
- __webpack_require__(125);
- __webpack_require__(127);
- __webpack_require__(126);
- __webpack_require__(108);
- __webpack_require__(109);
- __webpack_require__(104);
- __webpack_require__(107);
- __webpack_require__(106);
- __webpack_require__(105);
- __webpack_require__(72);
- __webpack_require__(113);
- __webpack_require__(114);
- __webpack_require__(116);
- __webpack_require__(115);
- __webpack_require__(112);
- __webpack_require__(118);
- __webpack_require__(117);
- __webpack_require__(139);
- __webpack_require__(142);
- __webpack_require__(140);
- __webpack_require__(141);
- __webpack_require__(144);
- __webpack_require__(143);
- __webpack_require__(146);
- __webpack_require__(145);
- var _viewportColumns = __webpack_require__(60);
- var _viewportColumns2 = _interopRequireDefault(_viewportColumns);
- var _viewportRows = __webpack_require__(61);
- var _viewportRows2 = _interopRequireDefault(_viewportRows);
- var _coords = __webpack_require__(22);
- var _coords2 = _interopRequireDefault(_coords);
- var _range = __webpack_require__(43);
- var _range2 = _interopRequireDefault(_range);
- var _column = __webpack_require__(64);
- var _column2 = _interopRequireDefault(_column);
- var _row = __webpack_require__(65);
- var _row2 = _interopRequireDefault(_row);
- var _debug = __webpack_require__(99);
- var _debug2 = _interopRequireDefault(_debug);
- var _left = __webpack_require__(100);
- var _left2 = _interopRequireDefault(_left);
- var _top = __webpack_require__(101);
- var _top2 = _interopRequireDefault(_top);
- var _topLeftCorner = __webpack_require__(102);
- var _topLeftCorner2 = _interopRequireDefault(_topLeftCorner);
- var _border = __webpack_require__(59);
- var _border2 = _interopRequireDefault(_border);
- var _core = __webpack_require__(62);
- var _core2 = _interopRequireDefault(_core);
- var _event = __webpack_require__(63);
- var _event2 = _interopRequireDefault(_event);
- var _overlays = __webpack_require__(66);
- var _overlays2 = _interopRequireDefault(_overlays);
- var _scroll = __webpack_require__(67);
- var _scroll2 = _interopRequireDefault(_scroll);
- var _selection = __webpack_require__(103);
- var _selection2 = _interopRequireDefault(_selection);
- var _settings = __webpack_require__(68);
- var _settings2 = _interopRequireDefault(_settings);
- var _table = __webpack_require__(69);
- var _table2 = _interopRequireDefault(_table);
- var _tableRenderer = __webpack_require__(70);
- var _tableRenderer2 = _interopRequireDefault(_tableRenderer);
- var _viewport = __webpack_require__(71);
- var _viewport2 = _interopRequireDefault(_viewport);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.ViewportColumnsCalculator = _viewportColumns2.default;
- exports.ViewportRowsCalculator = _viewportRows2.default;
- exports.CellCoords = _coords2.default;
- exports.CellRange = _range2.default;
- exports.ColumnFilter = _column2.default;
- exports.RowFilter = _row2.default;
- exports.DebugOverlay = _debug2.default;
- exports.LeftOverlay = _left2.default;
- exports.TopOverlay = _top2.default;
- exports.TopLeftCornerOverlay = _topLeftCorner2.default;
- exports.Border = _border2.default;
- exports.default = _core2.default;
- exports.Core = _core2.default;
- exports.Event = _event2.default;
- exports.Overlays = _overlays2.default;
- exports.Scroll = _scroll2.default;
- exports.Selection = _selection2.default;
- exports.Settings = _settings2.default;
- exports.Table = _table2.default;
- exports.TableRenderer = _tableRenderer2.default;
- exports.Viewport = _viewport2.default;
- /***/ }),
- /* 148 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- 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; };
- exports.stringify = stringify;
- exports.isDefined = isDefined;
- exports.isUndefined = isUndefined;
- exports.isEmpty = isEmpty;
- exports.isRegExp = isRegExp;
- /**
- * Converts any value to string.
- *
- * @param {*} value
- * @returns {String}
- */
- function stringify(value) {
- var result = void 0;
- switch (typeof value === 'undefined' ? 'undefined' : _typeof(value)) {
- case 'string':
- case 'number':
- result = '' + value;
- break;
- case 'object':
- result = value === null ? '' : value.toString();
- break;
- case 'undefined':
- result = '';
- break;
- default:
- result = value.toString();
- break;
- }
- return result;
- }
- /**
- * Checks if given variable is defined.
- *
- * @param {*} variable Variable to check.
- * @returns {Boolean}
- */
- function isDefined(variable) {
- return typeof variable !== 'undefined';
- }
- /**
- * Checks if given variable is undefined.
- *
- * @param {*} variable Variable to check.
- * @returns {Boolean}
- */
- function isUndefined(variable) {
- return typeof variable === 'undefined';
- }
- /**
- * Check if given variable is null, empty string or undefined.
- *
- * @param {*} variable Variable to check.
- * @returns {Boolean}
- */
- function isEmpty(variable) {
- return variable === null || variable === '' || isUndefined(variable);
- }
- /**
- * Check if given variable is a regular expression.
- *
- * @param {*} variable Variable to check.
- * @returns {Boolean}
- */
- function isRegExp(variable) {
- return Object.prototype.toString.call(variable) === '[object RegExp]';
- }
- /***/ }),
- /* 149 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.toUpperCaseFirst = toUpperCaseFirst;
- exports.equalsIgnoreCase = equalsIgnoreCase;
- exports.randomString = randomString;
- exports.isPercentValue = isPercentValue;
- exports.substitute = substitute;
- exports.stripTags = stripTags;
- var _mixed = __webpack_require__(148);
- var _number = __webpack_require__(76);
- /**
- * Convert string to upper case first letter.
- *
- * @param {String} string String to convert.
- * @returns {String}
- */
- function toUpperCaseFirst(string) {
- return string[0].toUpperCase() + string.substr(1);
- }
- /**
- * Compare strings case insensitively.
- *
- * @param {...String} strings Strings to compare.
- * @returns {Boolean}
- */
- function equalsIgnoreCase() {
- var unique = [];
- for (var _len = arguments.length, strings = Array(_len), _key = 0; _key < _len; _key++) {
- strings[_key] = arguments[_key];
- }
- var length = strings.length;
- while (length--) {
- var string = (0, _mixed.stringify)(strings[length]).toLowerCase();
- if (unique.indexOf(string) === -1) {
- unique.push(string);
- }
- }
- return unique.length === 1;
- }
- /**
- * Generates a random hex string. Used as namespace for Handsontable instance events.
- *
- * @return {String} Returns 16-long character random string (eq. `'92b1bfc74ec4'`).
- */
- function randomString() {
- function s4() {
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
- }
- return s4() + s4() + s4() + s4();
- }
- /**
- * Checks if value is valid percent.
- *
- * @param {String} value
- * @returns {Boolean}
- */
- function isPercentValue(value) {
- return (/^([0-9][0-9]?%$)|(^100%$)/.test(value)
- );
- }
- /**
- * Substitute strings placed beetwen square brackets into value defined in `variables` object. String names defined in
- * square brackets must be the same as property name of `variables` object.
- *
- * @param {String} template Template string.
- * @param {Object} variables Object which contains all available values which can be injected into template.
- * @returns {String}
- */
- function substitute(template) {
- var variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- return ('' + template).replace(/(?:\\)?\[([^[\]]+)]/g, function (match, name) {
- if (match.charAt(0) === '\\') {
- return match.substr(1, match.length - 1);
- }
- return variables[name] === void 0 ? '' : variables[name];
- });
- }
- var STRIP_TAGS_REGEX = /<\/?\w+\/?>|<\w+[\s|/][^>]*>/gi;
- /**
- * Strip any HTML tag from the string.
- *
- * @param {String} string String to cut HTML from.
- * @return {String}
- */
- function stripTags(string) {
- string += '';
- return string.replace(STRIP_TAGS_REGEX, '');
- }
- /***/ }),
- /* 150 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.KEY_CODES = undefined;
- exports.isPrintableChar = isPrintableChar;
- exports.isMetaKey = isMetaKey;
- exports.isCtrlKey = isCtrlKey;
- exports.isKey = isKey;
- var _array = __webpack_require__(24);
- var KEY_CODES = exports.KEY_CODES = {
- MOUSE_LEFT: 1,
- MOUSE_RIGHT: 3,
- MOUSE_MIDDLE: 2,
- BACKSPACE: 8,
- COMMA: 188,
- INSERT: 45,
- DELETE: 46,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- CONTROL_LEFT: 91,
- COMMAND_LEFT: 17,
- COMMAND_RIGHT: 93,
- ALT: 18,
- HOME: 36,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- SPACE: 32,
- SHIFT: 16,
- CAPS_LOCK: 20,
- TAB: 9,
- ARROW_RIGHT: 39,
- ARROW_LEFT: 37,
- ARROW_UP: 38,
- ARROW_DOWN: 40,
- F1: 112,
- F2: 113,
- F3: 114,
- F4: 115,
- F5: 116,
- F6: 117,
- F7: 118,
- F8: 119,
- F9: 120,
- F10: 121,
- F11: 122,
- F12: 123,
- A: 65,
- X: 88,
- C: 67,
- V: 86
- };
- /**
- * Returns true if keyCode represents a printable character.
- *
- * @param {Number} keyCode
- * @returns {Boolean}
- */
- function isPrintableChar(keyCode) {
- return keyCode == 32 || // space
- keyCode >= 48 && keyCode <= 57 || // 0-9
- keyCode >= 96 && keyCode <= 111 || // numpad
- keyCode >= 186 && keyCode <= 192 || // ;=,-./`
- keyCode >= 219 && keyCode <= 222 || // []{}\|"'
- keyCode >= 226 || // special chars (229 for Asian chars)
- keyCode >= 65 && keyCode <= 90; // a-z
- }
- /**
- * @param {Number} keyCode
- * @returns {Boolean}
- */
- function isMetaKey(keyCode) {
- 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];
- return metaKeys.indexOf(keyCode) !== -1;
- }
- /**
- * @param {Number} keyCode
- * @returns {Boolean}
- */
- function isCtrlKey(keyCode) {
- return [KEY_CODES.CONTROL_LEFT, 224, KEY_CODES.COMMAND_LEFT, KEY_CODES.COMMAND_RIGHT].indexOf(keyCode) !== -1;
- }
- /**
- * @param {Number} keyCode
- * @param {String} baseCode
- * @returns {Boolean}
- */
- function isKey(keyCode, baseCode) {
- var keys = baseCode.split('|');
- var result = false;
- (0, _array.arrayEach)(keys, function (key) {
- if (keyCode === KEY_CODES[key]) {
- result = true;
- return false;
- }
- });
- return result;
- }
- /***/ }),
- /* 151 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
- var toObject = __webpack_require__(21)
- , toIndex = __webpack_require__(41)
- , toLength = __webpack_require__(10);
- module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){
- var O = toObject(this)
- , len = toLength(O.length)
- , to = toIndex(target, len)
- , from = toIndex(start, len)
- , end = arguments.length > 2 ? arguments[2] : undefined
- , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)
- , inc = 1;
- if(from < to && to < from + count){
- inc = -1;
- from += count - 1;
- to += count - 1;
- }
- while(count-- > 0){
- if(from in O)O[to] = O[from];
- else delete O[to];
- to += inc;
- from += inc;
- } return O;
- };
- /***/ }),
- /* 152 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
- var toObject = __webpack_require__(21)
- , toIndex = __webpack_require__(41)
- , toLength = __webpack_require__(10);
- module.exports = function fill(value /*, start = 0, end = @length */){
- var O = toObject(this)
- , length = toLength(O.length)
- , aLen = arguments.length
- , index = toIndex(aLen > 1 ? arguments[1] : undefined, length)
- , end = aLen > 2 ? arguments[2] : undefined
- , endPos = end === undefined ? length : toIndex(end, length);
- while(endPos > index)O[index++] = value;
- return O;
- };
- /***/ }),
- /* 153 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(4)
- , isArray = __webpack_require__(84)
- , SPECIES = __webpack_require__(1)('species');
- module.exports = function(original){
- var C;
- if(isArray(original)){
- C = original.constructor;
- // cross-realm fallback
- if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;
- if(isObject(C)){
- C = C[SPECIES];
- if(C === null)C = undefined;
- }
- } return C === undefined ? Array : C;
- };
- /***/ }),
- /* 154 */
- /***/ (function(module, exports, __webpack_require__) {
- // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
- var speciesConstructor = __webpack_require__(153);
- module.exports = function(original, length){
- return new (speciesConstructor(original))(length);
- };
- /***/ }),
- /* 155 */
- /***/ (function(module, exports, __webpack_require__) {
- // all enumerable object keys, includes symbols
- var getKeys = __webpack_require__(19)
- , gOPS = __webpack_require__(39)
- , pIE = __webpack_require__(29);
- module.exports = function(it){
- var result = getKeys(it)
- , getSymbols = gOPS.f;
- if(getSymbols){
- var symbols = getSymbols(it)
- , isEnum = pIE.f
- , i = 0
- , key;
- while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
- } return result;
- };
- /***/ }),
- /* 156 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.2.5.3 get RegExp.prototype.flags
- var anObject = __webpack_require__(5);
- module.exports = function(){
- var that = anObject(this)
- , result = '';
- if(that.global) result += 'g';
- if(that.ignoreCase) result += 'i';
- if(that.multiline) result += 'm';
- if(that.unicode) result += 'u';
- if(that.sticky) result += 'y';
- return result;
- };
- /***/ }),
- /* 157 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(4)
- , setPrototypeOf = __webpack_require__(93).set;
- module.exports = function(that, target, C){
- var P, S = target.constructor;
- if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){
- setPrototypeOf(that, P);
- } return that;
- };
- /***/ }),
- /* 158 */
- /***/ (function(module, exports) {
- // fast apply, http://jsperf.lnkit.com/fast-apply/5
- module.exports = function(fn, args, that){
- var un = that === undefined;
- switch(args.length){
- case 0: return un ? fn()
- : fn.call(that);
- case 1: return un ? fn(args[0])
- : fn.call(that, args[0]);
- case 2: return un ? fn(args[0], args[1])
- : fn.call(that, args[0], args[1]);
- case 3: return un ? fn(args[0], args[1], args[2])
- : fn.call(that, args[0], args[1], args[2]);
- case 4: return un ? fn(args[0], args[1], args[2], args[3])
- : fn.call(that, args[0], args[1], args[2], args[3]);
- } return fn.apply(that, args);
- };
- /***/ }),
- /* 159 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var create = __webpack_require__(51)
- , descriptor = __webpack_require__(20)
- , setToStringTag = __webpack_require__(30)
- , IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- __webpack_require__(15)(IteratorPrototype, __webpack_require__(1)('iterator'), function(){ return this; });
- module.exports = function(Constructor, NAME, next){
- Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
- setToStringTag(Constructor, NAME + ' Iterator');
- };
- /***/ }),
- /* 160 */
- /***/ (function(module, exports, __webpack_require__) {
- var getKeys = __webpack_require__(19)
- , toIObject = __webpack_require__(9);
- module.exports = function(object, el){
- var O = toIObject(object)
- , keys = getKeys(O)
- , length = keys.length
- , index = 0
- , key;
- while(length > index)if(O[key = keys[index++]] === el)return key;
- };
- /***/ }),
- /* 161 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(3)
- , macrotask = __webpack_require__(57).set
- , Observer = global.MutationObserver || global.WebKitMutationObserver
- , process = global.process
- , Promise = global.Promise
- , isNode = __webpack_require__(18)(process) == 'process';
- module.exports = function(){
- var head, last, notify;
- var flush = function(){
- var parent, fn;
- if(isNode && (parent = process.domain))parent.exit();
- while(head){
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch(e){
- if(head)notify();
- else last = undefined;
- throw e;
- }
- } last = undefined;
- if(parent)parent.enter();
- };
- // Node.js
- if(isNode){
- notify = function(){
- process.nextTick(flush);
- };
- // browsers with MutationObserver
- } else if(Observer){
- var toggle = true
- , node = document.createTextNode('');
- new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
- notify = function(){
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if(Promise && Promise.resolve){
- var promise = Promise.resolve();
- notify = function(){
- promise.then(flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessag
- // - onreadystatechange
- // - setTimeout
- } else {
- notify = function(){
- // strange IE + webpack dev server bug - use .call(global)
- macrotask.call(global, flush);
- };
- }
- return function(fn){
- var task = {fn: fn, next: undefined};
- if(last)last.next = task;
- if(!head){
- head = task;
- notify();
- } last = task;
- };
- };
- /***/ }),
- /* 162 */
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__(6)
- , anObject = __webpack_require__(5)
- , getKeys = __webpack_require__(19);
- module.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties){
- anObject(O);
- var keys = getKeys(Properties)
- , length = keys.length
- , i = 0
- , P;
- while(length > i)dP.f(O, P = keys[i++], Properties[P]);
- return O;
- };
- /***/ }),
- /* 163 */
- /***/ (function(module, exports, __webpack_require__) {
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
- var toIObject = __webpack_require__(9)
- , gOPN = __webpack_require__(53).f
- , toString = {}.toString;
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function(it){
- try {
- return gOPN(it);
- } catch(e){
- return windowNames.slice();
- }
- };
- module.exports.f = function getOwnPropertyNames(it){
- return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
- };
- /***/ }),
- /* 164 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
- var has = __webpack_require__(8)
- , toObject = __webpack_require__(21)
- , IE_PROTO = __webpack_require__(54)('IE_PROTO')
- , ObjectProto = Object.prototype;
- module.exports = Object.getPrototypeOf || function(O){
- O = toObject(O);
- if(has(O, IE_PROTO))return O[IE_PROTO];
- if(typeof O.constructor == 'function' && O instanceof O.constructor){
- return O.constructor.prototype;
- } return O instanceof Object ? ObjectProto : null;
- };
- /***/ }),
- /* 165 */
- /***/ (function(module, exports, __webpack_require__) {
- // all object keys, includes non-enumerable and symbols
- var gOPN = __webpack_require__(53)
- , gOPS = __webpack_require__(39)
- , anObject = __webpack_require__(5)
- , Reflect = __webpack_require__(3).Reflect;
- module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){
- var keys = gOPN.f(anObject(it))
- , getSymbols = gOPS.f;
- return getSymbols ? keys.concat(getSymbols(it)) : keys;
- };
- /***/ }),
- /* 166 */
- /***/ (function(module, exports) {
- // 7.2.9 SameValue(x, y)
- module.exports = Object.is || function is(x, y){
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
- };
- /***/ }),
- /* 167 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.3.20 SpeciesConstructor(O, defaultConstructor)
- var anObject = __webpack_require__(5)
- , aFunction = __webpack_require__(44)
- , SPECIES = __webpack_require__(1)('species');
- module.exports = function(O, D){
- var C = anObject(O).constructor, S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
- };
- /***/ }),
- /* 168 */
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__(42)
- , defined = __webpack_require__(13);
- // true -> String#at
- // false -> String#codePointAt
- module.exports = function(TO_STRING){
- return function(that, pos){
- var s = String(defined(that))
- , i = toInteger(pos)
- , l = s.length
- , a, b;
- if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
- /***/ }),
- /* 169 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(3)
- , core = __webpack_require__(26)
- , LIBRARY = __webpack_require__(38)
- , wksExt = __webpack_require__(97)
- , defineProperty = __webpack_require__(6).f;
- module.exports = function(name){
- var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
- if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
- };
- /***/ })
- /******/ ]);
- //# sourceMappingURL=walkontable.js.map
|