material-components-web.js 878 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696
  1. /*!
  2. Material Components for the Web
  3. Copyright (c) 2018 Google Inc.
  4. License: Apache-2.0
  5. */
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory();
  9. else if(typeof define === 'function' && define.amd)
  10. define([], factory);
  11. else if(typeof exports === 'object')
  12. exports["mdc"] = factory();
  13. else
  14. root["mdc"] = factory();
  15. })(this, function() {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, {
  55. /******/ configurable: false,
  56. /******/ enumerable: true,
  57. /******/ get: getter
  58. /******/ });
  59. /******/ }
  60. /******/ };
  61. /******/
  62. /******/ // getDefaultExport function for compatibility with non-harmony modules
  63. /******/ __webpack_require__.n = function(module) {
  64. /******/ var getter = module && module.__esModule ?
  65. /******/ function getDefault() { return module['default']; } :
  66. /******/ function getModuleExports() { return module; };
  67. /******/ __webpack_require__.d(getter, 'a', getter);
  68. /******/ return getter;
  69. /******/ };
  70. /******/
  71. /******/ // Object.prototype.hasOwnProperty.call
  72. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  73. /******/
  74. /******/ // __webpack_public_path__
  75. /******/ __webpack_require__.p = "";
  76. /******/
  77. /******/ // Load entry module and return exports
  78. /******/ return __webpack_require__(__webpack_require__.s = 48);
  79. /******/ })
  80. /************************************************************************/
  81. /******/ ([
  82. /* 0 */
  83. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84. "use strict";
  85. 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; }; }();
  86. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  87. /**
  88. * @license
  89. * Copyright 2016 Google Inc.
  90. *
  91. * Licensed under the Apache License, Version 2.0 (the "License");
  92. * you may not use this file except in compliance with the License.
  93. * You may obtain a copy of the License at
  94. *
  95. * http://www.apache.org/licenses/LICENSE-2.0
  96. *
  97. * Unless required by applicable law or agreed to in writing, software
  98. * distributed under the License is distributed on an "AS IS" BASIS,
  99. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  100. * See the License for the specific language governing permissions and
  101. * limitations under the License.
  102. */
  103. /**
  104. * @template A
  105. */
  106. var MDCFoundation = function () {
  107. _createClass(MDCFoundation, null, [{
  108. key: "cssClasses",
  109. /** @return enum{cssClasses} */
  110. get: function get() {
  111. // Classes extending MDCFoundation should implement this method to return an object which exports every
  112. // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
  113. return {};
  114. }
  115. /** @return enum{strings} */
  116. }, {
  117. key: "strings",
  118. get: function get() {
  119. // Classes extending MDCFoundation should implement this method to return an object which exports all
  120. // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
  121. return {};
  122. }
  123. /** @return enum{numbers} */
  124. }, {
  125. key: "numbers",
  126. get: function get() {
  127. // Classes extending MDCFoundation should implement this method to return an object which exports all
  128. // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
  129. return {};
  130. }
  131. /** @return {!Object} */
  132. }, {
  133. key: "defaultAdapter",
  134. get: function get() {
  135. // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
  136. // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
  137. // validation.
  138. return {};
  139. }
  140. /**
  141. * @param {A=} adapter
  142. */
  143. }]);
  144. function MDCFoundation() {
  145. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  146. _classCallCheck(this, MDCFoundation);
  147. /** @protected {!A} */
  148. this.adapter_ = adapter;
  149. }
  150. _createClass(MDCFoundation, [{
  151. key: "init",
  152. value: function init() {
  153. // Subclasses should override this method to perform initialization routines (registering events, etc.)
  154. }
  155. }, {
  156. key: "destroy",
  157. value: function destroy() {
  158. // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
  159. }
  160. }]);
  161. return MDCFoundation;
  162. }();
  163. /* harmony default export */ __webpack_exports__["a"] = (MDCFoundation);
  164. /***/ }),
  165. /* 1 */
  166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  167. "use strict";
  168. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  169. 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; }; }();
  170. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  171. /**
  172. * @license
  173. * Copyright 2016 Google Inc.
  174. *
  175. * Licensed under the Apache License, Version 2.0 (the "License");
  176. * you may not use this file except in compliance with the License.
  177. * You may obtain a copy of the License at
  178. *
  179. * http://www.apache.org/licenses/LICENSE-2.0
  180. *
  181. * Unless required by applicable law or agreed to in writing, software
  182. * distributed under the License is distributed on an "AS IS" BASIS,
  183. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  184. * See the License for the specific language governing permissions and
  185. * limitations under the License.
  186. */
  187. /**
  188. * @template F
  189. */
  190. var MDCComponent = function () {
  191. _createClass(MDCComponent, null, [{
  192. key: 'attachTo',
  193. /**
  194. * @param {!Element} root
  195. * @return {!MDCComponent}
  196. */
  197. value: function attachTo(root) {
  198. // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
  199. // returns an instantiated component with its root set to that element. Also note that in the cases of
  200. // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
  201. // from getDefaultFoundation().
  202. return new MDCComponent(root, new __WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]());
  203. }
  204. /**
  205. * @param {!Element} root
  206. * @param {F=} foundation
  207. * @param {...?} args
  208. */
  209. }]);
  210. function MDCComponent(root) {
  211. var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  212. _classCallCheck(this, MDCComponent);
  213. /** @protected {!Element} */
  214. this.root_ = root;
  215. for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  216. args[_key - 2] = arguments[_key];
  217. }
  218. this.initialize.apply(this, args);
  219. // Note that we initialize foundation here and not within the constructor's default param so that
  220. // this.root_ is defined and can be used within the foundation class.
  221. /** @protected {!F} */
  222. this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
  223. this.foundation_.init();
  224. this.initialSyncWithDOM();
  225. }
  226. _createClass(MDCComponent, [{
  227. key: 'initialize',
  228. value: function initialize() /* ...args */{}
  229. // Subclasses can override this to do any additional setup work that would be considered part of a
  230. // "constructor". Essentially, it is a hook into the parent constructor before the foundation is
  231. // initialized. Any additional arguments besides root and foundation will be passed in here.
  232. /**
  233. * @return {!F} foundation
  234. */
  235. }, {
  236. key: 'getDefaultFoundation',
  237. value: function getDefaultFoundation() {
  238. // Subclasses must override this method to return a properly configured foundation class for the
  239. // component.
  240. throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
  241. }
  242. }, {
  243. key: 'initialSyncWithDOM',
  244. value: function initialSyncWithDOM() {
  245. // Subclasses should override this method if they need to perform work to synchronize with a host DOM
  246. // object. An example of this would be a form control wrapper that needs to synchronize its internal state
  247. // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
  248. // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
  249. }
  250. }, {
  251. key: 'destroy',
  252. value: function destroy() {
  253. // Subclasses may implement this method to release any resources / deregister any listeners they have
  254. // attached. An example of this might be deregistering a resize event from the window object.
  255. this.foundation_.destroy();
  256. }
  257. /**
  258. * Wrapper method to add an event listener to the component's root element. This is most useful when
  259. * listening for custom events.
  260. * @param {string} evtType
  261. * @param {!Function} handler
  262. */
  263. }, {
  264. key: 'listen',
  265. value: function listen(evtType, handler) {
  266. this.root_.addEventListener(evtType, handler);
  267. }
  268. /**
  269. * Wrapper method to remove an event listener to the component's root element. This is most useful when
  270. * unlistening for custom events.
  271. * @param {string} evtType
  272. * @param {!Function} handler
  273. */
  274. }, {
  275. key: 'unlisten',
  276. value: function unlisten(evtType, handler) {
  277. this.root_.removeEventListener(evtType, handler);
  278. }
  279. /**
  280. * Fires a cross-browser-compatible custom event from the component root of the given type,
  281. * with the given data.
  282. * @param {string} evtType
  283. * @param {!Object} evtData
  284. * @param {boolean=} shouldBubble
  285. */
  286. }, {
  287. key: 'emit',
  288. value: function emit(evtType, evtData) {
  289. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  290. var evt = void 0;
  291. if (typeof CustomEvent === 'function') {
  292. evt = new CustomEvent(evtType, {
  293. detail: evtData,
  294. bubbles: shouldBubble
  295. });
  296. } else {
  297. evt = document.createEvent('CustomEvent');
  298. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  299. }
  300. this.root_.dispatchEvent(evt);
  301. }
  302. }]);
  303. return MDCComponent;
  304. }();
  305. /* harmony default export */ __webpack_exports__["a"] = (MDCComponent);
  306. /***/ }),
  307. /* 2 */
  308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  309. "use strict";
  310. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  311. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  312. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(1);
  313. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; });
  314. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; });
  315. /**
  316. * @license
  317. * Copyright 2016 Google Inc.
  318. *
  319. * Licensed under the Apache License, Version 2.0 (the "License");
  320. * you may not use this file except in compliance with the License.
  321. * You may obtain a copy of the License at
  322. *
  323. * http://www.apache.org/licenses/LICENSE-2.0
  324. *
  325. * Unless required by applicable law or agreed to in writing, software
  326. * distributed under the License is distributed on an "AS IS" BASIS,
  327. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  328. * See the License for the specific language governing permissions and
  329. * limitations under the License.
  330. */
  331. /***/ }),
  332. /* 3 */
  333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  334. "use strict";
  335. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  336. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRipple", function() { return MDCRipple; });
  337. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RippleCapableSurface", function() { return RippleCapableSurface; });
  338. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(23);
  340. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(51);
  341. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  342. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  343. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  344. 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; }; }();
  345. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  346. 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; }
  347. 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; }
  348. /**
  349. * @license
  350. * Copyright 2016 Google Inc. All Rights Reserved.
  351. *
  352. * Licensed under the Apache License, Version 2.0 (the "License");
  353. * you may not use this file except in compliance with the License.
  354. * You may obtain a copy of the License at
  355. *
  356. * http://www.apache.org/licenses/LICENSE-2.0
  357. *
  358. * Unless required by applicable law or agreed to in writing, software
  359. * distributed under the License is distributed on an "AS IS" BASIS,
  360. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  361. * See the License for the specific language governing permissions and
  362. * limitations under the License.
  363. */
  364. /**
  365. * @extends MDCComponent<!MDCRippleFoundation>
  366. */
  367. var MDCRipple = function (_MDCComponent) {
  368. _inherits(MDCRipple, _MDCComponent);
  369. /** @param {...?} args */
  370. function MDCRipple() {
  371. var _ref;
  372. _classCallCheck(this, MDCRipple);
  373. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  374. args[_key] = arguments[_key];
  375. }
  376. /** @type {boolean} */
  377. var _this = _possibleConstructorReturn(this, (_ref = MDCRipple.__proto__ || Object.getPrototypeOf(MDCRipple)).call.apply(_ref, [this].concat(args)));
  378. _this.disabled = false;
  379. /** @private {boolean} */
  380. _this.unbounded_;
  381. return _this;
  382. }
  383. /**
  384. * @param {!Element} root
  385. * @param {{isUnbounded: (boolean|undefined)}=} options
  386. * @return {!MDCRipple}
  387. */
  388. _createClass(MDCRipple, [{
  389. key: 'setUnbounded_',
  390. /**
  391. * Closure Compiler throws an access control error when directly accessing a
  392. * protected or private property inside a getter/setter, like unbounded above.
  393. * By accessing the protected property inside a method, we solve that problem.
  394. * That's why this function exists.
  395. * @private
  396. */
  397. value: function setUnbounded_() {
  398. this.foundation_.setUnbounded(this.unbounded_);
  399. }
  400. }, {
  401. key: 'activate',
  402. value: function activate() {
  403. this.foundation_.activate();
  404. }
  405. }, {
  406. key: 'deactivate',
  407. value: function deactivate() {
  408. this.foundation_.deactivate();
  409. }
  410. }, {
  411. key: 'layout',
  412. value: function layout() {
  413. this.foundation_.layout();
  414. }
  415. /**
  416. * @return {!MDCRippleFoundation}
  417. * @override
  418. */
  419. }, {
  420. key: 'getDefaultFoundation',
  421. value: function getDefaultFoundation() {
  422. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](MDCRipple.createAdapter(this));
  423. }
  424. /** @override */
  425. }, {
  426. key: 'initialSyncWithDOM',
  427. value: function initialSyncWithDOM() {
  428. this.unbounded = 'mdcRippleIsUnbounded' in this.root_.dataset;
  429. }
  430. }, {
  431. key: 'unbounded',
  432. /** @return {boolean} */
  433. get: function get() {
  434. return this.unbounded_;
  435. }
  436. /** @param {boolean} unbounded */
  437. ,
  438. set: function set(unbounded) {
  439. this.unbounded_ = Boolean(unbounded);
  440. this.setUnbounded_();
  441. }
  442. }], [{
  443. key: 'attachTo',
  444. value: function attachTo(root) {
  445. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  446. _ref2$isUnbounded = _ref2.isUnbounded,
  447. isUnbounded = _ref2$isUnbounded === undefined ? undefined : _ref2$isUnbounded;
  448. var ripple = new MDCRipple(root);
  449. // Only override unbounded behavior if option is explicitly specified
  450. if (isUnbounded !== undefined) {
  451. ripple.unbounded = /** @type {boolean} */isUnbounded;
  452. }
  453. return ripple;
  454. }
  455. /**
  456. * @param {!RippleCapableSurface} instance
  457. * @return {!MDCRippleAdapter}
  458. */
  459. }, {
  460. key: 'createAdapter',
  461. value: function createAdapter(instance) {
  462. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  463. return {
  464. browserSupportsCssVars: function browserSupportsCssVars() {
  465. return __WEBPACK_IMPORTED_MODULE_3__util__["supportsCssVariables"](window);
  466. },
  467. isUnbounded: function isUnbounded() {
  468. return instance.unbounded;
  469. },
  470. isSurfaceActive: function isSurfaceActive() {
  471. return instance.root_[MATCHES](':active');
  472. },
  473. isSurfaceDisabled: function isSurfaceDisabled() {
  474. return instance.disabled;
  475. },
  476. addClass: function addClass(className) {
  477. return instance.root_.classList.add(className);
  478. },
  479. removeClass: function removeClass(className) {
  480. return instance.root_.classList.remove(className);
  481. },
  482. containsEventTarget: function containsEventTarget(target) {
  483. return instance.root_.contains(target);
  484. },
  485. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  486. return instance.root_.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  487. },
  488. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  489. return instance.root_.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  490. },
  491. registerDocumentInteractionHandler: function registerDocumentInteractionHandler(evtType, handler) {
  492. return document.documentElement.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  493. },
  494. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler(evtType, handler) {
  495. return document.documentElement.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  496. },
  497. registerResizeHandler: function registerResizeHandler(handler) {
  498. return window.addEventListener('resize', handler);
  499. },
  500. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  501. return window.removeEventListener('resize', handler);
  502. },
  503. updateCssVariable: function updateCssVariable(varName, value) {
  504. return instance.root_.style.setProperty(varName, value);
  505. },
  506. computeBoundingRect: function computeBoundingRect() {
  507. return instance.root_.getBoundingClientRect();
  508. },
  509. getWindowPageOffset: function getWindowPageOffset() {
  510. return { x: window.pageXOffset, y: window.pageYOffset };
  511. }
  512. };
  513. }
  514. }]);
  515. return MDCRipple;
  516. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  517. /**
  518. * See Material Design spec for more details on when to use ripples.
  519. * https://material.io/guidelines/motion/choreography.html#choreography-creation
  520. * @record
  521. */
  522. var RippleCapableSurface = function RippleCapableSurface() {
  523. _classCallCheck(this, RippleCapableSurface);
  524. };
  525. /** @protected {!Element} */
  526. RippleCapableSurface.prototype.root_;
  527. /**
  528. * Whether or not the ripple bleeds out of the bounds of the element.
  529. * @type {boolean|undefined}
  530. */
  531. RippleCapableSurface.prototype.unbounded;
  532. /**
  533. * Whether or not the ripple is attached to a disabled component.
  534. * @type {boolean|undefined}
  535. */
  536. RippleCapableSurface.prototype.disabled;
  537. /***/ }),
  538. /* 4 */
  539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  540. "use strict";
  541. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControlState", function() { return MDCSelectionControlState; });
  543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControl", function() { return MDCSelectionControl; });
  544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_ripple_index__ = __webpack_require__(3);
  545. 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; }; }();
  546. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  547. /**
  548. * @license
  549. * Copyright 2017 Google Inc. All Rights Reserved.
  550. *
  551. * Licensed under the Apache License, Version 2.0 (the "License");
  552. * you may not use this file except in compliance with the License.
  553. * You may obtain a copy of the License at
  554. *
  555. * http://www.apache.org/licenses/LICENSE-2.0
  556. *
  557. * Unless required by applicable law or agreed to in writing, software
  558. * distributed under the License is distributed on an "AS IS" BASIS,
  559. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  560. * See the License for the specific language governing permissions and
  561. * limitations under the License.
  562. */
  563. /* eslint-disable no-unused-vars */
  564. /* eslint-enable no-unused-vars */
  565. /**
  566. * @typedef {{
  567. * checked: boolean,
  568. * indeterminate: boolean,
  569. * disabled: boolean,
  570. * value: ?string
  571. * }}
  572. */
  573. var MDCSelectionControlState = void 0;
  574. /**
  575. * @record
  576. */
  577. var MDCSelectionControl = function () {
  578. function MDCSelectionControl() {
  579. _classCallCheck(this, MDCSelectionControl);
  580. }
  581. _createClass(MDCSelectionControl, [{
  582. key: 'ripple',
  583. /** @return {?MDCRipple} */
  584. get: function get() {}
  585. }]);
  586. return MDCSelectionControl;
  587. }();
  588. /***/ }),
  589. /* 5 */
  590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  591. "use strict";
  592. /* unused harmony export MDCTabScrollerAnimation */
  593. /* unused harmony export MDCTabScrollerHorizontalEdges */
  594. /* unused harmony export MDCTabScrollerAdapter */
  595. 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; }; }();
  596. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  597. /**
  598. * @license
  599. * Copyright 2018 Google Inc. All Rights Reserved.
  600. *
  601. * Licensed under the Apache License, Version 2.0 (the "License");
  602. * you may not use this file except in compliance with the License.
  603. * You may obtain a copy of the License at
  604. *
  605. * http://www.apache.org/licenses/LICENSE-2.0
  606. *
  607. * Unless required by applicable law or agreed to in writing, software
  608. * distributed under the License is distributed on an "AS IS" BASIS,
  609. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  610. * See the License for the specific language governing permissions and
  611. * limitations under the License.
  612. */
  613. /* eslint no-unused-vars: [2, {"args": "none"}] */
  614. /**
  615. * MDCTabScrollerAnimation contains the values required for animating from the
  616. * current scroll position to the new scroll position. The "finalScrollPosition"
  617. * value represents the new scroll position while the "scrollDelta" value is the
  618. * corresponding transformation that is applied to the scroll content. Together,
  619. * they create the animation by first updating the scroll value then applying
  620. * the transformation and animating the transition. Both pieces are necessary
  621. * for the scroll animation to work. The values are used as-is by the tab
  622. * scroller animation method, ensuring that all logic for determining scroll
  623. * position or transformation is abstracted away from the animation method.
  624. * @typedef {{finalScrollPosition: number, scrollDelta: number}}
  625. */
  626. var MDCTabScrollerAnimation = void 0;
  627. /**
  628. * MDCTabScrollerHorizontalEdges represents the left and right edges of the
  629. * scroll content. These values vary depending on how scrolling in RTL is
  630. * implemented by the browser. One value is always 0 and one value is always
  631. * the max scrollable value as either a positive or negative integer.
  632. * @typedef {{left: number, right: number}}
  633. */
  634. var MDCTabScrollerHorizontalEdges = void 0;
  635. /**
  636. * Adapter for MDC Tab Scroller.
  637. *
  638. * Defines the shape of the adapter expected by the foundation. Implement this
  639. * adapter to integrate the Tab into your framework. See
  640. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  641. * for more information.
  642. *
  643. * @record
  644. */
  645. var MDCTabScrollerAdapter = function () {
  646. function MDCTabScrollerAdapter() {
  647. _classCallCheck(this, MDCTabScrollerAdapter);
  648. }
  649. _createClass(MDCTabScrollerAdapter, [{
  650. key: "addClass",
  651. /**
  652. * Adds the given className to the root element.
  653. * @param {string} className The className to add
  654. */
  655. value: function addClass(className) {}
  656. /**
  657. * Removes the given className from the root element.
  658. * @param {string} className The className to remove
  659. */
  660. }, {
  661. key: "removeClass",
  662. value: function removeClass(className) {}
  663. /**
  664. * Adds the given className to the scroll area element.
  665. * @param {string} className The className to add
  666. */
  667. }, {
  668. key: "addScrollAreaClass",
  669. value: function addScrollAreaClass(className) {}
  670. /**
  671. * Returns whether the event target matches given className.
  672. * @param {EventTarget} evtTarget The event target
  673. * @param {string} selector The selector to check
  674. * @return {boolean}
  675. */
  676. }, {
  677. key: "eventTargetMatchesSelector",
  678. value: function eventTargetMatchesSelector(evtTarget, selector) {}
  679. /**
  680. * Sets a style property of the area element to the passed value.
  681. * @param {string} propName The style property name to set
  682. * @param {string} value The style property value
  683. */
  684. }, {
  685. key: "setScrollAreaStyleProperty",
  686. value: function setScrollAreaStyleProperty(propName, value) {}
  687. /**
  688. * Sets a style property of the content element to the passed value.
  689. * @param {string} propName The style property name to set
  690. * @param {string} value The style property value
  691. */
  692. }, {
  693. key: "setScrollContentStyleProperty",
  694. value: function setScrollContentStyleProperty(propName, value) {}
  695. /**
  696. * Returns the scroll content element's computed style value of the given css property `propertyName`.
  697. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  698. * @param {string} propertyName
  699. * @return {string}
  700. */
  701. }, {
  702. key: "getScrollContentStyleValue",
  703. value: function getScrollContentStyleValue(propertyName) {}
  704. /**
  705. * Sets the scrollLeft value of the scroll area element to the passed value.
  706. * @param {number} scrollLeft The new scrollLeft value
  707. */
  708. }, {
  709. key: "setScrollAreaScrollLeft",
  710. value: function setScrollAreaScrollLeft(scrollLeft) {}
  711. /**
  712. * Returns the scrollLeft value of the scroll area element.
  713. * @return {number}
  714. */
  715. }, {
  716. key: "getScrollAreaScrollLeft",
  717. value: function getScrollAreaScrollLeft() {}
  718. /**
  719. * Returns the offsetWidth of the scroll content element.
  720. * @return {number}
  721. */
  722. }, {
  723. key: "getScrollContentOffsetWidth",
  724. value: function getScrollContentOffsetWidth() {}
  725. /**
  726. * Returns the offsetWitdth of the scroll area element.
  727. * @return {number}
  728. */
  729. }, {
  730. key: "getScrollAreaOffsetWidth",
  731. value: function getScrollAreaOffsetWidth() {}
  732. /**
  733. * Returns the bounding client rect of the scroll area element.
  734. * @return {!ClientRect}
  735. */
  736. }, {
  737. key: "computeScrollAreaClientRect",
  738. value: function computeScrollAreaClientRect() {}
  739. /**
  740. * Returns the bounding client rect of the scroll content element.
  741. * @return {!ClientRect}
  742. */
  743. }, {
  744. key: "computeScrollContentClientRect",
  745. value: function computeScrollContentClientRect() {}
  746. /**
  747. * Returns the height of the browser's horizontal scrollbars (in px).
  748. * @return {number}
  749. */
  750. }, {
  751. key: "computeHorizontalScrollbarHeight",
  752. value: function computeHorizontalScrollbarHeight() {}
  753. }]);
  754. return MDCTabScrollerAdapter;
  755. }();
  756. /***/ }),
  757. /* 6 */
  758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  759. "use strict";
  760. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsCssVariables", function() { return supportsCssVariables; });
  762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyPassive", function() { return applyPassive; });
  763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  764. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNormalizedEventCoords", function() { return getNormalizedEventCoords; });
  765. /**
  766. * @license
  767. * Copyright 2016 Google Inc. All Rights Reserved.
  768. *
  769. * Licensed under the Apache License, Version 2.0 (the "License");
  770. * you may not use this file except in compliance with the License.
  771. * You may obtain a copy of the License at
  772. *
  773. * http://www.apache.org/licenses/LICENSE-2.0
  774. *
  775. * Unless required by applicable law or agreed to in writing, software
  776. * distributed under the License is distributed on an "AS IS" BASIS,
  777. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  778. * See the License for the specific language governing permissions and
  779. * limitations under the License.
  780. */
  781. /**
  782. * Stores result from supportsCssVariables to avoid redundant processing to detect CSS custom variable support.
  783. * @private {boolean|undefined}
  784. */
  785. var supportsCssVariables_ = void 0;
  786. /**
  787. * Stores result from applyPassive to avoid redundant processing to detect passive event listener support.
  788. * @private {boolean|undefined}
  789. */
  790. var supportsPassive_ = void 0;
  791. /**
  792. * @param {!Window} windowObj
  793. * @return {boolean}
  794. */
  795. function detectEdgePseudoVarBug(windowObj) {
  796. // Detect versions of Edge with buggy var() support
  797. // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/
  798. var document = windowObj.document;
  799. var node = document.createElement('div');
  800. node.className = 'mdc-ripple-surface--test-edge-var-bug';
  801. document.body.appendChild(node);
  802. // The bug exists if ::before style ends up propagating to the parent element.
  803. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox,
  804. // but Firefox is known to support CSS custom properties correctly.
  805. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
  806. var computedStyle = windowObj.getComputedStyle(node);
  807. var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid';
  808. node.remove();
  809. return hasPseudoVarBug;
  810. }
  811. /**
  812. * @param {!Window} windowObj
  813. * @param {boolean=} forceRefresh
  814. * @return {boolean|undefined}
  815. */
  816. function supportsCssVariables(windowObj) {
  817. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  818. var supportsCssVariables = supportsCssVariables_;
  819. if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
  820. return supportsCssVariables;
  821. }
  822. var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';
  823. if (!supportsFunctionPresent) {
  824. return;
  825. }
  826. var explicitlySupportsCssVars = windowObj.CSS.supports('--css-vars', 'yes');
  827. // See: https://bugs.webkit.org/show_bug.cgi?id=154669
  828. // See: README section on Safari
  829. var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');
  830. if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
  831. supportsCssVariables = !detectEdgePseudoVarBug(windowObj);
  832. } else {
  833. supportsCssVariables = false;
  834. }
  835. if (!forceRefresh) {
  836. supportsCssVariables_ = supportsCssVariables;
  837. }
  838. return supportsCssVariables;
  839. }
  840. //
  841. /**
  842. * Determine whether the current browser supports passive event listeners, and if so, use them.
  843. * @param {!Window=} globalObj
  844. * @param {boolean=} forceRefresh
  845. * @return {boolean|{passive: boolean}}
  846. */
  847. function applyPassive() {
  848. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  849. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  850. if (supportsPassive_ === undefined || forceRefresh) {
  851. var isSupported = false;
  852. try {
  853. globalObj.document.addEventListener('test', null, { get passive() {
  854. isSupported = true;
  855. } });
  856. } catch (e) {}
  857. supportsPassive_ = isSupported;
  858. }
  859. return supportsPassive_ ? { passive: true } : false;
  860. }
  861. /**
  862. * @param {!Object} HTMLElementPrototype
  863. * @return {!Array<string>}
  864. */
  865. function getMatchesProperty(HTMLElementPrototype) {
  866. return ['webkitMatchesSelector', 'msMatchesSelector', 'matches'].filter(function (p) {
  867. return p in HTMLElementPrototype;
  868. }).pop();
  869. }
  870. /**
  871. * @param {!Event} ev
  872. * @param {{x: number, y: number}} pageOffset
  873. * @param {!ClientRect} clientRect
  874. * @return {{x: number, y: number}}
  875. */
  876. function getNormalizedEventCoords(ev, pageOffset, clientRect) {
  877. var x = pageOffset.x,
  878. y = pageOffset.y;
  879. var documentX = x + clientRect.left;
  880. var documentY = y + clientRect.top;
  881. var normalizedX = void 0;
  882. var normalizedY = void 0;
  883. // Determine touch point relative to the ripple container.
  884. if (ev.type === 'touchstart') {
  885. normalizedX = ev.changedTouches[0].pageX - documentX;
  886. normalizedY = ev.changedTouches[0].pageY - documentY;
  887. } else {
  888. normalizedX = ev.pageX - documentX;
  889. normalizedY = ev.pageY - documentY;
  890. }
  891. return { x: normalizedX, y: normalizedY };
  892. }
  893. /***/ }),
  894. /* 7 */
  895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  896. "use strict";
  897. 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; }; }();
  898. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  899. /**
  900. * @license
  901. * Copyright 2018 Google Inc. All Rights Reserved.
  902. *
  903. * Licensed under the Apache License, Version 2.0 (the "License");
  904. * you may not use this file except in compliance with the License.
  905. * You may obtain a copy of the License at
  906. *
  907. * http://www.apache.org/licenses/LICENSE-2.0
  908. *
  909. * Unless required by applicable law or agreed to in writing, software
  910. * distributed under the License is distributed on an "AS IS" BASIS,
  911. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  912. * See the License for the specific language governing permissions and
  913. * limitations under the License.
  914. */
  915. /* eslint no-unused-vars: [2, {"args": "none"}] */
  916. /**
  917. * Adapter for MDC Top App Bar
  918. *
  919. * Defines the shape of the adapter expected by the foundation. Implement this
  920. * adapter to integrate the Top App Bar into your framework. See
  921. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  922. * for more information.
  923. *
  924. * @record
  925. */
  926. var MDCTopAppBarAdapter = function () {
  927. function MDCTopAppBarAdapter() {
  928. _classCallCheck(this, MDCTopAppBarAdapter);
  929. }
  930. _createClass(MDCTopAppBarAdapter, [{
  931. key: "addClass",
  932. /**
  933. * Adds a class to the root Element.
  934. * @param {string} className
  935. */
  936. value: function addClass(className) {}
  937. /**
  938. * Removes a class from the root Element.
  939. * @param {string} className
  940. */
  941. }, {
  942. key: "removeClass",
  943. value: function removeClass(className) {}
  944. /**
  945. * Returns true if the root Element contains the given class.
  946. * @param {string} className
  947. * @return {boolean}
  948. */
  949. }, {
  950. key: "hasClass",
  951. value: function hasClass(className) {}
  952. /**
  953. * Sets the specified inline style property on the root Element to the given value.
  954. * @param {string} property
  955. * @param {string} value
  956. */
  957. }, {
  958. key: "setStyle",
  959. value: function setStyle(property, value) {}
  960. /**
  961. * Gets the height of the top app bar.
  962. * @return {number}
  963. */
  964. }, {
  965. key: "getTopAppBarHeight",
  966. value: function getTopAppBarHeight() {}
  967. /**
  968. * Registers an event handler on the navigation icon element for a given event.
  969. * @param {string} type
  970. * @param {function(!Event): undefined} handler
  971. */
  972. }, {
  973. key: "registerNavigationIconInteractionHandler",
  974. value: function registerNavigationIconInteractionHandler(type, handler) {}
  975. /**
  976. * Deregisters an event handler on the navigation icon element for a given event.
  977. * @param {string} type
  978. * @param {function(!Event): undefined} handler
  979. */
  980. }, {
  981. key: "deregisterNavigationIconInteractionHandler",
  982. value: function deregisterNavigationIconInteractionHandler(type, handler) {}
  983. /**
  984. * Emits an event when the navigation icon is clicked.
  985. */
  986. }, {
  987. key: "notifyNavigationIconClicked",
  988. value: function notifyNavigationIconClicked() {}
  989. /** @param {function(!Event)} handler */
  990. }, {
  991. key: "registerScrollHandler",
  992. value: function registerScrollHandler(handler) {}
  993. /** @param {function(!Event)} handler */
  994. }, {
  995. key: "deregisterScrollHandler",
  996. value: function deregisterScrollHandler(handler) {}
  997. /** @param {function(!Event)} handler */
  998. }, {
  999. key: "registerResizeHandler",
  1000. value: function registerResizeHandler(handler) {}
  1001. /** @param {function(!Event)} handler */
  1002. }, {
  1003. key: "deregisterResizeHandler",
  1004. value: function deregisterResizeHandler(handler) {}
  1005. /** @return {number} */
  1006. }, {
  1007. key: "getViewportScrollY",
  1008. value: function getViewportScrollY() {}
  1009. /** @return {number} */
  1010. }, {
  1011. key: "getTotalActionItems",
  1012. value: function getTotalActionItems() {}
  1013. }]);
  1014. return MDCTopAppBarAdapter;
  1015. }();
  1016. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTopAppBarAdapter);
  1017. /***/ }),
  1018. /* 8 */
  1019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1020. "use strict";
  1021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  1022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  1024. /**
  1025. * @license
  1026. * Copyright 2018 Google Inc. All Rights Reserved.
  1027. *
  1028. * Licensed under the Apache License, Version 2.0 (the "License");
  1029. * you may not use this file except in compliance with the License.
  1030. * You may obtain a copy of the License at
  1031. *
  1032. * http://www.apache.org/licenses/LICENSE-2.0
  1033. *
  1034. * Unless required by applicable law or agreed to in writing, software
  1035. * distributed under the License is distributed on an "AS IS" BASIS,
  1036. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1037. * See the License for the specific language governing permissions and
  1038. * limitations under the License.
  1039. */
  1040. /** @enum {string} */
  1041. var cssClasses = {
  1042. FIXED_CLASS: 'mdc-top-app-bar--fixed',
  1043. FIXED_SCROLLED_CLASS: 'mdc-top-app-bar--fixed-scrolled',
  1044. SHORT_CLASS: 'mdc-top-app-bar--short',
  1045. SHORT_HAS_ACTION_ITEM_CLASS: 'mdc-top-app-bar--short-has-action-item',
  1046. SHORT_COLLAPSED_CLASS: 'mdc-top-app-bar--short-collapsed'
  1047. };
  1048. /** @enum {number} */
  1049. var numbers = {
  1050. DEBOUNCE_THROTTLE_RESIZE_TIME_MS: 100,
  1051. MAX_TOP_APP_BAR_HEIGHT: 128
  1052. };
  1053. /** @enum {string} */
  1054. var strings = {
  1055. ACTION_ITEM_SELECTOR: '.mdc-top-app-bar__action-item',
  1056. NAVIGATION_EVENT: 'MDCTopAppBar:nav',
  1057. NAVIGATION_ICON_SELECTOR: '.mdc-top-app-bar__navigation-icon',
  1058. ROOT_SELECTOR: '.mdc-top-app-bar',
  1059. TITLE_SELECTOR: '.mdc-top-app-bar__title'
  1060. };
  1061. /***/ }),
  1062. /* 9 */
  1063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1064. "use strict";
  1065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transformStyleProperties; });
  1066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCorrectEventName; });
  1067. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCorrectPropertyName; });
  1068. /**
  1069. * @license
  1070. * Copyright 2016 Google Inc. All Rights Reserved.
  1071. *
  1072. * Licensed under the Apache License, Version 2.0 (the "License");
  1073. * you may not use this file except in compliance with the License.
  1074. * You may obtain a copy of the License at
  1075. *
  1076. * http://www.apache.org/licenses/LICENSE-2.0
  1077. *
  1078. * Unless required by applicable law or agreed to in writing, software
  1079. * distributed under the License is distributed on an "AS IS" BASIS,
  1080. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1081. * See the License for the specific language governing permissions and
  1082. * limitations under the License.
  1083. */
  1084. /**
  1085. * @typedef {{
  1086. * noPrefix: string,
  1087. * webkitPrefix: string,
  1088. * styleProperty: string
  1089. * }}
  1090. */
  1091. var VendorPropertyMapType = void 0;
  1092. /** @const {Object<string, !VendorPropertyMapType>} */
  1093. var eventTypeMap = {
  1094. 'animationstart': {
  1095. noPrefix: 'animationstart',
  1096. webkitPrefix: 'webkitAnimationStart',
  1097. styleProperty: 'animation'
  1098. },
  1099. 'animationend': {
  1100. noPrefix: 'animationend',
  1101. webkitPrefix: 'webkitAnimationEnd',
  1102. styleProperty: 'animation'
  1103. },
  1104. 'animationiteration': {
  1105. noPrefix: 'animationiteration',
  1106. webkitPrefix: 'webkitAnimationIteration',
  1107. styleProperty: 'animation'
  1108. },
  1109. 'transitionend': {
  1110. noPrefix: 'transitionend',
  1111. webkitPrefix: 'webkitTransitionEnd',
  1112. styleProperty: 'transition'
  1113. }
  1114. };
  1115. /** @const {Object<string, !VendorPropertyMapType>} */
  1116. var cssPropertyMap = {
  1117. 'animation': {
  1118. noPrefix: 'animation',
  1119. webkitPrefix: '-webkit-animation'
  1120. },
  1121. 'transform': {
  1122. noPrefix: 'transform',
  1123. webkitPrefix: '-webkit-transform'
  1124. },
  1125. 'transition': {
  1126. noPrefix: 'transition',
  1127. webkitPrefix: '-webkit-transition'
  1128. }
  1129. };
  1130. /**
  1131. * @param {!Object} windowObj
  1132. * @return {boolean}
  1133. */
  1134. function hasProperShape(windowObj) {
  1135. return windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function';
  1136. }
  1137. /**
  1138. * @param {string} eventType
  1139. * @return {boolean}
  1140. */
  1141. function eventFoundInMaps(eventType) {
  1142. return eventType in eventTypeMap || eventType in cssPropertyMap;
  1143. }
  1144. /**
  1145. * @param {string} eventType
  1146. * @param {!Object<string, !VendorPropertyMapType>} map
  1147. * @param {!Element} el
  1148. * @return {string}
  1149. */
  1150. function getJavaScriptEventName(eventType, map, el) {
  1151. return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1152. }
  1153. /**
  1154. * Helper function to determine browser prefix for CSS3 animation events
  1155. * and property names.
  1156. * @param {!Object} windowObj
  1157. * @param {string} eventType
  1158. * @return {string}
  1159. */
  1160. function getAnimationName(windowObj, eventType) {
  1161. if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) {
  1162. return eventType;
  1163. }
  1164. var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap;
  1165. var el = windowObj['document']['createElement']('div');
  1166. var eventName = '';
  1167. if (map === eventTypeMap) {
  1168. eventName = getJavaScriptEventName(eventType, map, el);
  1169. } else {
  1170. eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  1171. }
  1172. return eventName;
  1173. }
  1174. // Public functions to access getAnimationName() for JavaScript events or CSS
  1175. // property names.
  1176. var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
  1177. /**
  1178. * @param {!Object} windowObj
  1179. * @param {string} eventType
  1180. * @return {string}
  1181. */
  1182. function getCorrectEventName(windowObj, eventType) {
  1183. return getAnimationName(windowObj, eventType);
  1184. }
  1185. /**
  1186. * @param {!Object} windowObj
  1187. * @param {string} eventType
  1188. * @return {string}
  1189. */
  1190. function getCorrectPropertyName(windowObj, eventType) {
  1191. return getAnimationName(windowObj, eventType);
  1192. }
  1193. /***/ }),
  1194. /* 10 */
  1195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1196. "use strict";
  1197. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(69);
  1198. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__constants__["a"]; });
  1199. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(70);
  1200. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  1201. /**
  1202. * Copyright 2016 Google Inc. All Rights Reserved.
  1203. *
  1204. * Licensed under the Apache License, Version 2.0 (the "License");
  1205. * you may not use this file except in compliance with the License.
  1206. * You may obtain a copy of the License at
  1207. *
  1208. * http://www.apache.org/licenses/LICENSE-2.0
  1209. *
  1210. * Unless required by applicable law or agreed to in writing, software
  1211. * distributed under the License is distributed on an "AS IS" BASIS,
  1212. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1213. * See the License for the specific language governing permissions and
  1214. * limitations under the License.
  1215. */
  1216. /***/ }),
  1217. /* 11 */
  1218. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1219. "use strict";
  1220. /* unused harmony export MDCTabDimensions */
  1221. /* unused harmony export MDCTabAdapter */
  1222. 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; }; }();
  1223. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1224. /**
  1225. * @license
  1226. * Copyright 2018 Google Inc. All Rights Reserved.
  1227. *
  1228. * Licensed under the Apache License, Version 2.0 (the "License");
  1229. * you may not use this file except in compliance with the License.
  1230. * You may obtain a copy of the License at
  1231. *
  1232. * http://www.apache.org/licenses/LICENSE-2.0
  1233. *
  1234. * Unless required by applicable law or agreed to in writing, software
  1235. * distributed under the License is distributed on an "AS IS" BASIS,
  1236. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1237. * See the License for the specific language governing permissions and
  1238. * limitations under the License.
  1239. */
  1240. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1241. /**
  1242. * MDCTabDimensions provides details about the left and right edges of the Tab
  1243. * root element and the Tab content element. These values are used to determine
  1244. * the visual position of the Tab with respect it's parent container.
  1245. * @typedef {{rootLeft: number, rootRight: number, contentLeft: number, contentRight: number}}
  1246. */
  1247. var MDCTabDimensions = void 0;
  1248. /**
  1249. * Adapter for MDC Tab.
  1250. *
  1251. * Defines the shape of the adapter expected by the foundation. Implement this
  1252. * adapter to integrate the Tab into your framework. See
  1253. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1254. * for more information.
  1255. *
  1256. * @record
  1257. */
  1258. var MDCTabAdapter = function () {
  1259. function MDCTabAdapter() {
  1260. _classCallCheck(this, MDCTabAdapter);
  1261. }
  1262. _createClass(MDCTabAdapter, [{
  1263. key: "registerEventHandler",
  1264. /**
  1265. * Registers an event listener on the root element for a given event.
  1266. * @param {string} evtType
  1267. * @param {function(!Event): undefined} handler
  1268. */
  1269. value: function registerEventHandler(evtType, handler) {}
  1270. /**
  1271. * Deregisters an event listener on the root element for a given event.
  1272. * @param {string} evtType
  1273. * @param {function(!Event): undefined} handler
  1274. */
  1275. }, {
  1276. key: "deregisterEventHandler",
  1277. value: function deregisterEventHandler(evtType, handler) {}
  1278. /**
  1279. * Adds the given className to the root element.
  1280. * @param {string} className The className to add
  1281. */
  1282. }, {
  1283. key: "addClass",
  1284. value: function addClass(className) {}
  1285. /**
  1286. * Removes the given className from the root element.
  1287. * @param {string} className The className to remove
  1288. */
  1289. }, {
  1290. key: "removeClass",
  1291. value: function removeClass(className) {}
  1292. /**
  1293. * Returns whether the root element has the given className.
  1294. * @param {string} className The className to remove
  1295. * @return {boolean}
  1296. */
  1297. }, {
  1298. key: "hasClass",
  1299. value: function hasClass(className) {}
  1300. /**
  1301. * Sets the given attrName of the root element to the given value.
  1302. * @param {string} attr The attribute name to set
  1303. * @param {string} value The value so give the attribute
  1304. */
  1305. }, {
  1306. key: "setAttr",
  1307. value: function setAttr(attr, value) {}
  1308. /**
  1309. * Activates the indicator element.
  1310. * @param {!ClientRect=} previousIndicatorClientRect The client rect of the previously activated indicator
  1311. */
  1312. }, {
  1313. key: "activateIndicator",
  1314. value: function activateIndicator(previousIndicatorClientRect) {}
  1315. /** Deactivates the indicator. */
  1316. }, {
  1317. key: "deactivateIndicator",
  1318. value: function deactivateIndicator() {}
  1319. /**
  1320. * Returns the client rect of the indicator.
  1321. * @return {!ClientRect}
  1322. */
  1323. }, {
  1324. key: "computeIndicatorClientRect",
  1325. value: function computeIndicatorClientRect() {}
  1326. /**
  1327. * Emits the MDCTab:interacted event for use by parent components
  1328. */
  1329. }, {
  1330. key: "notifyInteracted",
  1331. value: function notifyInteracted() {}
  1332. /**
  1333. * Returns the offsetLeft value of the root element.
  1334. * @return {number}
  1335. */
  1336. }, {
  1337. key: "getOffsetLeft",
  1338. value: function getOffsetLeft() {}
  1339. /**
  1340. * Returns the offsetWidth value of the root element.
  1341. * @return {number}
  1342. */
  1343. }, {
  1344. key: "getOffsetWidth",
  1345. value: function getOffsetWidth() {}
  1346. /**
  1347. * Returns the offsetLeft of the content element.
  1348. * @return {number}
  1349. */
  1350. }, {
  1351. key: "getContentOffsetLeft",
  1352. value: function getContentOffsetLeft() {}
  1353. /**
  1354. * Returns the offsetWidth of the content element.
  1355. * @return {number}
  1356. */
  1357. }, {
  1358. key: "getContentOffsetWidth",
  1359. value: function getContentOffsetWidth() {}
  1360. /**
  1361. * Applies focus to the root element
  1362. */
  1363. }, {
  1364. key: "focus",
  1365. value: function focus() {}
  1366. }]);
  1367. return MDCTabAdapter;
  1368. }();
  1369. /***/ }),
  1370. /* 12 */
  1371. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1372. "use strict";
  1373. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(5);
  1374. 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; }; }();
  1375. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1376. /**
  1377. * @license
  1378. * Copyright 2018 Google Inc. All Rights Reserved.
  1379. *
  1380. * Licensed under the Apache License, Version 2.0 (the "License")
  1381. * you may not use this file except in compliance with the License.
  1382. * You may obtain a copy of the License at
  1383. *
  1384. * http://www.apache.org/licenses/LICENSE-2.0
  1385. *
  1386. * Unless required by applicable law or agreed to in writing, software
  1387. * distributed under the License is distributed on an "AS IS" BASIS,
  1388. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1389. * See the License for the specific language governing permissions and
  1390. * limitations under the License.
  1391. */
  1392. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1393. /* eslint-disable no-unused-vars */
  1394. /* eslint-enable no-unused-vars */
  1395. /**
  1396. * @abstract
  1397. */
  1398. var MDCTabScrollerRTL = function () {
  1399. /** @param {!MDCTabScrollerAdapter} adapter */
  1400. function MDCTabScrollerRTL(adapter) {
  1401. _classCallCheck(this, MDCTabScrollerRTL);
  1402. /** @private */
  1403. this.adapter_ = adapter;
  1404. }
  1405. /**
  1406. * @param {number} translateX The current translateX position
  1407. * @return {number}
  1408. * @abstract
  1409. */
  1410. _createClass(MDCTabScrollerRTL, [{
  1411. key: 'getScrollPositionRTL',
  1412. value: function getScrollPositionRTL(translateX) {}
  1413. /**
  1414. * @param {number} scrollX
  1415. * @return {!MDCTabScrollerAnimation}
  1416. * @abstract
  1417. */
  1418. }, {
  1419. key: 'scrollToRTL',
  1420. value: function scrollToRTL(scrollX) {}
  1421. /**
  1422. * @param {number} scrollX
  1423. * @return {!MDCTabScrollerAnimation}
  1424. * @abstract
  1425. */
  1426. }, {
  1427. key: 'incrementScrollRTL',
  1428. value: function incrementScrollRTL(scrollX) {}
  1429. /**
  1430. * @param {number} scrollX The current scrollX position
  1431. * @param {number} translateX The current translateX position
  1432. * @return {number}
  1433. * @abstract
  1434. */
  1435. }, {
  1436. key: 'getAnimatingScrollPosition',
  1437. value: function getAnimatingScrollPosition(scrollX, translateX) {}
  1438. }]);
  1439. return MDCTabScrollerRTL;
  1440. }();
  1441. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTL);
  1442. /***/ }),
  1443. /* 13 */
  1444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1445. "use strict";
  1446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  1447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  1448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(0);
  1449. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  1450. 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; }; }();
  1451. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1452. 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; }
  1453. 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; }
  1454. /**
  1455. * @license
  1456. * Copyright 2018 Google Inc. All Rights Reserved.
  1457. *
  1458. * Licensed under the Apache License, Version 2.0 (the "License");
  1459. * you may not use this file except in compliance with the License.
  1460. * You may obtain a copy of the License at
  1461. *
  1462. * http://www.apache.org/licenses/LICENSE-2.0
  1463. *
  1464. * Unless required by applicable law or agreed to in writing, software
  1465. * distributed under the License is distributed on an "AS IS" BASIS,
  1466. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1467. * See the License for the specific language governing permissions and
  1468. * limitations under the License.
  1469. */
  1470. /**
  1471. * @extends {MDCFoundation<!MDCTopAppBarAdapter>}
  1472. */
  1473. var MDCTopAppBarBaseFoundation = function (_MDCFoundation) {
  1474. _inherits(MDCTopAppBarBaseFoundation, _MDCFoundation);
  1475. _createClass(MDCTopAppBarBaseFoundation, null, [{
  1476. key: 'strings',
  1477. /** @return enum {string} */
  1478. get: function get() {
  1479. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  1480. }
  1481. /** @return enum {string} */
  1482. }, {
  1483. key: 'cssClasses',
  1484. get: function get() {
  1485. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  1486. }
  1487. /** @return enum {number} */
  1488. }, {
  1489. key: 'numbers',
  1490. get: function get() {
  1491. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  1492. }
  1493. /**
  1494. * {@see MDCTopAppBarAdapter} for typing information on parameters and return
  1495. * types.
  1496. * @return {!MDCTopAppBarAdapter}
  1497. */
  1498. }, {
  1499. key: 'defaultAdapter',
  1500. get: function get() {
  1501. return (/** @type {!MDCTopAppBarAdapter} */{
  1502. hasClass: function hasClass() /* className: string */{},
  1503. addClass: function addClass() /* className: string */{},
  1504. removeClass: function removeClass() /* className: string */{},
  1505. setStyle: function setStyle() /* property: string, value: string */{},
  1506. getTopAppBarHeight: function getTopAppBarHeight() {},
  1507. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1508. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1509. notifyNavigationIconClicked: function notifyNavigationIconClicked() {},
  1510. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  1511. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  1512. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  1513. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  1514. getViewportScrollY: function getViewportScrollY() {
  1515. return (/* number */0
  1516. );
  1517. },
  1518. getTotalActionItems: function getTotalActionItems() {
  1519. return (/* number */0
  1520. );
  1521. }
  1522. }
  1523. );
  1524. }
  1525. /**
  1526. * @param {!MDCTopAppBarAdapter} adapter
  1527. */
  1528. }]);
  1529. function MDCTopAppBarBaseFoundation( /** @type {!MDCTopAppBarAdapter} */adapter) {
  1530. _classCallCheck(this, MDCTopAppBarBaseFoundation);
  1531. var _this = _possibleConstructorReturn(this, (MDCTopAppBarBaseFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarBaseFoundation)).call(this, _extends(MDCTopAppBarBaseFoundation.defaultAdapter, adapter)));
  1532. _this.navClickHandler_ = function () {
  1533. return _this.adapter_.notifyNavigationIconClicked();
  1534. };
  1535. return _this;
  1536. }
  1537. _createClass(MDCTopAppBarBaseFoundation, [{
  1538. key: 'init',
  1539. value: function init() {
  1540. this.adapter_.registerNavigationIconInteractionHandler('click', this.navClickHandler_);
  1541. }
  1542. }, {
  1543. key: 'destroy',
  1544. value: function destroy() {
  1545. this.adapter_.deregisterNavigationIconInteractionHandler('click', this.navClickHandler_);
  1546. }
  1547. }]);
  1548. return MDCTopAppBarBaseFoundation;
  1549. }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* default */]);
  1550. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarBaseFoundation);
  1551. /***/ }),
  1552. /* 14 */
  1553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1554. "use strict";
  1555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipFoundation; });
  1556. /* unused harmony export MDCChipInteractionEventType */
  1557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  1558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(25);
  1559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(26);
  1560. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  1561. 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; }; }();
  1562. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1563. 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; }
  1564. 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; }
  1565. /**
  1566. * @license
  1567. * Copyright 2016 Google Inc. All Rights Reserved.
  1568. *
  1569. * Licensed under the Apache License, Version 2.0 (the "License");
  1570. * you may not use this file except in compliance with the License.
  1571. * You may obtain a copy of the License at
  1572. *
  1573. * http://www.apache.org/licenses/LICENSE-2.0
  1574. *
  1575. * Unless required by applicable law or agreed to in writing, software
  1576. * distributed under the License is distributed on an "AS IS" BASIS,
  1577. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1578. * See the License for the specific language governing permissions and
  1579. * limitations under the License.
  1580. */
  1581. /**
  1582. * @extends {MDCFoundation<!MDCChipAdapter>}
  1583. * @final
  1584. */
  1585. var MDCChipFoundation = function (_MDCFoundation) {
  1586. _inherits(MDCChipFoundation, _MDCFoundation);
  1587. _createClass(MDCChipFoundation, null, [{
  1588. key: 'strings',
  1589. /** @return enum {string} */
  1590. get: function get() {
  1591. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  1592. }
  1593. /** @return enum {string} */
  1594. }, {
  1595. key: 'cssClasses',
  1596. get: function get() {
  1597. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  1598. }
  1599. /**
  1600. * {@see MDCChipAdapter} for typing information on parameters and return
  1601. * types.
  1602. * @return {!MDCChipAdapter}
  1603. */
  1604. }, {
  1605. key: 'defaultAdapter',
  1606. get: function get() {
  1607. return (/** @type {!MDCChipAdapter} */{
  1608. addClass: function addClass() {},
  1609. removeClass: function removeClass() {},
  1610. hasClass: function hasClass() {},
  1611. addClassToLeadingIcon: function addClassToLeadingIcon() {},
  1612. removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {},
  1613. eventTargetHasClass: function eventTargetHasClass() {},
  1614. notifyInteraction: function notifyInteraction() {},
  1615. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {},
  1616. notifyRemoval: function notifyRemoval() {},
  1617. getComputedStyleValue: function getComputedStyleValue() {},
  1618. setStyleProperty: function setStyleProperty() {}
  1619. }
  1620. );
  1621. }
  1622. /**
  1623. * @param {!MDCChipAdapter} adapter
  1624. */
  1625. }]);
  1626. function MDCChipFoundation(adapter) {
  1627. _classCallCheck(this, MDCChipFoundation);
  1628. /**
  1629. * Whether a trailing icon click should immediately trigger exit/removal of the chip.
  1630. * @private {boolean}
  1631. * */
  1632. var _this = _possibleConstructorReturn(this, (MDCChipFoundation.__proto__ || Object.getPrototypeOf(MDCChipFoundation)).call(this, _extends(MDCChipFoundation.defaultAdapter, adapter)));
  1633. _this.shouldRemoveOnTrailingIconClick_ = true;
  1634. return _this;
  1635. }
  1636. /**
  1637. * @return {boolean}
  1638. */
  1639. _createClass(MDCChipFoundation, [{
  1640. key: 'isSelected',
  1641. value: function isSelected() {
  1642. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  1643. }
  1644. /**
  1645. * @param {boolean} selected
  1646. */
  1647. }, {
  1648. key: 'setSelected',
  1649. value: function setSelected(selected) {
  1650. if (selected) {
  1651. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  1652. } else {
  1653. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  1654. }
  1655. }
  1656. /**
  1657. * @return {boolean}
  1658. */
  1659. }, {
  1660. key: 'getShouldRemoveOnTrailingIconClick',
  1661. value: function getShouldRemoveOnTrailingIconClick() {
  1662. return this.shouldRemoveOnTrailingIconClick_;
  1663. }
  1664. /**
  1665. * @param {boolean} shouldRemove
  1666. */
  1667. }, {
  1668. key: 'setShouldRemoveOnTrailingIconClick',
  1669. value: function setShouldRemoveOnTrailingIconClick(shouldRemove) {
  1670. this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
  1671. }
  1672. /**
  1673. * Begins the exit animation which leads to removal of the chip.
  1674. */
  1675. }, {
  1676. key: 'beginExit',
  1677. value: function beginExit() {
  1678. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT);
  1679. }
  1680. /**
  1681. * Handles an interaction event on the root element.
  1682. * @param {!Event} evt
  1683. */
  1684. }, {
  1685. key: 'handleInteraction',
  1686. value: function handleInteraction(evt) {
  1687. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  1688. this.adapter_.notifyInteraction();
  1689. }
  1690. }
  1691. /**
  1692. * Handles a transition end event on the root element.
  1693. * @param {!Event} evt
  1694. */
  1695. }, {
  1696. key: 'handleTransitionEnd',
  1697. value: function handleTransitionEnd(evt) {
  1698. var _this2 = this;
  1699. // Handle transition end event on the chip when it is about to be removed.
  1700. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT)) {
  1701. if (evt.propertyName === 'width') {
  1702. this.adapter_.notifyRemoval();
  1703. } else if (evt.propertyName === 'opacity') {
  1704. // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5
  1705. var chipWidth = this.adapter_.getComputedStyleValue('width');
  1706. // On the next frame (once we get the computed width), explicitly set the chip's width
  1707. // to its current pixel width, so we aren't transitioning out of 'auto'.
  1708. requestAnimationFrame(function () {
  1709. _this2.adapter_.setStyleProperty('width', chipWidth);
  1710. // To mitigate jitter, start transitioning padding and margin before width.
  1711. _this2.adapter_.setStyleProperty('padding', '0');
  1712. _this2.adapter_.setStyleProperty('margin', '0');
  1713. // On the next frame (once width is explicitly set), transition width to 0.
  1714. requestAnimationFrame(function () {
  1715. _this2.adapter_.setStyleProperty('width', '0');
  1716. });
  1717. });
  1718. }
  1719. return;
  1720. }
  1721. // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.
  1722. if (evt.propertyName !== 'opacity') {
  1723. return;
  1724. }
  1725. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LEADING_ICON) && this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED)) {
  1726. this.adapter_.addClassToLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  1727. } else if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKMARK) && !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED)) {
  1728. this.adapter_.removeClassFromLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  1729. }
  1730. }
  1731. /**
  1732. * Handles an interaction event on the trailing icon element. This is used to
  1733. * prevent the ripple from activating on interaction with the trailing icon.
  1734. * @param {!Event} evt
  1735. */
  1736. }, {
  1737. key: 'handleTrailingIconInteraction',
  1738. value: function handleTrailingIconInteraction(evt) {
  1739. evt.stopPropagation();
  1740. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  1741. this.adapter_.notifyTrailingIconInteraction();
  1742. if (this.shouldRemoveOnTrailingIconClick_) {
  1743. this.beginExit();
  1744. }
  1745. }
  1746. }
  1747. }]);
  1748. return MDCChipFoundation;
  1749. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  1750. /**
  1751. * @typedef {{
  1752. * detail: {
  1753. * chip: {foundation: !MDCChipFoundation},
  1754. * },
  1755. * bubbles: boolean,
  1756. * }}
  1757. */
  1758. var MDCChipInteractionEventType = void 0;
  1759. /***/ }),
  1760. /* 15 */
  1761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1762. "use strict";
  1763. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1764. /* harmony export (immutable) */ __webpack_exports__["remapEvent"] = remapEvent;
  1765. /* harmony export (immutable) */ __webpack_exports__["getTransformPropertyName"] = getTransformPropertyName;
  1766. /* harmony export (immutable) */ __webpack_exports__["supportsCssCustomProperties"] = supportsCssCustomProperties;
  1767. /* harmony export (immutable) */ __webpack_exports__["applyPassive"] = applyPassive;
  1768. /* harmony export (immutable) */ __webpack_exports__["saveElementTabState"] = saveElementTabState;
  1769. /* harmony export (immutable) */ __webpack_exports__["restoreElementTabState"] = restoreElementTabState;
  1770. /**
  1771. * Copyright 2016 Google Inc. All Rights Reserved.
  1772. *
  1773. * Licensed under the Apache License, Version 2.0 (the "License");
  1774. * you may not use this file except in compliance with the License.
  1775. * You may obtain a copy of the License at
  1776. *
  1777. * http://www.apache.org/licenses/LICENSE-2.0
  1778. *
  1779. * Unless required by applicable law or agreed to in writing, software
  1780. * distributed under the License is distributed on an "AS IS" BASIS,
  1781. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1782. * See the License for the specific language governing permissions and
  1783. * limitations under the License.
  1784. */
  1785. var TAB_DATA = 'data-mdc-tabindex';
  1786. var TAB_DATA_HANDLED = 'data-mdc-tabindex-handled';
  1787. var storedTransformPropertyName_ = void 0;
  1788. var supportsPassive_ = void 0;
  1789. // Remap touch events to pointer events, if the browser doesn't support touch events.
  1790. function remapEvent(eventName) {
  1791. var globalObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
  1792. if (!('ontouchstart' in globalObj.document)) {
  1793. switch (eventName) {
  1794. case 'touchstart':
  1795. return 'pointerdown';
  1796. case 'touchmove':
  1797. return 'pointermove';
  1798. case 'touchend':
  1799. return 'pointerup';
  1800. default:
  1801. return eventName;
  1802. }
  1803. }
  1804. return eventName;
  1805. }
  1806. // Choose the correct transform property to use on the current browser.
  1807. function getTransformPropertyName() {
  1808. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  1809. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1810. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  1811. var el = globalObj.document.createElement('div');
  1812. var transformPropertyName = 'transform' in el.style ? 'transform' : '-webkit-transform';
  1813. storedTransformPropertyName_ = transformPropertyName;
  1814. }
  1815. return storedTransformPropertyName_;
  1816. }
  1817. // Determine whether the current browser supports CSS properties.
  1818. function supportsCssCustomProperties() {
  1819. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  1820. if ('CSS' in globalObj) {
  1821. return globalObj.CSS.supports('(--color: red)');
  1822. }
  1823. return false;
  1824. }
  1825. // Determine whether the current browser supports passive event listeners, and if so, use them.
  1826. function applyPassive() {
  1827. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  1828. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1829. if (supportsPassive_ === undefined || forceRefresh) {
  1830. var isSupported = false;
  1831. try {
  1832. globalObj.document.addEventListener('test', null, { get passive() {
  1833. isSupported = true;
  1834. } });
  1835. } catch (e) {}
  1836. supportsPassive_ = isSupported;
  1837. }
  1838. return supportsPassive_ ? { passive: true } : false;
  1839. }
  1840. // Save the tab state for an element.
  1841. function saveElementTabState(el) {
  1842. if (el.hasAttribute('tabindex')) {
  1843. el.setAttribute(TAB_DATA, el.getAttribute('tabindex'));
  1844. }
  1845. el.setAttribute(TAB_DATA_HANDLED, true);
  1846. }
  1847. // Restore the tab state for an element, if it was saved.
  1848. function restoreElementTabState(el) {
  1849. // Only modify elements we've already handled, in case anything was dynamically added since we saved state.
  1850. if (el.hasAttribute(TAB_DATA_HANDLED)) {
  1851. if (el.hasAttribute(TAB_DATA)) {
  1852. el.setAttribute('tabindex', el.getAttribute(TAB_DATA));
  1853. el.removeAttribute(TAB_DATA);
  1854. } else {
  1855. el.removeAttribute('tabindex');
  1856. }
  1857. el.removeAttribute(TAB_DATA_HANDLED);
  1858. }
  1859. }
  1860. /***/ }),
  1861. /* 16 */
  1862. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1863. "use strict";
  1864. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabel", function() { return MDCFloatingLabel; });
  1866. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1867. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(28);
  1868. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(75);
  1869. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabelFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  1870. 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; }; }();
  1871. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1872. 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; }
  1873. 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; }
  1874. /**
  1875. * @license
  1876. * Copyright 2016 Google Inc. All Rights Reserved.
  1877. *
  1878. * Licensed under the Apache License, Version 2.0 (the "License");
  1879. * you may not use this file except in compliance with the License.
  1880. * You may obtain a copy of the License at
  1881. *
  1882. * http://www.apache.org/licenses/LICENSE-2.0
  1883. *
  1884. * Unless required by applicable law or agreed to in writing, software
  1885. * distributed under the License is distributed on an "AS IS" BASIS,
  1886. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1887. * See the License for the specific language governing permissions and
  1888. * limitations under the License.
  1889. */
  1890. /**
  1891. * @extends {MDCComponent<!MDCFloatingLabelFoundation>}
  1892. * @final
  1893. */
  1894. var MDCFloatingLabel = function (_MDCComponent) {
  1895. _inherits(MDCFloatingLabel, _MDCComponent);
  1896. function MDCFloatingLabel() {
  1897. _classCallCheck(this, MDCFloatingLabel);
  1898. return _possibleConstructorReturn(this, (MDCFloatingLabel.__proto__ || Object.getPrototypeOf(MDCFloatingLabel)).apply(this, arguments));
  1899. }
  1900. _createClass(MDCFloatingLabel, [{
  1901. key: 'shake',
  1902. /**
  1903. * Styles the label to produce the label shake for errors.
  1904. * @param {boolean} shouldShake styles the label to shake by adding shake class
  1905. * if true, otherwise will stop shaking by removing shake class.
  1906. */
  1907. value: function shake(shouldShake) {
  1908. this.foundation_.shake(shouldShake);
  1909. }
  1910. /**
  1911. * Styles label to float/dock.
  1912. * @param {boolean} shouldFloat styles the label to float by adding float class
  1913. * if true, otherwise docks the label by removing the float class.
  1914. */
  1915. }, {
  1916. key: 'float',
  1917. value: function float(shouldFloat) {
  1918. this.foundation_.float(shouldFloat);
  1919. }
  1920. /**
  1921. * @return {number}
  1922. */
  1923. }, {
  1924. key: 'getWidth',
  1925. value: function getWidth() {
  1926. return this.foundation_.getWidth();
  1927. }
  1928. /**
  1929. * @return {!MDCFloatingLabelFoundation}
  1930. */
  1931. }, {
  1932. key: 'getDefaultFoundation',
  1933. value: function getDefaultFoundation() {
  1934. var _this2 = this;
  1935. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  1936. addClass: function addClass(className) {
  1937. return _this2.root_.classList.add(className);
  1938. },
  1939. removeClass: function removeClass(className) {
  1940. return _this2.root_.classList.remove(className);
  1941. },
  1942. getWidth: function getWidth() {
  1943. return _this2.root_.offsetWidth;
  1944. },
  1945. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  1946. return _this2.root_.addEventListener(evtType, handler);
  1947. },
  1948. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  1949. return _this2.root_.removeEventListener(evtType, handler);
  1950. }
  1951. });
  1952. }
  1953. }], [{
  1954. key: 'attachTo',
  1955. /**
  1956. * @param {!Element} root
  1957. * @return {!MDCFloatingLabel}
  1958. */
  1959. value: function attachTo(root) {
  1960. return new MDCFloatingLabel(root);
  1961. }
  1962. }]);
  1963. return MDCFloatingLabel;
  1964. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  1965. /***/ }),
  1966. /* 17 */
  1967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1968. "use strict";
  1969. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1970. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRipple", function() { return MDCLineRipple; });
  1971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1972. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(29);
  1973. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(95);
  1974. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  1975. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  1976. 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; }; }();
  1977. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1978. 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; }
  1979. 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; }
  1980. /**
  1981. * @license
  1982. * Copyright 2018 Google Inc. All Rights Reserved.
  1983. *
  1984. * Licensed under the Apache License, Version 2.0 (the "License");
  1985. * you may not use this file except in compliance with the License.
  1986. * You may obtain a copy of the License at
  1987. *
  1988. * http://www.apache.org/licenses/LICENSE-2.0
  1989. *
  1990. * Unless required by applicable law or agreed to in writing, software
  1991. * distributed under the License is distributed on an "AS IS" BASIS,
  1992. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1993. * See the License for the specific language governing permissions and
  1994. * limitations under the License.
  1995. */
  1996. /**
  1997. * @extends {MDCComponent<!MDCLineRippleFoundation>}
  1998. * @final
  1999. */
  2000. var MDCLineRipple = function (_MDCComponent) {
  2001. _inherits(MDCLineRipple, _MDCComponent);
  2002. function MDCLineRipple() {
  2003. _classCallCheck(this, MDCLineRipple);
  2004. return _possibleConstructorReturn(this, (MDCLineRipple.__proto__ || Object.getPrototypeOf(MDCLineRipple)).apply(this, arguments));
  2005. }
  2006. _createClass(MDCLineRipple, [{
  2007. key: 'activate',
  2008. /**
  2009. * Activates the line ripple
  2010. */
  2011. value: function activate() {
  2012. this.foundation_.activate();
  2013. }
  2014. /**
  2015. * Deactivates the line ripple
  2016. */
  2017. }, {
  2018. key: 'deactivate',
  2019. value: function deactivate() {
  2020. this.foundation_.deactivate();
  2021. }
  2022. /**
  2023. * Sets the transform origin given a user's click location. The `rippleCenter` is the
  2024. * x-coordinate of the middle of the ripple.
  2025. * @param {number} xCoordinate
  2026. */
  2027. }, {
  2028. key: 'setRippleCenter',
  2029. value: function setRippleCenter(xCoordinate) {
  2030. this.foundation_.setRippleCenter(xCoordinate);
  2031. }
  2032. /**
  2033. * @return {!MDCLineRippleFoundation}
  2034. */
  2035. }, {
  2036. key: 'getDefaultFoundation',
  2037. value: function getDefaultFoundation() {
  2038. var _this2 = this;
  2039. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCLineRippleAdapter} */_extends({
  2040. addClass: function addClass(className) {
  2041. return _this2.root_.classList.add(className);
  2042. },
  2043. removeClass: function removeClass(className) {
  2044. return _this2.root_.classList.remove(className);
  2045. },
  2046. hasClass: function hasClass(className) {
  2047. return _this2.root_.classList.contains(className);
  2048. },
  2049. setStyle: function setStyle(propertyName, value) {
  2050. return _this2.root_.style[propertyName] = value;
  2051. },
  2052. registerEventHandler: function registerEventHandler(evtType, handler) {
  2053. return _this2.root_.addEventListener(evtType, handler);
  2054. },
  2055. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2056. return _this2.root_.removeEventListener(evtType, handler);
  2057. }
  2058. }));
  2059. }
  2060. }], [{
  2061. key: 'attachTo',
  2062. /**
  2063. * @param {!Element} root
  2064. * @return {!MDCLineRipple}
  2065. */
  2066. value: function attachTo(root) {
  2067. return new MDCLineRipple(root);
  2068. }
  2069. }]);
  2070. return MDCLineRipple;
  2071. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2072. /***/ }),
  2073. /* 18 */
  2074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2075. "use strict";
  2076. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2077. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutline", function() { return MDCNotchedOutline; });
  2078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2079. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(33);
  2080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(103);
  2081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(34);
  2082. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutlineFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2083. 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; }; }();
  2084. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2085. 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; }
  2086. 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; }
  2087. /**
  2088. * @license
  2089. * Copyright 2017 Google Inc. All Rights Reserved.
  2090. *
  2091. * Licensed under the Apache License, Version 2.0 (the "License");
  2092. * you may not use this file except in compliance with the License.
  2093. * You may obtain a copy of the License at
  2094. *
  2095. * http://www.apache.org/licenses/LICENSE-2.0
  2096. *
  2097. * Unless required by applicable law or agreed to in writing, software
  2098. * distributed under the License is distributed on an "AS IS" BASIS,
  2099. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2100. * See the License for the specific language governing permissions and
  2101. * limitations under the License.
  2102. */
  2103. /**
  2104. * @extends {MDCComponent<!MDCNotchedOutlineFoundation>}
  2105. * @final
  2106. */
  2107. var MDCNotchedOutline = function (_MDCComponent) {
  2108. _inherits(MDCNotchedOutline, _MDCComponent);
  2109. function MDCNotchedOutline() {
  2110. _classCallCheck(this, MDCNotchedOutline);
  2111. return _possibleConstructorReturn(this, (MDCNotchedOutline.__proto__ || Object.getPrototypeOf(MDCNotchedOutline)).apply(this, arguments));
  2112. }
  2113. _createClass(MDCNotchedOutline, [{
  2114. key: 'notch',
  2115. /**
  2116. * Updates outline selectors and SVG path to open notch.
  2117. * @param {number} notchWidth The notch width in the outline.
  2118. * @param {boolean=} isRtl Determines if outline is rtl. If rtl is true, notch
  2119. * will be right justified in outline path, otherwise left justified.
  2120. */
  2121. value: function notch(notchWidth, isRtl) {
  2122. this.foundation_.notch(notchWidth, isRtl);
  2123. }
  2124. /**
  2125. * Updates the outline selectors to close notch and return it to idle state.
  2126. */
  2127. }, {
  2128. key: 'closeNotch',
  2129. value: function closeNotch() {
  2130. this.foundation_.closeNotch();
  2131. }
  2132. /**
  2133. * @return {!MDCNotchedOutlineFoundation}
  2134. */
  2135. }, {
  2136. key: 'getDefaultFoundation',
  2137. value: function getDefaultFoundation() {
  2138. var _this2 = this;
  2139. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  2140. getWidth: function getWidth() {
  2141. return _this2.root_.offsetWidth;
  2142. },
  2143. getHeight: function getHeight() {
  2144. return _this2.root_.offsetHeight;
  2145. },
  2146. addClass: function addClass(className) {
  2147. return _this2.root_.classList.add(className);
  2148. },
  2149. removeClass: function removeClass(className) {
  2150. return _this2.root_.classList.remove(className);
  2151. },
  2152. setOutlinePathAttr: function setOutlinePathAttr(value) {
  2153. var path = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].PATH_SELECTOR);
  2154. path.setAttribute('d', value);
  2155. },
  2156. getIdleOutlineStyleValue: function getIdleOutlineStyleValue(propertyName) {
  2157. var idleOutlineElement = _this2.root_.parentNode.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].IDLE_OUTLINE_SELECTOR);
  2158. return window.getComputedStyle(idleOutlineElement).getPropertyValue(propertyName);
  2159. }
  2160. });
  2161. }
  2162. }], [{
  2163. key: 'attachTo',
  2164. /**
  2165. * @param {!Element} root
  2166. * @return {!MDCNotchedOutline}
  2167. */
  2168. value: function attachTo(root) {
  2169. return new MDCNotchedOutline(root);
  2170. }
  2171. }]);
  2172. return MDCNotchedOutline;
  2173. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2174. /***/ }),
  2175. /* 19 */
  2176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2177. "use strict";
  2178. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTab", function() { return MDCTab; });
  2180. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(3);
  2182. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__ = __webpack_require__(38);
  2183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(11);
  2184. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(40);
  2185. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  2186. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2187. 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; }; }();
  2188. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  2189. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2190. 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; }
  2191. 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; }
  2192. /**
  2193. * @license
  2194. * Copyright 2018 Google Inc. All Rights Reserved.
  2195. *
  2196. * Licensed under the Apache License, Version 2.0 (the "License");
  2197. * you may not use this file except in compliance with the License.
  2198. * You may obtain a copy of the License at
  2199. *
  2200. * http://www.apache.org/licenses/LICENSE-2.0
  2201. *
  2202. * Unless required by applicable law or agreed to in writing, software
  2203. * distributed under the License is distributed on an "AS IS" BASIS,
  2204. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2205. * See the License for the specific language governing permissions and
  2206. * limitations under the License.
  2207. */
  2208. /* eslint-disable no-unused-vars */
  2209. /* eslint-enable no-unused-vars */
  2210. /**
  2211. * @extends {MDCComponent<!MDCTabFoundation>}
  2212. * @final
  2213. */
  2214. var MDCTab = function (_MDCComponent) {
  2215. _inherits(MDCTab, _MDCComponent);
  2216. /**
  2217. * @param {...?} args
  2218. */
  2219. function MDCTab() {
  2220. var _ref;
  2221. _classCallCheck(this, MDCTab);
  2222. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2223. args[_key] = arguments[_key];
  2224. }
  2225. /** @private {?MDCRipple} */
  2226. var _this = _possibleConstructorReturn(this, (_ref = MDCTab.__proto__ || Object.getPrototypeOf(MDCTab)).call.apply(_ref, [this].concat(args)));
  2227. _this.ripple_;
  2228. /** @private {?MDCTabIndicator} */
  2229. _this.tabIndicator_;
  2230. /** @private {?Element} */
  2231. _this.content_;
  2232. return _this;
  2233. }
  2234. /**
  2235. * @param {!Element} root
  2236. * @return {!MDCTab}
  2237. */
  2238. _createClass(MDCTab, [{
  2239. key: 'initialize',
  2240. value: function initialize() {
  2241. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  2242. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  2243. };
  2244. var tabIndicatorFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  2245. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__["MDCTabIndicator"](el);
  2246. };
  2247. var rippleSurface = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.RIPPLE_SELECTOR);
  2248. var rippleAdapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  2249. addClass: function addClass(className) {
  2250. return rippleSurface.classList.add(className);
  2251. },
  2252. removeClass: function removeClass(className) {
  2253. return rippleSurface.classList.remove(className);
  2254. },
  2255. updateCssVariable: function updateCssVariable(varName, value) {
  2256. return rippleSurface.style.setProperty(varName, value);
  2257. }
  2258. });
  2259. var rippleFoundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](rippleAdapter);
  2260. this.ripple_ = rippleFactory(this.root_, rippleFoundation);
  2261. var tabIndicatorElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_INDICATOR_SELECTOR);
  2262. this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
  2263. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  2264. }
  2265. }, {
  2266. key: 'destroy',
  2267. value: function destroy() {
  2268. this.ripple_.destroy();
  2269. _get(MDCTab.prototype.__proto__ || Object.getPrototypeOf(MDCTab.prototype), 'destroy', this).call(this);
  2270. }
  2271. /**
  2272. * @return {!MDCTabFoundation}
  2273. */
  2274. }, {
  2275. key: 'getDefaultFoundation',
  2276. value: function getDefaultFoundation() {
  2277. var _this2 = this;
  2278. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  2279. /** @type {!MDCTabAdapter} */{
  2280. setAttr: function setAttr(attr, value) {
  2281. return _this2.root_.setAttribute(attr, value);
  2282. },
  2283. registerEventHandler: function registerEventHandler(evtType, handler) {
  2284. return _this2.root_.addEventListener(evtType, handler);
  2285. },
  2286. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2287. return _this2.root_.removeEventListener(evtType, handler);
  2288. },
  2289. addClass: function addClass(className) {
  2290. return _this2.root_.classList.add(className);
  2291. },
  2292. removeClass: function removeClass(className) {
  2293. return _this2.root_.classList.remove(className);
  2294. },
  2295. hasClass: function hasClass(className) {
  2296. return _this2.root_.classList.contains(className);
  2297. },
  2298. activateIndicator: function activateIndicator(previousIndicatorClientRect) {
  2299. return _this2.tabIndicator_.activate(previousIndicatorClientRect);
  2300. },
  2301. deactivateIndicator: function deactivateIndicator() {
  2302. return _this2.tabIndicator_.deactivate();
  2303. },
  2304. computeIndicatorClientRect: function computeIndicatorClientRect() {
  2305. return _this2.tabIndicator_.computeContentClientRect();
  2306. },
  2307. notifyInteracted: function notifyInteracted() {
  2308. return _this2.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.INTERACTED_EVENT, { tab: _this2 }, true /* bubble */);
  2309. },
  2310. getOffsetLeft: function getOffsetLeft() {
  2311. return _this2.root_.offsetLeft;
  2312. },
  2313. getOffsetWidth: function getOffsetWidth() {
  2314. return _this2.root_.offsetWidth;
  2315. },
  2316. getContentOffsetLeft: function getContentOffsetLeft() {
  2317. return _this2.content_.offsetLeft;
  2318. },
  2319. getContentOffsetWidth: function getContentOffsetWidth() {
  2320. return _this2.content_.offsetWidth;
  2321. },
  2322. focus: function focus() {
  2323. return _this2.root_.focus();
  2324. }
  2325. });
  2326. }
  2327. /**
  2328. * Getter for the active state of the tab
  2329. * @return {boolean}
  2330. */
  2331. }, {
  2332. key: 'activate',
  2333. /**
  2334. * Activates the tab
  2335. * @param {!ClientRect=} computeIndicatorClientRect
  2336. */
  2337. value: function activate(computeIndicatorClientRect) {
  2338. this.foundation_.activate(computeIndicatorClientRect);
  2339. }
  2340. /**
  2341. * Deactivates the tab
  2342. */
  2343. }, {
  2344. key: 'deactivate',
  2345. value: function deactivate() {
  2346. this.foundation_.deactivate();
  2347. }
  2348. /**
  2349. * Returns the indicator's client rect
  2350. * @return {!ClientRect}
  2351. */
  2352. }, {
  2353. key: 'computeIndicatorClientRect',
  2354. value: function computeIndicatorClientRect() {
  2355. return this.foundation_.computeIndicatorClientRect();
  2356. }
  2357. /**
  2358. * @return {!MDCTabDimensions}
  2359. */
  2360. }, {
  2361. key: 'computeDimensions',
  2362. value: function computeDimensions() {
  2363. return this.foundation_.computeDimensions();
  2364. }
  2365. }, {
  2366. key: 'active',
  2367. get: function get() {
  2368. return this.foundation_.isActive();
  2369. }
  2370. }], [{
  2371. key: 'attachTo',
  2372. value: function attachTo(root) {
  2373. return new MDCTab(root);
  2374. }
  2375. }]);
  2376. return MDCTab;
  2377. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2378. /***/ }),
  2379. /* 20 */
  2380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2381. "use strict";
  2382. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2383. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(39);
  2384. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(119);
  2385. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2386. 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; }; }();
  2387. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2388. 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; }
  2389. 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; }
  2390. /**
  2391. * @license
  2392. * Copyright 2018 Google Inc. All Rights Reserved.
  2393. *
  2394. * Licensed under the Apache License, Version 2.0 (the "License")
  2395. * you may not use this file except in compliance with the License.
  2396. * You may obtain a copy of the License at
  2397. *
  2398. * http://www.apache.org/licenses/LICENSE-2.0
  2399. *
  2400. * Unless required by applicable law or agreed to in writing, software
  2401. * distributed under the License is distributed on an "AS IS" BASIS,
  2402. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2403. * See the License for the specific language governing permissions and
  2404. * limitations under the License.
  2405. */
  2406. /**
  2407. * @extends {MDCFoundation<!MDCTabIndicatorAdapter>}
  2408. * @abstract
  2409. */
  2410. var MDCTabIndicatorFoundation = function (_MDCFoundation) {
  2411. _inherits(MDCTabIndicatorFoundation, _MDCFoundation);
  2412. _createClass(MDCTabIndicatorFoundation, null, [{
  2413. key: 'cssClasses',
  2414. /** @return enum {string} */
  2415. get: function get() {
  2416. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2417. }
  2418. /** @return enum {string} */
  2419. }, {
  2420. key: 'strings',
  2421. get: function get() {
  2422. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  2423. }
  2424. /**
  2425. * @see MDCTabIndicatorAdapter for typing information
  2426. * @return {!MDCTabIndicatorAdapter}
  2427. */
  2428. }, {
  2429. key: 'defaultAdapter',
  2430. get: function get() {
  2431. return (/** @type {!MDCTabIndicatorAdapter} */{
  2432. registerEventHandler: function registerEventHandler() {},
  2433. deregisterEventHandler: function deregisterEventHandler() {},
  2434. addClass: function addClass() {},
  2435. removeClass: function removeClass() {},
  2436. computeContentClientRect: function computeContentClientRect() {},
  2437. setContentStyleProperty: function setContentStyleProperty() {}
  2438. }
  2439. );
  2440. }
  2441. /** @param {!MDCTabIndicatorAdapter} adapter */
  2442. }]);
  2443. function MDCTabIndicatorFoundation(adapter) {
  2444. _classCallCheck(this, MDCTabIndicatorFoundation);
  2445. return _possibleConstructorReturn(this, (MDCTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCTabIndicatorFoundation)).call(this, _extends(MDCTabIndicatorFoundation.defaultAdapter, adapter)));
  2446. }
  2447. /** @return {!ClientRect} */
  2448. _createClass(MDCTabIndicatorFoundation, [{
  2449. key: 'computeContentClientRect',
  2450. value: function computeContentClientRect() {
  2451. return this.adapter_.computeContentClientRect();
  2452. }
  2453. /**
  2454. * Activates the indicator
  2455. * @param {!ClientRect=} previousIndicatorClientRect
  2456. * @abstract
  2457. */
  2458. }, {
  2459. key: 'activate',
  2460. value: function activate(previousIndicatorClientRect) {} // eslint-disable-line no-unused-vars
  2461. /** @abstract */
  2462. }, {
  2463. key: 'deactivate',
  2464. value: function deactivate() {}
  2465. }]);
  2466. return MDCTabIndicatorFoundation;
  2467. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2468. /* harmony default export */ __webpack_exports__["a"] = (MDCTabIndicatorFoundation);
  2469. /***/ }),
  2470. /* 21 */
  2471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2472. "use strict";
  2473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  2475. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(132);
  2476. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2477. 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; }; }();
  2478. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2479. 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; }
  2480. 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; }
  2481. /**
  2482. * @license
  2483. * Copyright 2017 Google Inc. All Rights Reserved.
  2484. *
  2485. * Licensed under the Apache License, Version 2.0 (the "License");
  2486. * you may not use this file except in compliance with the License.
  2487. * You may obtain a copy of the License at
  2488. *
  2489. * http://www.apache.org/licenses/LICENSE-2.0
  2490. *
  2491. * Unless required by applicable law or agreed to in writing, software
  2492. * distributed under the License is distributed on an "AS IS" BASIS,
  2493. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2494. * See the License for the specific language governing permissions and
  2495. * limitations under the License.
  2496. */
  2497. /**
  2498. * @extends {MDCFoundation<!MDCTextFieldHelperTextAdapter>}
  2499. * @final
  2500. */
  2501. var MDCTextFieldHelperTextFoundation = function (_MDCFoundation) {
  2502. _inherits(MDCTextFieldHelperTextFoundation, _MDCFoundation);
  2503. _createClass(MDCTextFieldHelperTextFoundation, null, [{
  2504. key: 'cssClasses',
  2505. /** @return enum {string} */
  2506. get: function get() {
  2507. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2508. }
  2509. /** @return enum {string} */
  2510. }, {
  2511. key: 'strings',
  2512. get: function get() {
  2513. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  2514. }
  2515. /**
  2516. * {@see MDCTextFieldHelperTextAdapter} for typing information on parameters and return
  2517. * types.
  2518. * @return {!MDCTextFieldHelperTextAdapter}
  2519. */
  2520. }, {
  2521. key: 'defaultAdapter',
  2522. get: function get() {
  2523. return (/** @type {!MDCTextFieldHelperTextAdapter} */{
  2524. addClass: function addClass() {},
  2525. removeClass: function removeClass() {},
  2526. hasClass: function hasClass() {},
  2527. setAttr: function setAttr() {},
  2528. removeAttr: function removeAttr() {},
  2529. setContent: function setContent() {}
  2530. }
  2531. );
  2532. }
  2533. /**
  2534. * @param {!MDCTextFieldHelperTextAdapter} adapter
  2535. */
  2536. }]);
  2537. function MDCTextFieldHelperTextFoundation(adapter) {
  2538. _classCallCheck(this, MDCTextFieldHelperTextFoundation);
  2539. return _possibleConstructorReturn(this, (MDCTextFieldHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperTextFoundation)).call(this, _extends(MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)));
  2540. }
  2541. /**
  2542. * Sets the content of the helper text field.
  2543. * @param {string} content
  2544. */
  2545. _createClass(MDCTextFieldHelperTextFoundation, [{
  2546. key: 'setContent',
  2547. value: function setContent(content) {
  2548. this.adapter_.setContent(content);
  2549. }
  2550. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  2551. }, {
  2552. key: 'setPersistent',
  2553. value: function setPersistent(isPersistent) {
  2554. if (isPersistent) {
  2555. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  2556. } else {
  2557. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  2558. }
  2559. }
  2560. /**
  2561. * @param {boolean} isValidation True to make the helper text act as an
  2562. * error validation message.
  2563. */
  2564. }, {
  2565. key: 'setValidation',
  2566. value: function setValidation(isValidation) {
  2567. if (isValidation) {
  2568. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  2569. } else {
  2570. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  2571. }
  2572. }
  2573. /** Makes the helper text visible to the screen reader. */
  2574. }, {
  2575. key: 'showToScreenReader',
  2576. value: function showToScreenReader() {
  2577. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  2578. }
  2579. /**
  2580. * Sets the validity of the helper text based on the input validity.
  2581. * @param {boolean} inputIsValid
  2582. */
  2583. }, {
  2584. key: 'setValidity',
  2585. value: function setValidity(inputIsValid) {
  2586. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  2587. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  2588. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  2589. if (validationMsgNeedsDisplay) {
  2590. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  2591. } else {
  2592. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  2593. }
  2594. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  2595. this.hide_();
  2596. }
  2597. }
  2598. /**
  2599. * Hides the help text from screen readers.
  2600. * @private
  2601. */
  2602. }, {
  2603. key: 'hide_',
  2604. value: function hide_() {
  2605. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  2606. }
  2607. }]);
  2608. return MDCTextFieldHelperTextFoundation;
  2609. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2610. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldHelperTextFoundation);
  2611. /***/ }),
  2612. /* 22 */
  2613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2614. "use strict";
  2615. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2616. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(47);
  2617. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(133);
  2618. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2619. 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; }; }();
  2620. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2621. 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; }
  2622. 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; }
  2623. /**
  2624. * @license
  2625. * Copyright 2017 Google Inc. All Rights Reserved.
  2626. *
  2627. * Licensed under the Apache License, Version 2.0 (the "License");
  2628. * you may not use this file except in compliance with the License.
  2629. * You may obtain a copy of the License at
  2630. *
  2631. * http://www.apache.org/licenses/LICENSE-2.0
  2632. *
  2633. * Unless required by applicable law or agreed to in writing, software
  2634. * distributed under the License is distributed on an "AS IS" BASIS,
  2635. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2636. * See the License for the specific language governing permissions and
  2637. * limitations under the License.
  2638. */
  2639. /**
  2640. * @extends {MDCFoundation<!MDCTextFieldIconAdapter>}
  2641. * @final
  2642. */
  2643. var MDCTextFieldIconFoundation = function (_MDCFoundation) {
  2644. _inherits(MDCTextFieldIconFoundation, _MDCFoundation);
  2645. _createClass(MDCTextFieldIconFoundation, null, [{
  2646. key: 'strings',
  2647. /** @return enum {string} */
  2648. get: function get() {
  2649. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  2650. }
  2651. /**
  2652. * {@see MDCTextFieldIconAdapter} for typing information on parameters and return
  2653. * types.
  2654. * @return {!MDCTextFieldIconAdapter}
  2655. */
  2656. }, {
  2657. key: 'defaultAdapter',
  2658. get: function get() {
  2659. return (/** @type {!MDCTextFieldIconAdapter} */{
  2660. getAttr: function getAttr() {},
  2661. setAttr: function setAttr() {},
  2662. removeAttr: function removeAttr() {},
  2663. setContent: function setContent() {},
  2664. registerInteractionHandler: function registerInteractionHandler() {},
  2665. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  2666. notifyIconAction: function notifyIconAction() {}
  2667. }
  2668. );
  2669. }
  2670. /**
  2671. * @param {!MDCTextFieldIconAdapter} adapter
  2672. */
  2673. }]);
  2674. function MDCTextFieldIconFoundation(adapter) {
  2675. _classCallCheck(this, MDCTextFieldIconFoundation);
  2676. /** @private {string?} */
  2677. var _this = _possibleConstructorReturn(this, (MDCTextFieldIconFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldIconFoundation)).call(this, _extends(MDCTextFieldIconFoundation.defaultAdapter, adapter)));
  2678. _this.savedTabIndex_ = null;
  2679. /** @private {function(!Event): undefined} */
  2680. _this.interactionHandler_ = function (evt) {
  2681. return _this.handleInteraction(evt);
  2682. };
  2683. return _this;
  2684. }
  2685. _createClass(MDCTextFieldIconFoundation, [{
  2686. key: 'init',
  2687. value: function init() {
  2688. var _this2 = this;
  2689. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  2690. ['click', 'keydown'].forEach(function (evtType) {
  2691. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  2692. });
  2693. }
  2694. }, {
  2695. key: 'destroy',
  2696. value: function destroy() {
  2697. var _this3 = this;
  2698. ['click', 'keydown'].forEach(function (evtType) {
  2699. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  2700. });
  2701. }
  2702. /** @param {boolean} disabled */
  2703. }, {
  2704. key: 'setDisabled',
  2705. value: function setDisabled(disabled) {
  2706. if (!this.savedTabIndex_) {
  2707. return;
  2708. }
  2709. if (disabled) {
  2710. this.adapter_.setAttr('tabindex', '-1');
  2711. this.adapter_.removeAttr('role');
  2712. } else {
  2713. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  2714. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  2715. }
  2716. }
  2717. /** @param {string} label */
  2718. }, {
  2719. key: 'setAriaLabel',
  2720. value: function setAriaLabel(label) {
  2721. this.adapter_.setAttr('aria-label', label);
  2722. }
  2723. /** @param {string} content */
  2724. }, {
  2725. key: 'setContent',
  2726. value: function setContent(content) {
  2727. this.adapter_.setContent(content);
  2728. }
  2729. /**
  2730. * Handles an interaction event
  2731. * @param {!Event} evt
  2732. */
  2733. }, {
  2734. key: 'handleInteraction',
  2735. value: function handleInteraction(evt) {
  2736. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  2737. this.adapter_.notifyIconAction();
  2738. }
  2739. }
  2740. }]);
  2741. return MDCTextFieldIconFoundation;
  2742. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2743. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldIconFoundation);
  2744. /***/ }),
  2745. /* 23 */
  2746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2747. "use strict";
  2748. 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; }; }();
  2749. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2750. /**
  2751. * @license
  2752. * Copyright 2016 Google Inc. All Rights Reserved.
  2753. *
  2754. * Licensed under the Apache License, Version 2.0 (the "License");
  2755. * you may not use this file except in compliance with the License.
  2756. * You may obtain a copy of the License at
  2757. *
  2758. * http://www.apache.org/licenses/LICENSE-2.0
  2759. *
  2760. * Unless required by applicable law or agreed to in writing, software
  2761. * distributed under the License is distributed on an "AS IS" BASIS,
  2762. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2763. * See the License for the specific language governing permissions and
  2764. * limitations under the License.
  2765. */
  2766. /* eslint no-unused-vars: [2, {"args": "none"}] */
  2767. /**
  2768. * Adapter for MDC Ripple. Provides an interface for managing
  2769. * - classes
  2770. * - dom
  2771. * - CSS variables
  2772. * - position
  2773. * - dimensions
  2774. * - scroll position
  2775. * - event handlers
  2776. * - unbounded, active and disabled states
  2777. *
  2778. * Additionally, provides type information for the adapter to the Closure
  2779. * compiler.
  2780. *
  2781. * Implement this adapter for your framework of choice to delegate updates to
  2782. * the component in your framework of choice. See architecture documentation
  2783. * for more details.
  2784. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  2785. *
  2786. * @record
  2787. */
  2788. var MDCRippleAdapter = function () {
  2789. function MDCRippleAdapter() {
  2790. _classCallCheck(this, MDCRippleAdapter);
  2791. }
  2792. _createClass(MDCRippleAdapter, [{
  2793. key: "browserSupportsCssVars",
  2794. /** @return {boolean} */
  2795. value: function browserSupportsCssVars() {}
  2796. /** @return {boolean} */
  2797. }, {
  2798. key: "isUnbounded",
  2799. value: function isUnbounded() {}
  2800. /** @return {boolean} */
  2801. }, {
  2802. key: "isSurfaceActive",
  2803. value: function isSurfaceActive() {}
  2804. /** @return {boolean} */
  2805. }, {
  2806. key: "isSurfaceDisabled",
  2807. value: function isSurfaceDisabled() {}
  2808. /** @param {string} className */
  2809. }, {
  2810. key: "addClass",
  2811. value: function addClass(className) {}
  2812. /** @param {string} className */
  2813. }, {
  2814. key: "removeClass",
  2815. value: function removeClass(className) {}
  2816. /** @param {!EventTarget} target */
  2817. }, {
  2818. key: "containsEventTarget",
  2819. value: function containsEventTarget(target) {}
  2820. /**
  2821. * @param {string} evtType
  2822. * @param {!Function} handler
  2823. */
  2824. }, {
  2825. key: "registerInteractionHandler",
  2826. value: function registerInteractionHandler(evtType, handler) {}
  2827. /**
  2828. * @param {string} evtType
  2829. * @param {!Function} handler
  2830. */
  2831. }, {
  2832. key: "deregisterInteractionHandler",
  2833. value: function deregisterInteractionHandler(evtType, handler) {}
  2834. /**
  2835. * @param {string} evtType
  2836. * @param {!Function} handler
  2837. */
  2838. }, {
  2839. key: "registerDocumentInteractionHandler",
  2840. value: function registerDocumentInteractionHandler(evtType, handler) {}
  2841. /**
  2842. * @param {string} evtType
  2843. * @param {!Function} handler
  2844. */
  2845. }, {
  2846. key: "deregisterDocumentInteractionHandler",
  2847. value: function deregisterDocumentInteractionHandler(evtType, handler) {}
  2848. /**
  2849. * @param {!Function} handler
  2850. */
  2851. }, {
  2852. key: "registerResizeHandler",
  2853. value: function registerResizeHandler(handler) {}
  2854. /**
  2855. * @param {!Function} handler
  2856. */
  2857. }, {
  2858. key: "deregisterResizeHandler",
  2859. value: function deregisterResizeHandler(handler) {}
  2860. /**
  2861. * @param {string} varName
  2862. * @param {?number|string} value
  2863. */
  2864. }, {
  2865. key: "updateCssVariable",
  2866. value: function updateCssVariable(varName, value) {}
  2867. /** @return {!ClientRect} */
  2868. }, {
  2869. key: "computeBoundingRect",
  2870. value: function computeBoundingRect() {}
  2871. /** @return {{x: number, y: number}} */
  2872. }, {
  2873. key: "getWindowPageOffset",
  2874. value: function getWindowPageOffset() {}
  2875. }]);
  2876. return MDCRippleAdapter;
  2877. }();
  2878. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleAdapter);
  2879. /***/ }),
  2880. /* 24 */
  2881. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2882. "use strict";
  2883. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChip; });
  2884. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2885. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(3);
  2886. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(25);
  2887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(14);
  2888. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(26);
  2889. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  2890. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  2891. 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; }; }();
  2892. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  2893. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2894. 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; }
  2895. 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; }
  2896. /**
  2897. * @license
  2898. * Copyright 2016 Google Inc. All Rights Reserved.
  2899. *
  2900. * Licensed under the Apache License, Version 2.0 (the "License");
  2901. * you may not use this file except in compliance with the License.
  2902. * You may obtain a copy of the License at
  2903. *
  2904. * http://www.apache.org/licenses/LICENSE-2.0
  2905. *
  2906. * Unless required by applicable law or agreed to in writing, software
  2907. * distributed under the License is distributed on an "AS IS" BASIS,
  2908. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2909. * See the License for the specific language governing permissions and
  2910. * limitations under the License.
  2911. */
  2912. var INTERACTION_EVENTS = ['click', 'keydown'];
  2913. /**
  2914. * @extends {MDCComponent<!MDCChipFoundation>}
  2915. * @final
  2916. */
  2917. var MDCChip = function (_MDCComponent) {
  2918. _inherits(MDCChip, _MDCComponent);
  2919. /**
  2920. * @param {...?} args
  2921. */
  2922. function MDCChip() {
  2923. var _ref;
  2924. _classCallCheck(this, MDCChip);
  2925. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2926. args[_key] = arguments[_key];
  2927. }
  2928. /** @private {?Element} */
  2929. var _this = _possibleConstructorReturn(this, (_ref = MDCChip.__proto__ || Object.getPrototypeOf(MDCChip)).call.apply(_ref, [this].concat(args)));
  2930. _this.leadingIcon_;
  2931. /** @private {?Element} */
  2932. _this.trailingIcon_;
  2933. /** @private {!MDCRipple} */
  2934. _this.ripple_;
  2935. /** @private {?function(?Event): undefined} */
  2936. _this.handleInteraction_;
  2937. /** @private {?function(!Event): undefined} */
  2938. _this.handleTransitionEnd_;
  2939. /** @private {function(!Event): undefined} */
  2940. _this.handleTrailingIconInteraction_;
  2941. return _this;
  2942. }
  2943. /**
  2944. * @param {!Element} root
  2945. * @return {!MDCChip}
  2946. */
  2947. _createClass(MDCChip, [{
  2948. key: 'initialize',
  2949. value: function initialize() {
  2950. var _this2 = this;
  2951. this.leadingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LEADING_ICON_SELECTOR);
  2952. this.trailingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_SELECTOR);
  2953. // Adjust ripple size for chips with animated growing width. This applies when filter chips without
  2954. // a leading icon are selected, and a leading checkmark will cause the chip width to expand.
  2955. var checkmarkEl = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKMARK_SELECTOR);
  2956. if (checkmarkEl && !this.leadingIcon_) {
  2957. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter(this), {
  2958. computeBoundingRect: function computeBoundingRect() {
  2959. var height = _this2.root_.getBoundingClientRect().height;
  2960. // The checkmark's width is initially set to 0, so use the checkmark's height as a proxy since the
  2961. // checkmark should always be square.
  2962. var width = _this2.root_.getBoundingClientRect().width + checkmarkEl.getBoundingClientRect().height;
  2963. return { height: height, width: width };
  2964. }
  2965. });
  2966. this.ripple_ = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](this.root_, new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter));
  2967. } else {
  2968. this.ripple_ = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](this.root_);
  2969. }
  2970. }
  2971. }, {
  2972. key: 'initialSyncWithDOM',
  2973. value: function initialSyncWithDOM() {
  2974. var _this3 = this;
  2975. this.handleInteraction_ = function (evt) {
  2976. return _this3.foundation_.handleInteraction(evt);
  2977. };
  2978. this.handleTransitionEnd_ = function (evt) {
  2979. return _this3.foundation_.handleTransitionEnd(evt);
  2980. };
  2981. this.handleTrailingIconInteraction_ = function (evt) {
  2982. return _this3.foundation_.handleTrailingIconInteraction(evt);
  2983. };
  2984. INTERACTION_EVENTS.forEach(function (evtType) {
  2985. _this3.root_.addEventListener(evtType, _this3.handleInteraction_);
  2986. });
  2987. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  2988. if (this.trailingIcon_) {
  2989. INTERACTION_EVENTS.forEach(function (evtType) {
  2990. _this3.trailingIcon_.addEventListener(evtType, _this3.handleTrailingIconInteraction_);
  2991. });
  2992. }
  2993. }
  2994. }, {
  2995. key: 'destroy',
  2996. value: function destroy() {
  2997. var _this4 = this;
  2998. this.ripple_.destroy();
  2999. INTERACTION_EVENTS.forEach(function (evtType) {
  3000. _this4.root_.removeEventListener(evtType, _this4.handleInteraction_);
  3001. });
  3002. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  3003. if (this.trailingIcon_) {
  3004. INTERACTION_EVENTS.forEach(function (evtType) {
  3005. _this4.trailingIcon_.removeEventListener(evtType, _this4.handleTrailingIconInteraction_);
  3006. });
  3007. }
  3008. _get(MDCChip.prototype.__proto__ || Object.getPrototypeOf(MDCChip.prototype), 'destroy', this).call(this);
  3009. }
  3010. /**
  3011. * Returns true if the chip is selected.
  3012. * @return {boolean}
  3013. */
  3014. }, {
  3015. key: 'isSelected',
  3016. value: function isSelected() {
  3017. return this.foundation_.isSelected();
  3018. }
  3019. /**
  3020. * Begins the exit animation which leads to removal of the chip.
  3021. */
  3022. }, {
  3023. key: 'beginExit',
  3024. value: function beginExit() {
  3025. this.foundation_.beginExit();
  3026. }
  3027. /**
  3028. * @return {!MDCChipFoundation}
  3029. */
  3030. }, {
  3031. key: 'getDefaultFoundation',
  3032. /**
  3033. * @return {!MDCChipFoundation}
  3034. */
  3035. value: function getDefaultFoundation() {
  3036. var _this5 = this;
  3037. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCChipFoundation */]( /** @type {!MDCChipAdapter} */_extends({
  3038. addClass: function addClass(className) {
  3039. return _this5.root_.classList.add(className);
  3040. },
  3041. removeClass: function removeClass(className) {
  3042. return _this5.root_.classList.remove(className);
  3043. },
  3044. hasClass: function hasClass(className) {
  3045. return _this5.root_.classList.contains(className);
  3046. },
  3047. addClassToLeadingIcon: function addClassToLeadingIcon(className) {
  3048. if (_this5.leadingIcon_) {
  3049. _this5.leadingIcon_.classList.add(className);
  3050. }
  3051. },
  3052. removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
  3053. if (_this5.leadingIcon_) {
  3054. _this5.leadingIcon_.classList.remove(className);
  3055. }
  3056. },
  3057. eventTargetHasClass: function eventTargetHasClass(target, className) {
  3058. return target.classList.contains(className);
  3059. },
  3060. notifyInteraction: function notifyInteraction() {
  3061. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].INTERACTION_EVENT, { chip: _this5 }, true /* shouldBubble */);
  3062. },
  3063. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  3064. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_INTERACTION_EVENT, { chip: _this5 }, true /* shouldBubble */);
  3065. },
  3066. notifyRemoval: function notifyRemoval() {
  3067. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].REMOVAL_EVENT, { chip: _this5, root: _this5.root_ }, true /* shouldBubble */);
  3068. },
  3069. getComputedStyleValue: function getComputedStyleValue(propertyName) {
  3070. return window.getComputedStyle(_this5.root_).getPropertyValue(propertyName);
  3071. },
  3072. setStyleProperty: function setStyleProperty(propertyName, value) {
  3073. return _this5.root_.style.setProperty(propertyName, value);
  3074. }
  3075. }));
  3076. }
  3077. /** @return {!MDCRipple} */
  3078. }, {
  3079. key: 'foundation',
  3080. get: function get() {
  3081. return this.foundation_;
  3082. }
  3083. /**
  3084. * Returns whether a trailing icon click should trigger exit/removal of the chip.
  3085. * @return {boolean}
  3086. */
  3087. }, {
  3088. key: 'shouldRemoveOnTrailingIconClick',
  3089. get: function get() {
  3090. return this.foundation_.getShouldRemoveOnTrailingIconClick();
  3091. }
  3092. /**
  3093. * Sets whether a trailing icon click should trigger exit/removal of the chip.
  3094. * @param {boolean} shouldRemove
  3095. */
  3096. ,
  3097. set: function set(shouldRemove) {
  3098. return this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
  3099. }
  3100. }, {
  3101. key: 'ripple',
  3102. get: function get() {
  3103. return this.ripple_;
  3104. }
  3105. }], [{
  3106. key: 'attachTo',
  3107. value: function attachTo(root) {
  3108. return new MDCChip(root);
  3109. }
  3110. }]);
  3111. return MDCChip;
  3112. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3113. /***/ }),
  3114. /* 25 */
  3115. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3116. "use strict";
  3117. 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; }; }();
  3118. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3119. /**
  3120. * @license
  3121. * Copyright 2017 Google Inc. All Rights Reserved.
  3122. *
  3123. * Licensed under the Apache License, Version 2.0 (the "License");
  3124. * you may not use this file except in compliance with the License.
  3125. * You may obtain a copy of the License at
  3126. *
  3127. * http://www.apache.org/licenses/LICENSE-2.0
  3128. *
  3129. * Unless required by applicable law or agreed to in writing, software
  3130. * distributed under the License is distributed on an "AS IS" BASIS,
  3131. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3132. * See the License for the specific language governing permissions and
  3133. * limitations under the License.
  3134. */
  3135. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3136. /**
  3137. * Adapter for MDC Chip.
  3138. *
  3139. * Defines the shape of the adapter expected by the foundation. Implement this
  3140. * adapter to integrate the Chip into your framework. See
  3141. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  3142. * for more information.
  3143. *
  3144. * @record
  3145. */
  3146. var MDCChipAdapter = function () {
  3147. function MDCChipAdapter() {
  3148. _classCallCheck(this, MDCChipAdapter);
  3149. }
  3150. _createClass(MDCChipAdapter, [{
  3151. key: "addClass",
  3152. /**
  3153. * Adds a class to the root element.
  3154. * @param {string} className
  3155. */
  3156. value: function addClass(className) {}
  3157. /**
  3158. * Removes a class from the root element.
  3159. * @param {string} className
  3160. */
  3161. }, {
  3162. key: "removeClass",
  3163. value: function removeClass(className) {}
  3164. /**
  3165. * Returns true if the root element contains the given class.
  3166. * @param {string} className
  3167. * @return {boolean}
  3168. */
  3169. }, {
  3170. key: "hasClass",
  3171. value: function hasClass(className) {}
  3172. /**
  3173. * Adds a class to the leading icon element.
  3174. * @param {string} className
  3175. */
  3176. }, {
  3177. key: "addClassToLeadingIcon",
  3178. value: function addClassToLeadingIcon(className) {}
  3179. /**
  3180. * Removes a class from the leading icon element.
  3181. * @param {string} className
  3182. */
  3183. }, {
  3184. key: "removeClassFromLeadingIcon",
  3185. value: function removeClassFromLeadingIcon(className) {}
  3186. /**
  3187. * Returns true if target has className, false otherwise.
  3188. * @param {!EventTarget} target
  3189. * @param {string} className
  3190. * @return {boolean}
  3191. */
  3192. }, {
  3193. key: "eventTargetHasClass",
  3194. value: function eventTargetHasClass(target, className) {}
  3195. /**
  3196. * Emits a custom "MDCChip:interaction" event denoting the chip has been
  3197. * interacted with (typically on click or keydown).
  3198. */
  3199. }, {
  3200. key: "notifyInteraction",
  3201. value: function notifyInteraction() {}
  3202. /**
  3203. * Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been
  3204. * interacted with (typically on click or keydown).
  3205. */
  3206. }, {
  3207. key: "notifyTrailingIconInteraction",
  3208. value: function notifyTrailingIconInteraction() {}
  3209. /**
  3210. * Emits a custom event "MDCChip:removal" denoting the chip will be removed.
  3211. */
  3212. }, {
  3213. key: "notifyRemoval",
  3214. value: function notifyRemoval() {}
  3215. /**
  3216. * Returns the computed property value of the given style property on the root element.
  3217. * @param {string} propertyName
  3218. * @return {string}
  3219. */
  3220. }, {
  3221. key: "getComputedStyleValue",
  3222. value: function getComputedStyleValue(propertyName) {}
  3223. /**
  3224. * Sets the property value of the given style property on the root element.
  3225. * @param {string} propertyName
  3226. * @param {string} value
  3227. */
  3228. }, {
  3229. key: "setStyleProperty",
  3230. value: function setStyleProperty(propertyName, value) {}
  3231. }]);
  3232. return MDCChipAdapter;
  3233. }();
  3234. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipAdapter);
  3235. /***/ }),
  3236. /* 26 */
  3237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3238. "use strict";
  3239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  3240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3241. /**
  3242. * @license
  3243. * Copyright 2016 Google Inc. All Rights Reserved.
  3244. *
  3245. * Licensed under the Apache License, Version 2.0 (the "License");
  3246. * you may not use this file except in compliance with the License.
  3247. * You may obtain a copy of the License at
  3248. *
  3249. * http://www.apache.org/licenses/LICENSE-2.0
  3250. *
  3251. * Unless required by applicable law or agreed to in writing, software
  3252. * distributed under the License is distributed on an "AS IS" BASIS,
  3253. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3254. * See the License for the specific language governing permissions and
  3255. * limitations under the License.
  3256. */
  3257. /** @enum {string} */
  3258. var strings = {
  3259. ENTRY_ANIMATION_NAME: 'mdc-chip-entry',
  3260. INTERACTION_EVENT: 'MDCChip:interaction',
  3261. TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',
  3262. REMOVAL_EVENT: 'MDCChip:removal',
  3263. CHECKMARK_SELECTOR: '.mdc-chip__checkmark',
  3264. LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',
  3265. TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing'
  3266. };
  3267. /** @enum {string} */
  3268. var cssClasses = {
  3269. CHECKMARK: 'mdc-chip__checkmark',
  3270. CHIP_EXIT: 'mdc-chip--exit',
  3271. HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',
  3272. LEADING_ICON: 'mdc-chip__icon--leading',
  3273. TRAILING_ICON: 'mdc-chip__icon--trailing',
  3274. SELECTED: 'mdc-chip--selected'
  3275. };
  3276. /***/ }),
  3277. /* 27 */
  3278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3279. "use strict";
  3280. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_foundation__ = __webpack_require__(14);
  3281. 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; }; }();
  3282. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3283. /**
  3284. * @license
  3285. * Copyright 2017 Google Inc. All Rights Reserved.
  3286. *
  3287. * Licensed under the Apache License, Version 2.0 (the "License");
  3288. * you may not use this file except in compliance with the License.
  3289. * You may obtain a copy of the License at
  3290. *
  3291. * http://www.apache.org/licenses/LICENSE-2.0
  3292. *
  3293. * Unless required by applicable law or agreed to in writing, software
  3294. * distributed under the License is distributed on an "AS IS" BASIS,
  3295. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3296. * See the License for the specific language governing permissions and
  3297. * limitations under the License.
  3298. */
  3299. // eslint-disable-next-line no-unused-vars
  3300. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3301. /**
  3302. * Adapter for MDC Chip Set.
  3303. *
  3304. * Defines the shape of the adapter expected by the foundation. Implement this
  3305. * adapter to integrate the Chip Set into your framework. See
  3306. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  3307. * for more information.
  3308. *
  3309. * @record
  3310. */
  3311. var MDCChipSetAdapter = function () {
  3312. function MDCChipSetAdapter() {
  3313. _classCallCheck(this, MDCChipSetAdapter);
  3314. }
  3315. _createClass(MDCChipSetAdapter, [{
  3316. key: 'hasClass',
  3317. /**
  3318. * Returns true if the root element contains the given class name.
  3319. * @param {string} className
  3320. * @return {boolean}
  3321. */
  3322. value: function hasClass(className) {}
  3323. /**
  3324. * Removes the chip object from the chip set.
  3325. * @param {!Object} chip
  3326. */
  3327. }, {
  3328. key: 'removeChip',
  3329. value: function removeChip(chip) {}
  3330. }]);
  3331. return MDCChipSetAdapter;
  3332. }();
  3333. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipSetAdapter);
  3334. /***/ }),
  3335. /* 28 */
  3336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3337. "use strict";
  3338. 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; }; }();
  3339. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3340. /**
  3341. * @license
  3342. * Copyright 2017 Google Inc. All Rights Reserved.
  3343. *
  3344. * Licensed under the Apache License, Version 2.0 (the "License");
  3345. * you may not use this file except in compliance with the License.
  3346. * You may obtain a copy of the License at
  3347. *
  3348. * http://www.apache.org/licenses/LICENSE-2.0
  3349. *
  3350. * Unless required by applicable law or agreed to in writing, software
  3351. * distributed under the License is distributed on an "AS IS" BASIS,
  3352. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3353. * See the License for the specific language governing permissions and
  3354. * limitations under the License.
  3355. */
  3356. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3357. /**
  3358. * Adapter for MDC Floating Label.
  3359. *
  3360. * Defines the shape of the adapter expected by the foundation. Implement this
  3361. * adapter to integrate the floating label into your framework. See
  3362. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  3363. * for more information.
  3364. *
  3365. * @record
  3366. */
  3367. var MDCFloatingLabelAdapter = function () {
  3368. function MDCFloatingLabelAdapter() {
  3369. _classCallCheck(this, MDCFloatingLabelAdapter);
  3370. }
  3371. _createClass(MDCFloatingLabelAdapter, [{
  3372. key: "addClass",
  3373. /**
  3374. * Adds a class to the label element.
  3375. * @param {string} className
  3376. */
  3377. value: function addClass(className) {}
  3378. /**
  3379. * Removes a class from the label element.
  3380. * @param {string} className
  3381. */
  3382. }, {
  3383. key: "removeClass",
  3384. value: function removeClass(className) {}
  3385. /**
  3386. * Returns the width of the label element.
  3387. * @return {number}
  3388. */
  3389. }, {
  3390. key: "getWidth",
  3391. value: function getWidth() {}
  3392. /**
  3393. * Registers an event listener on the root element for a given event.
  3394. * @param {string} evtType
  3395. * @param {function(!Event): undefined} handler
  3396. */
  3397. }, {
  3398. key: "registerInteractionHandler",
  3399. value: function registerInteractionHandler(evtType, handler) {}
  3400. /**
  3401. * Deregisters an event listener on the root element for a given event.
  3402. * @param {string} evtType
  3403. * @param {function(!Event): undefined} handler
  3404. */
  3405. }, {
  3406. key: "deregisterInteractionHandler",
  3407. value: function deregisterInteractionHandler(evtType, handler) {}
  3408. }]);
  3409. return MDCFloatingLabelAdapter;
  3410. }();
  3411. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFloatingLabelAdapter);
  3412. /***/ }),
  3413. /* 29 */
  3414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3415. "use strict";
  3416. 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; }; }();
  3417. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3418. /**
  3419. * @license
  3420. * Copyright 2018 Google Inc. All Rights Reserved.
  3421. *
  3422. * Licensed under the Apache License, Version 2.0 (the "License");
  3423. * you may not use this file except in compliance with the License.
  3424. * You may obtain a copy of the License at
  3425. *
  3426. * http://www.apache.org/licenses/LICENSE-2.0
  3427. *
  3428. * Unless required by applicable law or agreed to in writing, software
  3429. * distributed under the License is distributed on an "AS IS" BASIS,
  3430. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3431. * See the License for the specific language governing permissions and
  3432. * limitations under the License.
  3433. */
  3434. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3435. /**
  3436. * Adapter for MDC TextField Line Ripple.
  3437. *
  3438. * Defines the shape of the adapter expected by the foundation. Implement this
  3439. * adapter to integrate the line ripple into your framework. See
  3440. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  3441. * for more information.
  3442. *
  3443. * @record
  3444. */
  3445. var MDCLineRippleAdapter = function () {
  3446. function MDCLineRippleAdapter() {
  3447. _classCallCheck(this, MDCLineRippleAdapter);
  3448. }
  3449. _createClass(MDCLineRippleAdapter, [{
  3450. key: "addClass",
  3451. /**
  3452. * Adds a class to the line ripple element.
  3453. * @param {string} className
  3454. */
  3455. value: function addClass(className) {}
  3456. /**
  3457. * Removes a class from the line ripple element.
  3458. * @param {string} className
  3459. */
  3460. }, {
  3461. key: "removeClass",
  3462. value: function removeClass(className) {}
  3463. /**
  3464. * @param {string} className
  3465. * @return {boolean}
  3466. */
  3467. }, {
  3468. key: "hasClass",
  3469. value: function hasClass(className) {}
  3470. /**
  3471. * Sets the style property with propertyName to value on the root element.
  3472. * @param {string} propertyName
  3473. * @param {string} value
  3474. */
  3475. }, {
  3476. key: "setStyle",
  3477. value: function setStyle(propertyName, value) {}
  3478. /**
  3479. * Registers an event listener on the line ripple element for a given event.
  3480. * @param {string} evtType
  3481. * @param {function(!Event): undefined} handler
  3482. */
  3483. }, {
  3484. key: "registerEventHandler",
  3485. value: function registerEventHandler(evtType, handler) {}
  3486. /**
  3487. * Deregisters an event listener on the line ripple element for a given event.
  3488. * @param {string} evtType
  3489. * @param {function(!Event): undefined} handler
  3490. */
  3491. }, {
  3492. key: "deregisterEventHandler",
  3493. value: function deregisterEventHandler(evtType, handler) {}
  3494. }]);
  3495. return MDCLineRippleAdapter;
  3496. }();
  3497. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLineRippleAdapter);
  3498. /***/ }),
  3499. /* 30 */
  3500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3501. "use strict";
  3502. 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; }; }();
  3503. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3504. /**
  3505. * @license
  3506. * Copyright 2018 Google Inc. All Rights Reserved.
  3507. *
  3508. * Licensed under the Apache License, Version 2.0 (the "License");
  3509. * you may not use this file except in compliance with the License.
  3510. * You may obtain a copy of the License at
  3511. *
  3512. * http://www.apache.org/licenses/LICENSE-2.0
  3513. *
  3514. * Unless required by applicable law or agreed to in writing, software
  3515. * distributed under the License is distributed on an "AS IS" BASIS,
  3516. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3517. * See the License for the specific language governing permissions and
  3518. * limitations under the License.
  3519. */
  3520. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3521. /**
  3522. * Adapter for MDC List. Provides an interface for managing focus.
  3523. *
  3524. * Additionally, provides type information for the adapter to the Closure
  3525. * compiler.
  3526. *
  3527. * Implement this adapter for your framework of choice to delegate updates to
  3528. * the component in your framework of choice. See architecture documentation
  3529. * for more details.
  3530. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  3531. *
  3532. * @record
  3533. */
  3534. var MDCListAdapter = function () {
  3535. function MDCListAdapter() {
  3536. _classCallCheck(this, MDCListAdapter);
  3537. }
  3538. _createClass(MDCListAdapter, [{
  3539. key: "getListItemCount",
  3540. /** @return {number} */
  3541. value: function getListItemCount() {}
  3542. /**
  3543. * @return {number} */
  3544. }, {
  3545. key: "getFocusedElementIndex",
  3546. value: function getFocusedElementIndex() {}
  3547. /** @param {Element} node */
  3548. }, {
  3549. key: "getListItemIndex",
  3550. value: function getListItemIndex(node) {}
  3551. /**
  3552. * @param {number} index
  3553. * @param {string} attribute
  3554. * @param {string} value
  3555. */
  3556. }, {
  3557. key: "setAttributeForElementIndex",
  3558. value: function setAttributeForElementIndex(index, attribute, value) {}
  3559. /**
  3560. * @param {number} index
  3561. * @param {string} attribute
  3562. */
  3563. }, {
  3564. key: "removeAttributeForElementIndex",
  3565. value: function removeAttributeForElementIndex(index, attribute) {}
  3566. /**
  3567. * @param {number} index
  3568. * @param {string} className
  3569. */
  3570. }, {
  3571. key: "addClassForElementIndex",
  3572. value: function addClassForElementIndex(index, className) {}
  3573. /**
  3574. * @param {number} index
  3575. * @param {string} className
  3576. */
  3577. }, {
  3578. key: "removeClassForElementIndex",
  3579. value: function removeClassForElementIndex(index, className) {}
  3580. /**
  3581. * Focuses list item at the index specified.
  3582. * @param {number} index
  3583. */
  3584. }, {
  3585. key: "focusItemAtIndex",
  3586. value: function focusItemAtIndex(index) {}
  3587. /**
  3588. * Checks if the provided element is a focusable sub-element.
  3589. * @param {Element} ele
  3590. */
  3591. }, {
  3592. key: "isElementFocusable",
  3593. value: function isElementFocusable(ele) {}
  3594. /**
  3595. * Checks if the provided element is contains the mdc-list-item class.
  3596. * @param {Element} ele
  3597. */
  3598. }, {
  3599. key: "isListItem",
  3600. value: function isListItem(ele) {}
  3601. /**
  3602. * Sets the tabindex to the value specified for all button/a element children of
  3603. * the list item at the index specified.
  3604. * @param {number} listItemIndex
  3605. * @param {number} tabIndexValue
  3606. */
  3607. }, {
  3608. key: "setTabIndexForListItemChildren",
  3609. value: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {}
  3610. }]);
  3611. return MDCListAdapter;
  3612. }();
  3613. /* unused harmony default export */ var _unused_webpack_default_export = (MDCListAdapter);
  3614. /***/ }),
  3615. /* 31 */
  3616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3617. "use strict";
  3618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  3619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3620. /**
  3621. * @license
  3622. * Copyright 2018 Google Inc. All Rights Reserved.
  3623. *
  3624. * Licensed under the Apache License, Version 2.0 (the "License");
  3625. * you may not use this file except in compliance with the License.
  3626. * You may obtain a copy of the License at
  3627. *
  3628. * http://www.apache.org/licenses/LICENSE-2.0
  3629. *
  3630. * Unless required by applicable law or agreed to in writing, software
  3631. * distributed under the License is distributed on an "AS IS" BASIS,
  3632. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3633. * See the License for the specific language governing permissions and
  3634. * limitations under the License.
  3635. */
  3636. /** @enum {string} */
  3637. var cssClasses = {
  3638. LIST_ITEM_CLASS: 'mdc-list-item',
  3639. LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected'
  3640. };
  3641. /** @enum {string} */
  3642. var strings = {
  3643. ARIA_ORIENTATION: 'aria-orientation',
  3644. ARIA_ORIENTATION_VERTICAL: 'vertical',
  3645. ARIA_SELECTED: 'aria-selected',
  3646. FOCUSABLE_CHILD_ELEMENTS: 'button:not(:disabled), a',
  3647. ENABLED_ITEMS_SELECTOR: '.mdc-list-item:not(.mdc-list-item--disabled)'
  3648. };
  3649. /***/ }),
  3650. /* 32 */
  3651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3652. "use strict";
  3653. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  3654. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  3655. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  3656. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CornerBit; });
  3657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corner; });
  3658. /**
  3659. * @license
  3660. * Copyright 2016 Google Inc. All Rights Reserved.
  3661. *
  3662. * Licensed under the Apache License, Version 2.0 (the "License");
  3663. * you may not use this file except in compliance with the License.
  3664. * You may obtain a copy of the License at
  3665. *
  3666. * http://www.apache.org/licenses/LICENSE-2.0
  3667. *
  3668. * Unless required by applicable law or agreed to in writing, software
  3669. * distributed under the License is distributed on an "AS IS" BASIS,
  3670. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3671. * See the License for the specific language governing permissions and
  3672. * limitations under the License.
  3673. */
  3674. /** @enum {string} */
  3675. var cssClasses = {
  3676. ROOT: 'mdc-menu',
  3677. OPEN: 'mdc-menu--open',
  3678. ANIMATING_OPEN: 'mdc-menu--animating-open',
  3679. ANIMATING_CLOSED: 'mdc-menu--animating-closed',
  3680. SELECTED_LIST_ITEM: 'mdc-list-item--selected'
  3681. };
  3682. /** @enum {string} */
  3683. var strings = {
  3684. ITEMS_SELECTOR: '.mdc-menu__items',
  3685. SELECTED_EVENT: 'MDCMenu:selected',
  3686. CANCEL_EVENT: 'MDCMenu:cancel',
  3687. ARIA_DISABLED_ATTR: 'aria-disabled'
  3688. };
  3689. /** @enum {number} */
  3690. var numbers = {
  3691. // Amount of time to wait before triggering a selected event on the menu. Note that this time
  3692. // will most likely be bumped up once interactive lists are supported to allow for the ripple to
  3693. // animate before closing the menu
  3694. SELECTED_TRIGGER_DELAY: 50,
  3695. // Total duration of menu open animation.
  3696. TRANSITION_OPEN_DURATION: 120,
  3697. // Total duration of menu close animation.
  3698. TRANSITION_CLOSE_DURATION: 75,
  3699. // Margin left to the edge of the viewport when menu is at maximum possible height.
  3700. MARGIN_TO_EDGE: 32,
  3701. // Ratio of anchor width to menu width for switching from corner positioning to center positioning.
  3702. ANCHOR_TO_MENU_WIDTH_RATIO: 0.67,
  3703. // Ratio of vertical offset to menu height for switching from corner to mid-way origin positioning.
  3704. OFFSET_TO_MENU_HEIGHT_RATIO: 0.1
  3705. };
  3706. /**
  3707. * Enum for bits in the {@see Corner) bitmap.
  3708. * @enum {number}
  3709. */
  3710. var CornerBit = {
  3711. BOTTOM: 1,
  3712. CENTER: 2,
  3713. RIGHT: 4,
  3714. FLIP_RTL: 8
  3715. };
  3716. /**
  3717. * Enum for representing an element corner for positioning the menu.
  3718. *
  3719. * The START constants map to LEFT if element directionality is left
  3720. * to right and RIGHT if the directionality is right to left.
  3721. * Likewise END maps to RIGHT or LEFT depending on the directionality.
  3722. *
  3723. * @enum {number}
  3724. */
  3725. var Corner = {
  3726. TOP_LEFT: 0,
  3727. TOP_RIGHT: CornerBit.RIGHT,
  3728. BOTTOM_LEFT: CornerBit.BOTTOM,
  3729. BOTTOM_RIGHT: CornerBit.BOTTOM | CornerBit.RIGHT,
  3730. TOP_START: CornerBit.FLIP_RTL,
  3731. TOP_END: CornerBit.FLIP_RTL | CornerBit.RIGHT,
  3732. BOTTOM_START: CornerBit.BOTTOM | CornerBit.FLIP_RTL,
  3733. BOTTOM_END: CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL
  3734. };
  3735. /***/ }),
  3736. /* 33 */
  3737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3738. "use strict";
  3739. 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; }; }();
  3740. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3741. /**
  3742. * @license
  3743. * Copyright 2017 Google Inc. All Rights Reserved.
  3744. *
  3745. * Licensed under the Apache License, Version 2.0 (the "License");
  3746. * you may not use this file except in compliance with the License.
  3747. * You may obtain a copy of the License at
  3748. *
  3749. * http://www.apache.org/licenses/LICENSE-2.0
  3750. *
  3751. * Unless required by applicable law or agreed to in writing, software
  3752. * distributed under the License is distributed on an "AS IS" BASIS,
  3753. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3754. * See the License for the specific language governing permissions and
  3755. * limitations under the License.
  3756. */
  3757. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3758. /**
  3759. * Adapter for MDC Notched Outline.
  3760. *
  3761. * Defines the shape of the adapter expected by the foundation. Implement this
  3762. * adapter to integrate the Notched Outline into your framework. See
  3763. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  3764. * for more information.
  3765. *
  3766. * @record
  3767. */
  3768. var MDCNotchedOutlineAdapter = function () {
  3769. function MDCNotchedOutlineAdapter() {
  3770. _classCallCheck(this, MDCNotchedOutlineAdapter);
  3771. }
  3772. _createClass(MDCNotchedOutlineAdapter, [{
  3773. key: "getWidth",
  3774. /**
  3775. * Returns the width of the root element.
  3776. * @return {number}
  3777. */
  3778. value: function getWidth() {}
  3779. /**
  3780. * Returns the height of the root element.
  3781. * @return {number}
  3782. */
  3783. }, {
  3784. key: "getHeight",
  3785. value: function getHeight() {}
  3786. /**
  3787. * Adds a class to the root element.
  3788. * @param {string} className
  3789. */
  3790. }, {
  3791. key: "addClass",
  3792. value: function addClass(className) {}
  3793. /**
  3794. * Removes a class from the root element.
  3795. * @param {string} className
  3796. */
  3797. }, {
  3798. key: "removeClass",
  3799. value: function removeClass(className) {}
  3800. /**
  3801. * Sets the "d" attribute of the outline element's SVG path.
  3802. * @param {string} value
  3803. */
  3804. }, {
  3805. key: "setOutlinePathAttr",
  3806. value: function setOutlinePathAttr(value) {}
  3807. /**
  3808. * Returns the idle outline element's computed style value of the given css property `propertyName`.
  3809. * We achieve this via `getComputedStyle(...).getPropertyValue(propertyName)`.
  3810. * @param {string} propertyName
  3811. * @return {string}
  3812. */
  3813. }, {
  3814. key: "getIdleOutlineStyleValue",
  3815. value: function getIdleOutlineStyleValue(propertyName) {}
  3816. }]);
  3817. return MDCNotchedOutlineAdapter;
  3818. }();
  3819. /* unused harmony default export */ var _unused_webpack_default_export = (MDCNotchedOutlineAdapter);
  3820. /***/ }),
  3821. /* 34 */
  3822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3823. "use strict";
  3824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  3826. /**
  3827. * @license
  3828. * Copyright 2018 Google Inc. All Rights Reserved.
  3829. *
  3830. * Licensed under the Apache License, Version 2.0 (the "License");
  3831. * you may not use this file except in compliance with the License.
  3832. * You may obtain a copy of the License at
  3833. *
  3834. * http://www.apache.org/licenses/LICENSE-2.0
  3835. *
  3836. * Unless required by applicable law or agreed to in writing, software
  3837. * distributed under the License is distributed on an "AS IS" BASIS,
  3838. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3839. * See the License for the specific language governing permissions and
  3840. * limitations under the License.
  3841. */
  3842. /** @enum {string} */
  3843. var strings = {
  3844. PATH_SELECTOR: '.mdc-notched-outline__path',
  3845. IDLE_OUTLINE_SELECTOR: '.mdc-notched-outline__idle'
  3846. };
  3847. /** @enum {string} */
  3848. var cssClasses = {
  3849. OUTLINE_NOTCHED: 'mdc-notched-outline--notched'
  3850. };
  3851. /***/ }),
  3852. /* 35 */
  3853. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3854. "use strict";
  3855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  3857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  3858. /**
  3859. * Copyright 2016 Google Inc. All Rights Reserved.
  3860. *
  3861. * Licensed under the Apache License, Version 2.0 (the "License");
  3862. * you may not use this file except in compliance with the License.
  3863. * You may obtain a copy of the License at
  3864. *
  3865. * http://www.apache.org/licenses/LICENSE-2.0
  3866. *
  3867. * Unless required by applicable law or agreed to in writing, software
  3868. * distributed under the License is distributed on an "AS IS" BASIS,
  3869. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3870. * See the License for the specific language governing permissions and
  3871. * limitations under the License.
  3872. */
  3873. var cssClasses = {
  3874. BOX: 'mdc-select--box',
  3875. DISABLED: 'mdc-select--disabled',
  3876. ROOT: 'mdc-select',
  3877. OUTLINED: 'mdc-select--outlined'
  3878. };
  3879. var strings = {
  3880. CHANGE_EVENT: 'MDCSelect:change',
  3881. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
  3882. LABEL_SELECTOR: '.mdc-floating-label',
  3883. NATIVE_CONTROL_SELECTOR: '.mdc-select__native-control',
  3884. OUTLINE_SELECTOR: '.mdc-notched-outline'
  3885. };
  3886. /** @enum {number} */
  3887. var numbers = {
  3888. LABEL_SCALE: 0.75
  3889. };
  3890. /***/ }),
  3891. /* 36 */
  3892. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3893. "use strict";
  3894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3895. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  3896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  3897. /**
  3898. * @license
  3899. * Copyright 2017 Google Inc. All Rights Reserved.
  3900. *
  3901. * Licensed under the Apache License, Version 2.0 (the "License");
  3902. * you may not use this file except in compliance with the License.
  3903. * You may obtain a copy of the License at
  3904. *
  3905. * http://www.apache.org/licenses/LICENSE-2.0
  3906. *
  3907. * Unless required by applicable law or agreed to in writing, software
  3908. * distributed under the License is distributed on an "AS IS" BASIS,
  3909. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3910. * See the License for the specific language governing permissions and
  3911. * limitations under the License.
  3912. */
  3913. /** @enum {string} */
  3914. var cssClasses = {
  3915. ACTIVE: 'mdc-slider--active',
  3916. DISABLED: 'mdc-slider--disabled',
  3917. DISCRETE: 'mdc-slider--discrete',
  3918. FOCUS: 'mdc-slider--focus',
  3919. IN_TRANSIT: 'mdc-slider--in-transit',
  3920. IS_DISCRETE: 'mdc-slider--discrete',
  3921. HAS_TRACK_MARKER: 'mdc-slider--display-markers'
  3922. };
  3923. /** @enum {string} */
  3924. var strings = {
  3925. TRACK_SELECTOR: '.mdc-slider__track',
  3926. TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',
  3927. LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child',
  3928. THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',
  3929. PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',
  3930. ARIA_VALUEMIN: 'aria-valuemin',
  3931. ARIA_VALUEMAX: 'aria-valuemax',
  3932. ARIA_VALUENOW: 'aria-valuenow',
  3933. ARIA_DISABLED: 'aria-disabled',
  3934. STEP_DATA_ATTR: 'data-step',
  3935. CHANGE_EVENT: 'MDCSlider:change',
  3936. INPUT_EVENT: 'MDCSlider:input'
  3937. };
  3938. /** @enum {number} */
  3939. var numbers = {
  3940. PAGE_FACTOR: 4
  3941. };
  3942. /***/ }),
  3943. /* 37 */
  3944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3945. "use strict";
  3946. 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; }; }();
  3947. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3948. /**
  3949. * @license
  3950. * Copyright 2017 Google Inc. All Rights Reserved.
  3951. *
  3952. * Licensed under the Apache License, Version 2.0 (the "License");
  3953. * you may not use this file except in compliance with the License.
  3954. * You may obtain a copy of the License at
  3955. *
  3956. * http://www.apache.org/licenses/LICENSE-2.0
  3957. *
  3958. * Unless required by applicable law or agreed to in writing, software
  3959. * distributed under the License is distributed on an "AS IS" BASIS,
  3960. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3961. * See the License for the specific language governing permissions and
  3962. * limitations under the License.
  3963. */
  3964. /* eslint-disable no-unused-vars */
  3965. /**
  3966. * Adapter for MDC Slider.
  3967. *
  3968. * Defines the shape of the adapter expected by the foundation. Implement this
  3969. * adapter to integrate the Slider into your framework. See
  3970. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  3971. * for more information.
  3972. *
  3973. * @record
  3974. */
  3975. var MDCSliderAdapter = function () {
  3976. function MDCSliderAdapter() {
  3977. _classCallCheck(this, MDCSliderAdapter);
  3978. }
  3979. _createClass(MDCSliderAdapter, [{
  3980. key: "hasClass",
  3981. /**
  3982. * Returns true if className exists for the slider Element
  3983. * @param {string} className
  3984. * @return {boolean}
  3985. */
  3986. value: function hasClass(className) {}
  3987. /**
  3988. * Adds a class to the slider Element
  3989. * @param {string} className
  3990. */
  3991. }, {
  3992. key: "addClass",
  3993. value: function addClass(className) {}
  3994. /**
  3995. * Removes a class from the slider Element
  3996. * @param {string} className
  3997. */
  3998. }, {
  3999. key: "removeClass",
  4000. value: function removeClass(className) {}
  4001. /**
  4002. * Returns a string if attribute name exists on the slider Element,
  4003. * otherwise returns null
  4004. * @param {string} name
  4005. * @return {?string}
  4006. */
  4007. }, {
  4008. key: "getAttribute",
  4009. value: function getAttribute(name) {}
  4010. /**
  4011. * Sets attribute name on slider Element to value
  4012. * @param {string} name
  4013. * @param {string} value
  4014. */
  4015. }, {
  4016. key: "setAttribute",
  4017. value: function setAttribute(name, value) {}
  4018. /**
  4019. * Removes attribute name from slider Element
  4020. * @param {string} name
  4021. */
  4022. }, {
  4023. key: "removeAttribute",
  4024. value: function removeAttribute(name) {}
  4025. /**
  4026. * Returns the bounding client rect for the slider Element
  4027. * @return {?ClientRect}
  4028. */
  4029. }, {
  4030. key: "computeBoundingRect",
  4031. value: function computeBoundingRect() {}
  4032. /**
  4033. * Returns the tab index of the slider Element
  4034. * @return {number}
  4035. */
  4036. }, {
  4037. key: "getTabIndex",
  4038. value: function getTabIndex() {}
  4039. /**
  4040. * Registers an event handler on the root element for a given event.
  4041. * @param {string} type
  4042. * @param {function(!Event): undefined} handler
  4043. */
  4044. }, {
  4045. key: "registerInteractionHandler",
  4046. value: function registerInteractionHandler(type, handler) {}
  4047. /**
  4048. * Deregisters an event handler on the root element for a given event.
  4049. * @param {string} type
  4050. * @param {function(!Event): undefined} handler
  4051. */
  4052. }, {
  4053. key: "deregisterInteractionHandler",
  4054. value: function deregisterInteractionHandler(type, handler) {}
  4055. /**
  4056. * Registers an event handler on the thumb container element for a given event.
  4057. * @param {string} type
  4058. * @param {function(!Event): undefined} handler
  4059. */
  4060. }, {
  4061. key: "registerThumbContainerInteractionHandler",
  4062. value: function registerThumbContainerInteractionHandler(type, handler) {}
  4063. /**
  4064. * Deregisters an event handler on the thumb container element for a given event.
  4065. * @param {string} type
  4066. * @param {function(!Event): undefined} handler
  4067. */
  4068. }, {
  4069. key: "deregisterThumbContainerInteractionHandler",
  4070. value: function deregisterThumbContainerInteractionHandler(type, handler) {}
  4071. /**
  4072. * Registers an event handler on the body for a given event.
  4073. * @param {string} type
  4074. * @param {function(!Event): undefined} handler
  4075. */
  4076. }, {
  4077. key: "registerBodyInteractionHandler",
  4078. value: function registerBodyInteractionHandler(type, handler) {}
  4079. /**
  4080. * Deregisters an event handler on the body for a given event.
  4081. * @param {string} type
  4082. * @param {function(!Event): undefined} handler
  4083. */
  4084. }, {
  4085. key: "deregisterBodyInteractionHandler",
  4086. value: function deregisterBodyInteractionHandler(type, handler) {}
  4087. /**
  4088. * Registers an event handler for the window resize event
  4089. * @param {function(!Event): undefined} handler
  4090. */
  4091. }, {
  4092. key: "registerResizeHandler",
  4093. value: function registerResizeHandler(handler) {}
  4094. /**
  4095. * Deregisters an event handler for the window resize event
  4096. * @param {function(!Event): undefined} handler
  4097. */
  4098. }, {
  4099. key: "deregisterResizeHandler",
  4100. value: function deregisterResizeHandler(handler) {}
  4101. /**
  4102. * Emits a custom event MDCSlider:input from the root
  4103. */
  4104. }, {
  4105. key: "notifyInput",
  4106. value: function notifyInput() {}
  4107. /**
  4108. * Emits a custom event MDCSlider:change from the root
  4109. */
  4110. }, {
  4111. key: "notifyChange",
  4112. value: function notifyChange() {}
  4113. /**
  4114. * Sets a style property of the thumb container element to the passed value
  4115. * @param {string} propertyName
  4116. * @param {string} value
  4117. */
  4118. }, {
  4119. key: "setThumbContainerStyleProperty",
  4120. value: function setThumbContainerStyleProperty(propertyName, value) {}
  4121. /**
  4122. * Sets a style property of the track element to the passed value
  4123. * @param {string} propertyName
  4124. * @param {string} value
  4125. */
  4126. }, {
  4127. key: "setTrackStyleProperty",
  4128. value: function setTrackStyleProperty(propertyName, value) {}
  4129. /**
  4130. * Sets the inner text of the pin marker to the passed value
  4131. * @param {number} value
  4132. */
  4133. }, {
  4134. key: "setMarkerValue",
  4135. value: function setMarkerValue(value) {}
  4136. /**
  4137. * Appends the passed number of track markers to the track mark container element
  4138. * @param {number} numMarkers
  4139. */
  4140. }, {
  4141. key: "appendTrackMarkers",
  4142. value: function appendTrackMarkers(numMarkers) {}
  4143. /**
  4144. * Removes all track markers fromt he track mark container element
  4145. */
  4146. }, {
  4147. key: "removeTrackMarkers",
  4148. value: function removeTrackMarkers() {}
  4149. /**
  4150. * Sets a style property of the last track marker to the passed value
  4151. * @param {string} propertyName
  4152. * @param {string} value
  4153. */
  4154. }, {
  4155. key: "setLastTrackMarkersStyleProperty",
  4156. value: function setLastTrackMarkersStyleProperty(propertyName, value) {}
  4157. /**
  4158. * Returns true if the root element is RTL, otherwise false
  4159. * @return {boolean}
  4160. */
  4161. }, {
  4162. key: "isRTL",
  4163. value: function isRTL() {}
  4164. }]);
  4165. return MDCSliderAdapter;
  4166. }();
  4167. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSliderAdapter);
  4168. /***/ }),
  4169. /* 38 */
  4170. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4171. "use strict";
  4172. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  4173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicator", function() { return MDCTabIndicator; });
  4174. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  4175. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(39);
  4176. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(20);
  4177. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__ = __webpack_require__(120);
  4178. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fading_foundation__ = __webpack_require__(121);
  4179. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  4180. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlidingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a"]; });
  4181. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFadingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a"]; });
  4182. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4183. 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; }; }();
  4184. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4185. 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; }
  4186. 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; }
  4187. /**
  4188. * @license
  4189. * Copyright 2018 Google Inc. All Rights Reserved.
  4190. *
  4191. * Licensed under the Apache License, Version 2.0 (the "License")
  4192. * you may not use this file except in compliance with the License.
  4193. * You may obtain a copy of the License at
  4194. *
  4195. * http://www.apache.org/licenses/LICENSE-2.0
  4196. *
  4197. * Unless required by applicable law or agreed to in writing, software
  4198. * distributed under the License is distributed on an "AS IS" BASIS,
  4199. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4200. * See the License for the specific language governing permissions and
  4201. * limitations under the License.
  4202. */
  4203. /**
  4204. * @extends {MDCComponent<!MDCTabIndicatorFoundation>}
  4205. * @final
  4206. */
  4207. var MDCTabIndicator = function (_MDCComponent) {
  4208. _inherits(MDCTabIndicator, _MDCComponent);
  4209. _createClass(MDCTabIndicator, null, [{
  4210. key: 'attachTo',
  4211. /**
  4212. * @param {!Element} root
  4213. * @return {!MDCTabIndicator}
  4214. */
  4215. value: function attachTo(root) {
  4216. return new MDCTabIndicator(root);
  4217. }
  4218. /**
  4219. * @param {...?} args
  4220. */
  4221. }]);
  4222. function MDCTabIndicator() {
  4223. var _ref;
  4224. _classCallCheck(this, MDCTabIndicator);
  4225. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  4226. args[_key] = arguments[_key];
  4227. }
  4228. /** @type {?Element} */
  4229. var _this = _possibleConstructorReturn(this, (_ref = MDCTabIndicator.__proto__ || Object.getPrototypeOf(MDCTabIndicator)).call.apply(_ref, [this].concat(args)));
  4230. _this.content_;
  4231. return _this;
  4232. }
  4233. _createClass(MDCTabIndicator, [{
  4234. key: 'initialize',
  4235. value: function initialize() {
  4236. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  4237. }
  4238. /**
  4239. * @return {!ClientRect}
  4240. */
  4241. }, {
  4242. key: 'computeContentClientRect',
  4243. value: function computeContentClientRect() {
  4244. return this.foundation_.computeContentClientRect();
  4245. }
  4246. /**
  4247. * @return {!MDCTabIndicatorFoundation}
  4248. */
  4249. }, {
  4250. key: 'getDefaultFoundation',
  4251. value: function getDefaultFoundation() {
  4252. var _this2 = this;
  4253. var adapter = /** @type {!MDCTabIndicatorAdapter} */_extends({
  4254. registerEventHandler: function registerEventHandler(evtType, handler) {
  4255. return _this2.root_.addEventListener(evtType, handler);
  4256. },
  4257. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  4258. return _this2.root_.removeEventListener(evtType, handler);
  4259. },
  4260. addClass: function addClass(className) {
  4261. return _this2.root_.classList.add(className);
  4262. },
  4263. removeClass: function removeClass(className) {
  4264. return _this2.root_.classList.remove(className);
  4265. },
  4266. computeContentClientRect: function computeContentClientRect() {
  4267. return _this2.content_.getBoundingClientRect();
  4268. },
  4269. setContentStyleProperty: function setContentStyleProperty(prop, value) {
  4270. return _this2.content_.style.setProperty(prop, value);
  4271. }
  4272. });
  4273. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].cssClasses.FADE)) {
  4274. return new __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a" /* default */](adapter);
  4275. }
  4276. // Default to the sliding indicator
  4277. return new __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a" /* default */](adapter);
  4278. }
  4279. /**
  4280. * @param {!ClientRect=} previousIndicatorClientRect
  4281. */
  4282. }, {
  4283. key: 'activate',
  4284. value: function activate(previousIndicatorClientRect) {
  4285. this.foundation_.activate(previousIndicatorClientRect);
  4286. }
  4287. }, {
  4288. key: 'deactivate',
  4289. value: function deactivate() {
  4290. this.foundation_.deactivate();
  4291. }
  4292. }]);
  4293. return MDCTabIndicator;
  4294. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  4295. /***/ }),
  4296. /* 39 */
  4297. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4298. "use strict";
  4299. 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; }; }();
  4300. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4301. /**
  4302. * @license
  4303. * Copyright 2018 Google Inc. All Rights Reserved.
  4304. *
  4305. * Licensed under the Apache License, Version 2.0 (the "License")
  4306. * you may not use this file except in compliance with the License.
  4307. * You may obtain a copy of the License at
  4308. *
  4309. * http://www.apache.org/licenses/LICENSE-2.0
  4310. *
  4311. * Unless required by applicable law or agreed to in writing, software
  4312. * distributed under the License is distributed on an "AS IS" BASIS,
  4313. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4314. * See the License for the specific language governing permissions and
  4315. * limitations under the License.
  4316. */
  4317. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4318. /**
  4319. * Adapter for MDC Tab Indicator.
  4320. *
  4321. * Defines the shape of the adapter expected by the foundation. Implement this
  4322. * adapter to integrate the Tab Indicator into your framework. See
  4323. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4324. * for more information.
  4325. *
  4326. * @record
  4327. */
  4328. var MDCTabIndicatorAdapter = function () {
  4329. function MDCTabIndicatorAdapter() {
  4330. _classCallCheck(this, MDCTabIndicatorAdapter);
  4331. }
  4332. _createClass(MDCTabIndicatorAdapter, [{
  4333. key: "registerEventHandler",
  4334. /**
  4335. * Registers an event listener on the root element for a given event.
  4336. * @param {string} evtType
  4337. * @param {function(!Event): undefined} handler
  4338. */
  4339. value: function registerEventHandler(evtType, handler) {}
  4340. /**
  4341. * Deregisters an event listener on the root element for a given event.
  4342. * @param {string} evtType
  4343. * @param {function(!Event): undefined} handler
  4344. */
  4345. }, {
  4346. key: "deregisterEventHandler",
  4347. value: function deregisterEventHandler(evtType, handler) {}
  4348. /**
  4349. * Adds the given className to the root element.
  4350. * @param {string} className The className to add
  4351. */
  4352. }, {
  4353. key: "addClass",
  4354. value: function addClass(className) {}
  4355. /**
  4356. * Removes the given className from the root element.
  4357. * @param {string} className The className to remove
  4358. */
  4359. }, {
  4360. key: "removeClass",
  4361. value: function removeClass(className) {}
  4362. /**
  4363. * Returns the client rect of the content element.
  4364. * @return {!ClientRect}
  4365. */
  4366. }, {
  4367. key: "computeContentClientRect",
  4368. value: function computeContentClientRect() {}
  4369. /**
  4370. * Sets a style property of the content element to the passed value
  4371. * @param {string} propName The style property name to set
  4372. * @param {string} value The style property value
  4373. */
  4374. }, {
  4375. key: "setContentStyleProperty",
  4376. value: function setContentStyleProperty(propName, value) {}
  4377. }]);
  4378. return MDCTabIndicatorAdapter;
  4379. }();
  4380. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabIndicatorAdapter);
  4381. /***/ }),
  4382. /* 40 */
  4383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4384. "use strict";
  4385. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4386. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(11);
  4387. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(122);
  4388. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  4389. 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; }; }();
  4390. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4391. 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; }
  4392. 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; }
  4393. /**
  4394. * @license
  4395. * Copyright 2018 Google Inc. All Rights Reserved.
  4396. *
  4397. * Licensed under the Apache License, Version 2.0 (the "License");
  4398. * you may not use this file except in compliance with the License.
  4399. * You may obtain a copy of the License at
  4400. *
  4401. * http://www.apache.org/licenses/LICENSE-2.0
  4402. *
  4403. * Unless required by applicable law or agreed to in writing, software
  4404. * distributed under the License is distributed on an "AS IS" BASIS,
  4405. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4406. * See the License for the specific language governing permissions and
  4407. * limitations under the License.
  4408. */
  4409. /* eslint-disable no-unused-vars */
  4410. /* eslint-enable no-unused-vars */
  4411. /**
  4412. * @extends {MDCFoundation<!MDCTabAdapter>}
  4413. * @final
  4414. */
  4415. var MDCTabFoundation = function (_MDCFoundation) {
  4416. _inherits(MDCTabFoundation, _MDCFoundation);
  4417. _createClass(MDCTabFoundation, null, [{
  4418. key: 'cssClasses',
  4419. /** @return enum {string} */
  4420. get: function get() {
  4421. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4422. }
  4423. /** @return enum {string} */
  4424. }, {
  4425. key: 'strings',
  4426. get: function get() {
  4427. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4428. }
  4429. /**
  4430. * @see MDCTabAdapter for typing information
  4431. * @return {!MDCTabAdapter}
  4432. */
  4433. }, {
  4434. key: 'defaultAdapter',
  4435. get: function get() {
  4436. return (/** @type {!MDCTabAdapter} */{
  4437. registerEventHandler: function registerEventHandler() {},
  4438. deregisterEventHandler: function deregisterEventHandler() {},
  4439. addClass: function addClass() {},
  4440. removeClass: function removeClass() {},
  4441. hasClass: function hasClass() {},
  4442. setAttr: function setAttr() {},
  4443. activateIndicator: function activateIndicator() {},
  4444. deactivateIndicator: function deactivateIndicator() {},
  4445. computeIndicatorClientRect: function computeIndicatorClientRect() {},
  4446. notifyInteracted: function notifyInteracted() {},
  4447. getOffsetLeft: function getOffsetLeft() {},
  4448. getOffsetWidth: function getOffsetWidth() {},
  4449. getContentOffsetLeft: function getContentOffsetLeft() {},
  4450. getContentOffsetWidth: function getContentOffsetWidth() {},
  4451. focus: function focus() {}
  4452. }
  4453. );
  4454. }
  4455. /** @param {!MDCTabAdapter} adapter */
  4456. }]);
  4457. function MDCTabFoundation(adapter) {
  4458. _classCallCheck(this, MDCTabFoundation);
  4459. /** @private {function(!Event): undefined} */
  4460. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  4461. _this.handleTransitionEnd_ = function (evt) {
  4462. return _this.handleTransitionEnd(evt);
  4463. };
  4464. /** @private {function(?Event): undefined} */
  4465. _this.handleClick_ = function () {
  4466. return _this.handleClick();
  4467. };
  4468. return _this;
  4469. }
  4470. _createClass(MDCTabFoundation, [{
  4471. key: 'init',
  4472. value: function init() {
  4473. this.adapter_.registerEventHandler('click', this.handleClick_);
  4474. }
  4475. /**
  4476. * Handles the "transitionend" event
  4477. * @param {!Event} evt A browser event
  4478. */
  4479. }, {
  4480. key: 'handleTransitionEnd',
  4481. value: function handleTransitionEnd(evt) {
  4482. // Early exit for ripple
  4483. if (evt.pseudoElement) {
  4484. return;
  4485. }
  4486. this.adapter_.deregisterEventHandler('transitionend', this.handleTransitionEnd_);
  4487. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATING_ACTIVATE);
  4488. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATING_DEACTIVATE);
  4489. }
  4490. /**
  4491. * Handles the "click" event
  4492. */
  4493. }, {
  4494. key: 'handleClick',
  4495. value: function handleClick() {
  4496. // It's up to the parent component to keep track of the active Tab and
  4497. // ensure we don't activate a Tab that's already active.
  4498. this.adapter_.notifyInteracted();
  4499. }
  4500. /**
  4501. * Returns the Tab's active state
  4502. * @return {boolean}
  4503. */
  4504. }, {
  4505. key: 'isActive',
  4506. value: function isActive() {
  4507. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  4508. }
  4509. /**
  4510. * Activates the Tab
  4511. * @param {!ClientRect=} previousIndicatorClientRect
  4512. */
  4513. }, {
  4514. key: 'activate',
  4515. value: function activate(previousIndicatorClientRect) {
  4516. // Early exit
  4517. if (this.isActive()) {
  4518. return;
  4519. }
  4520. this.adapter_.registerEventHandler('transitionend', this.handleTransitionEnd_);
  4521. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATING_ACTIVATE);
  4522. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  4523. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  4524. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0');
  4525. this.adapter_.activateIndicator(previousIndicatorClientRect);
  4526. this.adapter_.focus();
  4527. }
  4528. /**
  4529. * Deactivates the Tab
  4530. */
  4531. }, {
  4532. key: 'deactivate',
  4533. value: function deactivate() {
  4534. // Early exit
  4535. if (!this.isActive()) {
  4536. return;
  4537. }
  4538. this.adapter_.registerEventHandler('transitionend', this.handleTransitionEnd_);
  4539. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATING_DEACTIVATE);
  4540. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  4541. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  4542. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1');
  4543. this.adapter_.deactivateIndicator();
  4544. }
  4545. /**
  4546. * Returns the indicator's client rect
  4547. * @return {!ClientRect}
  4548. */
  4549. }, {
  4550. key: 'computeIndicatorClientRect',
  4551. value: function computeIndicatorClientRect() {
  4552. return this.adapter_.computeIndicatorClientRect();
  4553. }
  4554. /**
  4555. * Returns the dimensions of the Tab
  4556. * @return {!MDCTabDimensions}
  4557. */
  4558. }, {
  4559. key: 'computeDimensions',
  4560. value: function computeDimensions() {
  4561. var rootWidth = this.adapter_.getOffsetWidth();
  4562. var rootLeft = this.adapter_.getOffsetLeft();
  4563. var contentWidth = this.adapter_.getContentOffsetWidth();
  4564. var contentLeft = this.adapter_.getContentOffsetLeft();
  4565. return {
  4566. rootLeft: rootLeft,
  4567. rootRight: rootLeft + rootWidth,
  4568. contentLeft: rootLeft + contentLeft,
  4569. contentRight: rootLeft + contentLeft + contentWidth
  4570. };
  4571. }
  4572. }]);
  4573. return MDCTabFoundation;
  4574. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4575. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  4576. /***/ }),
  4577. /* 41 */
  4578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4579. "use strict";
  4580. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  4581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScroller", function() { return MDCTabScroller; });
  4582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  4583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  4584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(124);
  4585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(128);
  4586. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScrollerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  4587. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  4588. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  4589. 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; }; }();
  4590. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4591. 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; }
  4592. 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; }
  4593. /**
  4594. * @license
  4595. * Copyright 2018 Google Inc. All Rights Reserved.
  4596. *
  4597. * Licensed under the Apache License, Version 2.0 (the "License")
  4598. * you may not use this file except in compliance with the License.
  4599. * You may obtain a copy of the License at
  4600. *
  4601. * http://www.apache.org/licenses/LICENSE-2.0
  4602. *
  4603. * Unless required by applicable law or agreed to in writing, software
  4604. * distributed under the License is distributed on an "AS IS" BASIS,
  4605. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4606. * See the License for the specific language governing permissions and
  4607. * limitations under the License.
  4608. */
  4609. /**
  4610. * @extends {MDCComponent<!MDCTabScrollerFoundation>}
  4611. * @final
  4612. */
  4613. var MDCTabScroller = function (_MDCComponent) {
  4614. _inherits(MDCTabScroller, _MDCComponent);
  4615. _createClass(MDCTabScroller, null, [{
  4616. key: 'attachTo',
  4617. /**
  4618. * @param {!Element} root
  4619. * @return {!MDCTabScroller}
  4620. */
  4621. value: function attachTo(root) {
  4622. return new MDCTabScroller(root);
  4623. }
  4624. }]);
  4625. function MDCTabScroller() {
  4626. var _ref;
  4627. _classCallCheck(this, MDCTabScroller);
  4628. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  4629. args[_key] = arguments[_key];
  4630. }
  4631. /** @private {?Element} */
  4632. var _this = _possibleConstructorReturn(this, (_ref = MDCTabScroller.__proto__ || Object.getPrototypeOf(MDCTabScroller)).call.apply(_ref, [this].concat(args)));
  4633. _this.content_;
  4634. /** @private {?Element} */
  4635. _this.area_;
  4636. /** @private {?function(?Event): undefined} */
  4637. _this.handleInteraction_;
  4638. /** @private {?function(!Event): undefined} */
  4639. _this.handleTransitionEnd_;
  4640. return _this;
  4641. }
  4642. _createClass(MDCTabScroller, [{
  4643. key: 'initialize',
  4644. value: function initialize() {
  4645. this.area_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.AREA_SELECTOR);
  4646. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  4647. }
  4648. }, {
  4649. key: 'initialSyncWithDOM',
  4650. value: function initialSyncWithDOM() {
  4651. var _this2 = this;
  4652. this.handleInteraction_ = function () {
  4653. return _this2.foundation_.handleInteraction();
  4654. };
  4655. this.handleTransitionEnd_ = function (evt) {
  4656. return _this2.foundation_.handleTransitionEnd(evt);
  4657. };
  4658. this.area_.addEventListener('wheel', this.handleInteraction_);
  4659. this.area_.addEventListener('touchstart', this.handleInteraction_);
  4660. this.area_.addEventListener('pointerdown', this.handleInteraction_);
  4661. this.area_.addEventListener('mousedown', this.handleInteraction_);
  4662. this.area_.addEventListener('keydown', this.handleInteraction_);
  4663. this.content_.addEventListener('transitionend', this.handleTransitionEnd_);
  4664. }
  4665. }, {
  4666. key: 'destroy',
  4667. value: function destroy() {
  4668. _get(MDCTabScroller.prototype.__proto__ || Object.getPrototypeOf(MDCTabScroller.prototype), 'destroy', this).call(this);
  4669. this.area_.removeEventListener('wheel', this.handleInteraction_);
  4670. this.area_.removeEventListener('touchstart', this.handleInteraction_);
  4671. this.area_.removeEventListener('pointerdown', this.handleInteraction_);
  4672. this.area_.removeEventListener('mousedown', this.handleInteraction_);
  4673. this.area_.removeEventListener('keydown', this.handleInteraction_);
  4674. this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);
  4675. }
  4676. /**
  4677. * @return {!MDCTabScrollerFoundation}
  4678. */
  4679. }, {
  4680. key: 'getDefaultFoundation',
  4681. value: function getDefaultFoundation() {
  4682. var _this3 = this;
  4683. var adapter = /** @type {!MDCTabScrollerAdapter} */{
  4684. eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
  4685. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  4686. return evtTarget[MATCHES](selector);
  4687. },
  4688. addClass: function addClass(className) {
  4689. return _this3.root_.classList.add(className);
  4690. },
  4691. removeClass: function removeClass(className) {
  4692. return _this3.root_.classList.remove(className);
  4693. },
  4694. addScrollAreaClass: function addScrollAreaClass(className) {
  4695. return _this3.area_.classList.add(className);
  4696. },
  4697. setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
  4698. return _this3.area_.style.setProperty(prop, value);
  4699. },
  4700. setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
  4701. return _this3.content_.style.setProperty(prop, value);
  4702. },
  4703. getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
  4704. return window.getComputedStyle(_this3.content_).getPropertyValue(propName);
  4705. },
  4706. setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
  4707. return _this3.area_.scrollLeft = scrollX;
  4708. },
  4709. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  4710. return _this3.area_.scrollLeft;
  4711. },
  4712. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  4713. return _this3.content_.offsetWidth;
  4714. },
  4715. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  4716. return _this3.area_.offsetWidth;
  4717. },
  4718. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  4719. return _this3.area_.getBoundingClientRect();
  4720. },
  4721. computeScrollContentClientRect: function computeScrollContentClientRect() {
  4722. return _this3.content_.getBoundingClientRect();
  4723. },
  4724. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  4725. return __WEBPACK_IMPORTED_MODULE_3__util__["computeHorizontalScrollbarHeight"](document);
  4726. }
  4727. };
  4728. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](adapter);
  4729. }
  4730. /**
  4731. * Returns the current visual scroll position
  4732. * @return {number}
  4733. */
  4734. }, {
  4735. key: 'getScrollPosition',
  4736. value: function getScrollPosition() {
  4737. return this.foundation_.getScrollPosition();
  4738. }
  4739. /**
  4740. * Returns the width of the scroll content
  4741. * @return {number}
  4742. */
  4743. }, {
  4744. key: 'getScrollContentWidth',
  4745. value: function getScrollContentWidth() {
  4746. return this.content_.offsetWidth;
  4747. }
  4748. /**
  4749. * Increments the scroll value by the given amount
  4750. * @param {number} scrollXIncrement The pixel value by which to increment the scroll value
  4751. */
  4752. }, {
  4753. key: 'incrementScroll',
  4754. value: function incrementScroll(scrollXIncrement) {
  4755. this.foundation_.incrementScroll(scrollXIncrement);
  4756. }
  4757. /**
  4758. * Scrolls to the given pixel position
  4759. * @param {number} scrollX The pixel value to scroll to
  4760. */
  4761. }, {
  4762. key: 'scrollTo',
  4763. value: function scrollTo(scrollX) {
  4764. this.foundation_.scrollTo(scrollX);
  4765. }
  4766. }]);
  4767. return MDCTabScroller;
  4768. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  4769. /***/ }),
  4770. /* 42 */
  4771. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4772. "use strict";
  4773. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  4774. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  4775. /**
  4776. * @license
  4777. * Copyright 2018 Google Inc. All Rights Reserved.
  4778. *
  4779. * Licensed under the Apache License, Version 2.0 (the "License")
  4780. * you may not use this file except in compliance with the License.
  4781. * You may obtain a copy of the License at
  4782. *
  4783. * http://www.apache.org/licenses/LICENSE-2.0
  4784. *
  4785. * Unless required by applicable law or agreed to in writing, software
  4786. * distributed under the License is distributed on an "AS IS" BASIS,
  4787. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4788. * See the License for the specific language governing permissions and
  4789. * limitations under the License.
  4790. */
  4791. /** @enum {string} */
  4792. var cssClasses = {
  4793. ANIMATING: 'mdc-tab-scroller--animating',
  4794. SCROLL_TEST: 'mdc-tab-scroller__test',
  4795. SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll'
  4796. };
  4797. /** @enum {string} */
  4798. var strings = {
  4799. AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',
  4800. CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content'
  4801. };
  4802. /***/ }),
  4803. /* 43 */
  4804. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4805. "use strict";
  4806. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_tab_adapter__ = __webpack_require__(11);
  4807. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(19);
  4808. 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; }; }();
  4809. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4810. /**
  4811. * @license
  4812. * Copyright 2018 Google Inc. All Rights Reserved.
  4813. *
  4814. * Licensed under the Apache License, Version 2.0 (the "License")
  4815. * you may not use this file except in compliance with the License.
  4816. * You may obtain a copy of the License at
  4817. *
  4818. * http://www.apache.org/licenses/LICENSE-2.0
  4819. *
  4820. * Unless required by applicable law or agreed to in writing, software
  4821. * distributed under the License is distributed on an "AS IS" BASIS,
  4822. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4823. * See the License for the specific language governing permissions and
  4824. * limitations under the License.
  4825. */
  4826. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4827. /* eslint-disable no-unused-vars */
  4828. /* eslint-enable no-unused-vars */
  4829. /**
  4830. * Adapter for MDC Tab Bar.
  4831. *
  4832. * Defines the shape of the adapter expected by the foundation. Implement this
  4833. * adapter to integrate the Tab Bar into your framework. See
  4834. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4835. * for more information.
  4836. *
  4837. * @record
  4838. */
  4839. var MDCTabBarAdapter = function () {
  4840. function MDCTabBarAdapter() {
  4841. _classCallCheck(this, MDCTabBarAdapter);
  4842. }
  4843. _createClass(MDCTabBarAdapter, [{
  4844. key: 'scrollTo',
  4845. /**
  4846. * Scrolls to the given position
  4847. * @param {number} scrollX The position to scroll to
  4848. */
  4849. value: function scrollTo(scrollX) {}
  4850. /**
  4851. * Increments the current scroll position by the given amount
  4852. * @param {number} scrollXIncrement The amount to increment scroll
  4853. */
  4854. }, {
  4855. key: 'incrementScroll',
  4856. value: function incrementScroll(scrollXIncrement) {}
  4857. /**
  4858. * Returns the current scroll position
  4859. * @return {number}
  4860. */
  4861. }, {
  4862. key: 'getScrollPosition',
  4863. value: function getScrollPosition() {}
  4864. /**
  4865. * Returns the width of the scroll content
  4866. * @return {number}
  4867. */
  4868. }, {
  4869. key: 'getScrollContentWidth',
  4870. value: function getScrollContentWidth() {}
  4871. /**
  4872. * Returns the root element's offsetWidth
  4873. * @return {number}
  4874. */
  4875. }, {
  4876. key: 'getOffsetWidth',
  4877. value: function getOffsetWidth() {}
  4878. /**
  4879. * Returns if the Tab Bar language direction is RTL
  4880. * @return {boolean}
  4881. */
  4882. }, {
  4883. key: 'isRTL',
  4884. value: function isRTL() {}
  4885. /**
  4886. * Activates the tab at the given index with the given client rect
  4887. * @param {number} index The index of the tab to activate
  4888. * @param {!ClientRect} clientRect The client rect of the previously active Tab Indicator
  4889. */
  4890. }, {
  4891. key: 'activateTabAtIndex',
  4892. value: function activateTabAtIndex(index, clientRect) {}
  4893. /**
  4894. * Deactivates the tab at the given index
  4895. * @param {number} index The index of the tab to activate
  4896. */
  4897. }, {
  4898. key: 'deactivateTabAtIndex',
  4899. value: function deactivateTabAtIndex(index) {}
  4900. /**
  4901. * Returns the client rect of the tab's indicator
  4902. * @param {number} index The index of the tab
  4903. * @return {!ClientRect}
  4904. */
  4905. }, {
  4906. key: 'getTabIndicatorClientRectAtIndex',
  4907. value: function getTabIndicatorClientRectAtIndex(index) {}
  4908. /**
  4909. * Returns the tab dimensions of the tab at the given index
  4910. * @param {number} index The index of the tab
  4911. * @return {!MDCTabDimensions}
  4912. */
  4913. }, {
  4914. key: 'getTabDimensionsAtIndex',
  4915. value: function getTabDimensionsAtIndex(index) {}
  4916. /**
  4917. * Returns the length of the tab list
  4918. * @return {number}
  4919. */
  4920. }, {
  4921. key: 'getTabListLength',
  4922. value: function getTabListLength() {}
  4923. /**
  4924. * Returns the index of the active tab
  4925. * @return {number}
  4926. */
  4927. }, {
  4928. key: 'getActiveTabIndex',
  4929. value: function getActiveTabIndex() {}
  4930. /**
  4931. * Returns the index of the given tab
  4932. * @param {!MDCTab} tab The tab whose index to determin
  4933. * @return {number}
  4934. */
  4935. }, {
  4936. key: 'getIndexOfTab',
  4937. value: function getIndexOfTab(tab) {}
  4938. /**
  4939. * Emits the MDCTabBar:activated event
  4940. * @param {number} index The index of the activated tab
  4941. */
  4942. }, {
  4943. key: 'notifyTabActivated',
  4944. value: function notifyTabActivated(index) {}
  4945. }]);
  4946. return MDCTabBarAdapter;
  4947. }();
  4948. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabBarAdapter);
  4949. /***/ }),
  4950. /* 44 */
  4951. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4952. "use strict";
  4953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cssClasses; });
  4954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return strings; });
  4955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return numbers; });
  4956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VALIDATION_ATTR_WHITELIST; });
  4957. /**
  4958. * @license
  4959. * Copyright 2016 Google Inc. All Rights Reserved.
  4960. *
  4961. * Licensed under the Apache License, Version 2.0 (the "License");
  4962. * you may not use this file except in compliance with the License.
  4963. * You may obtain a copy of the License at
  4964. *
  4965. * http://www.apache.org/licenses/LICENSE-2.0
  4966. *
  4967. * Unless required by applicable law or agreed to in writing, software
  4968. * distributed under the License is distributed on an "AS IS" BASIS,
  4969. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4970. * See the License for the specific language governing permissions and
  4971. * limitations under the License.
  4972. */
  4973. /** @enum {string} */
  4974. var strings = {
  4975. ARIA_CONTROLS: 'aria-controls',
  4976. INPUT_SELECTOR: '.mdc-text-field__input',
  4977. LABEL_SELECTOR: '.mdc-floating-label',
  4978. ICON_SELECTOR: '.mdc-text-field__icon',
  4979. OUTLINE_SELECTOR: '.mdc-notched-outline',
  4980. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple'
  4981. };
  4982. /** @enum {string} */
  4983. var cssClasses = {
  4984. ROOT: 'mdc-text-field',
  4985. UPGRADED: 'mdc-text-field--upgraded',
  4986. DISABLED: 'mdc-text-field--disabled',
  4987. DENSE: 'mdc-text-field--dense',
  4988. FOCUSED: 'mdc-text-field--focused',
  4989. INVALID: 'mdc-text-field--invalid',
  4990. BOX: 'mdc-text-field--box',
  4991. OUTLINED: 'mdc-text-field--outlined'
  4992. };
  4993. /** @enum {number} */
  4994. var numbers = {
  4995. LABEL_SCALE: 0.75,
  4996. DENSE_LABEL_SCALE: 0.923
  4997. };
  4998. // whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
  4999. // under section: `Validation-related attributes`
  5000. var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength'];
  5001. /***/ }),
  5002. /* 45 */
  5003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5004. "use strict";
  5005. /* unused harmony export MDCTextFieldAdapter */
  5006. /* unused harmony export NativeInputType */
  5007. /* unused harmony export FoundationMapType */
  5008. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helper_text_foundation__ = __webpack_require__(21);
  5009. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icon_foundation__ = __webpack_require__(22);
  5010. 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; }; }();
  5011. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5012. /**
  5013. * @license
  5014. * Copyright 2017 Google Inc. All Rights Reserved.
  5015. *
  5016. * Licensed under the Apache License, Version 2.0 (the "License");
  5017. * you may not use this file except in compliance with the License.
  5018. * You may obtain a copy of the License at
  5019. *
  5020. * http://www.apache.org/licenses/LICENSE-2.0
  5021. *
  5022. * Unless required by applicable law or agreed to in writing, software
  5023. * distributed under the License is distributed on an "AS IS" BASIS,
  5024. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5025. * See the License for the specific language governing permissions and
  5026. * limitations under the License.
  5027. */
  5028. /* eslint-disable no-unused-vars */
  5029. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5030. /**
  5031. * @typedef {{
  5032. * value: string,
  5033. * disabled: boolean,
  5034. * badInput: boolean,
  5035. * validity: {
  5036. * badInput: boolean,
  5037. * valid: boolean,
  5038. * },
  5039. * }}
  5040. */
  5041. var NativeInputType = void 0;
  5042. /**
  5043. * @typedef {{
  5044. * helperText: (!MDCTextFieldHelperTextFoundation|undefined),
  5045. * icon: (!MDCTextFieldIconFoundation|undefined),
  5046. * }}
  5047. */
  5048. var FoundationMapType = void 0;
  5049. /**
  5050. * Adapter for MDC Text Field.
  5051. *
  5052. * Defines the shape of the adapter expected by the foundation. Implement this
  5053. * adapter to integrate the Text Field into your framework. See
  5054. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5055. * for more information.
  5056. *
  5057. * @record
  5058. */
  5059. var MDCTextFieldAdapter = function () {
  5060. function MDCTextFieldAdapter() {
  5061. _classCallCheck(this, MDCTextFieldAdapter);
  5062. }
  5063. _createClass(MDCTextFieldAdapter, [{
  5064. key: 'addClass',
  5065. /**
  5066. * Adds a class to the root Element.
  5067. * @param {string} className
  5068. */
  5069. value: function addClass(className) {}
  5070. /**
  5071. * Removes a class from the root Element.
  5072. * @param {string} className
  5073. */
  5074. }, {
  5075. key: 'removeClass',
  5076. value: function removeClass(className) {}
  5077. /**
  5078. * Returns true if the root element contains the given class name.
  5079. * @param {string} className
  5080. * @return {boolean}
  5081. */
  5082. }, {
  5083. key: 'hasClass',
  5084. value: function hasClass(className) {}
  5085. /**
  5086. * Registers an event handler on the root element for a given event.
  5087. * @param {string} type
  5088. * @param {function(!Event): undefined} handler
  5089. */
  5090. }, {
  5091. key: 'registerTextFieldInteractionHandler',
  5092. value: function registerTextFieldInteractionHandler(type, handler) {}
  5093. /**
  5094. * Deregisters an event handler on the root element for a given event.
  5095. * @param {string} type
  5096. * @param {function(!Event): undefined} handler
  5097. */
  5098. }, {
  5099. key: 'deregisterTextFieldInteractionHandler',
  5100. value: function deregisterTextFieldInteractionHandler(type, handler) {}
  5101. /**
  5102. * Registers an event listener on the native input element for a given event.
  5103. * @param {string} evtType
  5104. * @param {function(!Event): undefined} handler
  5105. */
  5106. }, {
  5107. key: 'registerInputInteractionHandler',
  5108. value: function registerInputInteractionHandler(evtType, handler) {}
  5109. /**
  5110. * Deregisters an event listener on the native input element for a given event.
  5111. * @param {string} evtType
  5112. * @param {function(!Event): undefined} handler
  5113. */
  5114. }, {
  5115. key: 'deregisterInputInteractionHandler',
  5116. value: function deregisterInputInteractionHandler(evtType, handler) {}
  5117. /**
  5118. * Registers a validation attribute change listener on the input element.
  5119. * Handler accepts list of attribute names.
  5120. * @param {function(!Array<string>): undefined} handler
  5121. * @return {!MutationObserver}
  5122. */
  5123. }, {
  5124. key: 'registerValidationAttributeChangeHandler',
  5125. value: function registerValidationAttributeChangeHandler(handler) {}
  5126. /**
  5127. * Disconnects a validation attribute observer on the input element.
  5128. * @param {!MutationObserver} observer
  5129. */
  5130. }, {
  5131. key: 'deregisterValidationAttributeChangeHandler',
  5132. value: function deregisterValidationAttributeChangeHandler(observer) {}
  5133. /**
  5134. * Returns an object representing the native text input element, with a
  5135. * similar API shape. The object returned should include the value, disabled
  5136. * and badInput properties, as well as the checkValidity() function. We never
  5137. * alter the value within our code, however we do update the disabled
  5138. * property, so if you choose to duck-type the return value for this method
  5139. * in your implementation it's important to keep this in mind. Also note that
  5140. * this method can return null, which the foundation will handle gracefully.
  5141. * @return {?Element|?NativeInputType}
  5142. */
  5143. }, {
  5144. key: 'getNativeInput',
  5145. value: function getNativeInput() {}
  5146. /**
  5147. * Returns true if the textfield is focused.
  5148. * We achieve this via `document.activeElement === this.root_`.
  5149. * @return {boolean}
  5150. */
  5151. }, {
  5152. key: 'isFocused',
  5153. value: function isFocused() {}
  5154. /**
  5155. * Returns true if the direction of the root element is set to RTL.
  5156. * @return {boolean}
  5157. */
  5158. }, {
  5159. key: 'isRtl',
  5160. value: function isRtl() {}
  5161. /**
  5162. * Activates the line ripple.
  5163. */
  5164. }, {
  5165. key: 'activateLineRipple',
  5166. value: function activateLineRipple() {}
  5167. /**
  5168. * Deactivates the line ripple.
  5169. */
  5170. }, {
  5171. key: 'deactivateLineRipple',
  5172. value: function deactivateLineRipple() {}
  5173. /**
  5174. * Sets the transform origin of the line ripple.
  5175. * @param {number} normalizedX
  5176. */
  5177. }, {
  5178. key: 'setLineRippleTransformOrigin',
  5179. value: function setLineRippleTransformOrigin(normalizedX) {}
  5180. /**
  5181. * Only implement if label exists.
  5182. * Shakes label if shouldShake is true.
  5183. * @param {boolean} shouldShake
  5184. */
  5185. }, {
  5186. key: 'shakeLabel',
  5187. value: function shakeLabel(shouldShake) {}
  5188. /**
  5189. * Only implement if label exists.
  5190. * Floats the label above the input element if shouldFloat is true.
  5191. * @param {boolean} shouldFloat
  5192. */
  5193. }, {
  5194. key: 'floatLabel',
  5195. value: function floatLabel(shouldFloat) {}
  5196. /**
  5197. * Returns true if label element exists, false if it doesn't.
  5198. * @return {boolean}
  5199. */
  5200. }, {
  5201. key: 'hasLabel',
  5202. value: function hasLabel() {}
  5203. /**
  5204. * Only implement if label exists.
  5205. * Returns width of label in pixels.
  5206. * @return {number}
  5207. */
  5208. }, {
  5209. key: 'getLabelWidth',
  5210. value: function getLabelWidth() {}
  5211. /**
  5212. * Returns true if outline element exists, false if it doesn't.
  5213. * @return {boolean}
  5214. */
  5215. }, {
  5216. key: 'hasOutline',
  5217. value: function hasOutline() {}
  5218. /**
  5219. * Only implement if outline element exists.
  5220. * Updates SVG Path and outline element based on the
  5221. * label element width and RTL context.
  5222. * @param {number} labelWidth
  5223. * @param {boolean=} isRtl
  5224. */
  5225. }, {
  5226. key: 'notchOutline',
  5227. value: function notchOutline(labelWidth, isRtl) {}
  5228. /**
  5229. * Only implement if outline element exists.
  5230. * Closes notch in outline element.
  5231. */
  5232. }, {
  5233. key: 'closeOutline',
  5234. value: function closeOutline() {}
  5235. }]);
  5236. return MDCTextFieldAdapter;
  5237. }();
  5238. /***/ }),
  5239. /* 46 */
  5240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5241. "use strict";
  5242. 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; }; }();
  5243. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5244. /**
  5245. * @license
  5246. * Copyright 2017 Google Inc. All Rights Reserved.
  5247. *
  5248. * Licensed under the Apache License, Version 2.0 (the "License");
  5249. * you may not use this file except in compliance with the License.
  5250. * You may obtain a copy of the License at
  5251. *
  5252. * http://www.apache.org/licenses/LICENSE-2.0
  5253. *
  5254. * Unless required by applicable law or agreed to in writing, software
  5255. * distributed under the License is distributed on an "AS IS" BASIS,
  5256. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5257. * See the License for the specific language governing permissions and
  5258. * limitations under the License.
  5259. */
  5260. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5261. /**
  5262. * Adapter for MDC Text Field Helper Text.
  5263. *
  5264. * Defines the shape of the adapter expected by the foundation. Implement this
  5265. * adapter to integrate the TextField helper text into your framework. See
  5266. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5267. * for more information.
  5268. *
  5269. * @record
  5270. */
  5271. var MDCTextFieldHelperTextAdapter = function () {
  5272. function MDCTextFieldHelperTextAdapter() {
  5273. _classCallCheck(this, MDCTextFieldHelperTextAdapter);
  5274. }
  5275. _createClass(MDCTextFieldHelperTextAdapter, [{
  5276. key: "addClass",
  5277. /**
  5278. * Adds a class to the helper text element.
  5279. * @param {string} className
  5280. */
  5281. value: function addClass(className) {}
  5282. /**
  5283. * Removes a class from the helper text element.
  5284. * @param {string} className
  5285. */
  5286. }, {
  5287. key: "removeClass",
  5288. value: function removeClass(className) {}
  5289. /**
  5290. * Returns whether or not the helper text element contains the given class.
  5291. * @param {string} className
  5292. * @return {boolean}
  5293. */
  5294. }, {
  5295. key: "hasClass",
  5296. value: function hasClass(className) {}
  5297. /**
  5298. * Sets an attribute with a given value on the helper text element.
  5299. * @param {string} attr
  5300. * @param {string} value
  5301. */
  5302. }, {
  5303. key: "setAttr",
  5304. value: function setAttr(attr, value) {}
  5305. /**
  5306. * Removes an attribute from the helper text element.
  5307. * @param {string} attr
  5308. */
  5309. }, {
  5310. key: "removeAttr",
  5311. value: function removeAttr(attr) {}
  5312. /**
  5313. * Sets the text content for the helper text element.
  5314. * @param {string} content
  5315. */
  5316. }, {
  5317. key: "setContent",
  5318. value: function setContent(content) {}
  5319. }]);
  5320. return MDCTextFieldHelperTextAdapter;
  5321. }();
  5322. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextAdapter);
  5323. /***/ }),
  5324. /* 47 */
  5325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5326. "use strict";
  5327. 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; }; }();
  5328. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5329. /**
  5330. * @license
  5331. * Copyright 2017 Google Inc. All Rights Reserved.
  5332. *
  5333. * Licensed under the Apache License, Version 2.0 (the "License");
  5334. * you may not use this file except in compliance with the License.
  5335. * You may obtain a copy of the License at
  5336. *
  5337. * http://www.apache.org/licenses/LICENSE-2.0
  5338. *
  5339. * Unless required by applicable law or agreed to in writing, software
  5340. * distributed under the License is distributed on an "AS IS" BASIS,
  5341. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5342. * See the License for the specific language governing permissions and
  5343. * limitations under the License.
  5344. */
  5345. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5346. /**
  5347. * Adapter for MDC Text Field Icon.
  5348. *
  5349. * Defines the shape of the adapter expected by the foundation. Implement this
  5350. * adapter to integrate the text field icon into your framework. See
  5351. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5352. * for more information.
  5353. *
  5354. * @record
  5355. */
  5356. var MDCTextFieldIconAdapter = function () {
  5357. function MDCTextFieldIconAdapter() {
  5358. _classCallCheck(this, MDCTextFieldIconAdapter);
  5359. }
  5360. _createClass(MDCTextFieldIconAdapter, [{
  5361. key: "getAttr",
  5362. /**
  5363. * Gets the value of an attribute on the icon element.
  5364. * @param {string} attr
  5365. * @return {string}
  5366. */
  5367. value: function getAttr(attr) {}
  5368. /**
  5369. * Sets an attribute on the icon element.
  5370. * @param {string} attr
  5371. * @param {string} value
  5372. */
  5373. }, {
  5374. key: "setAttr",
  5375. value: function setAttr(attr, value) {}
  5376. /**
  5377. * Removes an attribute from the icon element.
  5378. * @param {string} attr
  5379. */
  5380. }, {
  5381. key: "removeAttr",
  5382. value: function removeAttr(attr) {}
  5383. /**
  5384. * Sets the text content of the icon element.
  5385. * @param {string} content
  5386. */
  5387. }, {
  5388. key: "setContent",
  5389. value: function setContent(content) {}
  5390. /**
  5391. * Registers an event listener on the icon element for a given event.
  5392. * @param {string} evtType
  5393. * @param {function(!Event): undefined} handler
  5394. */
  5395. }, {
  5396. key: "registerInteractionHandler",
  5397. value: function registerInteractionHandler(evtType, handler) {}
  5398. /**
  5399. * Deregisters an event listener on the icon element for a given event.
  5400. * @param {string} evtType
  5401. * @param {function(!Event): undefined} handler
  5402. */
  5403. }, {
  5404. key: "deregisterInteractionHandler",
  5405. value: function deregisterInteractionHandler(evtType, handler) {}
  5406. /**
  5407. * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
  5408. */
  5409. }, {
  5410. key: "notifyIconAction",
  5411. value: function notifyIconAction() {}
  5412. }]);
  5413. return MDCTextFieldIconAdapter;
  5414. }();
  5415. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldIconAdapter);
  5416. /***/ }),
  5417. /* 48 */
  5418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5419. "use strict";
  5420. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  5421. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__ = __webpack_require__(49);
  5422. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_index__ = __webpack_require__(2);
  5423. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__ = __webpack_require__(50);
  5424. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_chips_index__ = __webpack_require__(56);
  5425. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__ = __webpack_require__(60);
  5426. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__ = __webpack_require__(66);
  5427. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_floating_label_index__ = __webpack_require__(16);
  5428. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_form_field_index__ = __webpack_require__(77);
  5429. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_grid_list_index__ = __webpack_require__(81);
  5430. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_icon_button_index__ = __webpack_require__(84);
  5431. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_icon_toggle_index__ = __webpack_require__(88);
  5432. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_linear_progress_index__ = __webpack_require__(92);
  5433. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_line_ripple_index__ = __webpack_require__(17);
  5434. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__material_list_index__ = __webpack_require__(97);
  5435. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__material_menu_index__ = __webpack_require__(99);
  5436. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__material_notched_outline_index__ = __webpack_require__(18);
  5437. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__material_radio_index__ = __webpack_require__(104);
  5438. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__material_ripple_index__ = __webpack_require__(3);
  5439. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__material_select_index__ = __webpack_require__(108);
  5440. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__material_selection_control_index__ = __webpack_require__(4);
  5441. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__material_slider_index__ = __webpack_require__(110);
  5442. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__material_snackbar_index__ = __webpack_require__(112);
  5443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__material_switch_index__ = __webpack_require__(115);
  5444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__material_tab_index__ = __webpack_require__(19);
  5445. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__material_tab_bar_index__ = __webpack_require__(123);
  5446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__material_tab_indicator_index__ = __webpack_require__(38);
  5447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__material_tab_scroller_index__ = __webpack_require__(41);
  5448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__material_textfield_index__ = __webpack_require__(131);
  5449. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__material_toolbar_index__ = __webpack_require__(137);
  5450. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__material_top_app_bar_index__ = __webpack_require__(140);
  5451. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "autoInit", function() { return __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a"]; });
  5452. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base", function() { return __WEBPACK_IMPORTED_MODULE_1__material_base_index__; });
  5453. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "checkbox", function() { return __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__; });
  5454. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "chips", function() { return __WEBPACK_IMPORTED_MODULE_3__material_chips_index__; });
  5455. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dialog", function() { return __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__; });
  5456. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "drawer", function() { return __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__; });
  5457. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "floatingLabel", function() { return __WEBPACK_IMPORTED_MODULE_6__material_floating_label_index__; });
  5458. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "formField", function() { return __WEBPACK_IMPORTED_MODULE_7__material_form_field_index__; });
  5459. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "gridList", function() { return __WEBPACK_IMPORTED_MODULE_8__material_grid_list_index__; });
  5460. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconButton", function() { return __WEBPACK_IMPORTED_MODULE_9__material_icon_button_index__; });
  5461. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconToggle", function() { return __WEBPACK_IMPORTED_MODULE_10__material_icon_toggle_index__; });
  5462. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "lineRipple", function() { return __WEBPACK_IMPORTED_MODULE_12__material_line_ripple_index__; });
  5463. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "linearProgress", function() { return __WEBPACK_IMPORTED_MODULE_11__material_linear_progress_index__; });
  5464. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "list", function() { return __WEBPACK_IMPORTED_MODULE_13__material_list_index__; });
  5465. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return __WEBPACK_IMPORTED_MODULE_14__material_menu_index__; });
  5466. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "notchedOutline", function() { return __WEBPACK_IMPORTED_MODULE_15__material_notched_outline_index__; });
  5467. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "radio", function() { return __WEBPACK_IMPORTED_MODULE_16__material_radio_index__; });
  5468. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ripple", function() { return __WEBPACK_IMPORTED_MODULE_17__material_ripple_index__; });
  5469. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_18__material_select_index__; });
  5470. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "selectionControl", function() { return __WEBPACK_IMPORTED_MODULE_19__material_selection_control_index__; });
  5471. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "slider", function() { return __WEBPACK_IMPORTED_MODULE_20__material_slider_index__; });
  5472. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "switchControl", function() { return __WEBPACK_IMPORTED_MODULE_22__material_switch_index__; });
  5473. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "snackbar", function() { return __WEBPACK_IMPORTED_MODULE_21__material_snackbar_index__; });
  5474. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tab", function() { return __WEBPACK_IMPORTED_MODULE_23__material_tab_index__; });
  5475. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabBar", function() { return __WEBPACK_IMPORTED_MODULE_24__material_tab_bar_index__; });
  5476. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabIndicator", function() { return __WEBPACK_IMPORTED_MODULE_25__material_tab_indicator_index__; });
  5477. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabScroller", function() { return __WEBPACK_IMPORTED_MODULE_26__material_tab_scroller_index__; });
  5478. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "textField", function() { return __WEBPACK_IMPORTED_MODULE_27__material_textfield_index__; });
  5479. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "toolbar", function() { return __WEBPACK_IMPORTED_MODULE_28__material_toolbar_index__; });
  5480. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "topAppBar", function() { return __WEBPACK_IMPORTED_MODULE_29__material_top_app_bar_index__; });
  5481. /**
  5482. * Copyright 2016 Google Inc. All Rights Reserved.
  5483. *
  5484. * Licensed under the Apache License, Version 2.0 (the "License");
  5485. * you may not use this file except in compliance with the License.
  5486. * You may obtain a copy of the License at
  5487. *
  5488. * http://www.apache.org/licenses/LICENSE-2.0
  5489. *
  5490. * Unless required by applicable law or agreed to in writing, software
  5491. * distributed under the License is distributed on an "AS IS" BASIS,
  5492. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5493. * See the License for the specific language governing permissions and
  5494. * limitations under the License.
  5495. */
  5496. // Register all components
  5497. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCCheckbox', __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__["MDCCheckbox"]);
  5498. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChip', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChip"]);
  5499. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChipSet', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChipSet"]);
  5500. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDialog', __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__["MDCDialog"]);
  5501. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCPersistentDrawer', __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__["MDCPersistentDrawer"]);
  5502. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTemporaryDrawer', __WEBPACK_IMPORTED_MODULE_5__material_drawer_index__["MDCTemporaryDrawer"]);
  5503. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFloatingLabel', __WEBPACK_IMPORTED_MODULE_6__material_floating_label_index__["MDCFloatingLabel"]);
  5504. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFormField', __WEBPACK_IMPORTED_MODULE_7__material_form_field_index__["MDCFormField"]);
  5505. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRipple', __WEBPACK_IMPORTED_MODULE_17__material_ripple_index__["MDCRipple"]);
  5506. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCGridList', __WEBPACK_IMPORTED_MODULE_8__material_grid_list_index__["MDCGridList"]);
  5507. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconButtonToggle', __WEBPACK_IMPORTED_MODULE_9__material_icon_button_index__["MDCIconButtonToggle"]);
  5508. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconToggle', __WEBPACK_IMPORTED_MODULE_10__material_icon_toggle_index__["MDCIconToggle"]);
  5509. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLineRipple', __WEBPACK_IMPORTED_MODULE_12__material_line_ripple_index__["MDCLineRipple"]);
  5510. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLinearProgress', __WEBPACK_IMPORTED_MODULE_11__material_linear_progress_index__["MDCLinearProgress"]);
  5511. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCList', __WEBPACK_IMPORTED_MODULE_13__material_list_index__["MDCList"]);
  5512. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCNotchedOutline', __WEBPACK_IMPORTED_MODULE_15__material_notched_outline_index__["MDCNotchedOutline"]);
  5513. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRadio', __WEBPACK_IMPORTED_MODULE_16__material_radio_index__["MDCRadio"]);
  5514. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSnackbar', __WEBPACK_IMPORTED_MODULE_21__material_snackbar_index__["MDCSnackbar"]);
  5515. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTabBar', __WEBPACK_IMPORTED_MODULE_24__material_tab_bar_index__["MDCTabBar"]);
  5516. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTextField', __WEBPACK_IMPORTED_MODULE_27__material_textfield_index__["MDCTextField"]);
  5517. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenu', __WEBPACK_IMPORTED_MODULE_14__material_menu_index__["MDCMenu"]);
  5518. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSelect', __WEBPACK_IMPORTED_MODULE_18__material_select_index__["MDCSelect"]);
  5519. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSlider', __WEBPACK_IMPORTED_MODULE_20__material_slider_index__["MDCSlider"]);
  5520. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSwitch', __WEBPACK_IMPORTED_MODULE_22__material_switch_index__["MDCSwitch"]);
  5521. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCToolbar', __WEBPACK_IMPORTED_MODULE_28__material_toolbar_index__["MDCToolbar"]);
  5522. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTopAppBar', __WEBPACK_IMPORTED_MODULE_29__material_top_app_bar_index__["MDCTopAppBar"]);
  5523. // Export all components.
  5524. /***/ }),
  5525. /* 49 */
  5526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5527. "use strict";
  5528. /* harmony export (immutable) */ __webpack_exports__["a"] = mdcAutoInit;
  5529. /**
  5530. * Copyright 2016 Google Inc. All Rights Reserved.
  5531. *
  5532. * Licensed under the Apache License, Version 2.0 (the "License");
  5533. * you may not use this file except in compliance with the License.
  5534. * You may obtain a copy of the License at
  5535. *
  5536. * http://www.apache.org/licenses/LICENSE-2.0
  5537. *
  5538. * Unless required by applicable law or agreed to in writing, software
  5539. * distributed under the License is distributed on an "AS IS" BASIS,
  5540. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5541. * See the License for the specific language governing permissions and
  5542. * limitations under the License.
  5543. */
  5544. var registry = Object.create(null);
  5545. var CONSOLE_WARN = console.warn.bind(console);
  5546. function _emit(evtType, evtData) {
  5547. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  5548. var evt = void 0;
  5549. if (typeof CustomEvent === 'function') {
  5550. evt = new CustomEvent(evtType, {
  5551. detail: evtData,
  5552. bubbles: shouldBubble
  5553. });
  5554. } else {
  5555. evt = document.createEvent('CustomEvent');
  5556. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  5557. }
  5558. document.dispatchEvent(evt);
  5559. }
  5560. /**
  5561. * Auto-initializes all mdc components on a page.
  5562. */
  5563. function mdcAutoInit() {
  5564. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  5565. var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CONSOLE_WARN;
  5566. var components = [];
  5567. var nodes = root.querySelectorAll('[data-mdc-auto-init]');
  5568. for (var i = 0, node; node = nodes[i]; i++) {
  5569. var ctorName = node.dataset.mdcAutoInit;
  5570. if (!ctorName) {
  5571. throw new Error('(mdc-auto-init) Constructor name must be given.');
  5572. }
  5573. var Ctor = registry[ctorName];
  5574. if (typeof Ctor !== 'function') {
  5575. throw new Error('(mdc-auto-init) Could not find constructor in registry for ' + ctorName);
  5576. }
  5577. if (node[ctorName]) {
  5578. warn('(mdc-auto-init) Component already initialized for ' + node + '. Skipping...');
  5579. continue;
  5580. }
  5581. // TODO: Should we make an eslint rule for an attachTo() static method?
  5582. var component = Ctor.attachTo(node);
  5583. Object.defineProperty(node, ctorName, {
  5584. value: component,
  5585. writable: false,
  5586. enumerable: false,
  5587. configurable: true
  5588. });
  5589. components.push(component);
  5590. }
  5591. _emit('MDCAutoInit:End', {});
  5592. return components;
  5593. }
  5594. mdcAutoInit.register = function (componentName, Ctor) {
  5595. var warn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONSOLE_WARN;
  5596. if (typeof Ctor !== 'function') {
  5597. throw new Error('(mdc-auto-init) Invalid Ctor value ' + Ctor + '. Expected function');
  5598. }
  5599. if (registry[componentName]) {
  5600. warn('(mdc-auto-init) Overriding registration for ' + componentName + ' with ' + Ctor + '. ' + ('Was: ' + registry[componentName]));
  5601. }
  5602. registry[componentName] = Ctor;
  5603. };
  5604. mdcAutoInit.deregister = function (componentName) {
  5605. delete registry[componentName];
  5606. };
  5607. mdcAutoInit.deregisterAll = function () {
  5608. Object.keys(registry).forEach(this.deregister, this);
  5609. };
  5610. /***/ }),
  5611. /* 50 */
  5612. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5613. "use strict";
  5614. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  5615. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckbox", function() { return MDCCheckbox; });
  5616. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation_index__ = __webpack_require__(9);
  5617. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  5618. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  5619. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(53);
  5620. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(3);
  5621. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_util__ = __webpack_require__(6);
  5622. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckboxFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  5623. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  5624. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  5625. 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; }; }();
  5626. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5627. 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; }
  5628. 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; }
  5629. /**
  5630. * @license
  5631. * Copyright 2016 Google Inc. All Rights Reserved.
  5632. *
  5633. * Licensed under the Apache License, Version 2.0 (the "License");
  5634. * you may not use this file except in compliance with the License.
  5635. * You may obtain a copy of the License at
  5636. *
  5637. * http://www.apache.org/licenses/LICENSE-2.0
  5638. *
  5639. * Unless required by applicable law or agreed to in writing, software
  5640. * distributed under the License is distributed on an "AS IS" BASIS,
  5641. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5642. * See the License for the specific language governing permissions and
  5643. * limitations under the License.
  5644. */
  5645. /* eslint-disable no-unused-vars */
  5646. /* eslint-enable no-unused-vars */
  5647. /**
  5648. * @extends MDCComponent<!MDCCheckboxFoundation>
  5649. * @implements {MDCSelectionControl}
  5650. */
  5651. var MDCCheckbox = function (_MDCComponent) {
  5652. _inherits(MDCCheckbox, _MDCComponent);
  5653. _createClass(MDCCheckbox, [{
  5654. key: 'nativeCb_',
  5655. /**
  5656. * Returns the state of the native control element, or null if the native control element is not present.
  5657. * @return {?MDCSelectionControlState}
  5658. * @private
  5659. */
  5660. get: function get() {
  5661. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  5662. var cbEl = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  5663. return cbEl;
  5664. }
  5665. }], [{
  5666. key: 'attachTo',
  5667. value: function attachTo(root) {
  5668. return new MDCCheckbox(root);
  5669. }
  5670. }]);
  5671. function MDCCheckbox() {
  5672. var _ref;
  5673. _classCallCheck(this, MDCCheckbox);
  5674. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5675. args[_key] = arguments[_key];
  5676. }
  5677. /** @private {!MDCRipple} */
  5678. var _this = _possibleConstructorReturn(this, (_ref = MDCCheckbox.__proto__ || Object.getPrototypeOf(MDCCheckbox)).call.apply(_ref, [this].concat(args)));
  5679. _this.ripple_ = _this.initRipple_();
  5680. return _this;
  5681. }
  5682. /**
  5683. * @return {!MDCRipple}
  5684. * @private
  5685. */
  5686. _createClass(MDCCheckbox, [{
  5687. key: 'initRipple_',
  5688. value: function initRipple_() {
  5689. var _this2 = this;
  5690. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_5__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  5691. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  5692. isUnbounded: function isUnbounded() {
  5693. return true;
  5694. },
  5695. isSurfaceActive: function isSurfaceActive() {
  5696. return _this2.nativeCb_[MATCHES](':active');
  5697. },
  5698. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  5699. return _this2.nativeCb_.addEventListener(type, handler);
  5700. },
  5701. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  5702. return _this2.nativeCb_.removeEventListener(type, handler);
  5703. }
  5704. });
  5705. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  5706. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  5707. }
  5708. /** @return {!MDCCheckboxFoundation} */
  5709. }, {
  5710. key: 'getDefaultFoundation',
  5711. value: function getDefaultFoundation() {
  5712. var _this3 = this;
  5713. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  5714. addClass: function addClass(className) {
  5715. return _this3.root_.classList.add(className);
  5716. },
  5717. removeClass: function removeClass(className) {
  5718. return _this3.root_.classList.remove(className);
  5719. },
  5720. setNativeControlAttr: function setNativeControlAttr(attr, value) {
  5721. return _this3.nativeCb_.setAttribute(attr, value);
  5722. },
  5723. removeNativeControlAttr: function removeNativeControlAttr(attr) {
  5724. return _this3.nativeCb_.removeAttribute(attr);
  5725. },
  5726. registerAnimationEndHandler: function registerAnimationEndHandler(handler) {
  5727. return _this3.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), handler);
  5728. },
  5729. deregisterAnimationEndHandler: function deregisterAnimationEndHandler(handler) {
  5730. return _this3.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), handler);
  5731. },
  5732. registerChangeHandler: function registerChangeHandler(handler) {
  5733. return _this3.nativeCb_.addEventListener('change', handler);
  5734. },
  5735. deregisterChangeHandler: function deregisterChangeHandler(handler) {
  5736. return _this3.nativeCb_.removeEventListener('change', handler);
  5737. },
  5738. getNativeControl: function getNativeControl() {
  5739. return _this3.nativeCb_;
  5740. },
  5741. forceLayout: function forceLayout() {
  5742. return _this3.root_.offsetWidth;
  5743. },
  5744. isAttachedToDOM: function isAttachedToDOM() {
  5745. return Boolean(_this3.root_.parentNode);
  5746. }
  5747. });
  5748. }
  5749. /** @return {!MDCRipple} */
  5750. }, {
  5751. key: 'destroy',
  5752. value: function destroy() {
  5753. this.ripple_.destroy();
  5754. _get(MDCCheckbox.prototype.__proto__ || Object.getPrototypeOf(MDCCheckbox.prototype), 'destroy', this).call(this);
  5755. }
  5756. }, {
  5757. key: 'ripple',
  5758. get: function get() {
  5759. return this.ripple_;
  5760. }
  5761. /** @return {boolean} */
  5762. }, {
  5763. key: 'checked',
  5764. get: function get() {
  5765. return this.foundation_.isChecked();
  5766. }
  5767. /** @param {boolean} checked */
  5768. ,
  5769. set: function set(checked) {
  5770. this.foundation_.setChecked(checked);
  5771. }
  5772. /** @return {boolean} */
  5773. }, {
  5774. key: 'indeterminate',
  5775. get: function get() {
  5776. return this.foundation_.isIndeterminate();
  5777. }
  5778. /** @param {boolean} indeterminate */
  5779. ,
  5780. set: function set(indeterminate) {
  5781. this.foundation_.setIndeterminate(indeterminate);
  5782. }
  5783. /** @return {boolean} */
  5784. }, {
  5785. key: 'disabled',
  5786. get: function get() {
  5787. return this.foundation_.isDisabled();
  5788. }
  5789. /** @param {boolean} disabled */
  5790. ,
  5791. set: function set(disabled) {
  5792. this.foundation_.setDisabled(disabled);
  5793. }
  5794. /** @return {?string} */
  5795. }, {
  5796. key: 'value',
  5797. get: function get() {
  5798. return this.foundation_.getValue();
  5799. }
  5800. /** @param {?string} value */
  5801. ,
  5802. set: function set(value) {
  5803. this.foundation_.setValue(value);
  5804. }
  5805. }]);
  5806. return MDCCheckbox;
  5807. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  5808. /***/ }),
  5809. /* 51 */
  5810. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5811. "use strict";
  5812. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  5813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(23);
  5814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(52);
  5815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  5816. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  5817. 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; }; }();
  5818. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5819. 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; }
  5820. 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; }
  5821. /**
  5822. * @license
  5823. * Copyright 2016 Google Inc. All Rights Reserved.
  5824. *
  5825. * Licensed under the Apache License, Version 2.0 (the "License");
  5826. * you may not use this file except in compliance with the License.
  5827. * You may obtain a copy of the License at
  5828. *
  5829. * http://www.apache.org/licenses/LICENSE-2.0
  5830. *
  5831. * Unless required by applicable law or agreed to in writing, software
  5832. * distributed under the License is distributed on an "AS IS" BASIS,
  5833. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5834. * See the License for the specific language governing permissions and
  5835. * limitations under the License.
  5836. */
  5837. /**
  5838. * @typedef {{
  5839. * isActivated: (boolean|undefined),
  5840. * hasDeactivationUXRun: (boolean|undefined),
  5841. * wasActivatedByPointer: (boolean|undefined),
  5842. * wasElementMadeActive: (boolean|undefined),
  5843. * activationEvent: Event,
  5844. * isProgrammatic: (boolean|undefined)
  5845. * }}
  5846. */
  5847. var ActivationStateType = void 0;
  5848. /**
  5849. * @typedef {{
  5850. * activate: (string|undefined),
  5851. * deactivate: (string|undefined),
  5852. * focus: (string|undefined),
  5853. * blur: (string|undefined)
  5854. * }}
  5855. */
  5856. var ListenerInfoType = void 0;
  5857. /**
  5858. * @typedef {{
  5859. * activate: function(!Event),
  5860. * deactivate: function(!Event),
  5861. * focus: function(),
  5862. * blur: function()
  5863. * }}
  5864. */
  5865. var ListenersType = void 0;
  5866. /**
  5867. * @typedef {{
  5868. * x: number,
  5869. * y: number
  5870. * }}
  5871. */
  5872. var PointType = void 0;
  5873. // Activation events registered on the root element of each instance for activation
  5874. var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
  5875. // Deactivation events registered on documentElement when a pointer-related down event occurs
  5876. var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup'];
  5877. // Tracks activations that have occurred on the current frame, to avoid simultaneous nested activations
  5878. /** @type {!Array<!EventTarget>} */
  5879. var activatedTargets = [];
  5880. /**
  5881. * @extends {MDCFoundation<!MDCRippleAdapter>}
  5882. */
  5883. var MDCRippleFoundation = function (_MDCFoundation) {
  5884. _inherits(MDCRippleFoundation, _MDCFoundation);
  5885. _createClass(MDCRippleFoundation, null, [{
  5886. key: 'cssClasses',
  5887. get: function get() {
  5888. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  5889. }
  5890. }, {
  5891. key: 'strings',
  5892. get: function get() {
  5893. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  5894. }
  5895. }, {
  5896. key: 'numbers',
  5897. get: function get() {
  5898. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  5899. }
  5900. }, {
  5901. key: 'defaultAdapter',
  5902. get: function get() {
  5903. return {
  5904. browserSupportsCssVars: function browserSupportsCssVars() /* boolean - cached */{},
  5905. isUnbounded: function isUnbounded() /* boolean */{},
  5906. isSurfaceActive: function isSurfaceActive() /* boolean */{},
  5907. isSurfaceDisabled: function isSurfaceDisabled() /* boolean */{},
  5908. addClass: function addClass() /* className: string */{},
  5909. removeClass: function removeClass() /* className: string */{},
  5910. containsEventTarget: function containsEventTarget() /* target: !EventTarget */{},
  5911. registerInteractionHandler: function registerInteractionHandler() /* evtType: string, handler: EventListener */{},
  5912. deregisterInteractionHandler: function deregisterInteractionHandler() /* evtType: string, handler: EventListener */{},
  5913. registerDocumentInteractionHandler: function registerDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  5914. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  5915. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  5916. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  5917. updateCssVariable: function updateCssVariable() /* varName: string, value: string */{},
  5918. computeBoundingRect: function computeBoundingRect() /* ClientRect */{},
  5919. getWindowPageOffset: function getWindowPageOffset() /* {x: number, y: number} */{}
  5920. };
  5921. }
  5922. }]);
  5923. function MDCRippleFoundation(adapter) {
  5924. _classCallCheck(this, MDCRippleFoundation);
  5925. /** @private {number} */
  5926. var _this = _possibleConstructorReturn(this, (MDCRippleFoundation.__proto__ || Object.getPrototypeOf(MDCRippleFoundation)).call(this, _extends(MDCRippleFoundation.defaultAdapter, adapter)));
  5927. _this.layoutFrame_ = 0;
  5928. /** @private {!ClientRect} */
  5929. _this.frame_ = /** @type {!ClientRect} */{ width: 0, height: 0 };
  5930. /** @private {!ActivationStateType} */
  5931. _this.activationState_ = _this.defaultActivationState_();
  5932. /** @private {number} */
  5933. _this.initialSize_ = 0;
  5934. /** @private {number} */
  5935. _this.maxRadius_ = 0;
  5936. /** @private {function(!Event)} */
  5937. _this.activateHandler_ = function (e) {
  5938. return _this.activate_(e);
  5939. };
  5940. /** @private {function(!Event)} */
  5941. _this.deactivateHandler_ = function (e) {
  5942. return _this.deactivate_(e);
  5943. };
  5944. /** @private {function(?Event=)} */
  5945. _this.focusHandler_ = function () {
  5946. return _this.handleFocus();
  5947. };
  5948. /** @private {function(?Event=)} */
  5949. _this.blurHandler_ = function () {
  5950. return _this.handleBlur();
  5951. };
  5952. /** @private {!Function} */
  5953. _this.resizeHandler_ = function () {
  5954. return _this.layout();
  5955. };
  5956. /** @private {{left: number, top:number}} */
  5957. _this.unboundedCoords_ = {
  5958. left: 0,
  5959. top: 0
  5960. };
  5961. /** @private {number} */
  5962. _this.fgScale_ = 0;
  5963. /** @private {number} */
  5964. _this.activationTimer_ = 0;
  5965. /** @private {number} */
  5966. _this.fgDeactivationRemovalTimer_ = 0;
  5967. /** @private {boolean} */
  5968. _this.activationAnimationHasEnded_ = false;
  5969. /** @private {!Function} */
  5970. _this.activationTimerCallback_ = function () {
  5971. _this.activationAnimationHasEnded_ = true;
  5972. _this.runDeactivationUXLogicIfReady_();
  5973. };
  5974. /** @private {?Event} */
  5975. _this.previousActivationEvent_ = null;
  5976. return _this;
  5977. }
  5978. /**
  5979. * We compute this property so that we are not querying information about the client
  5980. * until the point in time where the foundation requests it. This prevents scenarios where
  5981. * client-side feature-detection may happen too early, such as when components are rendered on the server
  5982. * and then initialized at mount time on the client.
  5983. * @return {boolean}
  5984. * @private
  5985. */
  5986. _createClass(MDCRippleFoundation, [{
  5987. key: 'isSupported_',
  5988. value: function isSupported_() {
  5989. return this.adapter_.browserSupportsCssVars();
  5990. }
  5991. /**
  5992. * @return {!ActivationStateType}
  5993. */
  5994. }, {
  5995. key: 'defaultActivationState_',
  5996. value: function defaultActivationState_() {
  5997. return {
  5998. isActivated: false,
  5999. hasDeactivationUXRun: false,
  6000. wasActivatedByPointer: false,
  6001. wasElementMadeActive: false,
  6002. activationEvent: null,
  6003. isProgrammatic: false
  6004. };
  6005. }
  6006. /** @override */
  6007. }, {
  6008. key: 'init',
  6009. value: function init() {
  6010. var _this2 = this;
  6011. if (!this.isSupported_()) {
  6012. return;
  6013. }
  6014. this.registerRootHandlers_();
  6015. var _MDCRippleFoundation$ = MDCRippleFoundation.cssClasses,
  6016. ROOT = _MDCRippleFoundation$.ROOT,
  6017. UNBOUNDED = _MDCRippleFoundation$.UNBOUNDED;
  6018. requestAnimationFrame(function () {
  6019. _this2.adapter_.addClass(ROOT);
  6020. if (_this2.adapter_.isUnbounded()) {
  6021. _this2.adapter_.addClass(UNBOUNDED);
  6022. // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple
  6023. _this2.layoutInternal_();
  6024. }
  6025. });
  6026. }
  6027. /** @override */
  6028. }, {
  6029. key: 'destroy',
  6030. value: function destroy() {
  6031. var _this3 = this;
  6032. if (!this.isSupported_()) {
  6033. return;
  6034. }
  6035. if (this.activationTimer_) {
  6036. clearTimeout(this.activationTimer_);
  6037. this.activationTimer_ = 0;
  6038. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  6039. this.adapter_.removeClass(FG_ACTIVATION);
  6040. }
  6041. this.deregisterRootHandlers_();
  6042. this.deregisterDeactivationHandlers_();
  6043. var _MDCRippleFoundation$2 = MDCRippleFoundation.cssClasses,
  6044. ROOT = _MDCRippleFoundation$2.ROOT,
  6045. UNBOUNDED = _MDCRippleFoundation$2.UNBOUNDED;
  6046. requestAnimationFrame(function () {
  6047. _this3.adapter_.removeClass(ROOT);
  6048. _this3.adapter_.removeClass(UNBOUNDED);
  6049. _this3.removeCssVars_();
  6050. });
  6051. }
  6052. /** @private */
  6053. }, {
  6054. key: 'registerRootHandlers_',
  6055. value: function registerRootHandlers_() {
  6056. var _this4 = this;
  6057. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  6058. _this4.adapter_.registerInteractionHandler(type, _this4.activateHandler_);
  6059. });
  6060. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  6061. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  6062. if (this.adapter_.isUnbounded()) {
  6063. this.adapter_.registerResizeHandler(this.resizeHandler_);
  6064. }
  6065. }
  6066. /**
  6067. * @param {!Event} e
  6068. * @private
  6069. */
  6070. }, {
  6071. key: 'registerDeactivationHandlers_',
  6072. value: function registerDeactivationHandlers_(e) {
  6073. var _this5 = this;
  6074. if (e.type === 'keydown') {
  6075. this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_);
  6076. } else {
  6077. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  6078. _this5.adapter_.registerDocumentInteractionHandler(type, _this5.deactivateHandler_);
  6079. });
  6080. }
  6081. }
  6082. /** @private */
  6083. }, {
  6084. key: 'deregisterRootHandlers_',
  6085. value: function deregisterRootHandlers_() {
  6086. var _this6 = this;
  6087. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  6088. _this6.adapter_.deregisterInteractionHandler(type, _this6.activateHandler_);
  6089. });
  6090. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  6091. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  6092. if (this.adapter_.isUnbounded()) {
  6093. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  6094. }
  6095. }
  6096. /** @private */
  6097. }, {
  6098. key: 'deregisterDeactivationHandlers_',
  6099. value: function deregisterDeactivationHandlers_() {
  6100. var _this7 = this;
  6101. this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_);
  6102. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  6103. _this7.adapter_.deregisterDocumentInteractionHandler(type, _this7.deactivateHandler_);
  6104. });
  6105. }
  6106. /** @private */
  6107. }, {
  6108. key: 'removeCssVars_',
  6109. value: function removeCssVars_() {
  6110. var _this8 = this;
  6111. var strings = MDCRippleFoundation.strings;
  6112. Object.keys(strings).forEach(function (k) {
  6113. if (k.indexOf('VAR_') === 0) {
  6114. _this8.adapter_.updateCssVariable(strings[k], null);
  6115. }
  6116. });
  6117. }
  6118. /**
  6119. * @param {?Event} e
  6120. * @private
  6121. */
  6122. }, {
  6123. key: 'activate_',
  6124. value: function activate_(e) {
  6125. var _this9 = this;
  6126. if (this.adapter_.isSurfaceDisabled()) {
  6127. return;
  6128. }
  6129. var activationState = this.activationState_;
  6130. if (activationState.isActivated) {
  6131. return;
  6132. }
  6133. // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
  6134. var previousActivationEvent = this.previousActivationEvent_;
  6135. var isSameInteraction = previousActivationEvent && e && previousActivationEvent.type !== e.type;
  6136. if (isSameInteraction) {
  6137. return;
  6138. }
  6139. activationState.isActivated = true;
  6140. activationState.isProgrammatic = e === null;
  6141. activationState.activationEvent = e;
  6142. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown';
  6143. var hasActivatedChild = e && activatedTargets.length > 0 && activatedTargets.some(function (target) {
  6144. return _this9.adapter_.containsEventTarget(target);
  6145. });
  6146. if (hasActivatedChild) {
  6147. // Immediately reset activation state, while preserving logic that prevents touch follow-on events
  6148. this.resetActivationState_();
  6149. return;
  6150. }
  6151. if (e) {
  6152. activatedTargets.push( /** @type {!EventTarget} */e.target);
  6153. this.registerDeactivationHandlers_(e);
  6154. }
  6155. activationState.wasElementMadeActive = this.checkElementMadeActive_(e);
  6156. if (activationState.wasElementMadeActive) {
  6157. this.animateActivation_();
  6158. }
  6159. requestAnimationFrame(function () {
  6160. // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples
  6161. activatedTargets = [];
  6162. if (!activationState.wasElementMadeActive && (e.key === ' ' || e.keyCode === 32)) {
  6163. // If space was pressed, try again within an rAF call to detect :active, because different UAs report
  6164. // active states inconsistently when they're called within event handling code:
  6165. // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
  6166. // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
  6167. // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS
  6168. // variable is set within a rAF callback for a submit button interaction (#2241).
  6169. activationState.wasElementMadeActive = _this9.checkElementMadeActive_(e);
  6170. if (activationState.wasElementMadeActive) {
  6171. _this9.animateActivation_();
  6172. }
  6173. }
  6174. if (!activationState.wasElementMadeActive) {
  6175. // Reset activation state immediately if element was not made active.
  6176. _this9.activationState_ = _this9.defaultActivationState_();
  6177. }
  6178. });
  6179. }
  6180. /**
  6181. * @param {?Event} e
  6182. * @private
  6183. */
  6184. }, {
  6185. key: 'checkElementMadeActive_',
  6186. value: function checkElementMadeActive_(e) {
  6187. return e && e.type === 'keydown' ? this.adapter_.isSurfaceActive() : true;
  6188. }
  6189. /**
  6190. * @param {?Event=} event Optional event containing position information.
  6191. */
  6192. }, {
  6193. key: 'activate',
  6194. value: function activate() {
  6195. var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6196. this.activate_(event);
  6197. }
  6198. /** @private */
  6199. }, {
  6200. key: 'animateActivation_',
  6201. value: function animateActivation_() {
  6202. var _this10 = this;
  6203. var _MDCRippleFoundation$3 = MDCRippleFoundation.strings,
  6204. VAR_FG_TRANSLATE_START = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_START,
  6205. VAR_FG_TRANSLATE_END = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_END;
  6206. var _MDCRippleFoundation$4 = MDCRippleFoundation.cssClasses,
  6207. FG_DEACTIVATION = _MDCRippleFoundation$4.FG_DEACTIVATION,
  6208. FG_ACTIVATION = _MDCRippleFoundation$4.FG_ACTIVATION;
  6209. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  6210. this.layoutInternal_();
  6211. var translateStart = '';
  6212. var translateEnd = '';
  6213. if (!this.adapter_.isUnbounded()) {
  6214. var _getFgTranslationCoor = this.getFgTranslationCoordinates_(),
  6215. startPoint = _getFgTranslationCoor.startPoint,
  6216. endPoint = _getFgTranslationCoor.endPoint;
  6217. translateStart = startPoint.x + 'px, ' + startPoint.y + 'px';
  6218. translateEnd = endPoint.x + 'px, ' + endPoint.y + 'px';
  6219. }
  6220. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  6221. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  6222. // Cancel any ongoing activation/deactivation animations
  6223. clearTimeout(this.activationTimer_);
  6224. clearTimeout(this.fgDeactivationRemovalTimer_);
  6225. this.rmBoundedActivationClasses_();
  6226. this.adapter_.removeClass(FG_DEACTIVATION);
  6227. // Force layout in order to re-trigger the animation.
  6228. this.adapter_.computeBoundingRect();
  6229. this.adapter_.addClass(FG_ACTIVATION);
  6230. this.activationTimer_ = setTimeout(function () {
  6231. return _this10.activationTimerCallback_();
  6232. }, DEACTIVATION_TIMEOUT_MS);
  6233. }
  6234. /**
  6235. * @private
  6236. * @return {{startPoint: PointType, endPoint: PointType}}
  6237. */
  6238. }, {
  6239. key: 'getFgTranslationCoordinates_',
  6240. value: function getFgTranslationCoordinates_() {
  6241. var _activationState_ = this.activationState_,
  6242. activationEvent = _activationState_.activationEvent,
  6243. wasActivatedByPointer = _activationState_.wasActivatedByPointer;
  6244. var startPoint = void 0;
  6245. if (wasActivatedByPointer) {
  6246. startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["getNormalizedEventCoords"])(
  6247. /** @type {!Event} */activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  6248. } else {
  6249. startPoint = {
  6250. x: this.frame_.width / 2,
  6251. y: this.frame_.height / 2
  6252. };
  6253. }
  6254. // Center the element around the start point.
  6255. startPoint = {
  6256. x: startPoint.x - this.initialSize_ / 2,
  6257. y: startPoint.y - this.initialSize_ / 2
  6258. };
  6259. var endPoint = {
  6260. x: this.frame_.width / 2 - this.initialSize_ / 2,
  6261. y: this.frame_.height / 2 - this.initialSize_ / 2
  6262. };
  6263. return { startPoint: startPoint, endPoint: endPoint };
  6264. }
  6265. /** @private */
  6266. }, {
  6267. key: 'runDeactivationUXLogicIfReady_',
  6268. value: function runDeactivationUXLogicIfReady_() {
  6269. var _this11 = this;
  6270. // This method is called both when a pointing device is released, and when the activation animation ends.
  6271. // The deactivation animation should only run after both of those occur.
  6272. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  6273. var _activationState_2 = this.activationState_,
  6274. hasDeactivationUXRun = _activationState_2.hasDeactivationUXRun,
  6275. isActivated = _activationState_2.isActivated;
  6276. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  6277. if (activationHasEnded && this.activationAnimationHasEnded_) {
  6278. this.rmBoundedActivationClasses_();
  6279. this.adapter_.addClass(FG_DEACTIVATION);
  6280. this.fgDeactivationRemovalTimer_ = setTimeout(function () {
  6281. _this11.adapter_.removeClass(FG_DEACTIVATION);
  6282. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS);
  6283. }
  6284. }
  6285. /** @private */
  6286. }, {
  6287. key: 'rmBoundedActivationClasses_',
  6288. value: function rmBoundedActivationClasses_() {
  6289. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  6290. this.adapter_.removeClass(FG_ACTIVATION);
  6291. this.activationAnimationHasEnded_ = false;
  6292. this.adapter_.computeBoundingRect();
  6293. }
  6294. }, {
  6295. key: 'resetActivationState_',
  6296. value: function resetActivationState_() {
  6297. var _this12 = this;
  6298. this.previousActivationEvent_ = this.activationState_.activationEvent;
  6299. this.activationState_ = this.defaultActivationState_();
  6300. // Touch devices may fire additional events for the same interaction within a short time.
  6301. // Store the previous event until it's safe to assume that subsequent events are for new interactions.
  6302. setTimeout(function () {
  6303. return _this12.previousActivationEvent_ = null;
  6304. }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
  6305. }
  6306. /**
  6307. * @param {?Event} e
  6308. * @private
  6309. */
  6310. }, {
  6311. key: 'deactivate_',
  6312. value: function deactivate_(e) {
  6313. var _this13 = this;
  6314. var activationState = this.activationState_;
  6315. // This can happen in scenarios such as when you have a keyup event that blurs the element.
  6316. if (!activationState.isActivated) {
  6317. return;
  6318. }
  6319. var state = /** @type {!ActivationStateType} */_extends({}, activationState);
  6320. if (activationState.isProgrammatic) {
  6321. var evtObject = null;
  6322. requestAnimationFrame(function () {
  6323. return _this13.animateDeactivation_(evtObject, state);
  6324. });
  6325. this.resetActivationState_();
  6326. } else {
  6327. this.deregisterDeactivationHandlers_();
  6328. requestAnimationFrame(function () {
  6329. _this13.activationState_.hasDeactivationUXRun = true;
  6330. _this13.animateDeactivation_(e, state);
  6331. _this13.resetActivationState_();
  6332. });
  6333. }
  6334. }
  6335. /**
  6336. * @param {?Event=} event Optional event containing position information.
  6337. */
  6338. }, {
  6339. key: 'deactivate',
  6340. value: function deactivate() {
  6341. var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6342. this.deactivate_(event);
  6343. }
  6344. /**
  6345. * @param {Event} e
  6346. * @param {!ActivationStateType} options
  6347. * @private
  6348. */
  6349. }, {
  6350. key: 'animateDeactivation_',
  6351. value: function animateDeactivation_(e, _ref) {
  6352. var wasActivatedByPointer = _ref.wasActivatedByPointer,
  6353. wasElementMadeActive = _ref.wasElementMadeActive;
  6354. if (wasActivatedByPointer || wasElementMadeActive) {
  6355. this.runDeactivationUXLogicIfReady_();
  6356. }
  6357. }
  6358. }, {
  6359. key: 'layout',
  6360. value: function layout() {
  6361. var _this14 = this;
  6362. if (this.layoutFrame_) {
  6363. cancelAnimationFrame(this.layoutFrame_);
  6364. }
  6365. this.layoutFrame_ = requestAnimationFrame(function () {
  6366. _this14.layoutInternal_();
  6367. _this14.layoutFrame_ = 0;
  6368. });
  6369. }
  6370. /** @private */
  6371. }, {
  6372. key: 'layoutInternal_',
  6373. value: function layoutInternal_() {
  6374. var _this15 = this;
  6375. this.frame_ = this.adapter_.computeBoundingRect();
  6376. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  6377. // Surface diameter is treated differently for unbounded vs. bounded ripples.
  6378. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
  6379. // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
  6380. // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
  6381. // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
  6382. // `overflow: hidden`.
  6383. var getBoundedRadius = function getBoundedRadius() {
  6384. var hypotenuse = Math.sqrt(Math.pow(_this15.frame_.width, 2) + Math.pow(_this15.frame_.height, 2));
  6385. return hypotenuse + MDCRippleFoundation.numbers.PADDING;
  6386. };
  6387. this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
  6388. // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
  6389. this.initialSize_ = maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE;
  6390. this.fgScale_ = this.maxRadius_ / this.initialSize_;
  6391. this.updateLayoutCssVars_();
  6392. }
  6393. /** @private */
  6394. }, {
  6395. key: 'updateLayoutCssVars_',
  6396. value: function updateLayoutCssVars_() {
  6397. var _MDCRippleFoundation$5 = MDCRippleFoundation.strings,
  6398. VAR_FG_SIZE = _MDCRippleFoundation$5.VAR_FG_SIZE,
  6399. VAR_LEFT = _MDCRippleFoundation$5.VAR_LEFT,
  6400. VAR_TOP = _MDCRippleFoundation$5.VAR_TOP,
  6401. VAR_FG_SCALE = _MDCRippleFoundation$5.VAR_FG_SCALE;
  6402. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + 'px');
  6403. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  6404. if (this.adapter_.isUnbounded()) {
  6405. this.unboundedCoords_ = {
  6406. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  6407. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  6408. };
  6409. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + 'px');
  6410. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + 'px');
  6411. }
  6412. }
  6413. /** @param {boolean} unbounded */
  6414. }, {
  6415. key: 'setUnbounded',
  6416. value: function setUnbounded(unbounded) {
  6417. var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
  6418. if (unbounded) {
  6419. this.adapter_.addClass(UNBOUNDED);
  6420. } else {
  6421. this.adapter_.removeClass(UNBOUNDED);
  6422. }
  6423. }
  6424. }, {
  6425. key: 'handleFocus',
  6426. value: function handleFocus() {
  6427. var _this16 = this;
  6428. requestAnimationFrame(function () {
  6429. return _this16.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  6430. });
  6431. }
  6432. }, {
  6433. key: 'handleBlur',
  6434. value: function handleBlur() {
  6435. var _this17 = this;
  6436. requestAnimationFrame(function () {
  6437. return _this17.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  6438. });
  6439. }
  6440. }]);
  6441. return MDCRippleFoundation;
  6442. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  6443. /* harmony default export */ __webpack_exports__["a"] = (MDCRippleFoundation);
  6444. /***/ }),
  6445. /* 52 */
  6446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6447. "use strict";
  6448. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6449. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  6450. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  6451. /**
  6452. * @license
  6453. * Copyright 2016 Google Inc. All Rights Reserved.
  6454. *
  6455. * Licensed under the Apache License, Version 2.0 (the "License");
  6456. * you may not use this file except in compliance with the License.
  6457. * You may obtain a copy of the License at
  6458. *
  6459. * http://www.apache.org/licenses/LICENSE-2.0
  6460. *
  6461. * Unless required by applicable law or agreed to in writing, software
  6462. * distributed under the License is distributed on an "AS IS" BASIS,
  6463. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6464. * See the License for the specific language governing permissions and
  6465. * limitations under the License.
  6466. */
  6467. var cssClasses = {
  6468. // Ripple is a special case where the "root" component is really a "mixin" of sorts,
  6469. // given that it's an 'upgrade' to an existing component. That being said it is the root
  6470. // CSS class that all other CSS classes derive from.
  6471. ROOT: 'mdc-ripple-upgraded',
  6472. UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
  6473. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
  6474. FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
  6475. FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'
  6476. };
  6477. var strings = {
  6478. VAR_LEFT: '--mdc-ripple-left',
  6479. VAR_TOP: '--mdc-ripple-top',
  6480. VAR_FG_SIZE: '--mdc-ripple-fg-size',
  6481. VAR_FG_SCALE: '--mdc-ripple-fg-scale',
  6482. VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
  6483. VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'
  6484. };
  6485. var numbers = {
  6486. PADDING: 10,
  6487. INITIAL_ORIGIN_SCALE: 0.6,
  6488. DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
  6489. FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)
  6490. TAP_DELAY_MS: 300 };
  6491. /***/ }),
  6492. /* 53 */
  6493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6494. "use strict";
  6495. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  6496. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  6497. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(54);
  6498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(55);
  6499. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  6500. 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; }; }();
  6501. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6502. 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; }
  6503. 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; }
  6504. /**
  6505. * @license
  6506. * Copyright 2016 Google Inc. All Rights Reserved.
  6507. *
  6508. * Licensed under the Apache License, Version 2.0 (the "License");
  6509. * you may not use this file except in compliance with the License.
  6510. * You may obtain a copy of the License at
  6511. *
  6512. * http://www.apache.org/licenses/LICENSE-2.0
  6513. *
  6514. * Unless required by applicable law or agreed to in writing, software
  6515. * distributed under the License is distributed on an "AS IS" BASIS,
  6516. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6517. * See the License for the specific language governing permissions and
  6518. * limitations under the License.
  6519. */
  6520. /* eslint-disable no-unused-vars */
  6521. /* eslint-enable no-unused-vars */
  6522. /** @const {!Array<string>} */
  6523. var CB_PROTO_PROPS = ['checked', 'indeterminate'];
  6524. /**
  6525. * @extends {MDCFoundation<!MDCCheckboxAdapter>}
  6526. */
  6527. var MDCCheckboxFoundation = function (_MDCFoundation) {
  6528. _inherits(MDCCheckboxFoundation, _MDCFoundation);
  6529. _createClass(MDCCheckboxFoundation, null, [{
  6530. key: 'cssClasses',
  6531. /** @return enum {cssClasses} */
  6532. get: function get() {
  6533. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  6534. }
  6535. /** @return enum {strings} */
  6536. }, {
  6537. key: 'strings',
  6538. get: function get() {
  6539. return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */];
  6540. }
  6541. /** @return enum {numbers} */
  6542. }, {
  6543. key: 'numbers',
  6544. get: function get() {
  6545. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */];
  6546. }
  6547. /** @return {!MDCCheckboxAdapter} */
  6548. }, {
  6549. key: 'defaultAdapter',
  6550. get: function get() {
  6551. return (/** @type {!MDCCheckboxAdapter} */{
  6552. addClass: function addClass() /* className: string */{},
  6553. removeClass: function removeClass() /* className: string */{},
  6554. setNativeControlAttr: function setNativeControlAttr() /* attr: string, value: string */{},
  6555. removeNativeControlAttr: function removeNativeControlAttr() /* attr: string */{},
  6556. registerAnimationEndHandler: function registerAnimationEndHandler() /* handler: EventListener */{},
  6557. deregisterAnimationEndHandler: function deregisterAnimationEndHandler() /* handler: EventListener */{},
  6558. registerChangeHandler: function registerChangeHandler() /* handler: EventListener */{},
  6559. deregisterChangeHandler: function deregisterChangeHandler() /* handler: EventListener */{},
  6560. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{},
  6561. forceLayout: function forceLayout() {},
  6562. isAttachedToDOM: function isAttachedToDOM() /* boolean */{}
  6563. }
  6564. );
  6565. }
  6566. }]);
  6567. function MDCCheckboxFoundation(adapter) {
  6568. _classCallCheck(this, MDCCheckboxFoundation);
  6569. /** @private {string} */
  6570. var _this = _possibleConstructorReturn(this, (MDCCheckboxFoundation.__proto__ || Object.getPrototypeOf(MDCCheckboxFoundation)).call(this, _extends(MDCCheckboxFoundation.defaultAdapter, adapter)));
  6571. _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT;
  6572. /** @private {string} */
  6573. _this.currentAnimationClass_ = '';
  6574. /** @private {number} */
  6575. _this.animEndLatchTimer_ = 0;
  6576. _this.animEndHandler_ = /** @private {!EventListener} */function () {
  6577. return _this.handleAnimationEnd();
  6578. };
  6579. _this.changeHandler_ = /** @private {!EventListener} */function () {
  6580. return _this.handleChange();
  6581. };
  6582. return _this;
  6583. }
  6584. /** @override */
  6585. _createClass(MDCCheckboxFoundation, [{
  6586. key: 'init',
  6587. value: function init() {
  6588. this.currentCheckState_ = this.determineCheckState_(this.getNativeControl_());
  6589. this.updateAriaChecked_();
  6590. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].UPGRADED);
  6591. this.adapter_.registerChangeHandler(this.changeHandler_);
  6592. this.installPropertyChangeHooks_();
  6593. }
  6594. /** @override */
  6595. }, {
  6596. key: 'destroy',
  6597. value: function destroy() {
  6598. this.adapter_.deregisterChangeHandler(this.changeHandler_);
  6599. this.uninstallPropertyChangeHooks_();
  6600. }
  6601. /** @return {boolean} */
  6602. }, {
  6603. key: 'isChecked',
  6604. value: function isChecked() {
  6605. return this.getNativeControl_().checked;
  6606. }
  6607. /** @param {boolean} checked */
  6608. }, {
  6609. key: 'setChecked',
  6610. value: function setChecked(checked) {
  6611. this.getNativeControl_().checked = checked;
  6612. }
  6613. /** @return {boolean} */
  6614. }, {
  6615. key: 'isIndeterminate',
  6616. value: function isIndeterminate() {
  6617. return this.getNativeControl_().indeterminate;
  6618. }
  6619. /** @param {boolean} indeterminate */
  6620. }, {
  6621. key: 'setIndeterminate',
  6622. value: function setIndeterminate(indeterminate) {
  6623. this.getNativeControl_().indeterminate = indeterminate;
  6624. }
  6625. /** @return {boolean} */
  6626. }, {
  6627. key: 'isDisabled',
  6628. value: function isDisabled() {
  6629. return this.getNativeControl_().disabled;
  6630. }
  6631. /** @param {boolean} disabled */
  6632. }, {
  6633. key: 'setDisabled',
  6634. value: function setDisabled(disabled) {
  6635. this.getNativeControl_().disabled = disabled;
  6636. if (disabled) {
  6637. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  6638. } else {
  6639. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  6640. }
  6641. }
  6642. /** @return {?string} */
  6643. }, {
  6644. key: 'getValue',
  6645. value: function getValue() {
  6646. return this.getNativeControl_().value;
  6647. }
  6648. /** @param {?string} value */
  6649. }, {
  6650. key: 'setValue',
  6651. value: function setValue(value) {
  6652. this.getNativeControl_().value = value;
  6653. }
  6654. /**
  6655. * Handles the animationend event for the checkbox
  6656. */
  6657. }, {
  6658. key: 'handleAnimationEnd',
  6659. value: function handleAnimationEnd() {
  6660. var _this2 = this;
  6661. clearTimeout(this.animEndLatchTimer_);
  6662. this.animEndLatchTimer_ = setTimeout(function () {
  6663. _this2.adapter_.removeClass(_this2.currentAnimationClass_);
  6664. _this2.adapter_.deregisterAnimationEndHandler(_this2.animEndHandler_);
  6665. }, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].ANIM_END_LATCH_MS);
  6666. }
  6667. /**
  6668. * Handles the change event for the checkbox
  6669. */
  6670. }, {
  6671. key: 'handleChange',
  6672. value: function handleChange() {
  6673. this.transitionCheckState_();
  6674. }
  6675. /** @private */
  6676. }, {
  6677. key: 'installPropertyChangeHooks_',
  6678. value: function installPropertyChangeHooks_() {
  6679. var _this3 = this;
  6680. var nativeCb = this.getNativeControl_();
  6681. var cbProto = Object.getPrototypeOf(nativeCb);
  6682. CB_PROTO_PROPS.forEach(function (controlState) {
  6683. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  6684. // We have to check for this descriptor, since some browsers (Safari) don't support its return.
  6685. // See: https://bugs.webkit.org/show_bug.cgi?id=49739
  6686. if (validDescriptor(desc)) {
  6687. var nativeCbDesc = /** @type {!ObjectPropertyDescriptor} */{
  6688. get: desc.get,
  6689. set: function set(state) {
  6690. desc.set.call(nativeCb, state);
  6691. _this3.transitionCheckState_();
  6692. },
  6693. configurable: desc.configurable,
  6694. enumerable: desc.enumerable
  6695. };
  6696. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  6697. }
  6698. });
  6699. }
  6700. /** @private */
  6701. }, {
  6702. key: 'uninstallPropertyChangeHooks_',
  6703. value: function uninstallPropertyChangeHooks_() {
  6704. var nativeCb = this.getNativeControl_();
  6705. var cbProto = Object.getPrototypeOf(nativeCb);
  6706. CB_PROTO_PROPS.forEach(function (controlState) {
  6707. var desc = /** @type {!ObjectPropertyDescriptor} */Object.getOwnPropertyDescriptor(cbProto, controlState);
  6708. if (validDescriptor(desc)) {
  6709. Object.defineProperty(nativeCb, controlState, desc);
  6710. }
  6711. });
  6712. }
  6713. /** @private */
  6714. }, {
  6715. key: 'transitionCheckState_',
  6716. value: function transitionCheckState_() {
  6717. var nativeCb = this.adapter_.getNativeControl();
  6718. if (!nativeCb) {
  6719. return;
  6720. }
  6721. var oldState = this.currentCheckState_;
  6722. var newState = this.determineCheckState_(nativeCb);
  6723. if (oldState === newState) {
  6724. return;
  6725. }
  6726. this.updateAriaChecked_();
  6727. // Check to ensure that there isn't a previously existing animation class, in case for example
  6728. // the user interacted with the checkbox before the animation was finished.
  6729. if (this.currentAnimationClass_.length > 0) {
  6730. clearTimeout(this.animEndLatchTimer_);
  6731. this.adapter_.forceLayout();
  6732. this.adapter_.removeClass(this.currentAnimationClass_);
  6733. }
  6734. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  6735. this.currentCheckState_ = newState;
  6736. // Check for parentNode so that animations are only run when the element is attached
  6737. // to the DOM.
  6738. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  6739. this.adapter_.addClass(this.currentAnimationClass_);
  6740. this.adapter_.registerAnimationEndHandler(this.animEndHandler_);
  6741. }
  6742. }
  6743. /**
  6744. * @param {!MDCSelectionControlState} nativeCb
  6745. * @return {string}
  6746. * @private
  6747. */
  6748. }, {
  6749. key: 'determineCheckState_',
  6750. value: function determineCheckState_(nativeCb) {
  6751. var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE,
  6752. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  6753. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  6754. if (nativeCb.indeterminate) {
  6755. return TRANSITION_STATE_INDETERMINATE;
  6756. }
  6757. return nativeCb.checked ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  6758. }
  6759. /**
  6760. * @param {string} oldState
  6761. * @param {string} newState
  6762. * @return {string}
  6763. */
  6764. }, {
  6765. key: 'getTransitionAnimationClass_',
  6766. value: function getTransitionAnimationClass_(oldState, newState) {
  6767. var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT,
  6768. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  6769. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  6770. var _MDCCheckboxFoundatio = MDCCheckboxFoundation.cssClasses,
  6771. ANIM_UNCHECKED_CHECKED = _MDCCheckboxFoundatio.ANIM_UNCHECKED_CHECKED,
  6772. ANIM_UNCHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_UNCHECKED_INDETERMINATE,
  6773. ANIM_CHECKED_UNCHECKED = _MDCCheckboxFoundatio.ANIM_CHECKED_UNCHECKED,
  6774. ANIM_CHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_CHECKED_INDETERMINATE,
  6775. ANIM_INDETERMINATE_CHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_CHECKED,
  6776. ANIM_INDETERMINATE_UNCHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_UNCHECKED;
  6777. switch (oldState) {
  6778. case TRANSITION_STATE_INIT:
  6779. if (newState === TRANSITION_STATE_UNCHECKED) {
  6780. return '';
  6781. }
  6782. // fallthrough
  6783. case TRANSITION_STATE_UNCHECKED:
  6784. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  6785. case TRANSITION_STATE_CHECKED:
  6786. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  6787. // TRANSITION_STATE_INDETERMINATE
  6788. default:
  6789. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  6790. }
  6791. }
  6792. }, {
  6793. key: 'updateAriaChecked_',
  6794. value: function updateAriaChecked_() {
  6795. // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.
  6796. if (this.isIndeterminate()) {
  6797. this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE);
  6798. } else {
  6799. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR);
  6800. }
  6801. }
  6802. /**
  6803. * @return {!MDCSelectionControlState}
  6804. * @private
  6805. */
  6806. }, {
  6807. key: 'getNativeControl_',
  6808. value: function getNativeControl_() {
  6809. return this.adapter_.getNativeControl() || {
  6810. checked: false,
  6811. indeterminate: false,
  6812. disabled: false,
  6813. value: null
  6814. };
  6815. }
  6816. }]);
  6817. return MDCCheckboxFoundation;
  6818. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  6819. /**
  6820. * @param {ObjectPropertyDescriptor|undefined} inputPropDesc
  6821. * @return {boolean}
  6822. */
  6823. function validDescriptor(inputPropDesc) {
  6824. return !!inputPropDesc && typeof inputPropDesc.set === 'function';
  6825. }
  6826. /* harmony default export */ __webpack_exports__["a"] = (MDCCheckboxFoundation);
  6827. /***/ }),
  6828. /* 54 */
  6829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6830. "use strict";
  6831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  6832. 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; }; }();
  6833. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6834. /**
  6835. * @license
  6836. * Copyright 2016 Google Inc. All Rights Reserved.
  6837. *
  6838. * Licensed under the Apache License, Version 2.0 (the "License");
  6839. * you may not use this file except in compliance with the License.
  6840. * You may obtain a copy of the License at
  6841. *
  6842. * http://www.apache.org/licenses/LICENSE-2.0
  6843. *
  6844. * Unless required by applicable law or agreed to in writing, software
  6845. * distributed under the License is distributed on an "AS IS" BASIS,
  6846. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6847. * See the License for the specific language governing permissions and
  6848. * limitations under the License.
  6849. */
  6850. /* eslint-disable no-unused-vars */
  6851. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6852. /**
  6853. * Adapter for MDC Checkbox. Provides an interface for managing
  6854. * - classes
  6855. * - dom
  6856. * - event handlers
  6857. *
  6858. * Additionally, provides type information for the adapter to the Closure
  6859. * compiler.
  6860. *
  6861. * Implement this adapter for your framework of choice to delegate updates to
  6862. * the component in your framework of choice. See architecture documentation
  6863. * for more details.
  6864. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  6865. *
  6866. * @record
  6867. */
  6868. var MDCCheckboxAdapter = function () {
  6869. function MDCCheckboxAdapter() {
  6870. _classCallCheck(this, MDCCheckboxAdapter);
  6871. }
  6872. _createClass(MDCCheckboxAdapter, [{
  6873. key: 'addClass',
  6874. /** @param {string} className */
  6875. value: function addClass(className) {}
  6876. /** @param {string} className */
  6877. }, {
  6878. key: 'removeClass',
  6879. value: function removeClass(className) {}
  6880. /**
  6881. * Sets an attribute with a given value on the input element.
  6882. * @param {string} attr
  6883. * @param {string} value
  6884. */
  6885. }, {
  6886. key: 'setNativeControlAttr',
  6887. value: function setNativeControlAttr(attr, value) {}
  6888. /**
  6889. * Removes an attribute from the input element.
  6890. * @param {string} attr
  6891. */
  6892. }, {
  6893. key: 'removeNativeControlAttr',
  6894. value: function removeNativeControlAttr(attr) {}
  6895. /** @param {!EventListener} handler */
  6896. }, {
  6897. key: 'registerAnimationEndHandler',
  6898. value: function registerAnimationEndHandler(handler) {}
  6899. /** @param {!EventListener} handler */
  6900. }, {
  6901. key: 'deregisterAnimationEndHandler',
  6902. value: function deregisterAnimationEndHandler(handler) {}
  6903. /** @param {!EventListener} handler */
  6904. }, {
  6905. key: 'registerChangeHandler',
  6906. value: function registerChangeHandler(handler) {}
  6907. /** @param {!EventListener} handler */
  6908. }, {
  6909. key: 'deregisterChangeHandler',
  6910. value: function deregisterChangeHandler(handler) {}
  6911. /** @return {!MDCSelectionControlState} */
  6912. }, {
  6913. key: 'getNativeControl',
  6914. value: function getNativeControl() {}
  6915. }, {
  6916. key: 'forceLayout',
  6917. value: function forceLayout() {}
  6918. /** @return {boolean} */
  6919. }, {
  6920. key: 'isAttachedToDOM',
  6921. value: function isAttachedToDOM() {}
  6922. }]);
  6923. return MDCCheckboxAdapter;
  6924. }();
  6925. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxAdapter);
  6926. /***/ }),
  6927. /* 55 */
  6928. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6929. "use strict";
  6930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  6932. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  6933. /**
  6934. * @license
  6935. * Copyright 2016 Google Inc. All Rights Reserved.
  6936. *
  6937. * Licensed under the Apache License, Version 2.0 (the "License");
  6938. * you may not use this file except in compliance with the License.
  6939. * You may obtain a copy of the License at
  6940. *
  6941. * http://www.apache.org/licenses/LICENSE-2.0
  6942. *
  6943. * Unless required by applicable law or agreed to in writing, software
  6944. * distributed under the License is distributed on an "AS IS" BASIS,
  6945. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6946. * See the License for the specific language governing permissions and
  6947. * limitations under the License.
  6948. */
  6949. /** @const {string} */
  6950. var ROOT = 'mdc-checkbox';
  6951. /** @enum {string} */
  6952. var cssClasses = {
  6953. UPGRADED: 'mdc-checkbox--upgraded',
  6954. CHECKED: 'mdc-checkbox--checked',
  6955. INDETERMINATE: 'mdc-checkbox--indeterminate',
  6956. DISABLED: 'mdc-checkbox--disabled',
  6957. ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
  6958. ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
  6959. ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
  6960. ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
  6961. ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
  6962. ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'
  6963. };
  6964. /** @enum {string} */
  6965. var strings = {
  6966. NATIVE_CONTROL_SELECTOR: '.' + ROOT + '__native-control',
  6967. TRANSITION_STATE_INIT: 'init',
  6968. TRANSITION_STATE_CHECKED: 'checked',
  6969. TRANSITION_STATE_UNCHECKED: 'unchecked',
  6970. TRANSITION_STATE_INDETERMINATE: 'indeterminate',
  6971. ARIA_CHECKED_ATTR: 'aria-checked',
  6972. ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed'
  6973. };
  6974. /** @enum {number} */
  6975. var numbers = {
  6976. ANIM_END_LATCH_MS: 250
  6977. };
  6978. /***/ }),
  6979. /* 56 */
  6980. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6981. "use strict";
  6982. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6983. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_index__ = __webpack_require__(24);
  6984. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__chip_set_index__ = __webpack_require__(57);
  6985. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["b"]; });
  6986. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChip", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["a"]; });
  6987. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSetFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["b"]; });
  6988. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSet", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["a"]; });
  6989. /**
  6990. * Copyright 2017 Google Inc. All Rights Reserved.
  6991. *
  6992. * Licensed under the Apache License, Version 2.0 (the "License");
  6993. * you may not use this file except in compliance with the License.
  6994. * You may obtain a copy of the License at
  6995. *
  6996. * http://www.apache.org/licenses/LICENSE-2.0
  6997. *
  6998. * Unless required by applicable law or agreed to in writing, software
  6999. * distributed under the License is distributed on an "AS IS" BASIS,
  7000. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7001. * See the License for the specific language governing permissions and
  7002. * limitations under the License.
  7003. */
  7004. /***/ }),
  7005. /* 57 */
  7006. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7007. "use strict";
  7008. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSet; });
  7009. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  7010. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(27);
  7011. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(58);
  7012. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chip_index__ = __webpack_require__(24);
  7013. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  7014. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  7015. 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; }; }();
  7016. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  7017. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7018. 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; }
  7019. 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; }
  7020. /**
  7021. * @license
  7022. * Copyright 2016 Google Inc. All Rights Reserved.
  7023. *
  7024. * Licensed under the Apache License, Version 2.0 (the "License");
  7025. * you may not use this file except in compliance with the License.
  7026. * You may obtain a copy of the License at
  7027. *
  7028. * http://www.apache.org/licenses/LICENSE-2.0
  7029. *
  7030. * Unless required by applicable law or agreed to in writing, software
  7031. * distributed under the License is distributed on an "AS IS" BASIS,
  7032. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7033. * See the License for the specific language governing permissions and
  7034. * limitations under the License.
  7035. */
  7036. /**
  7037. * @extends {MDCComponent<!MDCChipSetFoundation>}
  7038. * @final
  7039. */
  7040. var MDCChipSet = function (_MDCComponent) {
  7041. _inherits(MDCChipSet, _MDCComponent);
  7042. /**
  7043. * @param {...?} args
  7044. */
  7045. function MDCChipSet() {
  7046. var _ref;
  7047. _classCallCheck(this, MDCChipSet);
  7048. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  7049. args[_key] = arguments[_key];
  7050. }
  7051. /** @type {!Array<!MDCChip>} */
  7052. var _this = _possibleConstructorReturn(this, (_ref = MDCChipSet.__proto__ || Object.getPrototypeOf(MDCChipSet)).call.apply(_ref, [this].concat(args)));
  7053. _this.chips;
  7054. /** @type {(function(!Element): !MDCChip)} */
  7055. _this.chipFactory_;
  7056. /** @private {?function(?Event): undefined} */
  7057. _this.handleChipInteraction_;
  7058. /** @private {?function(?Event): undefined} */
  7059. _this.handleChipRemoval_;
  7060. return _this;
  7061. }
  7062. /**
  7063. * @param {!Element} root
  7064. * @return {!MDCChipSet}
  7065. */
  7066. _createClass(MDCChipSet, [{
  7067. key: 'initialize',
  7068. /**
  7069. * @param {(function(!Element): !MDCChip)=} chipFactory A function which
  7070. * creates a new MDCChip.
  7071. */
  7072. value: function initialize() {
  7073. var chipFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  7074. return new __WEBPACK_IMPORTED_MODULE_3__chip_index__["a" /* MDCChip */](el);
  7075. };
  7076. this.chipFactory_ = chipFactory;
  7077. this.chips = this.instantiateChips_(this.chipFactory_);
  7078. }
  7079. }, {
  7080. key: 'initialSyncWithDOM',
  7081. value: function initialSyncWithDOM() {
  7082. var _this2 = this;
  7083. this.chips.forEach(function (chip) {
  7084. if (chip.isSelected()) {
  7085. _this2.foundation_.select(chip.foundation);
  7086. }
  7087. });
  7088. this.handleChipInteraction_ = function (evt) {
  7089. return _this2.foundation_.handleChipInteraction(evt);
  7090. };
  7091. this.handleChipRemoval_ = function (evt) {
  7092. return _this2.foundation_.handleChipRemoval(evt);
  7093. };
  7094. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  7095. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  7096. }
  7097. }, {
  7098. key: 'destroy',
  7099. value: function destroy() {
  7100. this.chips.forEach(function (chip) {
  7101. chip.destroy();
  7102. });
  7103. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  7104. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  7105. _get(MDCChipSet.prototype.__proto__ || Object.getPrototypeOf(MDCChipSet.prototype), 'destroy', this).call(this);
  7106. }
  7107. /**
  7108. * Adds a new chip object to the chip set from the given chip element.
  7109. * @param {!Element} chipEl
  7110. */
  7111. }, {
  7112. key: 'addChip',
  7113. value: function addChip(chipEl) {
  7114. this.chips.push(this.chipFactory_(chipEl));
  7115. }
  7116. /**
  7117. * @return {!MDCChipSetFoundation}
  7118. */
  7119. }, {
  7120. key: 'getDefaultFoundation',
  7121. value: function getDefaultFoundation() {
  7122. var _this3 = this;
  7123. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCChipSetAdapter} */_extends({
  7124. hasClass: function hasClass(className) {
  7125. return _this3.root_.classList.contains(className);
  7126. },
  7127. removeChip: function removeChip(chip) {
  7128. var index = _this3.chips.indexOf(chip);
  7129. _this3.chips.splice(index, 1);
  7130. chip.destroy();
  7131. }
  7132. }));
  7133. }
  7134. /**
  7135. * Instantiates chip components on all of the chip set's child chip elements.
  7136. * @param {(function(!Element): !MDCChip)} chipFactory
  7137. * @return {!Array<!MDCChip>}
  7138. */
  7139. }, {
  7140. key: 'instantiateChips_',
  7141. value: function instantiateChips_(chipFactory) {
  7142. var chipElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHIP_SELECTOR));
  7143. return chipElements.map(function (el) {
  7144. return chipFactory(el);
  7145. });
  7146. }
  7147. }], [{
  7148. key: 'attachTo',
  7149. value: function attachTo(root) {
  7150. return new MDCChipSet(root);
  7151. }
  7152. }]);
  7153. return MDCChipSet;
  7154. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  7155. /***/ }),
  7156. /* 58 */
  7157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7158. "use strict";
  7159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  7160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(27);
  7161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__chip_foundation__ = __webpack_require__(14);
  7162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(59);
  7163. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  7164. 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; }; }();
  7165. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7166. 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; }
  7167. 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; }
  7168. /**
  7169. * @license
  7170. * Copyright 2017 Google Inc. All Rights Reserved.
  7171. *
  7172. * Licensed under the Apache License, Version 2.0 (the "License");
  7173. * you may not use this file except in compliance with the License.
  7174. * You may obtain a copy of the License at
  7175. *
  7176. * http://www.apache.org/licenses/LICENSE-2.0
  7177. *
  7178. * Unless required by applicable law or agreed to in writing, software
  7179. * distributed under the License is distributed on an "AS IS" BASIS,
  7180. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7181. * See the License for the specific language governing permissions and
  7182. * limitations under the License.
  7183. */
  7184. // eslint-disable-next-line no-unused-vars
  7185. /**
  7186. * @extends {MDCFoundation<!MDCChipSetAdapter>}
  7187. * @final
  7188. */
  7189. var MDCChipSetFoundation = function (_MDCFoundation) {
  7190. _inherits(MDCChipSetFoundation, _MDCFoundation);
  7191. _createClass(MDCChipSetFoundation, null, [{
  7192. key: 'strings',
  7193. /** @return enum {string} */
  7194. get: function get() {
  7195. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  7196. }
  7197. /** @return enum {string} */
  7198. }, {
  7199. key: 'cssClasses',
  7200. get: function get() {
  7201. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  7202. }
  7203. /**
  7204. * {@see MDCChipSetAdapter} for typing information on parameters and return
  7205. * types.
  7206. * @return {!MDCChipSetAdapter}
  7207. */
  7208. }, {
  7209. key: 'defaultAdapter',
  7210. get: function get() {
  7211. return (/** @type {!MDCChipSetAdapter} */{
  7212. hasClass: function hasClass() {},
  7213. removeChip: function removeChip() {}
  7214. }
  7215. );
  7216. }
  7217. /**
  7218. * @param {!MDCChipSetAdapter} adapter
  7219. */
  7220. }]);
  7221. function MDCChipSetFoundation(adapter) {
  7222. _classCallCheck(this, MDCChipSetFoundation);
  7223. /**
  7224. * The selected chips in the set. Only used for choice chip set or filter chip set.
  7225. * @private {!Array<!MDCChipFoundation>}
  7226. */
  7227. var _this = _possibleConstructorReturn(this, (MDCChipSetFoundation.__proto__ || Object.getPrototypeOf(MDCChipSetFoundation)).call(this, _extends(MDCChipSetFoundation.defaultAdapter, adapter)));
  7228. _this.selectedChips_ = [];
  7229. return _this;
  7230. }
  7231. /**
  7232. * Selects the given chip. Deselects all other chips if the chip set is of the choice variant.
  7233. * @param {!MDCChipFoundation} chipFoundation
  7234. */
  7235. _createClass(MDCChipSetFoundation, [{
  7236. key: 'select',
  7237. value: function select(chipFoundation) {
  7238. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE)) {
  7239. this.deselectAll_();
  7240. }
  7241. chipFoundation.setSelected(true);
  7242. this.selectedChips_.push(chipFoundation);
  7243. }
  7244. /**
  7245. * Deselects the given chip.
  7246. * @param {!MDCChipFoundation} chipFoundation
  7247. */
  7248. }, {
  7249. key: 'deselect',
  7250. value: function deselect(chipFoundation) {
  7251. var index = this.selectedChips_.indexOf(chipFoundation);
  7252. if (index >= 0) {
  7253. this.selectedChips_.splice(index, 1);
  7254. }
  7255. chipFoundation.setSelected(false);
  7256. }
  7257. /** Deselects all selected chips. */
  7258. }, {
  7259. key: 'deselectAll_',
  7260. value: function deselectAll_() {
  7261. this.selectedChips_.forEach(function (chipFoundation) {
  7262. chipFoundation.setSelected(false);
  7263. });
  7264. this.selectedChips_.length = 0;
  7265. }
  7266. /**
  7267. * Handles a chip interaction event
  7268. * @param {!MDCChipInteractionEventType} evt
  7269. * @private
  7270. */
  7271. }, {
  7272. key: 'handleChipInteraction',
  7273. value: function handleChipInteraction(evt) {
  7274. var chipFoundation = evt.detail.chip.foundation;
  7275. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FILTER)) {
  7276. if (chipFoundation.isSelected()) {
  7277. this.deselect(chipFoundation);
  7278. } else {
  7279. this.select(chipFoundation);
  7280. }
  7281. }
  7282. }
  7283. /**
  7284. * Handles the event when a chip is removed.
  7285. * @param {!MDCChipInteractionEventType} evt
  7286. * @private
  7287. */
  7288. }, {
  7289. key: 'handleChipRemoval',
  7290. value: function handleChipRemoval(evt) {
  7291. var chip = evt.detail.chip;
  7292. this.deselect(chip.foundation);
  7293. this.adapter_.removeChip(chip);
  7294. }
  7295. }]);
  7296. return MDCChipSetFoundation;
  7297. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  7298. /* harmony default export */ __webpack_exports__["a"] = (MDCChipSetFoundation);
  7299. /***/ }),
  7300. /* 59 */
  7301. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7302. "use strict";
  7303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  7304. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7305. /**
  7306. * @license
  7307. * Copyright 2016 Google Inc. All Rights Reserved.
  7308. *
  7309. * Licensed under the Apache License, Version 2.0 (the "License");
  7310. * you may not use this file except in compliance with the License.
  7311. * You may obtain a copy of the License at
  7312. *
  7313. * http://www.apache.org/licenses/LICENSE-2.0
  7314. *
  7315. * Unless required by applicable law or agreed to in writing, software
  7316. * distributed under the License is distributed on an "AS IS" BASIS,
  7317. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7318. * See the License for the specific language governing permissions and
  7319. * limitations under the License.
  7320. */
  7321. /** @enum {string} */
  7322. var strings = {
  7323. CHIP_SELECTOR: '.mdc-chip'
  7324. };
  7325. /** @enum {string} */
  7326. var cssClasses = {
  7327. CHOICE: 'mdc-chip-set--choice',
  7328. FILTER: 'mdc-chip-set--filter'
  7329. };
  7330. /***/ }),
  7331. /* 60 */
  7332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7333. "use strict";
  7334. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7335. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialog", function() { return MDCDialog; });
  7336. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  7337. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(3);
  7338. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(61);
  7339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(63);
  7340. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialogFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  7341. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  7342. 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; }; }();
  7343. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  7344. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7345. 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; }
  7346. 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; }
  7347. /**
  7348. * Copyright 2017 Google Inc. All Rights Reserved.
  7349. *
  7350. * Licensed under the Apache License, Version 2.0 (the "License");
  7351. * you may not use this file except in compliance with the License.
  7352. * You may obtain a copy of the License at
  7353. *
  7354. * http://www.apache.org/licenses/LICENSE-2.0
  7355. *
  7356. * Unless required by applicable law or agreed to in writing, software
  7357. * distributed under the License is distributed on an "AS IS" BASIS,
  7358. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7359. * See the License for the specific language governing permissions and
  7360. * limitations under the License.
  7361. */
  7362. var MDCDialog = function (_MDCComponent) {
  7363. _inherits(MDCDialog, _MDCComponent);
  7364. function MDCDialog() {
  7365. _classCallCheck(this, MDCDialog);
  7366. return _possibleConstructorReturn(this, (MDCDialog.__proto__ || Object.getPrototypeOf(MDCDialog)).apply(this, arguments));
  7367. }
  7368. _createClass(MDCDialog, [{
  7369. key: 'initialize',
  7370. value: function initialize() {
  7371. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_3__util__["createFocusTrapInstance"](this.dialogSurface_, this.acceptButton_);
  7372. this.footerBtnRipples_ = [];
  7373. var footerBtns = this.root_.querySelectorAll('.mdc-dialog__footer__button');
  7374. for (var i = 0, footerBtn; footerBtn = footerBtns[i]; i++) {
  7375. this.footerBtnRipples_.push(new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](footerBtn));
  7376. }
  7377. }
  7378. }, {
  7379. key: 'destroy',
  7380. value: function destroy() {
  7381. this.footerBtnRipples_.forEach(function (ripple) {
  7382. return ripple.destroy();
  7383. });
  7384. _get(MDCDialog.prototype.__proto__ || Object.getPrototypeOf(MDCDialog.prototype), 'destroy', this).call(this);
  7385. }
  7386. }, {
  7387. key: 'show',
  7388. value: function show() {
  7389. this.foundation_.open();
  7390. }
  7391. }, {
  7392. key: 'close',
  7393. value: function close() {
  7394. this.foundation_.close();
  7395. }
  7396. }, {
  7397. key: 'getDefaultFoundation',
  7398. value: function getDefaultFoundation() {
  7399. var _this2 = this;
  7400. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  7401. addClass: function addClass(className) {
  7402. return _this2.root_.classList.add(className);
  7403. },
  7404. removeClass: function removeClass(className) {
  7405. return _this2.root_.classList.remove(className);
  7406. },
  7407. addBodyClass: function addBodyClass(className) {
  7408. return document.body.classList.add(className);
  7409. },
  7410. removeBodyClass: function removeBodyClass(className) {
  7411. return document.body.classList.remove(className);
  7412. },
  7413. eventTargetHasClass: function eventTargetHasClass(target, className) {
  7414. return target.classList.contains(className);
  7415. },
  7416. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  7417. return _this2.root_.addEventListener(evt, handler);
  7418. },
  7419. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  7420. return _this2.root_.removeEventListener(evt, handler);
  7421. },
  7422. registerSurfaceInteractionHandler: function registerSurfaceInteractionHandler(evt, handler) {
  7423. return _this2.dialogSurface_.addEventListener(evt, handler);
  7424. },
  7425. deregisterSurfaceInteractionHandler: function deregisterSurfaceInteractionHandler(evt, handler) {
  7426. return _this2.dialogSurface_.removeEventListener(evt, handler);
  7427. },
  7428. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  7429. return document.addEventListener('keydown', handler);
  7430. },
  7431. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  7432. return document.removeEventListener('keydown', handler);
  7433. },
  7434. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  7435. return _this2.dialogSurface_.addEventListener('transitionend', handler);
  7436. },
  7437. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  7438. return _this2.dialogSurface_.removeEventListener('transitionend', handler);
  7439. },
  7440. notifyAccept: function notifyAccept() {
  7441. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ACCEPT_EVENT);
  7442. },
  7443. notifyCancel: function notifyCancel() {
  7444. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CANCEL_EVENT);
  7445. },
  7446. trapFocusOnSurface: function trapFocusOnSurface() {
  7447. return _this2.focusTrap_.activate();
  7448. },
  7449. untrapFocusOnSurface: function untrapFocusOnSurface() {
  7450. return _this2.focusTrap_.deactivate();
  7451. },
  7452. isDialog: function isDialog(el) {
  7453. return el === _this2.dialogSurface_;
  7454. }
  7455. });
  7456. }
  7457. }, {
  7458. key: 'open',
  7459. get: function get() {
  7460. return this.foundation_.isOpen();
  7461. }
  7462. }, {
  7463. key: 'acceptButton_',
  7464. get: function get() {
  7465. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ACCEPT_SELECTOR);
  7466. }
  7467. }, {
  7468. key: 'dialogSurface_',
  7469. get: function get() {
  7470. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.DIALOG_SURFACE_SELECTOR);
  7471. }
  7472. }], [{
  7473. key: 'attachTo',
  7474. value: function attachTo(root) {
  7475. return new MDCDialog(root);
  7476. }
  7477. }]);
  7478. return MDCDialog;
  7479. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  7480. /***/ }),
  7481. /* 61 */
  7482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7483. "use strict";
  7484. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  7485. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(62);
  7486. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  7487. 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; }; }();
  7488. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7489. 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; }
  7490. 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; }
  7491. /**
  7492. * Copyright 2017 Google Inc. All Rights Reserved.
  7493. *
  7494. * Licensed under the Apache License, Version 2.0 (the "License");
  7495. * you may not use this file except in compliance with the License.
  7496. * You may obtain a copy of the License at
  7497. *
  7498. * http://www.apache.org/licenses/LICENSE-2.0
  7499. *
  7500. * Unless required by applicable law or agreed to in writing, software
  7501. * distributed under the License is distributed on an "AS IS" BASIS,
  7502. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7503. * See the License for the specific language governing permissions and
  7504. * limitations under the License.
  7505. */
  7506. var MDCDialogFoundation = function (_MDCFoundation) {
  7507. _inherits(MDCDialogFoundation, _MDCFoundation);
  7508. _createClass(MDCDialogFoundation, null, [{
  7509. key: 'cssClasses',
  7510. get: function get() {
  7511. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  7512. }
  7513. }, {
  7514. key: 'strings',
  7515. get: function get() {
  7516. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  7517. }
  7518. }, {
  7519. key: 'defaultAdapter',
  7520. get: function get() {
  7521. return {
  7522. addClass: function addClass() /* className: string */{},
  7523. removeClass: function removeClass() /* className: string */{},
  7524. addBodyClass: function addBodyClass() /* className: string */{},
  7525. removeBodyClass: function removeBodyClass() /* className: string */{},
  7526. eventTargetHasClass: function eventTargetHasClass() {
  7527. return (/* target: EventTarget, className: string */ /* boolean */false
  7528. );
  7529. },
  7530. registerInteractionHandler: function registerInteractionHandler() /* evt: string, handler: EventListener */{},
  7531. deregisterInteractionHandler: function deregisterInteractionHandler() /* evt: string, handler: EventListener */{},
  7532. registerSurfaceInteractionHandler: function registerSurfaceInteractionHandler() /* evt: string, handler: EventListener */{},
  7533. deregisterSurfaceInteractionHandler: function deregisterSurfaceInteractionHandler() /* evt: string, handler: EventListener */{},
  7534. registerDocumentKeydownHandler: function registerDocumentKeydownHandler() /* handler: EventListener */{},
  7535. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler() /* handler: EventListener */{},
  7536. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  7537. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  7538. notifyAccept: function notifyAccept() {},
  7539. notifyCancel: function notifyCancel() {},
  7540. trapFocusOnSurface: function trapFocusOnSurface() {},
  7541. untrapFocusOnSurface: function untrapFocusOnSurface() {},
  7542. isDialog: function isDialog() {
  7543. return (/* el: Element */ /* boolean */false
  7544. );
  7545. }
  7546. };
  7547. }
  7548. }]);
  7549. function MDCDialogFoundation(adapter) {
  7550. _classCallCheck(this, MDCDialogFoundation);
  7551. var _this = _possibleConstructorReturn(this, (MDCDialogFoundation.__proto__ || Object.getPrototypeOf(MDCDialogFoundation)).call(this, _extends(MDCDialogFoundation.defaultAdapter, adapter)));
  7552. _this.isOpen_ = false;
  7553. _this.componentClickHandler_ = function (evt) {
  7554. if (_this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].BACKDROP)) {
  7555. _this.cancel(true);
  7556. }
  7557. };
  7558. _this.dialogClickHandler_ = function (evt) {
  7559. return _this.handleDialogClick_(evt);
  7560. };
  7561. _this.documentKeydownHandler_ = function (evt) {
  7562. if (evt.key && evt.key === 'Escape' || evt.keyCode === 27) {
  7563. _this.cancel(true);
  7564. }
  7565. };
  7566. _this.transitionEndHandler_ = function (evt) {
  7567. return _this.handleTransitionEnd_(evt);
  7568. };
  7569. return _this;
  7570. }
  7571. _createClass(MDCDialogFoundation, [{
  7572. key: 'destroy',
  7573. value: function destroy() {
  7574. // Ensure that dialog is cleaned up when destroyed
  7575. if (this.isOpen_) {
  7576. this.adapter_.deregisterSurfaceInteractionHandler('click', this.dialogClickHandler_);
  7577. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  7578. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  7579. this.adapter_.untrapFocusOnSurface();
  7580. this.adapter_.deregisterTransitionEndHandler(this.transitionEndHandler_);
  7581. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
  7582. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
  7583. this.enableScroll_();
  7584. }
  7585. }
  7586. }, {
  7587. key: 'open',
  7588. value: function open() {
  7589. this.isOpen_ = true;
  7590. this.disableScroll_();
  7591. this.adapter_.registerDocumentKeydownHandler(this.documentKeydownHandler_);
  7592. this.adapter_.registerSurfaceInteractionHandler('click', this.dialogClickHandler_);
  7593. this.adapter_.registerInteractionHandler('click', this.componentClickHandler_);
  7594. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  7595. this.adapter_.addClass(MDCDialogFoundation.cssClasses.ANIMATING);
  7596. this.adapter_.addClass(MDCDialogFoundation.cssClasses.OPEN);
  7597. }
  7598. }, {
  7599. key: 'close',
  7600. value: function close() {
  7601. this.isOpen_ = false;
  7602. this.enableScroll_();
  7603. this.adapter_.deregisterSurfaceInteractionHandler('click', this.dialogClickHandler_);
  7604. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  7605. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  7606. this.adapter_.untrapFocusOnSurface();
  7607. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  7608. this.adapter_.addClass(MDCDialogFoundation.cssClasses.ANIMATING);
  7609. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
  7610. }
  7611. }, {
  7612. key: 'isOpen',
  7613. value: function isOpen() {
  7614. return this.isOpen_;
  7615. }
  7616. }, {
  7617. key: 'accept',
  7618. value: function accept(shouldNotify) {
  7619. if (shouldNotify) {
  7620. this.adapter_.notifyAccept();
  7621. }
  7622. this.close();
  7623. }
  7624. }, {
  7625. key: 'cancel',
  7626. value: function cancel(shouldNotify) {
  7627. if (shouldNotify) {
  7628. this.adapter_.notifyCancel();
  7629. }
  7630. this.close();
  7631. }
  7632. }, {
  7633. key: 'handleDialogClick_',
  7634. value: function handleDialogClick_(evt) {
  7635. var target = evt.target;
  7636. if (this.adapter_.eventTargetHasClass(target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACCEPT_BTN)) {
  7637. this.accept(true);
  7638. } else if (this.adapter_.eventTargetHasClass(target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].CANCEL_BTN)) {
  7639. this.cancel(true);
  7640. }
  7641. }
  7642. }, {
  7643. key: 'handleTransitionEnd_',
  7644. value: function handleTransitionEnd_(evt) {
  7645. if (this.adapter_.isDialog(evt.target)) {
  7646. this.adapter_.deregisterTransitionEndHandler(this.transitionEndHandler_);
  7647. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
  7648. if (this.isOpen_) {
  7649. this.adapter_.trapFocusOnSurface();
  7650. };
  7651. };
  7652. }
  7653. }, {
  7654. key: 'disableScroll_',
  7655. value: function disableScroll_() {
  7656. this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  7657. }
  7658. }, {
  7659. key: 'enableScroll_',
  7660. value: function enableScroll_() {
  7661. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  7662. }
  7663. }]);
  7664. return MDCDialogFoundation;
  7665. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  7666. /* harmony default export */ __webpack_exports__["a"] = (MDCDialogFoundation);
  7667. /***/ }),
  7668. /* 62 */
  7669. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7670. "use strict";
  7671. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7672. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  7673. /**
  7674. * Copyright 2016 Google Inc. All Rights Reserved.
  7675. *
  7676. * Licensed under the Apache License, Version 2.0 (the "License");
  7677. * you may not use this file except in compliance with the License.
  7678. * You may obtain a copy of the License at
  7679. *
  7680. * http://www.apache.org/licenses/LICENSE-2.0
  7681. *
  7682. * Unless required by applicable law or agreed to in writing, software
  7683. * distributed under the License is distributed on an "AS IS" BASIS,
  7684. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7685. * See the License for the specific language governing permissions and
  7686. * limitations under the License.
  7687. */
  7688. var cssClasses = {
  7689. ROOT: 'mdc-dialog',
  7690. OPEN: 'mdc-dialog--open',
  7691. ANIMATING: 'mdc-dialog--animating',
  7692. BACKDROP: 'mdc-dialog__backdrop',
  7693. SCROLL_LOCK: 'mdc-dialog-scroll-lock',
  7694. ACCEPT_BTN: 'mdc-dialog__footer__button--accept',
  7695. CANCEL_BTN: 'mdc-dialog__footer__button--cancel'
  7696. };
  7697. var strings = {
  7698. OPEN_DIALOG_SELECTOR: '.mdc-dialog--open',
  7699. DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface',
  7700. ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept',
  7701. ACCEPT_EVENT: 'MDCDialog:accept',
  7702. CANCEL_EVENT: 'MDCDialog:cancel'
  7703. };
  7704. /***/ }),
  7705. /* 63 */
  7706. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7707. "use strict";
  7708. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7709. /* harmony export (immutable) */ __webpack_exports__["createFocusTrapInstance"] = createFocusTrapInstance;
  7710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(64);
  7711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  7712. /**
  7713. * Copyright 2016 Google Inc. All Rights Reserved.
  7714. *
  7715. * Licensed under the Apache License, Version 2.0 (the "License");
  7716. * you may not use this file except in compliance with the License.
  7717. * You may obtain a copy of the License at
  7718. *
  7719. * http://www.apache.org/licenses/LICENSE-2.0
  7720. *
  7721. * Unless required by applicable law or agreed to in writing, software
  7722. * distributed under the License is distributed on an "AS IS" BASIS,
  7723. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7724. * See the License for the specific language governing permissions and
  7725. * limitations under the License.
  7726. */
  7727. function createFocusTrapInstance(surfaceEl, acceptButtonEl) {
  7728. var focusTrapFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  7729. return focusTrapFactory(surfaceEl, {
  7730. initialFocus: acceptButtonEl,
  7731. clickOutsideDeactivates: true
  7732. });
  7733. }
  7734. /***/ }),
  7735. /* 64 */
  7736. /***/ (function(module, exports, __webpack_require__) {
  7737. var tabbable = __webpack_require__(65);
  7738. var listeningFocusTrap = null;
  7739. function focusTrap(element, userOptions) {
  7740. var tabbableNodes = [];
  7741. var firstTabbableNode = null;
  7742. var lastTabbableNode = null;
  7743. var nodeFocusedBeforeActivation = null;
  7744. var active = false;
  7745. var paused = false;
  7746. var tabEvent = null;
  7747. var container = (typeof element === 'string')
  7748. ? document.querySelector(element)
  7749. : element;
  7750. var config = userOptions || {};
  7751. config.returnFocusOnDeactivate = (userOptions && userOptions.returnFocusOnDeactivate !== undefined)
  7752. ? userOptions.returnFocusOnDeactivate
  7753. : true;
  7754. config.escapeDeactivates = (userOptions && userOptions.escapeDeactivates !== undefined)
  7755. ? userOptions.escapeDeactivates
  7756. : true;
  7757. var trap = {
  7758. activate: activate,
  7759. deactivate: deactivate,
  7760. pause: pause,
  7761. unpause: unpause,
  7762. };
  7763. return trap;
  7764. function activate(activateOptions) {
  7765. if (active) return;
  7766. var defaultedActivateOptions = {
  7767. onActivate: (activateOptions && activateOptions.onActivate !== undefined)
  7768. ? activateOptions.onActivate
  7769. : config.onActivate,
  7770. };
  7771. active = true;
  7772. paused = false;
  7773. nodeFocusedBeforeActivation = document.activeElement;
  7774. if (defaultedActivateOptions.onActivate) {
  7775. defaultedActivateOptions.onActivate();
  7776. }
  7777. addListeners();
  7778. return trap;
  7779. }
  7780. function deactivate(deactivateOptions) {
  7781. if (!active) return;
  7782. var defaultedDeactivateOptions = {
  7783. returnFocus: (deactivateOptions && deactivateOptions.returnFocus !== undefined)
  7784. ? deactivateOptions.returnFocus
  7785. : config.returnFocusOnDeactivate,
  7786. onDeactivate: (deactivateOptions && deactivateOptions.onDeactivate !== undefined)
  7787. ? deactivateOptions.onDeactivate
  7788. : config.onDeactivate,
  7789. };
  7790. removeListeners();
  7791. if (defaultedDeactivateOptions.onDeactivate) {
  7792. defaultedDeactivateOptions.onDeactivate();
  7793. }
  7794. if (defaultedDeactivateOptions.returnFocus) {
  7795. setTimeout(function () {
  7796. tryFocus(nodeFocusedBeforeActivation);
  7797. }, 0);
  7798. }
  7799. active = false;
  7800. paused = false;
  7801. return this;
  7802. }
  7803. function pause() {
  7804. if (paused || !active) return;
  7805. paused = true;
  7806. removeListeners();
  7807. }
  7808. function unpause() {
  7809. if (!paused || !active) return;
  7810. paused = false;
  7811. addListeners();
  7812. }
  7813. function addListeners() {
  7814. if (!active) return;
  7815. // There can be only one listening focus trap at a time
  7816. if (listeningFocusTrap) {
  7817. listeningFocusTrap.pause();
  7818. }
  7819. listeningFocusTrap = trap;
  7820. updateTabbableNodes();
  7821. tryFocus(firstFocusNode());
  7822. document.addEventListener('focus', checkFocus, true);
  7823. document.addEventListener('click', checkClick, true);
  7824. document.addEventListener('mousedown', checkPointerDown, true);
  7825. document.addEventListener('touchstart', checkPointerDown, true);
  7826. document.addEventListener('keydown', checkKey, true);
  7827. return trap;
  7828. }
  7829. function removeListeners() {
  7830. if (!active || listeningFocusTrap !== trap) return;
  7831. document.removeEventListener('focus', checkFocus, true);
  7832. document.removeEventListener('click', checkClick, true);
  7833. document.removeEventListener('mousedown', checkPointerDown, true);
  7834. document.removeEventListener('touchstart', checkPointerDown, true);
  7835. document.removeEventListener('keydown', checkKey, true);
  7836. listeningFocusTrap = null;
  7837. return trap;
  7838. }
  7839. function getNodeForOption(optionName) {
  7840. var optionValue = config[optionName];
  7841. var node = optionValue;
  7842. if (!optionValue) {
  7843. return null;
  7844. }
  7845. if (typeof optionValue === 'string') {
  7846. node = document.querySelector(optionValue);
  7847. if (!node) {
  7848. throw new Error('`' + optionName + '` refers to no known node');
  7849. }
  7850. }
  7851. if (typeof optionValue === 'function') {
  7852. node = optionValue();
  7853. if (!node) {
  7854. throw new Error('`' + optionName + '` did not return a node');
  7855. }
  7856. }
  7857. return node;
  7858. }
  7859. function firstFocusNode() {
  7860. var node;
  7861. if (getNodeForOption('initialFocus') !== null) {
  7862. node = getNodeForOption('initialFocus');
  7863. } else if (container.contains(document.activeElement)) {
  7864. node = document.activeElement;
  7865. } else {
  7866. node = tabbableNodes[0] || getNodeForOption('fallbackFocus');
  7867. }
  7868. if (!node) {
  7869. throw new Error('You can\'t have a focus-trap without at least one focusable element');
  7870. }
  7871. return node;
  7872. }
  7873. // This needs to be done on mousedown and touchstart instead of click
  7874. // so that it precedes the focus event
  7875. function checkPointerDown(e) {
  7876. if (config.clickOutsideDeactivates && !container.contains(e.target)) {
  7877. deactivate({ returnFocus: false });
  7878. }
  7879. }
  7880. function checkClick(e) {
  7881. if (config.clickOutsideDeactivates) return;
  7882. if (container.contains(e.target)) return;
  7883. e.preventDefault();
  7884. e.stopImmediatePropagation();
  7885. }
  7886. function checkFocus(e) {
  7887. if (container.contains(e.target)) return;
  7888. e.preventDefault();
  7889. e.stopImmediatePropagation();
  7890. // Checking for a blur method here resolves a Firefox issue (#15)
  7891. if (typeof e.target.blur === 'function') e.target.blur();
  7892. if (tabEvent) {
  7893. readjustFocus(tabEvent);
  7894. }
  7895. }
  7896. function checkKey(e) {
  7897. if (e.key === 'Tab' || e.keyCode === 9) {
  7898. handleTab(e);
  7899. }
  7900. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  7901. deactivate();
  7902. }
  7903. }
  7904. function handleTab(e) {
  7905. updateTabbableNodes();
  7906. if (e.target.hasAttribute('tabindex') && Number(e.target.getAttribute('tabindex')) < 0) {
  7907. return tabEvent = e;
  7908. }
  7909. e.preventDefault();
  7910. var currentFocusIndex = tabbableNodes.indexOf(e.target);
  7911. if (e.shiftKey) {
  7912. if (e.target === firstTabbableNode || tabbableNodes.indexOf(e.target) === -1) {
  7913. return tryFocus(lastTabbableNode);
  7914. }
  7915. return tryFocus(tabbableNodes[currentFocusIndex - 1]);
  7916. }
  7917. if (e.target === lastTabbableNode) return tryFocus(firstTabbableNode);
  7918. tryFocus(tabbableNodes[currentFocusIndex + 1]);
  7919. }
  7920. function updateTabbableNodes() {
  7921. tabbableNodes = tabbable(container);
  7922. firstTabbableNode = tabbableNodes[0];
  7923. lastTabbableNode = tabbableNodes[tabbableNodes.length - 1];
  7924. }
  7925. function readjustFocus(e) {
  7926. if (e.shiftKey) return tryFocus(lastTabbableNode);
  7927. tryFocus(firstTabbableNode);
  7928. }
  7929. }
  7930. function isEscapeEvent(e) {
  7931. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  7932. }
  7933. function tryFocus(node) {
  7934. if (!node || !node.focus) return;
  7935. if (node === document.activeElement) return;
  7936. node.focus();
  7937. if (node.tagName.toLowerCase() === 'input') {
  7938. node.select();
  7939. }
  7940. }
  7941. module.exports = focusTrap;
  7942. /***/ }),
  7943. /* 65 */
  7944. /***/ (function(module, exports) {
  7945. module.exports = function(el, options) {
  7946. options = options || {};
  7947. var elementDocument = el.ownerDocument || el;
  7948. var basicTabbables = [];
  7949. var orderedTabbables = [];
  7950. // A node is "available" if
  7951. // - it's computed style
  7952. var isUnavailable = createIsUnavailable(elementDocument);
  7953. var candidateSelectors = [
  7954. 'input',
  7955. 'select',
  7956. 'a[href]',
  7957. 'textarea',
  7958. 'button',
  7959. '[tabindex]',
  7960. ];
  7961. var candidates = el.querySelectorAll(candidateSelectors.join(','));
  7962. if (options.includeContainer) {
  7963. var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  7964. if (
  7965. candidateSelectors.some(function(candidateSelector) {
  7966. return matches.call(el, candidateSelector);
  7967. })
  7968. ) {
  7969. candidates = Array.prototype.slice.apply(candidates);
  7970. candidates.unshift(el);
  7971. }
  7972. }
  7973. var candidate, candidateIndex;
  7974. for (var i = 0, l = candidates.length; i < l; i++) {
  7975. candidate = candidates[i];
  7976. candidateIndex = parseInt(candidate.getAttribute('tabindex'), 10) || candidate.tabIndex;
  7977. if (
  7978. candidateIndex < 0
  7979. || (candidate.tagName === 'INPUT' && candidate.type === 'hidden')
  7980. || candidate.disabled
  7981. || isUnavailable(candidate, elementDocument)
  7982. ) {
  7983. continue;
  7984. }
  7985. if (candidateIndex === 0) {
  7986. basicTabbables.push(candidate);
  7987. } else {
  7988. orderedTabbables.push({
  7989. index: i,
  7990. tabIndex: candidateIndex,
  7991. node: candidate,
  7992. });
  7993. }
  7994. }
  7995. var tabbableNodes = orderedTabbables
  7996. .sort(function(a, b) {
  7997. return a.tabIndex === b.tabIndex ? a.index - b.index : a.tabIndex - b.tabIndex;
  7998. })
  7999. .map(function(a) {
  8000. return a.node
  8001. });
  8002. Array.prototype.push.apply(tabbableNodes, basicTabbables);
  8003. return tabbableNodes;
  8004. }
  8005. function createIsUnavailable(elementDocument) {
  8006. // Node cache must be refreshed on every check, in case
  8007. // the content of the element has changed
  8008. var isOffCache = [];
  8009. // "off" means `display: none;`, as opposed to "hidden",
  8010. // which means `visibility: hidden;`. getComputedStyle
  8011. // accurately reflects visiblity in context but not
  8012. // "off" state, so we need to recursively check parents.
  8013. function isOff(node, nodeComputedStyle) {
  8014. if (node === elementDocument.documentElement) return false;
  8015. // Find the cached node (Array.prototype.find not available in IE9)
  8016. for (var i = 0, length = isOffCache.length; i < length; i++) {
  8017. if (isOffCache[i][0] === node) return isOffCache[i][1];
  8018. }
  8019. nodeComputedStyle = nodeComputedStyle || elementDocument.defaultView.getComputedStyle(node);
  8020. var result = false;
  8021. if (nodeComputedStyle.display === 'none') {
  8022. result = true;
  8023. } else if (node.parentNode) {
  8024. result = isOff(node.parentNode);
  8025. }
  8026. isOffCache.push([node, result]);
  8027. return result;
  8028. }
  8029. return function isUnavailable(node) {
  8030. if (node === elementDocument.documentElement) return false;
  8031. var computedStyle = elementDocument.defaultView.getComputedStyle(node);
  8032. if (isOff(node, computedStyle)) return true;
  8033. return computedStyle.visibility === 'hidden';
  8034. }
  8035. }
  8036. /***/ }),
  8037. /* 66 */
  8038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8039. "use strict";
  8040. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(15);
  8042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__temporary__ = __webpack_require__(67);
  8043. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTemporaryDrawer", function() { return __WEBPACK_IMPORTED_MODULE_1__temporary__["a"]; });
  8044. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTemporaryDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__temporary__["b"]; });
  8045. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__persistent__ = __webpack_require__(72);
  8046. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCPersistentDrawer", function() { return __WEBPACK_IMPORTED_MODULE_2__persistent__["a"]; });
  8047. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCPersistentDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__persistent__["b"]; });
  8048. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_0__util__; });
  8049. /**
  8050. * Copyright 2016 Google Inc. All Rights Reserved.
  8051. *
  8052. * Licensed under the Apache License, Version 2.0 (the "License");
  8053. * you may not use this file except in compliance with the License.
  8054. * You may obtain a copy of the License at
  8055. *
  8056. * http://www.apache.org/licenses/LICENSE-2.0
  8057. *
  8058. * Unless required by applicable law or agreed to in writing, software
  8059. * distributed under the License is distributed on an "AS IS" BASIS,
  8060. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8061. * See the License for the specific language governing permissions and
  8062. * limitations under the License.
  8063. */
  8064. /***/ }),
  8065. /* 67 */
  8066. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8067. "use strict";
  8068. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTemporaryDrawer; });
  8069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  8070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(68);
  8071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(15);
  8072. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  8073. /* unused harmony reexport util */
  8074. 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; }; }();
  8075. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8076. 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; }
  8077. 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; }
  8078. /**
  8079. * Copyright 2016 Google Inc. All Rights Reserved.
  8080. *
  8081. * Licensed under the Apache License, Version 2.0 (the "License");
  8082. * you may not use this file except in compliance with the License.
  8083. * You may obtain a copy of the License at
  8084. *
  8085. * http://www.apache.org/licenses/LICENSE-2.0
  8086. *
  8087. * Unless required by applicable law or agreed to in writing, software
  8088. * distributed under the License is distributed on an "AS IS" BASIS,
  8089. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8090. * See the License for the specific language governing permissions and
  8091. * limitations under the License.
  8092. */
  8093. var MDCTemporaryDrawer = function (_MDCComponent) {
  8094. _inherits(MDCTemporaryDrawer, _MDCComponent);
  8095. function MDCTemporaryDrawer() {
  8096. _classCallCheck(this, MDCTemporaryDrawer);
  8097. return _possibleConstructorReturn(this, (MDCTemporaryDrawer.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawer)).apply(this, arguments));
  8098. }
  8099. _createClass(MDCTemporaryDrawer, [{
  8100. key: 'getDefaultFoundation',
  8101. value: function getDefaultFoundation() {
  8102. var _this2 = this;
  8103. var _MDCTemporaryDrawerFo = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  8104. FOCUSABLE_ELEMENTS = _MDCTemporaryDrawerFo.FOCUSABLE_ELEMENTS,
  8105. OPACITY_VAR_NAME = _MDCTemporaryDrawerFo.OPACITY_VAR_NAME;
  8106. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  8107. addClass: function addClass(className) {
  8108. return _this2.root_.classList.add(className);
  8109. },
  8110. removeClass: function removeClass(className) {
  8111. return _this2.root_.classList.remove(className);
  8112. },
  8113. hasClass: function hasClass(className) {
  8114. return _this2.root_.classList.contains(className);
  8115. },
  8116. addBodyClass: function addBodyClass(className) {
  8117. return document.body.classList.add(className);
  8118. },
  8119. removeBodyClass: function removeBodyClass(className) {
  8120. return document.body.classList.remove(className);
  8121. },
  8122. eventTargetHasClass: function eventTargetHasClass(target, className) {
  8123. return target.classList.contains(className);
  8124. },
  8125. hasNecessaryDom: function hasNecessaryDom() {
  8126. return Boolean(_this2.drawer);
  8127. },
  8128. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  8129. return _this2.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  8130. },
  8131. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  8132. return _this2.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  8133. },
  8134. registerDrawerInteractionHandler: function registerDrawerInteractionHandler(evt, handler) {
  8135. return _this2.drawer.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  8136. },
  8137. deregisterDrawerInteractionHandler: function deregisterDrawerInteractionHandler(evt, handler) {
  8138. return _this2.drawer.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  8139. },
  8140. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  8141. return _this2.drawer.addEventListener('transitionend', handler);
  8142. },
  8143. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  8144. return _this2.drawer.removeEventListener('transitionend', handler);
  8145. },
  8146. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  8147. return document.addEventListener('keydown', handler);
  8148. },
  8149. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  8150. return document.removeEventListener('keydown', handler);
  8151. },
  8152. getDrawerWidth: function getDrawerWidth() {
  8153. return _this2.drawer.offsetWidth;
  8154. },
  8155. setTranslateX: function setTranslateX(value) {
  8156. return _this2.drawer.style.setProperty(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"](), value === null ? null : 'translateX(' + value + 'px)');
  8157. },
  8158. updateCssVariable: function updateCssVariable(value) {
  8159. if (__WEBPACK_IMPORTED_MODULE_2__util__["supportsCssCustomProperties"]()) {
  8160. _this2.root_.style.setProperty(OPACITY_VAR_NAME, value);
  8161. }
  8162. },
  8163. getFocusableElements: function getFocusableElements() {
  8164. return _this2.drawer.querySelectorAll(FOCUSABLE_ELEMENTS);
  8165. },
  8166. saveElementTabState: function saveElementTabState(el) {
  8167. return __WEBPACK_IMPORTED_MODULE_2__util__["saveElementTabState"](el);
  8168. },
  8169. restoreElementTabState: function restoreElementTabState(el) {
  8170. return __WEBPACK_IMPORTED_MODULE_2__util__["restoreElementTabState"](el);
  8171. },
  8172. makeElementUntabbable: function makeElementUntabbable(el) {
  8173. return el.setAttribute('tabindex', -1);
  8174. },
  8175. notifyOpen: function notifyOpen() {
  8176. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.OPEN_EVENT);
  8177. },
  8178. notifyClose: function notifyClose() {
  8179. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CLOSE_EVENT);
  8180. },
  8181. isRtl: function isRtl() {
  8182. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  8183. },
  8184. isDrawer: function isDrawer(el) {
  8185. return el === _this2.drawer;
  8186. }
  8187. });
  8188. }
  8189. }, {
  8190. key: 'open',
  8191. get: function get() {
  8192. return this.foundation_.isOpen();
  8193. },
  8194. set: function set(value) {
  8195. if (value) {
  8196. this.foundation_.open();
  8197. } else {
  8198. this.foundation_.close();
  8199. }
  8200. }
  8201. /* Return the drawer element inside the component. */
  8202. }, {
  8203. key: 'drawer',
  8204. get: function get() {
  8205. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.DRAWER_SELECTOR);
  8206. }
  8207. }], [{
  8208. key: 'attachTo',
  8209. value: function attachTo(root) {
  8210. return new MDCTemporaryDrawer(root);
  8211. }
  8212. }]);
  8213. return MDCTemporaryDrawer;
  8214. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  8215. /***/ }),
  8216. /* 68 */
  8217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8218. "use strict";
  8219. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable_index__ = __webpack_require__(10);
  8220. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(71);
  8221. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  8222. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  8223. 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; }; }();
  8224. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8225. 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; }
  8226. 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; }
  8227. /**
  8228. * Copyright 2016 Google Inc. All Rights Reserved.
  8229. *
  8230. * Licensed under the Apache License, Version 2.0 (the "License");
  8231. * you may not use this file except in compliance with the License.
  8232. * You may obtain a copy of the License at
  8233. *
  8234. * http://www.apache.org/licenses/LICENSE-2.0
  8235. *
  8236. * Unless required by applicable law or agreed to in writing, software
  8237. * distributed under the License is distributed on an "AS IS" BASIS,
  8238. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8239. * See the License for the specific language governing permissions and
  8240. * limitations under the License.
  8241. */
  8242. var MDCTemporaryDrawerFoundation = function (_MDCSlidableDrawerFou) {
  8243. _inherits(MDCTemporaryDrawerFoundation, _MDCSlidableDrawerFou);
  8244. _createClass(MDCTemporaryDrawerFoundation, null, [{
  8245. key: 'cssClasses',
  8246. get: function get() {
  8247. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  8248. }
  8249. }, {
  8250. key: 'strings',
  8251. get: function get() {
  8252. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  8253. }
  8254. }, {
  8255. key: 'defaultAdapter',
  8256. get: function get() {
  8257. return _extends(__WEBPACK_IMPORTED_MODULE_0__slidable_index__["b" /* MDCSlidableDrawerFoundation */].defaultAdapter, {
  8258. addBodyClass: function addBodyClass() /* className: string */{},
  8259. removeBodyClass: function removeBodyClass() /* className: string */{},
  8260. isDrawer: function isDrawer() {
  8261. return false;
  8262. },
  8263. updateCssVariable: function updateCssVariable() /* value: string */{},
  8264. eventTargetHasClass: function eventTargetHasClass() {
  8265. return (/* target: EventTarget, className: string */ /* boolean */false
  8266. );
  8267. }
  8268. });
  8269. }
  8270. }]);
  8271. function MDCTemporaryDrawerFoundation(adapter) {
  8272. _classCallCheck(this, MDCTemporaryDrawerFoundation);
  8273. var _this = _possibleConstructorReturn(this, (MDCTemporaryDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation)).call(this, _extends(MDCTemporaryDrawerFoundation.defaultAdapter, adapter), MDCTemporaryDrawerFoundation.cssClasses.ROOT, MDCTemporaryDrawerFoundation.cssClasses.ANIMATING, MDCTemporaryDrawerFoundation.cssClasses.OPEN));
  8274. _this.componentClickHandler_ = function (evt) {
  8275. if (_this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ROOT)) {
  8276. _this.close(true);
  8277. }
  8278. };
  8279. return _this;
  8280. }
  8281. _createClass(MDCTemporaryDrawerFoundation, [{
  8282. key: 'init',
  8283. value: function init() {
  8284. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'init', this).call(this);
  8285. // Make browser aware of custom property being used in this element.
  8286. // Workaround for certain types of hard-to-reproduce heisenbugs.
  8287. this.adapter_.updateCssVariable(0);
  8288. this.adapter_.registerInteractionHandler('click', this.componentClickHandler_);
  8289. }
  8290. }, {
  8291. key: 'destroy',
  8292. value: function destroy() {
  8293. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'destroy', this).call(this);
  8294. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  8295. this.enableScroll_();
  8296. }
  8297. }, {
  8298. key: 'open',
  8299. value: function open() {
  8300. this.disableScroll_();
  8301. // Make sure custom property values are cleared before starting.
  8302. this.adapter_.updateCssVariable('');
  8303. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'open', this).call(this);
  8304. }
  8305. }, {
  8306. key: 'close',
  8307. value: function close() {
  8308. // Make sure custom property values are cleared before making any changes.
  8309. this.adapter_.updateCssVariable('');
  8310. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'close', this).call(this);
  8311. }
  8312. }, {
  8313. key: 'prepareForTouchEnd_',
  8314. value: function prepareForTouchEnd_() {
  8315. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'prepareForTouchEnd_', this).call(this);
  8316. this.adapter_.updateCssVariable('');
  8317. }
  8318. }, {
  8319. key: 'updateDrawer_',
  8320. value: function updateDrawer_() {
  8321. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'updateDrawer_', this).call(this);
  8322. var newOpacity = Math.max(0, 1 + this.direction_ * (this.newPosition_ / this.drawerWidth_));
  8323. this.adapter_.updateCssVariable(newOpacity);
  8324. }
  8325. }, {
  8326. key: 'isRootTransitioningEventTarget_',
  8327. value: function isRootTransitioningEventTarget_(el) {
  8328. return this.adapter_.isDrawer(el);
  8329. }
  8330. }, {
  8331. key: 'handleTransitionEnd_',
  8332. value: function handleTransitionEnd_(evt) {
  8333. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'handleTransitionEnd_', this).call(this, evt);
  8334. if (!this.isOpen_) {
  8335. this.enableScroll_();
  8336. }
  8337. }
  8338. }, {
  8339. key: 'disableScroll_',
  8340. value: function disableScroll_() {
  8341. this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  8342. }
  8343. }, {
  8344. key: 'enableScroll_',
  8345. value: function enableScroll_() {
  8346. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  8347. }
  8348. }]);
  8349. return MDCTemporaryDrawerFoundation;
  8350. }(__WEBPACK_IMPORTED_MODULE_0__slidable_index__["b" /* MDCSlidableDrawerFoundation */]);
  8351. /* harmony default export */ __webpack_exports__["a"] = (MDCTemporaryDrawerFoundation);
  8352. /***/ }),
  8353. /* 69 */
  8354. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8355. "use strict";
  8356. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FOCUSABLE_ELEMENTS; });
  8357. /**
  8358. * Copyright 2016 Google Inc. All Rights Reserved.
  8359. *
  8360. * Licensed under the Apache License, Version 2.0 (the "License");
  8361. * you may not use this file except in compliance with the License.
  8362. * You may obtain a copy of the License at
  8363. *
  8364. * http://www.apache.org/licenses/LICENSE-2.0
  8365. *
  8366. * Unless required by applicable law or agreed to in writing, software
  8367. * distributed under the License is distributed on an "AS IS" BASIS,
  8368. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8369. * See the License for the specific language governing permissions and
  8370. * limitations under the License.
  8371. */
  8372. var FOCUSABLE_ELEMENTS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), ' + 'button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]';
  8373. /***/ }),
  8374. /* 70 */
  8375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8376. "use strict";
  8377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSlidableDrawerFoundation; });
  8378. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  8379. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  8380. 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; }; }();
  8381. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8382. 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; }
  8383. 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; }
  8384. /**
  8385. * Copyright 2016 Google Inc. All Rights Reserved.
  8386. *
  8387. * Licensed under the Apache License, Version 2.0 (the "License");
  8388. * you may not use this file except in compliance with the License.
  8389. * You may obtain a copy of the License at
  8390. *
  8391. * http://www.apache.org/licenses/LICENSE-2.0
  8392. *
  8393. * Unless required by applicable law or agreed to in writing, software
  8394. * distributed under the License is distributed on an "AS IS" BASIS,
  8395. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8396. * See the License for the specific language governing permissions and
  8397. * limitations under the License.
  8398. */
  8399. var MDCSlidableDrawerFoundation = function (_MDCFoundation) {
  8400. _inherits(MDCSlidableDrawerFoundation, _MDCFoundation);
  8401. _createClass(MDCSlidableDrawerFoundation, null, [{
  8402. key: 'defaultAdapter',
  8403. get: function get() {
  8404. return {
  8405. addClass: function addClass() /* className: string */{},
  8406. removeClass: function removeClass() /* className: string */{},
  8407. hasClass: function hasClass() /* className: string */{},
  8408. hasNecessaryDom: function hasNecessaryDom() {
  8409. return (/* boolean */false
  8410. );
  8411. },
  8412. registerInteractionHandler: function registerInteractionHandler() /* evt: string, handler: EventListener */{},
  8413. deregisterInteractionHandler: function deregisterInteractionHandler() /* evt: string, handler: EventListener */{},
  8414. registerDrawerInteractionHandler: function registerDrawerInteractionHandler() /* evt: string, handler: EventListener */{},
  8415. deregisterDrawerInteractionHandler: function deregisterDrawerInteractionHandler() /* evt: string, handler: EventListener */{},
  8416. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  8417. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  8418. registerDocumentKeydownHandler: function registerDocumentKeydownHandler() /* handler: EventListener */{},
  8419. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler() /* handler: EventListener */{},
  8420. setTranslateX: function setTranslateX() /* value: number | null */{},
  8421. getFocusableElements: function getFocusableElements() /* NodeList */{},
  8422. saveElementTabState: function saveElementTabState() /* el: Element */{},
  8423. restoreElementTabState: function restoreElementTabState() /* el: Element */{},
  8424. makeElementUntabbable: function makeElementUntabbable() /* el: Element */{},
  8425. notifyOpen: function notifyOpen() {},
  8426. notifyClose: function notifyClose() {},
  8427. isRtl: function isRtl() {
  8428. return (/* boolean */false
  8429. );
  8430. },
  8431. getDrawerWidth: function getDrawerWidth() {
  8432. return (/* number */0
  8433. );
  8434. }
  8435. };
  8436. }
  8437. }]);
  8438. function MDCSlidableDrawerFoundation(adapter, rootCssClass, animatingCssClass, openCssClass) {
  8439. _classCallCheck(this, MDCSlidableDrawerFoundation);
  8440. var _this = _possibleConstructorReturn(this, (MDCSlidableDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCSlidableDrawerFoundation)).call(this, _extends(MDCSlidableDrawerFoundation.defaultAdapter, adapter)));
  8441. _this.rootCssClass_ = rootCssClass;
  8442. _this.animatingCssClass_ = animatingCssClass;
  8443. _this.openCssClass_ = openCssClass;
  8444. _this.transitionEndHandler_ = function (evt) {
  8445. return _this.handleTransitionEnd_(evt);
  8446. };
  8447. _this.inert_ = false;
  8448. _this.componentTouchStartHandler_ = function (evt) {
  8449. return _this.handleTouchStart_(evt);
  8450. };
  8451. _this.componentTouchMoveHandler_ = function (evt) {
  8452. return _this.handleTouchMove_(evt);
  8453. };
  8454. _this.componentTouchEndHandler_ = function (evt) {
  8455. return _this.handleTouchEnd_(evt);
  8456. };
  8457. _this.documentKeydownHandler_ = function (evt) {
  8458. if (evt.key && evt.key === 'Escape' || evt.keyCode === 27) {
  8459. _this.close();
  8460. }
  8461. };
  8462. return _this;
  8463. }
  8464. _createClass(MDCSlidableDrawerFoundation, [{
  8465. key: 'init',
  8466. value: function init() {
  8467. var ROOT = this.rootCssClass_;
  8468. var OPEN = this.openCssClass_;
  8469. if (!this.adapter_.hasClass(ROOT)) {
  8470. throw new Error(ROOT + ' class required in root element.');
  8471. }
  8472. if (!this.adapter_.hasNecessaryDom()) {
  8473. throw new Error('Required DOM nodes missing in ' + ROOT + ' component.');
  8474. }
  8475. if (this.adapter_.hasClass(OPEN)) {
  8476. this.isOpen_ = true;
  8477. } else {
  8478. this.detabinate_();
  8479. this.isOpen_ = false;
  8480. }
  8481. this.adapter_.registerDrawerInteractionHandler('touchstart', this.componentTouchStartHandler_);
  8482. this.adapter_.registerInteractionHandler('touchmove', this.componentTouchMoveHandler_);
  8483. this.adapter_.registerInteractionHandler('touchend', this.componentTouchEndHandler_);
  8484. }
  8485. }, {
  8486. key: 'destroy',
  8487. value: function destroy() {
  8488. this.adapter_.deregisterDrawerInteractionHandler('touchstart', this.componentTouchStartHandler_);
  8489. this.adapter_.deregisterInteractionHandler('touchmove', this.componentTouchMoveHandler_);
  8490. this.adapter_.deregisterInteractionHandler('touchend', this.componentTouchEndHandler_);
  8491. // Deregister the document keydown handler just in case the component is destroyed while the menu is open.
  8492. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  8493. }
  8494. }, {
  8495. key: 'open',
  8496. value: function open() {
  8497. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  8498. this.adapter_.registerDocumentKeydownHandler(this.documentKeydownHandler_);
  8499. this.adapter_.addClass(this.animatingCssClass_);
  8500. this.adapter_.addClass(this.openCssClass_);
  8501. this.retabinate_();
  8502. // Debounce multiple calls
  8503. if (!this.isOpen_) {
  8504. this.adapter_.notifyOpen();
  8505. }
  8506. this.isOpen_ = true;
  8507. }
  8508. }, {
  8509. key: 'close',
  8510. value: function close() {
  8511. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  8512. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  8513. this.adapter_.addClass(this.animatingCssClass_);
  8514. this.adapter_.removeClass(this.openCssClass_);
  8515. this.detabinate_();
  8516. // Debounce multiple calls
  8517. if (this.isOpen_) {
  8518. this.adapter_.notifyClose();
  8519. }
  8520. this.isOpen_ = false;
  8521. }
  8522. }, {
  8523. key: 'isOpen',
  8524. value: function isOpen() {
  8525. return this.isOpen_;
  8526. }
  8527. /**
  8528. * Render all children of the drawer inert when it's closed.
  8529. */
  8530. }, {
  8531. key: 'detabinate_',
  8532. value: function detabinate_() {
  8533. if (this.inert_) {
  8534. return;
  8535. }
  8536. var elements = this.adapter_.getFocusableElements();
  8537. if (elements) {
  8538. for (var i = 0; i < elements.length; i++) {
  8539. this.adapter_.saveElementTabState(elements[i]);
  8540. this.adapter_.makeElementUntabbable(elements[i]);
  8541. }
  8542. }
  8543. this.inert_ = true;
  8544. }
  8545. /**
  8546. * Make all children of the drawer tabbable again when it's open.
  8547. */
  8548. }, {
  8549. key: 'retabinate_',
  8550. value: function retabinate_() {
  8551. if (!this.inert_) {
  8552. return;
  8553. }
  8554. var elements = this.adapter_.getFocusableElements();
  8555. if (elements) {
  8556. for (var i = 0; i < elements.length; i++) {
  8557. this.adapter_.restoreElementTabState(elements[i]);
  8558. }
  8559. }
  8560. this.inert_ = false;
  8561. }
  8562. }, {
  8563. key: 'handleTouchStart_',
  8564. value: function handleTouchStart_(evt) {
  8565. if (!this.adapter_.hasClass(this.openCssClass_)) {
  8566. return;
  8567. }
  8568. if (evt.pointerType && evt.pointerType !== 'touch') {
  8569. return;
  8570. }
  8571. this.direction_ = this.adapter_.isRtl() ? -1 : 1;
  8572. this.drawerWidth_ = this.adapter_.getDrawerWidth();
  8573. this.startX_ = evt.touches ? evt.touches[0].pageX : evt.pageX;
  8574. this.currentX_ = this.startX_;
  8575. this.updateRaf_ = requestAnimationFrame(this.updateDrawer_.bind(this));
  8576. }
  8577. }, {
  8578. key: 'handleTouchMove_',
  8579. value: function handleTouchMove_(evt) {
  8580. if (evt.pointerType && evt.pointerType !== 'touch') {
  8581. return;
  8582. }
  8583. this.currentX_ = evt.touches ? evt.touches[0].pageX : evt.pageX;
  8584. }
  8585. }, {
  8586. key: 'handleTouchEnd_',
  8587. value: function handleTouchEnd_(evt) {
  8588. if (evt.pointerType && evt.pointerType !== 'touch') {
  8589. return;
  8590. }
  8591. this.prepareForTouchEnd_();
  8592. // Did the user close the drawer by more than 50%?
  8593. if (Math.abs(this.newPosition_ / this.drawerWidth_) >= 0.5) {
  8594. this.close();
  8595. } else {
  8596. // Triggering an open here means we'll get a nice animation back to the fully open state.
  8597. this.open();
  8598. }
  8599. }
  8600. }, {
  8601. key: 'prepareForTouchEnd_',
  8602. value: function prepareForTouchEnd_() {
  8603. cancelAnimationFrame(this.updateRaf_);
  8604. this.adapter_.setTranslateX(null);
  8605. }
  8606. }, {
  8607. key: 'updateDrawer_',
  8608. value: function updateDrawer_() {
  8609. this.updateRaf_ = requestAnimationFrame(this.updateDrawer_.bind(this));
  8610. this.adapter_.setTranslateX(this.newPosition_);
  8611. }
  8612. }, {
  8613. key: 'isRootTransitioningEventTarget_',
  8614. value: function isRootTransitioningEventTarget_() {
  8615. // Classes extending MDCSlidableDrawerFoundation should implement this method to return true or false
  8616. // if the event target is the root event target currently transitioning.
  8617. return false;
  8618. }
  8619. }, {
  8620. key: 'handleTransitionEnd_',
  8621. value: function handleTransitionEnd_(evt) {
  8622. if (this.isRootTransitioningEventTarget_(evt.target)) {
  8623. this.adapter_.removeClass(this.animatingCssClass_);
  8624. this.adapter_.deregisterTransitionEndHandler(this.transitionEndHandler_);
  8625. }
  8626. }
  8627. }, {
  8628. key: 'newPosition_',
  8629. get: function get() {
  8630. var newPos = null;
  8631. if (this.direction_ === 1) {
  8632. newPos = Math.min(0, this.currentX_ - this.startX_);
  8633. } else {
  8634. newPos = Math.max(0, this.currentX_ - this.startX_);
  8635. }
  8636. return newPos;
  8637. }
  8638. }]);
  8639. return MDCSlidableDrawerFoundation;
  8640. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  8641. /***/ }),
  8642. /* 71 */
  8643. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8644. "use strict";
  8645. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  8646. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  8647. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable_index__ = __webpack_require__(10);
  8648. /**
  8649. * Copyright 2016 Google Inc. All Rights Reserved.
  8650. *
  8651. * Licensed under the Apache License, Version 2.0 (the "License");
  8652. * you may not use this file except in compliance with the License.
  8653. * You may obtain a copy of the License at
  8654. *
  8655. * http://www.apache.org/licenses/LICENSE-2.0
  8656. *
  8657. * Unless required by applicable law or agreed to in writing, software
  8658. * distributed under the License is distributed on an "AS IS" BASIS,
  8659. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8660. * See the License for the specific language governing permissions and
  8661. * limitations under the License.
  8662. */
  8663. var cssClasses = {
  8664. ROOT: 'mdc-drawer--temporary',
  8665. OPEN: 'mdc-drawer--open',
  8666. ANIMATING: 'mdc-drawer--animating',
  8667. SCROLL_LOCK: 'mdc-drawer-scroll-lock'
  8668. };
  8669. var strings = {
  8670. DRAWER_SELECTOR: '.mdc-drawer--temporary .mdc-drawer__drawer',
  8671. OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity',
  8672. FOCUSABLE_ELEMENTS: __WEBPACK_IMPORTED_MODULE_0__slidable_index__["a" /* FOCUSABLE_ELEMENTS */],
  8673. OPEN_EVENT: 'MDCTemporaryDrawer:open',
  8674. CLOSE_EVENT: 'MDCTemporaryDrawer:close'
  8675. };
  8676. /***/ }),
  8677. /* 72 */
  8678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8679. "use strict";
  8680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCPersistentDrawer; });
  8681. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  8682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(73);
  8683. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(15);
  8684. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  8685. /* unused harmony reexport util */
  8686. 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; }; }();
  8687. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8688. 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; }
  8689. 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; }
  8690. /**
  8691. * Copyright 2016 Google Inc. All Rights Reserved.
  8692. *
  8693. * Licensed under the Apache License, Version 2.0 (the "License");
  8694. * you may not use this file except in compliance with the License.
  8695. * You may obtain a copy of the License at
  8696. *
  8697. * http://www.apache.org/licenses/LICENSE-2.0
  8698. *
  8699. * Unless required by applicable law or agreed to in writing, software
  8700. * distributed under the License is distributed on an "AS IS" BASIS,
  8701. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8702. * See the License for the specific language governing permissions and
  8703. * limitations under the License.
  8704. */
  8705. var MDCPersistentDrawer = function (_MDCComponent) {
  8706. _inherits(MDCPersistentDrawer, _MDCComponent);
  8707. function MDCPersistentDrawer() {
  8708. _classCallCheck(this, MDCPersistentDrawer);
  8709. return _possibleConstructorReturn(this, (MDCPersistentDrawer.__proto__ || Object.getPrototypeOf(MDCPersistentDrawer)).apply(this, arguments));
  8710. }
  8711. _createClass(MDCPersistentDrawer, [{
  8712. key: 'getDefaultFoundation',
  8713. value: function getDefaultFoundation() {
  8714. var _this2 = this;
  8715. var FOCUSABLE_ELEMENTS = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.FOCUSABLE_ELEMENTS;
  8716. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  8717. addClass: function addClass(className) {
  8718. return _this2.root_.classList.add(className);
  8719. },
  8720. removeClass: function removeClass(className) {
  8721. return _this2.root_.classList.remove(className);
  8722. },
  8723. hasClass: function hasClass(className) {
  8724. return _this2.root_.classList.contains(className);
  8725. },
  8726. hasNecessaryDom: function hasNecessaryDom() {
  8727. return Boolean(_this2.drawer);
  8728. },
  8729. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  8730. return _this2.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  8731. },
  8732. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  8733. return _this2.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  8734. },
  8735. registerDrawerInteractionHandler: function registerDrawerInteractionHandler(evt, handler) {
  8736. return _this2.drawer.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  8737. },
  8738. deregisterDrawerInteractionHandler: function deregisterDrawerInteractionHandler(evt, handler) {
  8739. return _this2.drawer.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  8740. },
  8741. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  8742. return _this2.root_.addEventListener('transitionend', handler);
  8743. },
  8744. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  8745. return _this2.root_.removeEventListener('transitionend', handler);
  8746. },
  8747. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  8748. return document.addEventListener('keydown', handler);
  8749. },
  8750. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  8751. return document.removeEventListener('keydown', handler);
  8752. },
  8753. getDrawerWidth: function getDrawerWidth() {
  8754. return _this2.drawer.offsetWidth;
  8755. },
  8756. setTranslateX: function setTranslateX(value) {
  8757. return _this2.drawer.style.setProperty(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"](), value === null ? null : 'translateX(' + value + 'px)');
  8758. },
  8759. getFocusableElements: function getFocusableElements() {
  8760. return _this2.drawer.querySelectorAll(FOCUSABLE_ELEMENTS);
  8761. },
  8762. saveElementTabState: function saveElementTabState(el) {
  8763. return __WEBPACK_IMPORTED_MODULE_2__util__["saveElementTabState"](el);
  8764. },
  8765. restoreElementTabState: function restoreElementTabState(el) {
  8766. return __WEBPACK_IMPORTED_MODULE_2__util__["restoreElementTabState"](el);
  8767. },
  8768. makeElementUntabbable: function makeElementUntabbable(el) {
  8769. return el.setAttribute('tabindex', -1);
  8770. },
  8771. notifyOpen: function notifyOpen() {
  8772. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.OPEN_EVENT);
  8773. },
  8774. notifyClose: function notifyClose() {
  8775. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CLOSE_EVENT);
  8776. },
  8777. isRtl: function isRtl() {
  8778. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  8779. },
  8780. isDrawer: function isDrawer(el) {
  8781. return el === _this2.drawer;
  8782. }
  8783. });
  8784. }
  8785. }, {
  8786. key: 'open',
  8787. get: function get() {
  8788. return this.foundation_.isOpen();
  8789. },
  8790. set: function set(value) {
  8791. if (value) {
  8792. this.foundation_.open();
  8793. } else {
  8794. this.foundation_.close();
  8795. }
  8796. }
  8797. // Return the drawer element inside the component.
  8798. }, {
  8799. key: 'drawer',
  8800. get: function get() {
  8801. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.DRAWER_SELECTOR);
  8802. }
  8803. }], [{
  8804. key: 'attachTo',
  8805. value: function attachTo(root) {
  8806. return new MDCPersistentDrawer(root);
  8807. }
  8808. }]);
  8809. return MDCPersistentDrawer;
  8810. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  8811. /***/ }),
  8812. /* 73 */
  8813. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8814. "use strict";
  8815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable_index__ = __webpack_require__(10);
  8816. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(74);
  8817. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  8818. 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; }; }();
  8819. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8820. 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; }
  8821. 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; }
  8822. /**
  8823. * Copyright 2016 Google Inc. All Rights Reserved.
  8824. *
  8825. * Licensed under the Apache License, Version 2.0 (the "License");
  8826. * you may not use this file except in compliance with the License.
  8827. * You may obtain a copy of the License at
  8828. *
  8829. * http://www.apache.org/licenses/LICENSE-2.0
  8830. *
  8831. * Unless required by applicable law or agreed to in writing, software
  8832. * distributed under the License is distributed on an "AS IS" BASIS,
  8833. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8834. * See the License for the specific language governing permissions and
  8835. * limitations under the License.
  8836. */
  8837. var MDCPersistentDrawerFoundation = function (_MDCSlidableDrawerFou) {
  8838. _inherits(MDCPersistentDrawerFoundation, _MDCSlidableDrawerFou);
  8839. _createClass(MDCPersistentDrawerFoundation, null, [{
  8840. key: 'cssClasses',
  8841. get: function get() {
  8842. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  8843. }
  8844. }, {
  8845. key: 'strings',
  8846. get: function get() {
  8847. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  8848. }
  8849. }, {
  8850. key: 'defaultAdapter',
  8851. get: function get() {
  8852. return _extends(__WEBPACK_IMPORTED_MODULE_0__slidable_index__["b" /* MDCSlidableDrawerFoundation */].defaultAdapter, {
  8853. isDrawer: function isDrawer() {
  8854. return false;
  8855. }
  8856. });
  8857. }
  8858. }]);
  8859. function MDCPersistentDrawerFoundation(adapter) {
  8860. _classCallCheck(this, MDCPersistentDrawerFoundation);
  8861. return _possibleConstructorReturn(this, (MDCPersistentDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCPersistentDrawerFoundation)).call(this, _extends(MDCPersistentDrawerFoundation.defaultAdapter, adapter), MDCPersistentDrawerFoundation.cssClasses.ROOT, MDCPersistentDrawerFoundation.cssClasses.ANIMATING, MDCPersistentDrawerFoundation.cssClasses.OPEN));
  8862. }
  8863. _createClass(MDCPersistentDrawerFoundation, [{
  8864. key: 'isRootTransitioningEventTarget_',
  8865. value: function isRootTransitioningEventTarget_(el) {
  8866. return this.adapter_.isDrawer(el);
  8867. }
  8868. }]);
  8869. return MDCPersistentDrawerFoundation;
  8870. }(__WEBPACK_IMPORTED_MODULE_0__slidable_index__["b" /* MDCSlidableDrawerFoundation */]);
  8871. /* harmony default export */ __webpack_exports__["a"] = (MDCPersistentDrawerFoundation);
  8872. /***/ }),
  8873. /* 74 */
  8874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8875. "use strict";
  8876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  8877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  8878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable_index__ = __webpack_require__(10);
  8879. /**
  8880. * Copyright 2016 Google Inc. All Rights Reserved.
  8881. *
  8882. * Licensed under the Apache License, Version 2.0 (the "License");
  8883. * you may not use this file except in compliance with the License.
  8884. * You may obtain a copy of the License at
  8885. *
  8886. * http://www.apache.org/licenses/LICENSE-2.0
  8887. *
  8888. * Unless required by applicable law or agreed to in writing, software
  8889. * distributed under the License is distributed on an "AS IS" BASIS,
  8890. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8891. * See the License for the specific language governing permissions and
  8892. * limitations under the License.
  8893. */
  8894. var cssClasses = {
  8895. ROOT: 'mdc-drawer--persistent',
  8896. OPEN: 'mdc-drawer--open',
  8897. ANIMATING: 'mdc-drawer--animating'
  8898. };
  8899. var strings = {
  8900. DRAWER_SELECTOR: '.mdc-drawer--persistent .mdc-drawer__drawer',
  8901. FOCUSABLE_ELEMENTS: __WEBPACK_IMPORTED_MODULE_0__slidable_index__["a" /* FOCUSABLE_ELEMENTS */],
  8902. OPEN_EVENT: 'MDCPersistentDrawer:open',
  8903. CLOSE_EVENT: 'MDCPersistentDrawer:close'
  8904. };
  8905. /***/ }),
  8906. /* 75 */
  8907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8908. "use strict";
  8909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  8910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(28);
  8911. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(76);
  8912. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  8913. 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; }; }();
  8914. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8915. 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; }
  8916. 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; }
  8917. /**
  8918. * @license
  8919. * Copyright 2016 Google Inc. All Rights Reserved.
  8920. *
  8921. * Licensed under the Apache License, Version 2.0 (the "License");
  8922. * you may not use this file except in compliance with the License.
  8923. * You may obtain a copy of the License at
  8924. *
  8925. * http://www.apache.org/licenses/LICENSE-2.0
  8926. *
  8927. * Unless required by applicable law or agreed to in writing, software
  8928. * distributed under the License is distributed on an "AS IS" BASIS,
  8929. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8930. * See the License for the specific language governing permissions and
  8931. * limitations under the License.
  8932. */
  8933. /**
  8934. * @extends {MDCFoundation<!MDCFloatingLabelAdapter>}
  8935. * @final
  8936. */
  8937. var MDCFloatingLabelFoundation = function (_MDCFoundation) {
  8938. _inherits(MDCFloatingLabelFoundation, _MDCFoundation);
  8939. _createClass(MDCFloatingLabelFoundation, null, [{
  8940. key: 'cssClasses',
  8941. /** @return enum {string} */
  8942. get: function get() {
  8943. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  8944. }
  8945. /**
  8946. * {@see MDCFloatingLabelAdapter} for typing information on parameters and return
  8947. * types.
  8948. * @return {!MDCFloatingLabelAdapter}
  8949. */
  8950. }, {
  8951. key: 'defaultAdapter',
  8952. get: function get() {
  8953. return (/** @type {!MDCFloatingLabelAdapter} */{
  8954. addClass: function addClass() {},
  8955. removeClass: function removeClass() {},
  8956. getWidth: function getWidth() {},
  8957. registerInteractionHandler: function registerInteractionHandler() {},
  8958. deregisterInteractionHandler: function deregisterInteractionHandler() {}
  8959. }
  8960. );
  8961. }
  8962. /**
  8963. * @param {!MDCFloatingLabelAdapter} adapter
  8964. */
  8965. }]);
  8966. function MDCFloatingLabelFoundation(adapter) {
  8967. _classCallCheck(this, MDCFloatingLabelFoundation);
  8968. /** @private {function(!Event): undefined} */
  8969. var _this = _possibleConstructorReturn(this, (MDCFloatingLabelFoundation.__proto__ || Object.getPrototypeOf(MDCFloatingLabelFoundation)).call(this, _extends(MDCFloatingLabelFoundation.defaultAdapter, adapter)));
  8970. _this.shakeAnimationEndHandler_ = function () {
  8971. return _this.handleShakeAnimationEnd_();
  8972. };
  8973. return _this;
  8974. }
  8975. _createClass(MDCFloatingLabelFoundation, [{
  8976. key: 'init',
  8977. value: function init() {
  8978. this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  8979. }
  8980. }, {
  8981. key: 'destroy',
  8982. value: function destroy() {
  8983. this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  8984. }
  8985. /**
  8986. * Returns the width of the label element.
  8987. * @return {number}
  8988. */
  8989. }, {
  8990. key: 'getWidth',
  8991. value: function getWidth() {
  8992. return this.adapter_.getWidth();
  8993. }
  8994. /**
  8995. * Styles the label to produce the label shake for errors.
  8996. * @param {boolean} shouldShake adds shake class if true,
  8997. * otherwise removes shake class.
  8998. */
  8999. }, {
  9000. key: 'shake',
  9001. value: function shake(shouldShake) {
  9002. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  9003. if (shouldShake) {
  9004. this.adapter_.addClass(LABEL_SHAKE);
  9005. } else {
  9006. this.adapter_.removeClass(LABEL_SHAKE);
  9007. }
  9008. }
  9009. /**
  9010. * Styles the label to float or dock.
  9011. * @param {boolean} shouldFloat adds float class if true, otherwise remove
  9012. * float and shake class to dock label.
  9013. */
  9014. }, {
  9015. key: 'float',
  9016. value: function float(shouldFloat) {
  9017. var _MDCFloatingLabelFoun = MDCFloatingLabelFoundation.cssClasses,
  9018. LABEL_FLOAT_ABOVE = _MDCFloatingLabelFoun.LABEL_FLOAT_ABOVE,
  9019. LABEL_SHAKE = _MDCFloatingLabelFoun.LABEL_SHAKE;
  9020. if (shouldFloat) {
  9021. this.adapter_.addClass(LABEL_FLOAT_ABOVE);
  9022. } else {
  9023. this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
  9024. this.adapter_.removeClass(LABEL_SHAKE);
  9025. }
  9026. }
  9027. /**
  9028. * Handles an interaction event on the root element.
  9029. */
  9030. }, {
  9031. key: 'handleShakeAnimationEnd_',
  9032. value: function handleShakeAnimationEnd_() {
  9033. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  9034. this.adapter_.removeClass(LABEL_SHAKE);
  9035. }
  9036. }]);
  9037. return MDCFloatingLabelFoundation;
  9038. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  9039. /* harmony default export */ __webpack_exports__["a"] = (MDCFloatingLabelFoundation);
  9040. /***/ }),
  9041. /* 76 */
  9042. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9043. "use strict";
  9044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  9045. /**
  9046. * @license
  9047. * Copyright 2016 Google Inc. All Rights Reserved.
  9048. *
  9049. * Licensed under the Apache License, Version 2.0 (the "License");
  9050. * you may not use this file except in compliance with the License.
  9051. * You may obtain a copy of the License at
  9052. *
  9053. * http://www.apache.org/licenses/LICENSE-2.0
  9054. *
  9055. * Unless required by applicable law or agreed to in writing, software
  9056. * distributed under the License is distributed on an "AS IS" BASIS,
  9057. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9058. * See the License for the specific language governing permissions and
  9059. * limitations under the License.
  9060. */
  9061. /** @enum {string} */
  9062. var cssClasses = {
  9063. LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
  9064. LABEL_SHAKE: 'mdc-floating-label--shake'
  9065. };
  9066. /***/ }),
  9067. /* 77 */
  9068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9069. "use strict";
  9070. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; });
  9072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  9073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(78);
  9074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  9075. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  9076. 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; }; }();
  9077. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9078. 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; }
  9079. 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; }
  9080. /**
  9081. * @license
  9082. * Copyright 2017 Google Inc. All Rights Reserved.
  9083. *
  9084. * Licensed under the Apache License, Version 2.0 (the "License");
  9085. * you may not use this file except in compliance with the License.
  9086. * You may obtain a copy of the License at
  9087. *
  9088. * http://www.apache.org/licenses/LICENSE-2.0
  9089. *
  9090. * Unless required by applicable law or agreed to in writing, software
  9091. * distributed under the License is distributed on an "AS IS" BASIS,
  9092. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9093. * See the License for the specific language governing permissions and
  9094. * limitations under the License.
  9095. */
  9096. /* eslint-disable no-unused-vars */
  9097. /* eslint-enable no-unused-vars */
  9098. /**
  9099. * @extends MDCComponent<!MDCFormFieldFoundation>
  9100. */
  9101. var MDCFormField = function (_MDCComponent) {
  9102. _inherits(MDCFormField, _MDCComponent);
  9103. _createClass(MDCFormField, [{
  9104. key: 'input',
  9105. /** @param {?MDCSelectionControl} input */
  9106. set: function set(input) {
  9107. this.input_ = input;
  9108. }
  9109. /** @return {?MDCSelectionControl} */
  9110. ,
  9111. get: function get() {
  9112. return this.input_;
  9113. }
  9114. }], [{
  9115. key: 'attachTo',
  9116. value: function attachTo(root) {
  9117. return new MDCFormField(root);
  9118. }
  9119. }]);
  9120. function MDCFormField() {
  9121. var _ref;
  9122. _classCallCheck(this, MDCFormField);
  9123. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9124. args[_key] = arguments[_key];
  9125. }
  9126. /** @private {?MDCSelectionControl} */
  9127. var _this = _possibleConstructorReturn(this, (_ref = MDCFormField.__proto__ || Object.getPrototypeOf(MDCFormField)).call.apply(_ref, [this].concat(args)));
  9128. _this.input_;
  9129. return _this;
  9130. }
  9131. /**
  9132. * @return {!Element}
  9133. * @private
  9134. */
  9135. _createClass(MDCFormField, [{
  9136. key: 'getDefaultFoundation',
  9137. /** @return {!MDCFormFieldFoundation} */
  9138. value: function getDefaultFoundation() {
  9139. var _this2 = this;
  9140. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  9141. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  9142. return _this2.label_.addEventListener(type, handler);
  9143. },
  9144. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  9145. return _this2.label_.removeEventListener(type, handler);
  9146. },
  9147. activateInputRipple: function activateInputRipple() {
  9148. if (_this2.input_ && _this2.input_.ripple) {
  9149. _this2.input_.ripple.activate();
  9150. }
  9151. },
  9152. deactivateInputRipple: function deactivateInputRipple() {
  9153. if (_this2.input_ && _this2.input_.ripple) {
  9154. _this2.input_.ripple.deactivate();
  9155. }
  9156. }
  9157. });
  9158. }
  9159. }, {
  9160. key: 'label_',
  9161. get: function get() {
  9162. var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.LABEL_SELECTOR;
  9163. return (/** @type {!Element} */this.root_.querySelector(LABEL_SELECTOR)
  9164. );
  9165. }
  9166. }]);
  9167. return MDCFormField;
  9168. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  9169. /***/ }),
  9170. /* 78 */
  9171. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9172. "use strict";
  9173. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9174. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(79);
  9175. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(80);
  9176. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  9177. 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; }; }();
  9178. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9179. 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; }
  9180. 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; }
  9181. /**
  9182. * @license
  9183. * Copyright 2017 Google Inc. All Rights Reserved.
  9184. *
  9185. * Licensed under the Apache License, Version 2.0 (the "License");
  9186. * you may not use this file except in compliance with the License.
  9187. * You may obtain a copy of the License at
  9188. *
  9189. * http://www.apache.org/licenses/LICENSE-2.0
  9190. *
  9191. * Unless required by applicable law or agreed to in writing, software
  9192. * distributed under the License is distributed on an "AS IS" BASIS,
  9193. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9194. * See the License for the specific language governing permissions and
  9195. * limitations under the License.
  9196. */
  9197. /**
  9198. * @extends {MDCFoundation<!MDCFormFieldAdapter>}
  9199. */
  9200. var MDCFormFieldFoundation = function (_MDCFoundation) {
  9201. _inherits(MDCFormFieldFoundation, _MDCFoundation);
  9202. _createClass(MDCFormFieldFoundation, null, [{
  9203. key: 'cssClasses',
  9204. /** @return enum {cssClasses} */
  9205. get: function get() {
  9206. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  9207. }
  9208. /** @return enum {strings} */
  9209. }, {
  9210. key: 'strings',
  9211. get: function get() {
  9212. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  9213. }
  9214. /** @return {!MDCFormFieldAdapter} */
  9215. }, {
  9216. key: 'defaultAdapter',
  9217. get: function get() {
  9218. return {
  9219. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  9220. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  9221. activateInputRipple: function activateInputRipple() {},
  9222. deactivateInputRipple: function deactivateInputRipple() {}
  9223. };
  9224. }
  9225. }]);
  9226. function MDCFormFieldFoundation(adapter) {
  9227. _classCallCheck(this, MDCFormFieldFoundation);
  9228. /** @private {!EventListener} */
  9229. var _this = _possibleConstructorReturn(this, (MDCFormFieldFoundation.__proto__ || Object.getPrototypeOf(MDCFormFieldFoundation)).call(this, _extends(MDCFormFieldFoundation.defaultAdapter, adapter)));
  9230. _this.clickHandler_ = /** @type {!EventListener} */function () {
  9231. return _this.handleClick_();
  9232. };
  9233. return _this;
  9234. }
  9235. _createClass(MDCFormFieldFoundation, [{
  9236. key: 'init',
  9237. value: function init() {
  9238. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  9239. }
  9240. }, {
  9241. key: 'destroy',
  9242. value: function destroy() {
  9243. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  9244. }
  9245. /** @private */
  9246. }, {
  9247. key: 'handleClick_',
  9248. value: function handleClick_() {
  9249. var _this2 = this;
  9250. this.adapter_.activateInputRipple();
  9251. requestAnimationFrame(function () {
  9252. return _this2.adapter_.deactivateInputRipple();
  9253. });
  9254. }
  9255. }]);
  9256. return MDCFormFieldFoundation;
  9257. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  9258. /* harmony default export */ __webpack_exports__["a"] = (MDCFormFieldFoundation);
  9259. /***/ }),
  9260. /* 79 */
  9261. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9262. "use strict";
  9263. 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; }; }();
  9264. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9265. /**
  9266. * @license
  9267. * Copyright 2016 Google Inc. All Rights Reserved.
  9268. *
  9269. * Licensed under the Apache License, Version 2.0 (the "License");
  9270. * you may not use this file except in compliance with the License.
  9271. * You may obtain a copy of the License at
  9272. *
  9273. * http://www.apache.org/licenses/LICENSE-2.0
  9274. *
  9275. * Unless required by applicable law or agreed to in writing, software
  9276. * distributed under the License is distributed on an "AS IS" BASIS,
  9277. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9278. * See the License for the specific language governing permissions and
  9279. * limitations under the License.
  9280. */
  9281. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9282. /**
  9283. * Adapter for MDC Form Field. Provides an interface for managing
  9284. * - event handlers
  9285. * - ripple activation
  9286. *
  9287. * Additionally, provides type information for the adapter to the Closure
  9288. * compiler.
  9289. *
  9290. * Implement this adapter for your framework of choice to delegate updates to
  9291. * the component in your framework of choice. See architecture documentation
  9292. * for more details.
  9293. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  9294. *
  9295. * @record
  9296. */
  9297. var MDCFormFieldAdapter = function () {
  9298. function MDCFormFieldAdapter() {
  9299. _classCallCheck(this, MDCFormFieldAdapter);
  9300. }
  9301. _createClass(MDCFormFieldAdapter, [{
  9302. key: "registerInteractionHandler",
  9303. /**
  9304. * @param {string} type
  9305. * @param {!EventListener} handler
  9306. */
  9307. value: function registerInteractionHandler(type, handler) {}
  9308. /**
  9309. * @param {string} type
  9310. * @param {!EventListener} handler
  9311. */
  9312. }, {
  9313. key: "deregisterInteractionHandler",
  9314. value: function deregisterInteractionHandler(type, handler) {}
  9315. }, {
  9316. key: "activateInputRipple",
  9317. value: function activateInputRipple() {}
  9318. }, {
  9319. key: "deactivateInputRipple",
  9320. value: function deactivateInputRipple() {}
  9321. }]);
  9322. return MDCFormFieldAdapter;
  9323. }();
  9324. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldAdapter);
  9325. /***/ }),
  9326. /* 80 */
  9327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9328. "use strict";
  9329. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  9330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  9331. /**
  9332. * @license
  9333. * Copyright 2017 Google Inc. All Rights Reserved.
  9334. *
  9335. * Licensed under the Apache License, Version 2.0 (the "License");
  9336. * you may not use this file except in compliance with the License.
  9337. * You may obtain a copy of the License at
  9338. *
  9339. * http://www.apache.org/licenses/LICENSE-2.0
  9340. *
  9341. * Unless required by applicable law or agreed to in writing, software
  9342. * distributed under the License is distributed on an "AS IS" BASIS,
  9343. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9344. * See the License for the specific language governing permissions and
  9345. * limitations under the License.
  9346. */
  9347. /** @enum {string} */
  9348. var cssClasses = {
  9349. ROOT: 'mdc-form-field'
  9350. };
  9351. /** @enum {string} */
  9352. var strings = {
  9353. LABEL_SELECTOR: '.mdc-form-field > label'
  9354. };
  9355. /***/ }),
  9356. /* 81 */
  9357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9358. "use strict";
  9359. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridList", function() { return MDCGridList; });
  9361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  9362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(82);
  9363. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  9364. 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; }; }();
  9365. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9366. 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; }
  9367. 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; }
  9368. /**
  9369. * Copyright 2016 Google Inc. All Rights Reserved.
  9370. *
  9371. * Licensed under the Apache License, Version 2.0 (the "License");
  9372. * you may not use this file except in compliance with the License.
  9373. * You may obtain a copy of the License at
  9374. *
  9375. * http://www.apache.org/licenses/LICENSE-2.0
  9376. *
  9377. * Unless required by applicable law or agreed to in writing, software
  9378. * distributed under the License is distributed on an "AS IS" BASIS,
  9379. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9380. * See the License for the specific language governing permissions and
  9381. * limitations under the License.
  9382. */
  9383. var MDCGridList = function (_MDCComponent) {
  9384. _inherits(MDCGridList, _MDCComponent);
  9385. function MDCGridList() {
  9386. _classCallCheck(this, MDCGridList);
  9387. return _possibleConstructorReturn(this, (MDCGridList.__proto__ || Object.getPrototypeOf(MDCGridList)).apply(this, arguments));
  9388. }
  9389. _createClass(MDCGridList, [{
  9390. key: 'getDefaultFoundation',
  9391. value: function getDefaultFoundation() {
  9392. var _this2 = this;
  9393. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  9394. getOffsetWidth: function getOffsetWidth() {
  9395. return _this2.root_.offsetWidth;
  9396. },
  9397. getNumberOfTiles: function getNumberOfTiles() {
  9398. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR).length;
  9399. },
  9400. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  9401. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR)[index].offsetWidth;
  9402. },
  9403. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  9404. _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILES_SELECTOR).style[property] = value;
  9405. },
  9406. registerResizeHandler: function registerResizeHandler(handler) {
  9407. return window.addEventListener('resize', handler);
  9408. },
  9409. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  9410. return window.removeEventListener('resize', handler);
  9411. }
  9412. });
  9413. }
  9414. }], [{
  9415. key: 'attachTo',
  9416. value: function attachTo(root) {
  9417. return new MDCGridList(root);
  9418. }
  9419. }]);
  9420. return MDCGridList;
  9421. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  9422. /***/ }),
  9423. /* 82 */
  9424. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9425. "use strict";
  9426. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  9427. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(83);
  9428. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  9429. 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; }; }();
  9430. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9431. 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; }
  9432. 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; }
  9433. /**
  9434. * Copyright 2016 Google Inc. All Rights Reserved.
  9435. *
  9436. * Licensed under the Apache License, Version 2.0 (the "License");
  9437. * you may not use this file except in compliance with the License.
  9438. * You may obtain a copy of the License at
  9439. *
  9440. * http://www.apache.org/licenses/LICENSE-2.0
  9441. *
  9442. * Unless required by applicable law or agreed to in writing, software
  9443. * distributed under the License is distributed on an "AS IS" BASIS,
  9444. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9445. * See the License for the specific language governing permissions and
  9446. * limitations under the License.
  9447. */
  9448. var MDCGridListFoundation = function (_MDCFoundation) {
  9449. _inherits(MDCGridListFoundation, _MDCFoundation);
  9450. _createClass(MDCGridListFoundation, null, [{
  9451. key: 'strings',
  9452. get: function get() {
  9453. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* strings */];
  9454. }
  9455. }, {
  9456. key: 'defaultAdapter',
  9457. get: function get() {
  9458. return {
  9459. getOffsetWidth: function getOffsetWidth() {
  9460. return (/* number */0
  9461. );
  9462. },
  9463. getNumberOfTiles: function getNumberOfTiles() {
  9464. return (/* number */0
  9465. );
  9466. },
  9467. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  9468. return (/* index: number */ /* number */0
  9469. );
  9470. },
  9471. setStyleForTilesElement: function setStyleForTilesElement() /* property: string, value: string */{},
  9472. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  9473. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{}
  9474. };
  9475. }
  9476. }]);
  9477. function MDCGridListFoundation(adapter) {
  9478. _classCallCheck(this, MDCGridListFoundation);
  9479. var _this = _possibleConstructorReturn(this, (MDCGridListFoundation.__proto__ || Object.getPrototypeOf(MDCGridListFoundation)).call(this, _extends(MDCGridListFoundation.defaultAdapter, adapter)));
  9480. _this.resizeHandler_ = function () {
  9481. return _this.alignCenter();
  9482. };
  9483. _this.resizeFrame_ = 0;
  9484. return _this;
  9485. }
  9486. _createClass(MDCGridListFoundation, [{
  9487. key: 'init',
  9488. value: function init() {
  9489. this.alignCenter();
  9490. this.adapter_.registerResizeHandler(this.resizeHandler_);
  9491. }
  9492. }, {
  9493. key: 'destroy',
  9494. value: function destroy() {
  9495. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  9496. }
  9497. }, {
  9498. key: 'alignCenter',
  9499. value: function alignCenter() {
  9500. var _this2 = this;
  9501. if (this.resizeFrame_ !== 0) {
  9502. cancelAnimationFrame(this.resizeFrame_);
  9503. }
  9504. this.resizeFrame_ = requestAnimationFrame(function () {
  9505. _this2.alignCenter_();
  9506. _this2.resizeFrame_ = 0;
  9507. });
  9508. }
  9509. }, {
  9510. key: 'alignCenter_',
  9511. value: function alignCenter_() {
  9512. if (this.adapter_.getNumberOfTiles() == 0) {
  9513. return;
  9514. }
  9515. var gridWidth = this.adapter_.getOffsetWidth();
  9516. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  9517. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  9518. this.adapter_.setStyleForTilesElement('width', tilesWidth + 'px');
  9519. }
  9520. }]);
  9521. return MDCGridListFoundation;
  9522. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  9523. /* harmony default export */ __webpack_exports__["a"] = (MDCGridListFoundation);
  9524. /***/ }),
  9525. /* 83 */
  9526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9527. "use strict";
  9528. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  9529. /**
  9530. * Copyright 2016 Google Inc. All Rights Reserved.
  9531. *
  9532. * Licensed under the Apache License, Version 2.0 (the "License");
  9533. * you may not use this file except in compliance with the License.
  9534. * You may obtain a copy of the License at
  9535. *
  9536. * http://www.apache.org/licenses/LICENSE-2.0
  9537. *
  9538. * Unless required by applicable law or agreed to in writing, software
  9539. * distributed under the License is distributed on an "AS IS" BASIS,
  9540. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9541. * See the License for the specific language governing permissions and
  9542. * limitations under the License.
  9543. */
  9544. var strings = {
  9545. TILES_SELECTOR: '.mdc-grid-list__tiles',
  9546. TILE_SELECTOR: '.mdc-grid-tile'
  9547. };
  9548. /***/ }),
  9549. /* 84 */
  9550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9551. "use strict";
  9552. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9553. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggle", function() { return MDCIconButtonToggle; });
  9554. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  9555. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(85);
  9556. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(3);
  9557. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  9558. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  9559. 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; }; }();
  9560. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9561. 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; }
  9562. 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; }
  9563. /**
  9564. * @license
  9565. * Copyright 2018 Google Inc. All Rights Reserved.
  9566. *
  9567. * Licensed under the Apache License, Version 2.0 (the "License");
  9568. * you may not use this file except in compliance with the License.
  9569. * You may obtain a copy of the License at
  9570. *
  9571. * http://www.apache.org/licenses/LICENSE-2.0
  9572. *
  9573. * Unless required by applicable law or agreed to in writing, software
  9574. * distributed under the License is distributed on an "AS IS" BASIS,
  9575. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9576. * See the License for the specific language governing permissions and
  9577. * limitations under the License.
  9578. */
  9579. /**
  9580. * @extends {MDCComponent<!MDCIconButtonToggleFoundation>}
  9581. */
  9582. var MDCIconButtonToggle = function (_MDCComponent) {
  9583. _inherits(MDCIconButtonToggle, _MDCComponent);
  9584. _createClass(MDCIconButtonToggle, null, [{
  9585. key: 'attachTo',
  9586. value: function attachTo(root) {
  9587. return new MDCIconButtonToggle(root);
  9588. }
  9589. }]);
  9590. function MDCIconButtonToggle() {
  9591. var _ref;
  9592. _classCallCheck(this, MDCIconButtonToggle);
  9593. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9594. args[_key] = arguments[_key];
  9595. }
  9596. /** @private {!MDCRipple} */
  9597. var _this = _possibleConstructorReturn(this, (_ref = MDCIconButtonToggle.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle)).call.apply(_ref, [this].concat(args)));
  9598. _this.ripple_ = _this.initRipple_();
  9599. /** @private {!Function} */
  9600. _this.handleClick_;
  9601. return _this;
  9602. }
  9603. /** @return {!Element} */
  9604. _createClass(MDCIconButtonToggle, [{
  9605. key: 'initRipple_',
  9606. /**
  9607. * @return {!MDCRipple}
  9608. * @private
  9609. */
  9610. value: function initRipple_() {
  9611. var ripple = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_);
  9612. ripple.unbounded = true;
  9613. return ripple;
  9614. }
  9615. }, {
  9616. key: 'destroy',
  9617. value: function destroy() {
  9618. this.root_.removeEventListener('click', this.handleClick_);
  9619. this.ripple_.destroy();
  9620. _get(MDCIconButtonToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle.prototype), 'destroy', this).call(this);
  9621. }
  9622. /** @return {!MDCIconButtonToggleFoundation} */
  9623. }, {
  9624. key: 'getDefaultFoundation',
  9625. value: function getDefaultFoundation() {
  9626. var _this2 = this;
  9627. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  9628. addClass: function addClass(className) {
  9629. return _this2.iconEl_.classList.add(className);
  9630. },
  9631. removeClass: function removeClass(className) {
  9632. return _this2.iconEl_.classList.remove(className);
  9633. },
  9634. setText: function setText(text) {
  9635. return _this2.iconEl_.textContent = text;
  9636. },
  9637. getAttr: function getAttr(name) {
  9638. return _this2.root_.getAttribute(name);
  9639. },
  9640. setAttr: function setAttr(name, value) {
  9641. return _this2.root_.setAttribute(name, value);
  9642. },
  9643. notifyChange: function notifyChange(evtData) {
  9644. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  9645. }
  9646. });
  9647. }
  9648. }, {
  9649. key: 'initialSyncWithDOM',
  9650. value: function initialSyncWithDOM() {
  9651. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  9652. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  9653. this.root_.addEventListener('click', this.handleClick_);
  9654. }
  9655. /** @return {!MDCRipple} */
  9656. }, {
  9657. key: 'refreshToggleData',
  9658. value: function refreshToggleData() {
  9659. this.foundation_.refreshToggleData();
  9660. }
  9661. }, {
  9662. key: 'iconEl_',
  9663. get: function get() {
  9664. var sel = this.root_.dataset['iconInnerSelector'];
  9665. return sel ?
  9666. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  9667. }
  9668. }, {
  9669. key: 'ripple',
  9670. get: function get() {
  9671. return this.ripple_;
  9672. }
  9673. /** @return {boolean} */
  9674. }, {
  9675. key: 'on',
  9676. get: function get() {
  9677. return this.foundation_.isOn();
  9678. }
  9679. /** @param {boolean} isOn */
  9680. ,
  9681. set: function set(isOn) {
  9682. this.foundation_.toggle(isOn);
  9683. }
  9684. }]);
  9685. return MDCIconButtonToggle;
  9686. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  9687. /***/ }),
  9688. /* 85 */
  9689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9690. "use strict";
  9691. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(86);
  9693. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(87);
  9694. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  9695. 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; }; }();
  9696. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9697. 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; }
  9698. 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; }
  9699. /**
  9700. * @license
  9701. * Copyright 2018 Google Inc. All Rights Reserved.
  9702. *
  9703. * Licensed under the Apache License, Version 2.0 (the "License");
  9704. * you may not use this file except in compliance with the License.
  9705. * You may obtain a copy of the License at
  9706. *
  9707. * http://www.apache.org/licenses/LICENSE-2.0
  9708. *
  9709. * Unless required by applicable law or agreed to in writing, software
  9710. * distributed under the License is distributed on an "AS IS" BASIS,
  9711. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9712. * See the License for the specific language governing permissions and
  9713. * limitations under the License.
  9714. */
  9715. /* eslint-disable no-unused-vars */
  9716. /**
  9717. * @extends {MDCFoundation<!MDCIconButtonToggleAdapter>}
  9718. */
  9719. var MDCIconButtonToggleFoundation = function (_MDCFoundation) {
  9720. _inherits(MDCIconButtonToggleFoundation, _MDCFoundation);
  9721. _createClass(MDCIconButtonToggleFoundation, null, [{
  9722. key: 'cssClasses',
  9723. get: function get() {
  9724. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  9725. }
  9726. }, {
  9727. key: 'strings',
  9728. get: function get() {
  9729. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  9730. }
  9731. }, {
  9732. key: 'defaultAdapter',
  9733. get: function get() {
  9734. return {
  9735. addClass: function addClass() /* className: string */{},
  9736. removeClass: function removeClass() /* className: string */{},
  9737. setText: function setText() /* text: string */{},
  9738. getAttr: function getAttr() {
  9739. return (/* name: string */ /* string */''
  9740. );
  9741. },
  9742. setAttr: function setAttr() /* name: string, value: string */{},
  9743. notifyChange: function notifyChange() /* evtData: IconButtonToggleEvent */{}
  9744. };
  9745. }
  9746. }]);
  9747. function MDCIconButtonToggleFoundation(adapter) {
  9748. _classCallCheck(this, MDCIconButtonToggleFoundation);
  9749. var _this = _possibleConstructorReturn(this, (MDCIconButtonToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconButtonToggleFoundation)).call(this, _extends(MDCIconButtonToggleFoundation.defaultAdapter, adapter)));
  9750. var ARIA_PRESSED = MDCIconButtonToggleFoundation.strings.ARIA_PRESSED;
  9751. /** @private {boolean} */
  9752. _this.on_ = _this.adapter_.getAttr(ARIA_PRESSED) === 'true';
  9753. /** @private {boolean} */
  9754. _this.disabled_ = false;
  9755. /** @private {?IconButtonToggleState} */
  9756. _this.toggleOnData_ = null;
  9757. /** @private {?IconButtonToggleState} */
  9758. _this.toggleOffData_ = null;
  9759. return _this;
  9760. }
  9761. _createClass(MDCIconButtonToggleFoundation, [{
  9762. key: 'init',
  9763. value: function init() {
  9764. this.refreshToggleData();
  9765. }
  9766. }, {
  9767. key: 'refreshToggleData',
  9768. value: function refreshToggleData() {
  9769. this.toggleOnData_ = {
  9770. label: this.adapter_.getAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].DATA_TOGGLE_ON_LABEL),
  9771. content: this.adapter_.getAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].DATA_TOGGLE_ON_CONTENT),
  9772. cssClass: this.adapter_.getAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].DATA_TOGGLE_ON_CLASS)
  9773. };
  9774. this.toggleOffData_ = {
  9775. label: this.adapter_.getAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].DATA_TOGGLE_OFF_LABEL),
  9776. content: this.adapter_.getAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].DATA_TOGGLE_OFF_CONTENT),
  9777. cssClass: this.adapter_.getAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].DATA_TOGGLE_OFF_CLASS)
  9778. };
  9779. }
  9780. }, {
  9781. key: 'handleClick',
  9782. value: function handleClick() {
  9783. this.toggle();
  9784. var isOn = this.on_;
  9785. this.adapter_.notifyChange( /** @type {!IconButtonToggleEvent} */{ isOn: isOn });
  9786. }
  9787. /** @return {boolean} */
  9788. }, {
  9789. key: 'isOn',
  9790. value: function isOn() {
  9791. return this.on_;
  9792. }
  9793. /** @param {boolean=} isOn */
  9794. }, {
  9795. key: 'toggle',
  9796. value: function toggle() {
  9797. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  9798. this.on_ = isOn;
  9799. var _MDCIconButtonToggleF = MDCIconButtonToggleFoundation.strings,
  9800. ARIA_LABEL = _MDCIconButtonToggleF.ARIA_LABEL,
  9801. ARIA_PRESSED = _MDCIconButtonToggleF.ARIA_PRESSED;
  9802. this.adapter_.setAttr(ARIA_PRESSED, this.on_.toString());
  9803. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  9804. classToRemove = _ref.cssClass;
  9805. if (classToRemove) {
  9806. this.adapter_.removeClass(classToRemove);
  9807. }
  9808. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  9809. content = _ref2.content,
  9810. label = _ref2.label,
  9811. cssClass = _ref2.cssClass;
  9812. if (cssClass) {
  9813. this.adapter_.addClass(cssClass);
  9814. }
  9815. if (content) {
  9816. this.adapter_.setText(content);
  9817. }
  9818. if (label) {
  9819. this.adapter_.setAttr(ARIA_LABEL, label);
  9820. }
  9821. }
  9822. }]);
  9823. return MDCIconButtonToggleFoundation;
  9824. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  9825. /** @record */
  9826. var IconButtonToggleState = function IconButtonToggleState() {
  9827. _classCallCheck(this, IconButtonToggleState);
  9828. };
  9829. /**
  9830. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  9831. * @export {string|undefined}
  9832. */
  9833. IconButtonToggleState.prototype.label;
  9834. /**
  9835. * The text for the icon toggle, or undefined if there is no text.
  9836. * @export {string|undefined}
  9837. */
  9838. IconButtonToggleState.prototype.content;
  9839. /**
  9840. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  9841. * @export {string|undefined}
  9842. */
  9843. IconButtonToggleState.prototype.cssClass;
  9844. /* harmony default export */ __webpack_exports__["a"] = (MDCIconButtonToggleFoundation);
  9845. /***/ }),
  9846. /* 86 */
  9847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9848. "use strict";
  9849. /* unused harmony export MDCIconButtonToggleAdapter */
  9850. /* unused harmony export IconButtonToggleEvent */
  9851. 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; }; }();
  9852. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9853. /**
  9854. * @license
  9855. * Copyright 2018 Google Inc. All Rights Reserved.
  9856. *
  9857. * Licensed under the Apache License, Version 2.0 (the "License");
  9858. * you may not use this file except in compliance with the License.
  9859. * You may obtain a copy of the License at
  9860. *
  9861. * http://www.apache.org/licenses/LICENSE-2.0
  9862. *
  9863. * Unless required by applicable law or agreed to in writing, software
  9864. * distributed under the License is distributed on an "AS IS" BASIS,
  9865. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9866. * See the License for the specific language governing permissions and
  9867. * limitations under the License.
  9868. */
  9869. /* eslint no-unused-vars: [2, {"args": "none"}] */
  9870. /**
  9871. * Adapter for MDC Icon Button Toggle. Provides an interface for managing
  9872. * - classes
  9873. * - dom
  9874. * - inner text
  9875. * - event handlers
  9876. * - event dispatch
  9877. *
  9878. * Additionally, provides type information for the adapter to the Closure
  9879. * compiler.
  9880. *
  9881. * Implement this adapter for your framework of choice to delegate updates to
  9882. * the component in your framework of choice. See architecture documentation
  9883. * for more details.
  9884. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  9885. *
  9886. * @record
  9887. */
  9888. var MDCIconButtonToggleAdapter = function () {
  9889. function MDCIconButtonToggleAdapter() {
  9890. _classCallCheck(this, MDCIconButtonToggleAdapter);
  9891. }
  9892. _createClass(MDCIconButtonToggleAdapter, [{
  9893. key: "addClass",
  9894. /** @param {string} className */
  9895. value: function addClass(className) {}
  9896. /** @param {string} className */
  9897. }, {
  9898. key: "removeClass",
  9899. value: function removeClass(className) {}
  9900. /**
  9901. * @param {string} type
  9902. * @param {!EventListener} handler
  9903. */
  9904. }, {
  9905. key: "registerInteractionHandler",
  9906. value: function registerInteractionHandler(type, handler) {}
  9907. /**
  9908. * @param {string} type
  9909. * @param {!EventListener} handler
  9910. */
  9911. }, {
  9912. key: "deregisterInteractionHandler",
  9913. value: function deregisterInteractionHandler(type, handler) {}
  9914. /** @param {string} text */
  9915. }, {
  9916. key: "setText",
  9917. value: function setText(text) {}
  9918. /**
  9919. * @param {string} name
  9920. * @return {string}
  9921. */
  9922. }, {
  9923. key: "getAttr",
  9924. value: function getAttr(name) {}
  9925. /**
  9926. * @param {string} name
  9927. * @param {string} value
  9928. */
  9929. }, {
  9930. key: "setAttr",
  9931. value: function setAttr(name, value) {}
  9932. /** @param {!IconButtonToggleEvent} evtData */
  9933. }, {
  9934. key: "notifyChange",
  9935. value: function notifyChange(evtData) {}
  9936. }]);
  9937. return MDCIconButtonToggleAdapter;
  9938. }();
  9939. /**
  9940. * @typedef {{
  9941. * isOn: boolean,
  9942. * }}
  9943. */
  9944. var IconButtonToggleEvent = void 0;
  9945. /***/ }),
  9946. /* 87 */
  9947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9948. "use strict";
  9949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  9950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  9951. /**
  9952. * @license
  9953. * Copyright 2018 Google Inc. All Rights Reserved.
  9954. *
  9955. * Licensed under the Apache License, Version 2.0 (the "License");
  9956. * you may not use this file except in compliance with the License.
  9957. * You may obtain a copy of the License at
  9958. *
  9959. * http://www.apache.org/licenses/LICENSE-2.0
  9960. *
  9961. * Unless required by applicable law or agreed to in writing, software
  9962. * distributed under the License is distributed on an "AS IS" BASIS,
  9963. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9964. * See the License for the specific language governing permissions and
  9965. * limitations under the License.
  9966. */
  9967. /** @enum {string} */
  9968. var cssClasses = {
  9969. ROOT: 'mdc-icon-button'
  9970. };
  9971. /** @enum {string} */
  9972. var strings = {
  9973. DATA_TOGGLE_ON_LABEL: 'data-toggle-on-label',
  9974. DATA_TOGGLE_ON_CONTENT: 'data-toggle-on-content',
  9975. DATA_TOGGLE_ON_CLASS: 'data-toggle-on-class',
  9976. DATA_TOGGLE_OFF_LABEL: 'data-toggle-off-label',
  9977. DATA_TOGGLE_OFF_CONTENT: 'data-toggle-off-content',
  9978. DATA_TOGGLE_OFF_CLASS: 'data-toggle-off-class',
  9979. ARIA_PRESSED: 'aria-pressed',
  9980. ARIA_LABEL: 'aria-label',
  9981. CHANGE_EVENT: 'MDCIconButtonToggle:change'
  9982. };
  9983. /***/ }),
  9984. /* 88 */
  9985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9986. "use strict";
  9987. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggle", function() { return MDCIconToggle; });
  9989. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  9990. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(89);
  9991. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(3);
  9992. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  9993. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  9994. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  9995. 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; }; }();
  9996. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9997. 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; }
  9998. 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; }
  9999. /**
  10000. * @license
  10001. * Copyright 2016 Google Inc. All Rights Reserved.
  10002. *
  10003. * Licensed under the Apache License, Version 2.0 (the "License");
  10004. * you may not use this file except in compliance with the License.
  10005. * You may obtain a copy of the License at
  10006. *
  10007. * http://www.apache.org/licenses/LICENSE-2.0
  10008. *
  10009. * Unless required by applicable law or agreed to in writing, software
  10010. * distributed under the License is distributed on an "AS IS" BASIS,
  10011. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10012. * See the License for the specific language governing permissions and
  10013. * limitations under the License.
  10014. */
  10015. /**
  10016. * @extends {MDCComponent<!MDCIconToggleFoundation>}
  10017. */
  10018. var MDCIconToggle = function (_MDCComponent) {
  10019. _inherits(MDCIconToggle, _MDCComponent);
  10020. _createClass(MDCIconToggle, null, [{
  10021. key: 'attachTo',
  10022. value: function attachTo(root) {
  10023. return new MDCIconToggle(root);
  10024. }
  10025. }]);
  10026. function MDCIconToggle() {
  10027. var _ref;
  10028. _classCallCheck(this, MDCIconToggle);
  10029. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  10030. args[_key] = arguments[_key];
  10031. }
  10032. /** @private {!MDCRipple} */
  10033. var _this = _possibleConstructorReturn(this, (_ref = MDCIconToggle.__proto__ || Object.getPrototypeOf(MDCIconToggle)).call.apply(_ref, [this].concat(args)));
  10034. _this.ripple_ = _this.initRipple_();
  10035. return _this;
  10036. }
  10037. /** @return {!Element} */
  10038. _createClass(MDCIconToggle, [{
  10039. key: 'initRipple_',
  10040. /**
  10041. * @return {!MDCRipple}
  10042. * @private
  10043. */
  10044. value: function initRipple_() {
  10045. var _this2 = this;
  10046. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].createAdapter(this), {
  10047. isUnbounded: function isUnbounded() {
  10048. return true;
  10049. },
  10050. isSurfaceActive: function isSurfaceActive() {
  10051. return _this2.foundation_.isKeyboardActivated();
  10052. }
  10053. });
  10054. var foundation = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRippleFoundation"](adapter);
  10055. return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_, foundation);
  10056. }
  10057. }, {
  10058. key: 'destroy',
  10059. value: function destroy() {
  10060. this.ripple_.destroy();
  10061. _get(MDCIconToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconToggle.prototype), 'destroy', this).call(this);
  10062. }
  10063. /** @return {!MDCIconToggleFoundation} */
  10064. }, {
  10065. key: 'getDefaultFoundation',
  10066. value: function getDefaultFoundation() {
  10067. var _this3 = this;
  10068. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  10069. addClass: function addClass(className) {
  10070. return _this3.iconEl_.classList.add(className);
  10071. },
  10072. removeClass: function removeClass(className) {
  10073. return _this3.iconEl_.classList.remove(className);
  10074. },
  10075. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  10076. return _this3.root_.addEventListener(type, handler);
  10077. },
  10078. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  10079. return _this3.root_.removeEventListener(type, handler);
  10080. },
  10081. setText: function setText(text) {
  10082. return _this3.iconEl_.textContent = text;
  10083. },
  10084. getTabIndex: function getTabIndex() {
  10085. return (/* number */_this3.root_.tabIndex
  10086. );
  10087. },
  10088. setTabIndex: function setTabIndex(tabIndex) {
  10089. return _this3.root_.tabIndex = tabIndex;
  10090. },
  10091. getAttr: function getAttr(name, value) {
  10092. return _this3.root_.getAttribute(name, value);
  10093. },
  10094. setAttr: function setAttr(name, value) {
  10095. return _this3.root_.setAttribute(name, value);
  10096. },
  10097. rmAttr: function rmAttr(name) {
  10098. return _this3.root_.removeAttribute(name);
  10099. },
  10100. notifyChange: function notifyChange(evtData) {
  10101. return _this3.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  10102. }
  10103. });
  10104. }
  10105. }, {
  10106. key: 'initialSyncWithDOM',
  10107. value: function initialSyncWithDOM() {
  10108. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  10109. this.disabled = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_DISABLED) === 'true';
  10110. }
  10111. /** @return {!MDCRipple} */
  10112. }, {
  10113. key: 'refreshToggleData',
  10114. value: function refreshToggleData() {
  10115. this.foundation_.refreshToggleData();
  10116. }
  10117. }, {
  10118. key: 'iconEl_',
  10119. get: function get() {
  10120. var sel = this.root_.dataset['iconInnerSelector'];
  10121. return sel ?
  10122. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  10123. }
  10124. }, {
  10125. key: 'ripple',
  10126. get: function get() {
  10127. return this.ripple_;
  10128. }
  10129. /** @return {boolean} */
  10130. }, {
  10131. key: 'on',
  10132. get: function get() {
  10133. return this.foundation_.isOn();
  10134. }
  10135. /** @param {boolean} isOn */
  10136. ,
  10137. set: function set(isOn) {
  10138. this.foundation_.toggle(isOn);
  10139. }
  10140. /** @return {boolean} */
  10141. }, {
  10142. key: 'disabled',
  10143. get: function get() {
  10144. return this.foundation_.isDisabled();
  10145. }
  10146. /** @param {boolean} isDisabled */
  10147. ,
  10148. set: function set(isDisabled) {
  10149. this.foundation_.setDisabled(isDisabled);
  10150. }
  10151. }]);
  10152. return MDCIconToggle;
  10153. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  10154. /***/ }),
  10155. /* 89 */
  10156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10157. "use strict";
  10158. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(90);
  10160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(91);
  10161. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  10162. 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; }; }();
  10163. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10164. 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; }
  10165. 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; }
  10166. /**
  10167. * @license
  10168. * Copyright 2016 Google Inc. All Rights Reserved.
  10169. *
  10170. * Licensed under the Apache License, Version 2.0 (the "License");
  10171. * you may not use this file except in compliance with the License.
  10172. * You may obtain a copy of the License at
  10173. *
  10174. * http://www.apache.org/licenses/LICENSE-2.0
  10175. *
  10176. * Unless required by applicable law or agreed to in writing, software
  10177. * distributed under the License is distributed on an "AS IS" BASIS,
  10178. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10179. * See the License for the specific language governing permissions and
  10180. * limitations under the License.
  10181. */
  10182. /* eslint-disable no-unused-vars */
  10183. /**
  10184. * @extends {MDCFoundation<!MDCIconToggleAdapter>}
  10185. */
  10186. var MDCIconToggleFoundation = function (_MDCFoundation) {
  10187. _inherits(MDCIconToggleFoundation, _MDCFoundation);
  10188. _createClass(MDCIconToggleFoundation, null, [{
  10189. key: 'cssClasses',
  10190. get: function get() {
  10191. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  10192. }
  10193. }, {
  10194. key: 'strings',
  10195. get: function get() {
  10196. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  10197. }
  10198. }, {
  10199. key: 'defaultAdapter',
  10200. get: function get() {
  10201. return {
  10202. addClass: function addClass() /* className: string */{},
  10203. removeClass: function removeClass() /* className: string */{},
  10204. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  10205. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  10206. setText: function setText() /* text: string */{},
  10207. getTabIndex: function getTabIndex() {
  10208. return (/* number */0
  10209. );
  10210. },
  10211. setTabIndex: function setTabIndex() /* tabIndex: number */{},
  10212. getAttr: function getAttr() {
  10213. return (/* name: string */ /* string */''
  10214. );
  10215. },
  10216. setAttr: function setAttr() /* name: string, value: string */{},
  10217. rmAttr: function rmAttr() /* name: string */{},
  10218. notifyChange: function notifyChange() /* evtData: IconToggleEvent */{}
  10219. };
  10220. }
  10221. }]);
  10222. function MDCIconToggleFoundation(adapter) {
  10223. _classCallCheck(this, MDCIconToggleFoundation);
  10224. /** @private {boolean} */
  10225. var _this = _possibleConstructorReturn(this, (MDCIconToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconToggleFoundation)).call(this, _extends(MDCIconToggleFoundation.defaultAdapter, adapter)));
  10226. _this.on_ = false;
  10227. /** @private {boolean} */
  10228. _this.disabled_ = false;
  10229. /** @private {number} */
  10230. _this.savedTabIndex_ = -1;
  10231. /** @private {?IconToggleState} */
  10232. _this.toggleOnData_ = null;
  10233. /** @private {?IconToggleState} */
  10234. _this.toggleOffData_ = null;
  10235. _this.clickHandler_ = /** @private {!EventListener} */function () {
  10236. return _this.toggleFromEvt_();
  10237. };
  10238. /** @private {boolean} */
  10239. _this.isHandlingKeydown_ = false;
  10240. _this.keydownHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  10241. if (isSpace(evt)) {
  10242. _this.isHandlingKeydown_ = true;
  10243. return evt.preventDefault();
  10244. }
  10245. };
  10246. _this.keyupHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  10247. if (isSpace(evt)) {
  10248. _this.isHandlingKeydown_ = false;
  10249. _this.toggleFromEvt_();
  10250. }
  10251. };
  10252. return _this;
  10253. }
  10254. _createClass(MDCIconToggleFoundation, [{
  10255. key: 'init',
  10256. value: function init() {
  10257. this.refreshToggleData();
  10258. this.savedTabIndex_ = this.adapter_.getTabIndex();
  10259. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  10260. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  10261. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  10262. }
  10263. }, {
  10264. key: 'refreshToggleData',
  10265. value: function refreshToggleData() {
  10266. var _MDCIconToggleFoundat = MDCIconToggleFoundation.strings,
  10267. DATA_TOGGLE_ON = _MDCIconToggleFoundat.DATA_TOGGLE_ON,
  10268. DATA_TOGGLE_OFF = _MDCIconToggleFoundat.DATA_TOGGLE_OFF;
  10269. this.toggleOnData_ = this.parseJsonDataAttr_(DATA_TOGGLE_ON);
  10270. this.toggleOffData_ = this.parseJsonDataAttr_(DATA_TOGGLE_OFF);
  10271. }
  10272. }, {
  10273. key: 'destroy',
  10274. value: function destroy() {
  10275. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  10276. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  10277. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  10278. }
  10279. /** @private */
  10280. }, {
  10281. key: 'toggleFromEvt_',
  10282. value: function toggleFromEvt_() {
  10283. this.toggle();
  10284. var isOn = this.on_;
  10285. this.adapter_.notifyChange( /** @type {!IconToggleEvent} */{ isOn: isOn });
  10286. }
  10287. /** @return {boolean} */
  10288. }, {
  10289. key: 'isOn',
  10290. value: function isOn() {
  10291. return this.on_;
  10292. }
  10293. /** @param {boolean=} isOn */
  10294. }, {
  10295. key: 'toggle',
  10296. value: function toggle() {
  10297. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  10298. this.on_ = isOn;
  10299. var _MDCIconToggleFoundat2 = MDCIconToggleFoundation.strings,
  10300. ARIA_LABEL = _MDCIconToggleFoundat2.ARIA_LABEL,
  10301. ARIA_PRESSED = _MDCIconToggleFoundat2.ARIA_PRESSED;
  10302. if (this.on_) {
  10303. this.adapter_.setAttr(ARIA_PRESSED, 'true');
  10304. } else {
  10305. this.adapter_.setAttr(ARIA_PRESSED, 'false');
  10306. }
  10307. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  10308. classToRemove = _ref.cssClass;
  10309. if (classToRemove) {
  10310. this.adapter_.removeClass(classToRemove);
  10311. }
  10312. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  10313. content = _ref2.content,
  10314. label = _ref2.label,
  10315. cssClass = _ref2.cssClass;
  10316. if (cssClass) {
  10317. this.adapter_.addClass(cssClass);
  10318. }
  10319. if (content) {
  10320. this.adapter_.setText(content);
  10321. }
  10322. if (label) {
  10323. this.adapter_.setAttr(ARIA_LABEL, label);
  10324. }
  10325. }
  10326. /**
  10327. * @param {string} dataAttr
  10328. * @return {!IconToggleState}
  10329. */
  10330. }, {
  10331. key: 'parseJsonDataAttr_',
  10332. value: function parseJsonDataAttr_(dataAttr) {
  10333. var val = this.adapter_.getAttr(dataAttr);
  10334. if (!val) {
  10335. return {};
  10336. }
  10337. return (/** @type {!IconToggleState} */JSON.parse(val)
  10338. );
  10339. }
  10340. /** @return {boolean} */
  10341. }, {
  10342. key: 'isDisabled',
  10343. value: function isDisabled() {
  10344. return this.disabled_;
  10345. }
  10346. /** @param {boolean} isDisabled */
  10347. }, {
  10348. key: 'setDisabled',
  10349. value: function setDisabled(isDisabled) {
  10350. this.disabled_ = isDisabled;
  10351. var DISABLED = MDCIconToggleFoundation.cssClasses.DISABLED;
  10352. var ARIA_DISABLED = MDCIconToggleFoundation.strings.ARIA_DISABLED;
  10353. if (this.disabled_) {
  10354. this.savedTabIndex_ = this.adapter_.getTabIndex();
  10355. this.adapter_.setTabIndex(-1);
  10356. this.adapter_.setAttr(ARIA_DISABLED, 'true');
  10357. this.adapter_.addClass(DISABLED);
  10358. } else {
  10359. this.adapter_.setTabIndex(this.savedTabIndex_);
  10360. this.adapter_.rmAttr(ARIA_DISABLED);
  10361. this.adapter_.removeClass(DISABLED);
  10362. }
  10363. }
  10364. /** @return {boolean} */
  10365. }, {
  10366. key: 'isKeyboardActivated',
  10367. value: function isKeyboardActivated() {
  10368. return this.isHandlingKeydown_;
  10369. }
  10370. }]);
  10371. return MDCIconToggleFoundation;
  10372. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10373. /**
  10374. * @typedef {{
  10375. * key: string,
  10376. * keyCode: number
  10377. * }}
  10378. */
  10379. var KeyboardKey = void 0;
  10380. /**
  10381. * @param {!KeyboardKey} keyboardKey
  10382. * @return {boolean}
  10383. */
  10384. function isSpace(keyboardKey) {
  10385. return keyboardKey.key === 'Space' || keyboardKey.keyCode === 32;
  10386. }
  10387. /** @record */
  10388. var IconToggleState = function IconToggleState() {
  10389. _classCallCheck(this, IconToggleState);
  10390. };
  10391. /**
  10392. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  10393. * @export {string|undefined}
  10394. */
  10395. IconToggleState.prototype.label;
  10396. /**
  10397. * The text for the icon toggle, or undefined if there is no text.
  10398. * @export {string|undefined}
  10399. */
  10400. IconToggleState.prototype.content;
  10401. /**
  10402. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  10403. * @export {string|undefined}
  10404. */
  10405. IconToggleState.prototype.cssClass;
  10406. /* harmony default export */ __webpack_exports__["a"] = (MDCIconToggleFoundation);
  10407. /***/ }),
  10408. /* 90 */
  10409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10410. "use strict";
  10411. /* unused harmony export MDCIconToggleAdapter */
  10412. /* unused harmony export IconToggleEvent */
  10413. 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; }; }();
  10414. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10415. /**
  10416. * @license
  10417. * Copyright 2017 Google Inc. All Rights Reserved.
  10418. *
  10419. * Licensed under the Apache License, Version 2.0 (the "License");
  10420. * you may not use this file except in compliance with the License.
  10421. * You may obtain a copy of the License at
  10422. *
  10423. * http://www.apache.org/licenses/LICENSE-2.0
  10424. *
  10425. * Unless required by applicable law or agreed to in writing, software
  10426. * distributed under the License is distributed on an "AS IS" BASIS,
  10427. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10428. * See the License for the specific language governing permissions and
  10429. * limitations under the License.
  10430. */
  10431. /* eslint no-unused-vars: [2, {"args": "none"}] */
  10432. /**
  10433. * Adapter for MDC Icon Toggle. Provides an interface for managing
  10434. * - classes
  10435. * - dom
  10436. * - inner text
  10437. * - event handlers
  10438. * - event dispatch
  10439. *
  10440. * Additionally, provides type information for the adapter to the Closure
  10441. * compiler.
  10442. *
  10443. * Implement this adapter for your framework of choice to delegate updates to
  10444. * the component in your framework of choice. See architecture documentation
  10445. * for more details.
  10446. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  10447. *
  10448. * @record
  10449. */
  10450. var MDCIconToggleAdapter = function () {
  10451. function MDCIconToggleAdapter() {
  10452. _classCallCheck(this, MDCIconToggleAdapter);
  10453. }
  10454. _createClass(MDCIconToggleAdapter, [{
  10455. key: "addClass",
  10456. /** @param {string} className */
  10457. value: function addClass(className) {}
  10458. /** @param {string} className */
  10459. }, {
  10460. key: "removeClass",
  10461. value: function removeClass(className) {}
  10462. /**
  10463. * @param {string} type
  10464. * @param {!EventListener} handler
  10465. */
  10466. }, {
  10467. key: "registerInteractionHandler",
  10468. value: function registerInteractionHandler(type, handler) {}
  10469. /**
  10470. * @param {string} type
  10471. * @param {!EventListener} handler
  10472. */
  10473. }, {
  10474. key: "deregisterInteractionHandler",
  10475. value: function deregisterInteractionHandler(type, handler) {}
  10476. /** @param {string} text */
  10477. }, {
  10478. key: "setText",
  10479. value: function setText(text) {}
  10480. /** @return {number} */
  10481. }, {
  10482. key: "getTabIndex",
  10483. value: function getTabIndex() {}
  10484. /** @param {number} tabIndex */
  10485. }, {
  10486. key: "setTabIndex",
  10487. value: function setTabIndex(tabIndex) {}
  10488. /**
  10489. * @param {string} name
  10490. * @return {string}
  10491. */
  10492. }, {
  10493. key: "getAttr",
  10494. value: function getAttr(name) {}
  10495. /**
  10496. * @param {string} name
  10497. * @param {string} value
  10498. */
  10499. }, {
  10500. key: "setAttr",
  10501. value: function setAttr(name, value) {}
  10502. /** @param {string} name */
  10503. }, {
  10504. key: "rmAttr",
  10505. value: function rmAttr(name) {}
  10506. /** @param {!IconToggleEvent} evtData */
  10507. }, {
  10508. key: "notifyChange",
  10509. value: function notifyChange(evtData) {}
  10510. }]);
  10511. return MDCIconToggleAdapter;
  10512. }();
  10513. /**
  10514. * @typedef {{
  10515. * isOn: boolean,
  10516. * }}
  10517. */
  10518. var IconToggleEvent = void 0;
  10519. /***/ }),
  10520. /* 91 */
  10521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10522. "use strict";
  10523. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10524. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10525. /**
  10526. * @license
  10527. * Copyright 2016 Google Inc. All Rights Reserved.
  10528. *
  10529. * Licensed under the Apache License, Version 2.0 (the "License");
  10530. * you may not use this file except in compliance with the License.
  10531. * You may obtain a copy of the License at
  10532. *
  10533. * http://www.apache.org/licenses/LICENSE-2.0
  10534. *
  10535. * Unless required by applicable law or agreed to in writing, software
  10536. * distributed under the License is distributed on an "AS IS" BASIS,
  10537. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10538. * See the License for the specific language governing permissions and
  10539. * limitations under the License.
  10540. */
  10541. /** @enum {string} */
  10542. var cssClasses = {
  10543. ROOT: 'mdc-icon-toggle',
  10544. DISABLED: 'mdc-icon-toggle--disabled'
  10545. };
  10546. /** @enum {string} */
  10547. var strings = {
  10548. DATA_TOGGLE_ON: 'data-toggle-on',
  10549. DATA_TOGGLE_OFF: 'data-toggle-off',
  10550. ARIA_PRESSED: 'aria-pressed',
  10551. ARIA_DISABLED: 'aria-disabled',
  10552. ARIA_LABEL: 'aria-label',
  10553. CHANGE_EVENT: 'MDCIconToggle:change'
  10554. };
  10555. /***/ }),
  10556. /* 92 */
  10557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10558. "use strict";
  10559. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgress", function() { return MDCLinearProgress; });
  10561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  10562. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(93);
  10563. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgressFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  10564. 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; }; }();
  10565. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10566. 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; }
  10567. 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; }
  10568. /**
  10569. * Copyright 2017 Google Inc. All Rights Reserved.
  10570. *
  10571. * Licensed under the Apache License, Version 2.0 (the "License");
  10572. * you may not use this file except in compliance with the License.
  10573. * You may obtain a copy of the License at
  10574. *
  10575. * http://www.apache.org/licenses/LICENSE-2.0
  10576. *
  10577. * Unless required by applicable law or agreed to in writing, software
  10578. * distributed under the License is distributed on an "AS IS" BASIS,
  10579. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10580. * See the License for the specific language governing permissions and
  10581. * limitations under the License.
  10582. */
  10583. var MDCLinearProgress = function (_MDCComponent) {
  10584. _inherits(MDCLinearProgress, _MDCComponent);
  10585. function MDCLinearProgress() {
  10586. _classCallCheck(this, MDCLinearProgress);
  10587. return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
  10588. }
  10589. _createClass(MDCLinearProgress, [{
  10590. key: 'open',
  10591. value: function open() {
  10592. this.foundation_.open();
  10593. }
  10594. }, {
  10595. key: 'close',
  10596. value: function close() {
  10597. this.foundation_.close();
  10598. }
  10599. }, {
  10600. key: 'getDefaultFoundation',
  10601. value: function getDefaultFoundation() {
  10602. var _this2 = this;
  10603. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  10604. addClass: function addClass(className) {
  10605. return _this2.root_.classList.add(className);
  10606. },
  10607. getPrimaryBar: function getPrimaryBar() {
  10608. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.PRIMARY_BAR_SELECTOR);
  10609. },
  10610. getBuffer: function getBuffer() {
  10611. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.BUFFER_SELECTOR);
  10612. },
  10613. hasClass: function hasClass(className) {
  10614. return _this2.root_.classList.contains(className);
  10615. },
  10616. removeClass: function removeClass(className) {
  10617. return _this2.root_.classList.remove(className);
  10618. },
  10619. setStyle: function setStyle(el, styleProperty, value) {
  10620. return el.style[styleProperty] = value;
  10621. }
  10622. });
  10623. }
  10624. }, {
  10625. key: 'determinate',
  10626. set: function set(value) {
  10627. this.foundation_.setDeterminate(value);
  10628. }
  10629. }, {
  10630. key: 'progress',
  10631. set: function set(value) {
  10632. this.foundation_.setProgress(value);
  10633. }
  10634. }, {
  10635. key: 'buffer',
  10636. set: function set(value) {
  10637. this.foundation_.setBuffer(value);
  10638. }
  10639. }, {
  10640. key: 'reverse',
  10641. set: function set(value) {
  10642. this.foundation_.setReverse(value);
  10643. }
  10644. }], [{
  10645. key: 'attachTo',
  10646. value: function attachTo(root) {
  10647. return new MDCLinearProgress(root);
  10648. }
  10649. }]);
  10650. return MDCLinearProgress;
  10651. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  10652. /***/ }),
  10653. /* 93 */
  10654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10655. "use strict";
  10656. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  10657. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_index__ = __webpack_require__(9);
  10658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(94);
  10659. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  10660. 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; }; }();
  10661. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10662. 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; }
  10663. 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; }
  10664. /**
  10665. * Copyright 2017 Google Inc. All Rights Reserved.
  10666. *
  10667. * Licensed under the Apache License, Version 2.0 (the "License");
  10668. * you may not use this file except in compliance with the License.
  10669. * You may obtain a copy of the License at
  10670. *
  10671. * http://www.apache.org/licenses/LICENSE-2.0
  10672. *
  10673. * Unless required by applicable law or agreed to in writing, software
  10674. * distributed under the License is distributed on an "AS IS" BASIS,
  10675. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10676. * See the License for the specific language governing permissions and
  10677. * limitations under the License.
  10678. */
  10679. var MDCLinearProgressFoundation = function (_MDCFoundation) {
  10680. _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  10681. _createClass(MDCLinearProgressFoundation, null, [{
  10682. key: 'cssClasses',
  10683. get: function get() {
  10684. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  10685. }
  10686. }, {
  10687. key: 'strings',
  10688. get: function get() {
  10689. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  10690. }
  10691. }, {
  10692. key: 'defaultAdapter',
  10693. get: function get() {
  10694. return {
  10695. addClass: function addClass() /* className: string */{},
  10696. getPrimaryBar: function getPrimaryBar() /* el: Element */{},
  10697. getBuffer: function getBuffer() /* el: Element */{},
  10698. hasClass: function hasClass() {
  10699. return (/* className: string */false
  10700. );
  10701. },
  10702. removeClass: function removeClass() /* className: string */{},
  10703. setStyle: function setStyle() /* el: Element, styleProperty: string, value: string */{}
  10704. };
  10705. }
  10706. }]);
  10707. function MDCLinearProgressFoundation(adapter) {
  10708. _classCallCheck(this, MDCLinearProgressFoundation);
  10709. return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, _extends(MDCLinearProgressFoundation.defaultAdapter, adapter)));
  10710. }
  10711. _createClass(MDCLinearProgressFoundation, [{
  10712. key: 'init',
  10713. value: function init() {
  10714. this.determinate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  10715. this.reverse_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  10716. this.progress_ = 0;
  10717. }
  10718. }, {
  10719. key: 'setDeterminate',
  10720. value: function setDeterminate(isDeterminate) {
  10721. this.determinate_ = isDeterminate;
  10722. if (this.determinate_) {
  10723. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  10724. this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
  10725. } else {
  10726. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  10727. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  10728. this.setScale_(this.adapter_.getBuffer(), 1);
  10729. }
  10730. }
  10731. }, {
  10732. key: 'setProgress',
  10733. value: function setProgress(value) {
  10734. this.progress_ = value;
  10735. if (this.determinate_) {
  10736. this.setScale_(this.adapter_.getPrimaryBar(), value);
  10737. }
  10738. }
  10739. }, {
  10740. key: 'setBuffer',
  10741. value: function setBuffer(value) {
  10742. if (this.determinate_) {
  10743. this.setScale_(this.adapter_.getBuffer(), value);
  10744. }
  10745. }
  10746. }, {
  10747. key: 'setReverse',
  10748. value: function setReverse(isReversed) {
  10749. this.reverse_ = isReversed;
  10750. if (this.reverse_) {
  10751. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  10752. } else {
  10753. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  10754. }
  10755. }
  10756. }, {
  10757. key: 'open',
  10758. value: function open() {
  10759. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  10760. }
  10761. }, {
  10762. key: 'close',
  10763. value: function close() {
  10764. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  10765. }
  10766. }, {
  10767. key: 'setScale_',
  10768. value: function setScale_(el, scaleValue) {
  10769. var _this2 = this;
  10770. var value = 'scaleX(' + scaleValue + ')';
  10771. __WEBPACK_IMPORTED_MODULE_1__material_animation_index__["c" /* transformStyleProperties */].forEach(function (transformStyleProperty) {
  10772. _this2.adapter_.setStyle(el, transformStyleProperty, value);
  10773. });
  10774. }
  10775. }]);
  10776. return MDCLinearProgressFoundation;
  10777. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  10778. /* harmony default export */ __webpack_exports__["a"] = (MDCLinearProgressFoundation);
  10779. /***/ }),
  10780. /* 94 */
  10781. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10782. "use strict";
  10783. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10785. /**
  10786. * Copyright 2017 Google Inc. All Rights Reserved.
  10787. *
  10788. * Licensed under the Apache License, Version 2.0 (the "License");
  10789. * you may not use this file except in compliance with the License.
  10790. * You may obtain a copy of the License at
  10791. *
  10792. * http://www.apache.org/licenses/LICENSE-2.0
  10793. *
  10794. * Unless required by applicable law or agreed to in writing, software
  10795. * distributed under the License is distributed on an "AS IS" BASIS,
  10796. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10797. * See the License for the specific language governing permissions and
  10798. * limitations under the License.
  10799. */
  10800. var cssClasses = {
  10801. CLOSED_CLASS: 'mdc-linear-progress--closed',
  10802. INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
  10803. REVERSED_CLASS: 'mdc-linear-progress--reversed'
  10804. };
  10805. var strings = {
  10806. PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
  10807. BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  10808. };
  10809. /***/ }),
  10810. /* 95 */
  10811. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10812. "use strict";
  10813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(29);
  10815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(96);
  10816. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  10817. 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; }; }();
  10818. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10819. 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; }
  10820. 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; }
  10821. /**
  10822. * @license
  10823. * Copyright 2018 Google Inc. All Rights Reserved.
  10824. *
  10825. * Licensed under the Apache License, Version 2.0 (the "License");
  10826. * you may not use this file except in compliance with the License.
  10827. * You may obtain a copy of the License at
  10828. *
  10829. * http://www.apache.org/licenses/LICENSE-2.0
  10830. *
  10831. * Unless required by applicable law or agreed to in writing, software
  10832. * distributed under the License is distributed on an "AS IS" BASIS,
  10833. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10834. * See the License for the specific language governing permissions and
  10835. * limitations under the License.
  10836. */
  10837. /**
  10838. * @extends {MDCFoundation<!MDCLineRippleAdapter>}
  10839. * @final
  10840. */
  10841. var MDCLineRippleFoundation = function (_MDCFoundation) {
  10842. _inherits(MDCLineRippleFoundation, _MDCFoundation);
  10843. _createClass(MDCLineRippleFoundation, null, [{
  10844. key: 'cssClasses',
  10845. /** @return enum {string} */
  10846. get: function get() {
  10847. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  10848. }
  10849. /**
  10850. * {@see MDCLineRippleAdapter} for typing information on parameters and return
  10851. * types.
  10852. * @return {!MDCLineRippleAdapter}
  10853. */
  10854. }, {
  10855. key: 'defaultAdapter',
  10856. get: function get() {
  10857. return (/** @type {!MDCLineRippleAdapter} */{
  10858. addClass: function addClass() {},
  10859. removeClass: function removeClass() {},
  10860. hasClass: function hasClass() {},
  10861. setStyle: function setStyle() {},
  10862. registerEventHandler: function registerEventHandler() {},
  10863. deregisterEventHandler: function deregisterEventHandler() {}
  10864. }
  10865. );
  10866. }
  10867. /**
  10868. * @param {!MDCLineRippleAdapter=} adapter
  10869. */
  10870. }]);
  10871. function MDCLineRippleFoundation() {
  10872. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /** @type {!MDCLineRippleAdapter} */{};
  10873. _classCallCheck(this, MDCLineRippleFoundation);
  10874. /** @private {function(!Event): undefined} */
  10875. var _this = _possibleConstructorReturn(this, (MDCLineRippleFoundation.__proto__ || Object.getPrototypeOf(MDCLineRippleFoundation)).call(this, _extends(MDCLineRippleFoundation.defaultAdapter, adapter)));
  10876. _this.transitionEndHandler_ = function (evt) {
  10877. return _this.handleTransitionEnd(evt);
  10878. };
  10879. return _this;
  10880. }
  10881. _createClass(MDCLineRippleFoundation, [{
  10882. key: 'init',
  10883. value: function init() {
  10884. this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);
  10885. }
  10886. }, {
  10887. key: 'destroy',
  10888. value: function destroy() {
  10889. this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);
  10890. }
  10891. /**
  10892. * Activates the line ripple
  10893. */
  10894. }, {
  10895. key: 'activate',
  10896. value: function activate() {
  10897. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  10898. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  10899. }
  10900. /**
  10901. * Sets the center of the ripple animation to the given X coordinate.
  10902. * @param {number} xCoordinate
  10903. */
  10904. }, {
  10905. key: 'setRippleCenter',
  10906. value: function setRippleCenter(xCoordinate) {
  10907. this.adapter_.setStyle('transform-origin', xCoordinate + 'px center');
  10908. }
  10909. /**
  10910. * Deactivates the line ripple
  10911. */
  10912. }, {
  10913. key: 'deactivate',
  10914. value: function deactivate() {
  10915. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  10916. }
  10917. /**
  10918. * Handles a transition end event
  10919. * @param {!Event} evt
  10920. */
  10921. }, {
  10922. key: 'handleTransitionEnd',
  10923. value: function handleTransitionEnd(evt) {
  10924. // Wait for the line ripple to be either transparent or opaque
  10925. // before emitting the animation end event
  10926. var isDeactivating = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  10927. if (evt.propertyName === 'opacity') {
  10928. if (isDeactivating) {
  10929. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  10930. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  10931. }
  10932. }
  10933. }
  10934. }]);
  10935. return MDCLineRippleFoundation;
  10936. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10937. /* harmony default export */ __webpack_exports__["a"] = (MDCLineRippleFoundation);
  10938. /***/ }),
  10939. /* 96 */
  10940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10941. "use strict";
  10942. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10943. /**
  10944. * @license
  10945. * Copyright 2018 Google Inc. All Rights Reserved.
  10946. *
  10947. * Licensed under the Apache License, Version 2.0 (the "License");
  10948. * you may not use this file except in compliance with the License.
  10949. * You may obtain a copy of the License at
  10950. *
  10951. * http://www.apache.org/licenses/LICENSE-2.0
  10952. *
  10953. * Unless required by applicable law or agreed to in writing, software
  10954. * distributed under the License is distributed on an "AS IS" BASIS,
  10955. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10956. * See the License for the specific language governing permissions and
  10957. * limitations under the License.
  10958. */
  10959. /** @enum {string} */
  10960. var cssClasses = {
  10961. LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
  10962. LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating'
  10963. };
  10964. /***/ }),
  10965. /* 97 */
  10966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10967. "use strict";
  10968. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10969. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCList", function() { return MDCList; });
  10970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  10971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(98);
  10972. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(30);
  10973. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(31);
  10974. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  10975. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  10976. 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; }; }();
  10977. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10978. 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; }
  10979. 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; }
  10980. /**
  10981. * @license
  10982. * Copyright 2018 Google Inc. All Rights Reserved.
  10983. *
  10984. * Licensed under the Apache License, Version 2.0 (the "License");
  10985. * you may not use this file except in compliance with the License.
  10986. * You may obtain a copy of the License at
  10987. *
  10988. * http://www.apache.org/licenses/LICENSE-2.0
  10989. *
  10990. * Unless required by applicable law or agreed to in writing, software
  10991. * distributed under the License is distributed on an "AS IS" BASIS,
  10992. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10993. * See the License for the specific language governing permissions and
  10994. * limitations under the License.
  10995. */
  10996. /**
  10997. * @extends MDCComponent<!MDCListFoundation>
  10998. */
  10999. var MDCList = function (_MDCComponent) {
  11000. _inherits(MDCList, _MDCComponent);
  11001. /** @param {...?} args */
  11002. function MDCList() {
  11003. var _ref;
  11004. _classCallCheck(this, MDCList);
  11005. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11006. args[_key] = arguments[_key];
  11007. }
  11008. /** @private {!Function} */
  11009. var _this = _possibleConstructorReturn(this, (_ref = MDCList.__proto__ || Object.getPrototypeOf(MDCList)).call.apply(_ref, [this].concat(args)));
  11010. _this.handleKeydown_;
  11011. /** @private {!Function} */
  11012. _this.handleClick_;
  11013. /** @private {!Function} */
  11014. _this.focusInEventListener_;
  11015. /** @private {!Function} */
  11016. _this.focusOutEventListener_;
  11017. return _this;
  11018. }
  11019. /**
  11020. * @param {!Element} root
  11021. * @return {!MDCList}
  11022. */
  11023. _createClass(MDCList, [{
  11024. key: 'destroy',
  11025. value: function destroy() {
  11026. this.root_.removeEventListener('keydown', this.handleKeydown_);
  11027. this.root_.removeEventListener('click', this.handleClick_);
  11028. this.root_.removeEventListener('focusin', this.focusInEventListener_);
  11029. this.root_.removeEventListener('focusout', this.focusOutEventListener_);
  11030. }
  11031. }, {
  11032. key: 'initialSyncWithDOM',
  11033. value: function initialSyncWithDOM() {
  11034. this.handleKeydown_ = this.foundation_.handleKeydown.bind(this.foundation_);
  11035. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  11036. this.focusInEventListener_ = this.foundation_.handleFocusIn.bind(this.foundation_);
  11037. this.focusOutEventListener_ = this.foundation_.handleFocusOut.bind(this.foundation_);
  11038. this.root_.addEventListener('keydown', this.handleKeydown_);
  11039. this.root_.addEventListener('focusin', this.focusInEventListener_);
  11040. this.root_.addEventListener('focusout', this.focusOutEventListener_);
  11041. this.layout();
  11042. }
  11043. }, {
  11044. key: 'layout',
  11045. value: function layout() {
  11046. var direction = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ARIA_ORIENTATION);
  11047. this.vertical = direction === __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ARIA_ORIENTATION_VERTICAL;
  11048. // List items need to have at least tabindex=-1 to be focusable.
  11049. [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])')).forEach(function (ele) {
  11050. ele.setAttribute('tabindex', -1);
  11051. });
  11052. // Child button/a elements are not tabbable until the list item is focused.
  11053. [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS)).forEach(function (ele) {
  11054. return ele.setAttribute('tabindex', -1);
  11055. });
  11056. }
  11057. /** @param {boolean} value */
  11058. }, {
  11059. key: 'getDefaultFoundation',
  11060. /** @return {!MDCListFoundation} */
  11061. value: function getDefaultFoundation() {
  11062. var _this2 = this;
  11063. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]( /** @type {!MDCListAdapter} */_extends({
  11064. getListItemCount: function getListItemCount() {
  11065. return _this2.listElements_.length;
  11066. },
  11067. getFocusedElementIndex: function getFocusedElementIndex() {
  11068. return _this2.listElements_.indexOf(document.activeElement);
  11069. },
  11070. getListItemIndex: function getListItemIndex(node) {
  11071. return _this2.listElements_.indexOf(node);
  11072. },
  11073. setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
  11074. var element = _this2.listElements_[index];
  11075. if (element) {
  11076. element.setAttribute(attr, value);
  11077. }
  11078. },
  11079. removeAttributeForElementIndex: function removeAttributeForElementIndex(index, attr) {
  11080. var element = _this2.listElements_[index];
  11081. if (element) {
  11082. element.removeAttribute(attr);
  11083. }
  11084. },
  11085. addClassForElementIndex: function addClassForElementIndex(index, className) {
  11086. var element = _this2.listElements_[index];
  11087. if (element) {
  11088. element.classList.add(className);
  11089. }
  11090. },
  11091. removeClassForElementIndex: function removeClassForElementIndex(index, className) {
  11092. var element = _this2.listElements_[index];
  11093. if (element) {
  11094. element.classList.remove(className);
  11095. }
  11096. },
  11097. isListItem: function isListItem(target) {
  11098. return target.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].LIST_ITEM_CLASS);
  11099. },
  11100. focusItemAtIndex: function focusItemAtIndex(index) {
  11101. var element = _this2.listElements_[index];
  11102. if (element) {
  11103. element.focus();
  11104. }
  11105. },
  11106. isElementFocusable: function isElementFocusable(ele) {
  11107. if (!ele) return false;
  11108. var matches = Element.prototype.matches;
  11109. if (!matches) {
  11110. // IE uses a different name for the same functionality
  11111. matches = Element.prototype.msMatchesSelector;
  11112. }
  11113. return matches.call(ele, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS);
  11114. },
  11115. setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
  11116. var element = _this2.listElements_[listItemIndex];
  11117. var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS));
  11118. listItemChildren.forEach(function (ele) {
  11119. return ele.setAttribute('tabindex', tabIndexValue);
  11120. });
  11121. }
  11122. }));
  11123. }
  11124. }, {
  11125. key: 'vertical',
  11126. set: function set(value) {
  11127. this.foundation_.setVerticalOrientation(value);
  11128. }
  11129. /** @return Array<!Element>*/
  11130. }, {
  11131. key: 'listElements_',
  11132. get: function get() {
  11133. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ENABLED_ITEMS_SELECTOR));
  11134. }
  11135. /** @param {boolean} value */
  11136. }, {
  11137. key: 'wrapFocus',
  11138. set: function set(value) {
  11139. this.foundation_.setWrapFocus(value);
  11140. }
  11141. /** @param {boolean} isSingleSelectionList */
  11142. }, {
  11143. key: 'singleSelection',
  11144. set: function set(isSingleSelectionList) {
  11145. if (isSingleSelectionList) {
  11146. this.root_.addEventListener('click', this.handleClick_);
  11147. } else {
  11148. this.root_.removeEventListener('click', this.handleClick_);
  11149. }
  11150. this.foundation_.setSingleSelection(isSingleSelectionList);
  11151. var selectedElement = this.root_.querySelector('.mdc-list-item--selected');
  11152. if (selectedElement) {
  11153. this.selectedIndex = this.listElements_.indexOf(selectedElement);
  11154. }
  11155. }
  11156. /** @param {number} index */
  11157. }, {
  11158. key: 'selectedIndex',
  11159. set: function set(index) {
  11160. this.foundation_.setSelectedIndex(index);
  11161. }
  11162. }], [{
  11163. key: 'attachTo',
  11164. value: function attachTo(root) {
  11165. return new MDCList(root);
  11166. }
  11167. }]);
  11168. return MDCList;
  11169. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11170. /***/ }),
  11171. /* 98 */
  11172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11173. "use strict";
  11174. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11175. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(30);
  11176. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(31);
  11177. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  11178. 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; }; }();
  11179. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11180. 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; }
  11181. 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; }
  11182. /**
  11183. * @license
  11184. * Copyright 2018 Google Inc. All Rights Reserved.
  11185. *
  11186. * Licensed under the Apache License, Version 2.0 (the "License");
  11187. * you may not use this file except in compliance with the License.
  11188. * You may obtain a copy of the License at
  11189. *
  11190. * http://www.apache.org/licenses/LICENSE-2.0
  11191. *
  11192. * Unless required by applicable law or agreed to in writing, software
  11193. * distributed under the License is distributed on an "AS IS" BASIS,
  11194. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11195. * See the License for the specific language governing permissions and
  11196. * limitations under the License.
  11197. */
  11198. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];
  11199. var MDCListFoundation = function (_MDCFoundation) {
  11200. _inherits(MDCListFoundation, _MDCFoundation);
  11201. _createClass(MDCListFoundation, null, [{
  11202. key: 'strings',
  11203. /** @return enum {string} */
  11204. get: function get() {
  11205. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  11206. }
  11207. /** @return enum {string} */
  11208. }, {
  11209. key: 'cssClasses',
  11210. get: function get() {
  11211. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11212. }
  11213. /**
  11214. * {@see MDCListAdapter} for typing information on parameters and return
  11215. * types.
  11216. * @return {!MDCListAdapter}
  11217. */
  11218. }, {
  11219. key: 'defaultAdapter',
  11220. get: function get() {
  11221. return (/** @type {!MDCListAdapter} */{
  11222. getListItemCount: function getListItemCount() {},
  11223. getFocusedElementIndex: function getFocusedElementIndex() {},
  11224. getListItemIndex: function getListItemIndex() {},
  11225. setAttributeForElementIndex: function setAttributeForElementIndex() {},
  11226. removeAttributeForElementIndex: function removeAttributeForElementIndex() {},
  11227. addClassForElementIndex: function addClassForElementIndex() {},
  11228. removeClassForElementIndex: function removeClassForElementIndex() {},
  11229. focusItemAtIndex: function focusItemAtIndex() {},
  11230. isElementFocusable: function isElementFocusable() {},
  11231. isListItem: function isListItem() {},
  11232. setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {}
  11233. }
  11234. );
  11235. }
  11236. }]);
  11237. function MDCListFoundation() {
  11238. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /** @type {!MDCListFoundation} */{};
  11239. _classCallCheck(this, MDCListFoundation);
  11240. /** {boolean} */
  11241. var _this = _possibleConstructorReturn(this, (MDCListFoundation.__proto__ || Object.getPrototypeOf(MDCListFoundation)).call(this, _extends(MDCListFoundation.defaultAdapter, adapter)));
  11242. _this.wrapFocus_ = false;
  11243. /** {boolean} */
  11244. _this.isVertical_ = true;
  11245. /** {boolean} */
  11246. _this.isSingleSelectionList_ = false;
  11247. /** {number} */
  11248. _this.selectedIndex_ = -1;
  11249. return _this;
  11250. }
  11251. /**
  11252. * Sets the private wrapFocus_ variable.
  11253. * @param {boolean} value
  11254. */
  11255. _createClass(MDCListFoundation, [{
  11256. key: 'setWrapFocus',
  11257. value: function setWrapFocus(value) {
  11258. this.wrapFocus_ = value;
  11259. }
  11260. /**
  11261. * Sets the isVertical_ private variable.
  11262. * @param {boolean} value
  11263. */
  11264. }, {
  11265. key: 'setVerticalOrientation',
  11266. value: function setVerticalOrientation(value) {
  11267. this.isVertical_ = value;
  11268. }
  11269. /**
  11270. * Sets the isSingleSelectionList_ private variable.
  11271. * @param {boolean} value
  11272. */
  11273. }, {
  11274. key: 'setSingleSelection',
  11275. value: function setSingleSelection(value) {
  11276. this.isSingleSelectionList_ = value;
  11277. }
  11278. /** @param {number} index */
  11279. }, {
  11280. key: 'setSelectedIndex',
  11281. value: function setSelectedIndex(index) {
  11282. if (index === this.selectedIndex_) {
  11283. this.adapter_.removeAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED);
  11284. this.adapter_.removeClassForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
  11285. // Used to reset the first element to tabindex=0 when deselecting a list item.
  11286. // If already on the first list item, leave tabindex at 0.
  11287. if (this.selectedIndex_ >= 0) {
  11288. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
  11289. this.adapter_.setAttributeForElementIndex(0, 'tabindex', 0);
  11290. }
  11291. this.selectedIndex_ = -1;
  11292. return;
  11293. }
  11294. if (this.selectedIndex_ >= 0) {
  11295. this.adapter_.removeAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED);
  11296. this.adapter_.removeClassForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
  11297. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
  11298. }
  11299. if (index >= 0 && this.adapter_.getListItemCount() > index) {
  11300. this.selectedIndex_ = index;
  11301. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, true);
  11302. this.adapter_.addClassForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS);
  11303. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', 0);
  11304. if (this.selectedIndex_ !== 0) {
  11305. this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
  11306. }
  11307. }
  11308. }
  11309. /**
  11310. * Focus in handler for the list items.
  11311. * @param evt
  11312. */
  11313. }, {
  11314. key: 'handleFocusIn',
  11315. value: function handleFocusIn(evt) {
  11316. var listItem = this.getListItem_(evt.target);
  11317. if (!listItem) return;
  11318. var listItemIndex = this.adapter_.getListItemIndex(listItem);
  11319. if (listItemIndex >= 0) {
  11320. this.adapter_.setTabIndexForListItemChildren(listItemIndex, 0);
  11321. }
  11322. }
  11323. /**
  11324. * Focus out handler for the list items.
  11325. * @param {Event} evt
  11326. */
  11327. }, {
  11328. key: 'handleFocusOut',
  11329. value: function handleFocusOut(evt) {
  11330. var listItem = this.getListItem_(evt.target);
  11331. if (!listItem) return;
  11332. var listItemIndex = this.adapter_.getListItemIndex(listItem);
  11333. if (listItemIndex >= 0) {
  11334. this.adapter_.setTabIndexForListItemChildren(listItemIndex, -1);
  11335. }
  11336. }
  11337. /**
  11338. * Key handler for the list.
  11339. * @param {Event} evt
  11340. */
  11341. }, {
  11342. key: 'handleKeydown',
  11343. value: function handleKeydown(evt) {
  11344. var arrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;
  11345. var arrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;
  11346. var arrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;
  11347. var arrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;
  11348. var isHome = evt.key === 'Home' || evt.keyCode === 36;
  11349. var isEnd = evt.key === 'End' || evt.keyCode === 35;
  11350. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  11351. var isSpace = evt.key === 'Space' || evt.keyCode === 32;
  11352. var currentIndex = this.adapter_.getFocusedElementIndex();
  11353. if (currentIndex === -1) {
  11354. currentIndex = this.adapter_.getListItemIndex(this.getListItem_(evt.target));
  11355. if (currentIndex < 0) {
  11356. // If this event doesn't have a mdc-list-item ancestor from the
  11357. // current list (not from a sublist), return early.
  11358. return;
  11359. }
  11360. }
  11361. if (this.isVertical_ && arrowDown || !this.isVertical_ && arrowRight) {
  11362. this.preventDefaultEvent_(evt);
  11363. this.focusNextElement(currentIndex);
  11364. } else if (this.isVertical_ && arrowUp || !this.isVertical_ && arrowLeft) {
  11365. this.preventDefaultEvent_(evt);
  11366. this.focusPrevElement(currentIndex);
  11367. } else if (isHome) {
  11368. this.preventDefaultEvent_(evt);
  11369. this.focusFirstElement();
  11370. } else if (isEnd) {
  11371. this.preventDefaultEvent_(evt);
  11372. this.focusLastElement();
  11373. } else if (this.isSingleSelectionList_ && (isEnter || isSpace)) {
  11374. this.preventDefaultEvent_(evt);
  11375. // Check if the space key was pressed on the list item or a child element.
  11376. if (this.adapter_.isListItem(evt.target)) {
  11377. this.setSelectedIndex(currentIndex);
  11378. }
  11379. }
  11380. }
  11381. /**
  11382. * Click handler for the list.
  11383. */
  11384. }, {
  11385. key: 'handleClick',
  11386. value: function handleClick() {
  11387. var currentIndex = this.adapter_.getFocusedElementIndex();
  11388. if (currentIndex === -1) return;
  11389. this.setSelectedIndex(currentIndex);
  11390. }
  11391. /**
  11392. * Ensures that preventDefault is only called if the containing element doesn't
  11393. * consume the event, and it will cause an unintended scroll.
  11394. * @param {Event} evt
  11395. * @private
  11396. */
  11397. }, {
  11398. key: 'preventDefaultEvent_',
  11399. value: function preventDefaultEvent_(evt) {
  11400. var tagName = ('' + evt.target.tagName).toLowerCase();
  11401. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  11402. evt.preventDefault();
  11403. }
  11404. }
  11405. /**
  11406. * Focuses the next element on the list.
  11407. * @param {number} index
  11408. */
  11409. }, {
  11410. key: 'focusNextElement',
  11411. value: function focusNextElement(index) {
  11412. var count = this.adapter_.getListItemCount();
  11413. var nextIndex = index + 1;
  11414. if (nextIndex >= count) {
  11415. if (this.wrapFocus_) {
  11416. nextIndex = 0;
  11417. } else {
  11418. // Return early because last item is already focused.
  11419. return;
  11420. }
  11421. }
  11422. this.adapter_.focusItemAtIndex(nextIndex);
  11423. }
  11424. /**
  11425. * Focuses the previous element on the list.
  11426. * @param {number} index
  11427. */
  11428. }, {
  11429. key: 'focusPrevElement',
  11430. value: function focusPrevElement(index) {
  11431. var prevIndex = index - 1;
  11432. if (prevIndex < 0) {
  11433. if (this.wrapFocus_) {
  11434. prevIndex = this.adapter_.getListItemCount() - 1;
  11435. } else {
  11436. // Return early because first item is already focused.
  11437. return;
  11438. }
  11439. }
  11440. this.adapter_.focusItemAtIndex(prevIndex);
  11441. }
  11442. }, {
  11443. key: 'focusFirstElement',
  11444. value: function focusFirstElement() {
  11445. if (this.adapter_.getListItemCount() > 0) {
  11446. this.adapter_.focusItemAtIndex(0);
  11447. }
  11448. }
  11449. }, {
  11450. key: 'focusLastElement',
  11451. value: function focusLastElement() {
  11452. var lastIndex = this.adapter_.getListItemCount() - 1;
  11453. if (lastIndex >= 0) {
  11454. this.adapter_.focusItemAtIndex(lastIndex);
  11455. }
  11456. }
  11457. /**
  11458. * Utility method to find the first ancestor with the mdc-list-item class.
  11459. * @param {EventTarget} target
  11460. * @return {?Element}
  11461. * @private
  11462. */
  11463. }, {
  11464. key: 'getListItem_',
  11465. value: function getListItem_(target) {
  11466. while (!this.adapter_.isListItem(target)) {
  11467. if (!target.parentElement) return null;
  11468. target = target.parentElement;
  11469. }
  11470. return target;
  11471. }
  11472. }]);
  11473. return MDCListFoundation;
  11474. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11475. /* harmony default export */ __webpack_exports__["a"] = (MDCListFoundation);
  11476. /***/ }),
  11477. /* 99 */
  11478. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11479. "use strict";
  11480. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenu", function() { return MDCMenu; });
  11482. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  11483. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(100);
  11484. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(101);
  11485. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(32);
  11486. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["b"]; });
  11487. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  11488. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_3__constants__["a"]; });
  11489. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CornerBit", function() { return __WEBPACK_IMPORTED_MODULE_3__constants__["b"]; });
  11490. 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; }; }();
  11491. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11492. 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; }
  11493. 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; }
  11494. /**
  11495. * @license
  11496. * Copyright 2016 Google Inc. All Rights Reserved.
  11497. *
  11498. * Licensed under the Apache License, Version 2.0 (the "License");
  11499. * you may not use this file except in compliance with the License.
  11500. * You may obtain a copy of the License at
  11501. *
  11502. * http://www.apache.org/licenses/LICENSE-2.0
  11503. *
  11504. * Unless required by applicable law or agreed to in writing, software
  11505. * distributed under the License is distributed on an "AS IS" BASIS,
  11506. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11507. * See the License for the specific language governing permissions and
  11508. * limitations under the License.
  11509. */
  11510. /**
  11511. * @extends MDCComponent<!MDCMenuFoundation>
  11512. */
  11513. var MDCMenu = function (_MDCComponent) {
  11514. _inherits(MDCMenu, _MDCComponent);
  11515. /** @param {...?} args */
  11516. function MDCMenu() {
  11517. var _ref;
  11518. _classCallCheck(this, MDCMenu);
  11519. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11520. args[_key] = arguments[_key];
  11521. }
  11522. /** @private {!Element} */
  11523. var _this = _possibleConstructorReturn(this, (_ref = MDCMenu.__proto__ || Object.getPrototypeOf(MDCMenu)).call.apply(_ref, [this].concat(args)));
  11524. _this.previousFocus_;
  11525. return _this;
  11526. }
  11527. /**
  11528. * @param {!Element} root
  11529. * @return {!MDCMenu}
  11530. */
  11531. _createClass(MDCMenu, [{
  11532. key: 'show',
  11533. /** @param {{focusIndex: ?number}=} options */
  11534. value: function show() {
  11535. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11536. _ref2$focusIndex = _ref2.focusIndex,
  11537. focusIndex = _ref2$focusIndex === undefined ? null : _ref2$focusIndex;
  11538. this.foundation_.open({ focusIndex: focusIndex });
  11539. }
  11540. }, {
  11541. key: 'hide',
  11542. value: function hide() {
  11543. this.foundation_.close();
  11544. }
  11545. /**
  11546. * @param {Corner} corner Default anchor corner alignment of top-left
  11547. * menu corner.
  11548. */
  11549. }, {
  11550. key: 'setAnchorCorner',
  11551. value: function setAnchorCorner(corner) {
  11552. this.foundation_.setAnchorCorner(corner);
  11553. }
  11554. /**
  11555. * @param {AnchorMargin} margin
  11556. */
  11557. }, {
  11558. key: 'setAnchorMargin',
  11559. value: function setAnchorMargin(margin) {
  11560. this.foundation_.setAnchorMargin(margin);
  11561. }
  11562. /**
  11563. * Return the item container element inside the component.
  11564. * @return {?Element}
  11565. */
  11566. }, {
  11567. key: 'getOptionByIndex',
  11568. /**
  11569. * Return the item within the menu that is selected.
  11570. * @param {number} index
  11571. * @return {?Element}
  11572. */
  11573. value: function getOptionByIndex(index) {
  11574. var items = this.items;
  11575. if (index < items.length) {
  11576. return this.items[index];
  11577. } else {
  11578. return null;
  11579. }
  11580. }
  11581. /** @param {number} index */
  11582. }, {
  11583. key: 'getDefaultFoundation',
  11584. /** @return {!MDCMenuFoundation} */
  11585. value: function getDefaultFoundation() {
  11586. var _this2 = this;
  11587. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuFoundation */]({
  11588. addClass: function addClass(className) {
  11589. return _this2.root_.classList.add(className);
  11590. },
  11591. removeClass: function removeClass(className) {
  11592. return _this2.root_.classList.remove(className);
  11593. },
  11594. hasClass: function hasClass(className) {
  11595. return _this2.root_.classList.contains(className);
  11596. },
  11597. hasNecessaryDom: function hasNecessaryDom() {
  11598. return Boolean(_this2.itemsContainer_);
  11599. },
  11600. getAttributeForEventTarget: function getAttributeForEventTarget(target, attributeName) {
  11601. return target.getAttribute(attributeName);
  11602. },
  11603. getInnerDimensions: function getInnerDimensions() {
  11604. var itemsContainer = _this2.itemsContainer_;
  11605. return { width: itemsContainer.offsetWidth, height: itemsContainer.offsetHeight };
  11606. },
  11607. hasAnchor: function hasAnchor() {
  11608. return _this2.root_.parentElement && _this2.root_.parentElement.classList.contains('mdc-menu-anchor');
  11609. },
  11610. getAnchorDimensions: function getAnchorDimensions() {
  11611. return _this2.root_.parentElement.getBoundingClientRect();
  11612. },
  11613. getWindowDimensions: function getWindowDimensions() {
  11614. return { width: window.innerWidth, height: window.innerHeight };
  11615. },
  11616. getNumberOfItems: function getNumberOfItems() {
  11617. return _this2.items.length;
  11618. },
  11619. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  11620. return _this2.root_.addEventListener(type, handler);
  11621. },
  11622. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  11623. return _this2.root_.removeEventListener(type, handler);
  11624. },
  11625. registerBodyClickHandler: function registerBodyClickHandler(handler) {
  11626. return document.body.addEventListener('click', handler);
  11627. },
  11628. deregisterBodyClickHandler: function deregisterBodyClickHandler(handler) {
  11629. return document.body.removeEventListener('click', handler);
  11630. },
  11631. getIndexForEventTarget: function getIndexForEventTarget(target) {
  11632. return _this2.items.indexOf(target);
  11633. },
  11634. notifySelected: function notifySelected(evtData) {
  11635. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuFoundation */].strings.SELECTED_EVENT, {
  11636. index: evtData.index,
  11637. item: _this2.items[evtData.index]
  11638. });
  11639. },
  11640. notifyCancel: function notifyCancel() {
  11641. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuFoundation */].strings.CANCEL_EVENT, {});
  11642. },
  11643. saveFocus: function saveFocus() {
  11644. _this2.previousFocus_ = document.activeElement;
  11645. },
  11646. restoreFocus: function restoreFocus() {
  11647. if (_this2.previousFocus_ && _this2.previousFocus_.focus) {
  11648. _this2.previousFocus_.focus();
  11649. }
  11650. },
  11651. isFocused: function isFocused() {
  11652. return document.activeElement === _this2.root_;
  11653. },
  11654. focus: function focus() {
  11655. return _this2.root_.focus();
  11656. },
  11657. getFocusedItemIndex: function getFocusedItemIndex() {
  11658. return _this2.items.indexOf(document.activeElement);
  11659. },
  11660. focusItemAtIndex: function focusItemAtIndex(index) {
  11661. return _this2.items[index].focus();
  11662. },
  11663. isRtl: function isRtl() {
  11664. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  11665. },
  11666. setTransformOrigin: function setTransformOrigin(origin) {
  11667. _this2.root_.style[Object(__WEBPACK_IMPORTED_MODULE_1__util__["a" /* getTransformPropertyName */])(window) + '-origin'] = origin;
  11668. },
  11669. setPosition: function setPosition(position) {
  11670. _this2.root_.style.left = 'left' in position ? position.left : null;
  11671. _this2.root_.style.right = 'right' in position ? position.right : null;
  11672. _this2.root_.style.top = 'top' in position ? position.top : null;
  11673. _this2.root_.style.bottom = 'bottom' in position ? position.bottom : null;
  11674. },
  11675. setMaxHeight: function setMaxHeight(height) {
  11676. _this2.root_.style.maxHeight = height;
  11677. },
  11678. setAttrForOptionAtIndex: function setAttrForOptionAtIndex(index, attr, value) {
  11679. return _this2.items[index].setAttribute(attr, value);
  11680. },
  11681. rmAttrForOptionAtIndex: function rmAttrForOptionAtIndex(index, attr) {
  11682. return _this2.items[index].removeAttribute(attr);
  11683. },
  11684. addClassForOptionAtIndex: function addClassForOptionAtIndex(index, className) {
  11685. return _this2.items[index].classList.add(className);
  11686. },
  11687. rmClassForOptionAtIndex: function rmClassForOptionAtIndex(index, className) {
  11688. return _this2.items[index].classList.remove(className);
  11689. }
  11690. });
  11691. }
  11692. }, {
  11693. key: 'open',
  11694. /** @return {boolean} */
  11695. get: function get() {
  11696. return this.foundation_.isOpen();
  11697. }
  11698. /** @param {boolean} value */
  11699. ,
  11700. set: function set(value) {
  11701. if (value) {
  11702. this.foundation_.open();
  11703. } else {
  11704. this.foundation_.close();
  11705. }
  11706. }
  11707. }, {
  11708. key: 'itemsContainer_',
  11709. get: function get() {
  11710. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuFoundation */].strings.ITEMS_SELECTOR);
  11711. }
  11712. /**
  11713. * Return the items within the menu. Note that this only contains the set of elements within
  11714. * the items container that are proper list items, and not supplemental / presentational DOM
  11715. * elements.
  11716. * @return {!Array<!Element>}
  11717. */
  11718. }, {
  11719. key: 'items',
  11720. get: function get() {
  11721. var itemsContainer = this.itemsContainer_;
  11722. return [].slice.call(itemsContainer.querySelectorAll('.mdc-list-item[role]'));
  11723. }
  11724. }, {
  11725. key: 'selectedItemIndex',
  11726. set: function set(index) {
  11727. this.foundation_.setSelectedIndex(index);
  11728. }
  11729. /** @return {number} */
  11730. ,
  11731. get: function get() {
  11732. return this.foundation_.getSelectedIndex();
  11733. }
  11734. /** @param {!boolean} rememberSelection */
  11735. }, {
  11736. key: 'rememberSelection',
  11737. set: function set(rememberSelection) {
  11738. this.foundation_.setRememberSelection(rememberSelection);
  11739. }
  11740. /** @param {boolean} quickOpen */
  11741. }, {
  11742. key: 'quickOpen',
  11743. set: function set(quickOpen) {
  11744. this.foundation_.setQuickOpen(quickOpen);
  11745. }
  11746. }], [{
  11747. key: 'attachTo',
  11748. value: function attachTo(root) {
  11749. return new MDCMenu(root);
  11750. }
  11751. }]);
  11752. return MDCMenu;
  11753. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11754. /***/ }),
  11755. /* 100 */
  11756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11757. "use strict";
  11758. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getTransformPropertyName; });
  11759. /* unused harmony export clamp */
  11760. /* unused harmony export bezierProgress */
  11761. /**
  11762. * Copyright 2016 Google Inc. All Rights Reserved.
  11763. *
  11764. * Licensed under the Apache License, Version 2.0 (the "License");
  11765. * you may not use this file except in compliance with the License.
  11766. * You may obtain a copy of the License at
  11767. *
  11768. * http://www.apache.org/licenses/LICENSE-2.0
  11769. *
  11770. * Unless required by applicable law or agreed to in writing, software
  11771. * distributed under the License is distributed on an "AS IS" BASIS,
  11772. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11773. * See the License for the specific language governing permissions and
  11774. * limitations under the License.
  11775. */
  11776. /** @type {string|undefined} */
  11777. var storedTransformPropertyName_ = void 0;
  11778. /**
  11779. * Returns the name of the correct transform property to use on the current browser.
  11780. * @param {!Window} globalObj
  11781. * @param {boolean=} forceRefresh
  11782. * @return {string}
  11783. */
  11784. function getTransformPropertyName(globalObj) {
  11785. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  11786. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  11787. var el = globalObj.document.createElement('div');
  11788. var transformPropertyName = 'transform' in el.style ? 'transform' : 'webkitTransform';
  11789. storedTransformPropertyName_ = transformPropertyName;
  11790. }
  11791. return storedTransformPropertyName_;
  11792. }
  11793. /**
  11794. * Clamps a value between the minimum and the maximum, returning the clamped value.
  11795. * @param {number} value
  11796. * @param {number} min
  11797. * @param {number} max
  11798. * @return {number}
  11799. */
  11800. function clamp(value) {
  11801. var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  11802. var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
  11803. return Math.min(max, Math.max(min, value));
  11804. }
  11805. /**
  11806. * Returns the easing value to apply at time t, for a given cubic bezier curve.
  11807. * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively.
  11808. * Parameters are as follows:
  11809. * - time: The current time in the animation, scaled between 0 and 1.
  11810. * - x1: The x value of control point P1.
  11811. * - y1: The y value of control point P1.
  11812. * - x2: The x value of control point P2.
  11813. * - y2: The y value of control point P2.
  11814. * @param {number} time
  11815. * @param {number} x1
  11816. * @param {number} y1
  11817. * @param {number} x2
  11818. * @param {number} y2
  11819. * @return {number}
  11820. */
  11821. function bezierProgress(time, x1, y1, x2, y2) {
  11822. return getBezierCoordinate_(solvePositionFromXValue_(time, x1, x2), y1, y2);
  11823. }
  11824. /**
  11825. * Compute a single coordinate at a position point between 0 and 1.
  11826. * c1 and c2 are the matching coordinate on control points P1 and P2, respectively.
  11827. * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively.
  11828. * Adapted from https://github.com/google/closure-library/blob/master/closure/goog/math/bezier.js.
  11829. * @param {number} t
  11830. * @param {number} c1
  11831. * @param {number} c2
  11832. * @return {number}
  11833. */
  11834. function getBezierCoordinate_(t, c1, c2) {
  11835. // Special case start and end.
  11836. if (t === 0 || t === 1) {
  11837. return t;
  11838. }
  11839. // Step one - from 4 points to 3
  11840. var ic0 = t * c1;
  11841. var ic1 = c1 + t * (c2 - c1);
  11842. var ic2 = c2 + t * (1 - c2);
  11843. // Step two - from 3 points to 2
  11844. ic0 += t * (ic1 - ic0);
  11845. ic1 += t * (ic2 - ic1);
  11846. // Final step - last point
  11847. return ic0 + t * (ic1 - ic0);
  11848. }
  11849. /**
  11850. * Project a point onto the Bezier curve, from a given X. Calculates the position t along the curve.
  11851. * Adapted from https://github.com/google/closure-library/blob/master/closure/goog/math/bezier.js.
  11852. * @param {number} xVal
  11853. * @param {number} x1
  11854. * @param {number} x2
  11855. * @return {number}
  11856. */
  11857. function solvePositionFromXValue_(xVal, x1, x2) {
  11858. var EPSILON = 1e-6;
  11859. var MAX_ITERATIONS = 8;
  11860. if (xVal <= 0) {
  11861. return 0;
  11862. } else if (xVal >= 1) {
  11863. return 1;
  11864. }
  11865. // Initial estimate of t using linear interpolation.
  11866. var t = xVal;
  11867. // Try gradient descent to solve for t. If it works, it is very fast.
  11868. var tMin = 0;
  11869. var tMax = 1;
  11870. var value = 0;
  11871. for (var i = 0; i < MAX_ITERATIONS; i++) {
  11872. value = getBezierCoordinate_(t, x1, x2);
  11873. var derivative = (getBezierCoordinate_(t + EPSILON, x1, x2) - value) / EPSILON;
  11874. if (Math.abs(value - xVal) < EPSILON) {
  11875. return t;
  11876. } else if (Math.abs(derivative) < EPSILON) {
  11877. break;
  11878. } else {
  11879. if (value < xVal) {
  11880. tMin = t;
  11881. } else {
  11882. tMax = t;
  11883. }
  11884. t -= (value - xVal) / derivative;
  11885. }
  11886. }
  11887. // If the gradient descent got stuck in a local minimum, e.g. because
  11888. // the derivative was close to 0, use a Dichotomy refinement instead.
  11889. // We limit the number of interations to 8.
  11890. for (var _i = 0; Math.abs(value - xVal) > EPSILON && _i < MAX_ITERATIONS; _i++) {
  11891. if (value < xVal) {
  11892. tMin = t;
  11893. t = (t + tMax) / 2;
  11894. } else {
  11895. tMax = t;
  11896. t = (t + tMin) / 2;
  11897. }
  11898. value = getBezierCoordinate_(t, x1, x2);
  11899. }
  11900. return t;
  11901. }
  11902. /***/ }),
  11903. /* 101 */
  11904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11905. "use strict";
  11906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MDCMenuFoundation; });
  11907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnchorMargin; });
  11908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(102);
  11910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(32);
  11911. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  11912. 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; }; }();
  11913. 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; }
  11914. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11915. 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; }
  11916. 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; }
  11917. /**
  11918. * @license
  11919. * Copyright 2016 Google Inc. All Rights Reserved.
  11920. *
  11921. * Licensed under the Apache License, Version 2.0 (the "License");
  11922. * you may not use this file except in compliance with the License.
  11923. * You may obtain a copy of the License at
  11924. *
  11925. * http://www.apache.org/licenses/LICENSE-2.0
  11926. *
  11927. * Unless required by applicable law or agreed to in writing, software
  11928. * distributed under the License is distributed on an "AS IS" BASIS,
  11929. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11930. * See the License for the specific language governing permissions and
  11931. * limitations under the License.
  11932. */
  11933. /**
  11934. * @typedef {{
  11935. * top: number,
  11936. * right: number,
  11937. * bottom: number,
  11938. * left: number
  11939. * }}
  11940. */
  11941. var AnchorMargin = void 0;
  11942. /* eslint-disable no-unused-vars */
  11943. /**
  11944. * @typedef {{
  11945. * viewport: { width: number, height: number },
  11946. * viewportDistance: {top: number, right: number, bottom: number, left: number},
  11947. * anchorHeight: number,
  11948. * anchorWidth: number,
  11949. * menuHeight: number,
  11950. * menuWidth: number,
  11951. * }}
  11952. */
  11953. var AutoLayoutMeasurements = void 0;
  11954. /* eslint-enable no-unused-vars */
  11955. /**
  11956. * @extends {MDCFoundation<!MDCMenuAdapter>}
  11957. */
  11958. var MDCMenuFoundation = function (_MDCFoundation) {
  11959. _inherits(MDCMenuFoundation, _MDCFoundation);
  11960. _createClass(MDCMenuFoundation, null, [{
  11961. key: 'cssClasses',
  11962. /** @return enum{cssClasses} */
  11963. get: function get() {
  11964. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */];
  11965. }
  11966. /** @return enum{strings} */
  11967. }, {
  11968. key: 'strings',
  11969. get: function get() {
  11970. return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */];
  11971. }
  11972. /** @return enum{numbers} */
  11973. }, {
  11974. key: 'numbers',
  11975. get: function get() {
  11976. return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */];
  11977. }
  11978. /** @return enum{number} */
  11979. }, {
  11980. key: 'Corner',
  11981. get: function get() {
  11982. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */];
  11983. }
  11984. /**
  11985. * {@see MDCMenuAdapter} for typing information on parameters and return
  11986. * types.
  11987. * @return {!MDCMenuAdapter}
  11988. */
  11989. }, {
  11990. key: 'defaultAdapter',
  11991. get: function get() {
  11992. return (/** @type {!MDCMenuAdapter} */{
  11993. addClass: function addClass() {},
  11994. removeClass: function removeClass() {},
  11995. hasClass: function hasClass() {
  11996. return false;
  11997. },
  11998. hasNecessaryDom: function hasNecessaryDom() {
  11999. return false;
  12000. },
  12001. getAttributeForEventTarget: function getAttributeForEventTarget() {},
  12002. getInnerDimensions: function getInnerDimensions() {
  12003. return {};
  12004. },
  12005. hasAnchor: function hasAnchor() {
  12006. return false;
  12007. },
  12008. getAnchorDimensions: function getAnchorDimensions() {
  12009. return {};
  12010. },
  12011. getWindowDimensions: function getWindowDimensions() {
  12012. return {};
  12013. },
  12014. getNumberOfItems: function getNumberOfItems() {
  12015. return 0;
  12016. },
  12017. registerInteractionHandler: function registerInteractionHandler() {},
  12018. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  12019. registerBodyClickHandler: function registerBodyClickHandler() {},
  12020. deregisterBodyClickHandler: function deregisterBodyClickHandler() {},
  12021. getIndexForEventTarget: function getIndexForEventTarget() {
  12022. return 0;
  12023. },
  12024. notifySelected: function notifySelected() {},
  12025. notifyCancel: function notifyCancel() {},
  12026. saveFocus: function saveFocus() {},
  12027. restoreFocus: function restoreFocus() {},
  12028. isFocused: function isFocused() {
  12029. return false;
  12030. },
  12031. focus: function focus() {},
  12032. getFocusedItemIndex: function getFocusedItemIndex() {
  12033. return -1;
  12034. },
  12035. focusItemAtIndex: function focusItemAtIndex() {},
  12036. isRtl: function isRtl() {
  12037. return false;
  12038. },
  12039. setTransformOrigin: function setTransformOrigin() {},
  12040. setPosition: function setPosition() {},
  12041. setMaxHeight: function setMaxHeight() {},
  12042. setAttrForOptionAtIndex: function setAttrForOptionAtIndex() {},
  12043. rmAttrForOptionAtIndex: function rmAttrForOptionAtIndex() {},
  12044. addClassForOptionAtIndex: function addClassForOptionAtIndex() {},
  12045. rmClassForOptionAtIndex: function rmClassForOptionAtIndex() {}
  12046. }
  12047. );
  12048. }
  12049. /** @param {!MDCMenuAdapter} adapter */
  12050. }]);
  12051. function MDCMenuFoundation(adapter) {
  12052. _classCallCheck(this, MDCMenuFoundation);
  12053. /** @private {function(!Event)} */
  12054. var _this = _possibleConstructorReturn(this, (MDCMenuFoundation.__proto__ || Object.getPrototypeOf(MDCMenuFoundation)).call(this, _extends(MDCMenuFoundation.defaultAdapter, adapter)));
  12055. _this.clickHandler_ = function (evt) {
  12056. return _this.handlePossibleSelected_(evt);
  12057. };
  12058. /** @private {function(!Event)} */
  12059. _this.keydownHandler_ = function (evt) {
  12060. return _this.handleKeyboardDown_(evt);
  12061. };
  12062. /** @private {function(!Event)} */
  12063. _this.keyupHandler_ = function (evt) {
  12064. return _this.handleKeyboardUp_(evt);
  12065. };
  12066. /** @private {function(!Event)} */
  12067. _this.documentClickHandler_ = function (evt) {
  12068. return _this.handleDocumentClick_(evt);
  12069. };
  12070. /** @private {boolean} */
  12071. _this.isOpen_ = false;
  12072. /** @private {number} */
  12073. _this.openAnimationEndTimerId_ = 0;
  12074. /** @private {number} */
  12075. _this.closeAnimationEndTimerId_ = 0;
  12076. /** @private {number} */
  12077. _this.selectedTriggerTimerId_ = 0;
  12078. /** @private {number} */
  12079. _this.animationRequestId_ = 0;
  12080. /** @private {!{ width: number, height: number }} */
  12081. _this.dimensions_;
  12082. /** @private {number} */
  12083. _this.itemHeight_;
  12084. /** @private {Corner} */
  12085. _this.anchorCorner_ = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_START;
  12086. /** @private {AnchorMargin} */
  12087. _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 };
  12088. /** @private {?AutoLayoutMeasurements} */
  12089. _this.measures_ = null;
  12090. /** @private {number} */
  12091. _this.selectedIndex_ = -1;
  12092. /** @private {boolean} */
  12093. _this.rememberSelection_ = false;
  12094. /** @private {boolean} */
  12095. _this.quickOpen_ = false;
  12096. // A keyup event on the menu needs to have a corresponding keydown
  12097. // event on the menu. If the user opens the menu with a keydown event on a
  12098. // button, the menu will only get the key up event causing buggy behavior with selected elements.
  12099. /** @private {boolean} */
  12100. _this.keyDownWithinMenu_ = false;
  12101. return _this;
  12102. }
  12103. _createClass(MDCMenuFoundation, [{
  12104. key: 'init',
  12105. value: function init() {
  12106. var _MDCMenuFoundation$cs = MDCMenuFoundation.cssClasses,
  12107. ROOT = _MDCMenuFoundation$cs.ROOT,
  12108. OPEN = _MDCMenuFoundation$cs.OPEN;
  12109. if (!this.adapter_.hasClass(ROOT)) {
  12110. throw new Error(ROOT + ' class required in root element.');
  12111. }
  12112. if (!this.adapter_.hasNecessaryDom()) {
  12113. throw new Error('Required DOM nodes missing in ' + ROOT + ' component.');
  12114. }
  12115. if (this.adapter_.hasClass(OPEN)) {
  12116. this.isOpen_ = true;
  12117. }
  12118. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  12119. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  12120. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  12121. }
  12122. }, {
  12123. key: 'destroy',
  12124. value: function destroy() {
  12125. clearTimeout(this.selectedTriggerTimerId_);
  12126. clearTimeout(this.openAnimationEndTimerId_);
  12127. clearTimeout(this.closeAnimationEndTimerId_);
  12128. // Cancel any currently running animations.
  12129. cancelAnimationFrame(this.animationRequestId_);
  12130. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  12131. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  12132. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  12133. this.adapter_.deregisterBodyClickHandler(this.documentClickHandler_);
  12134. }
  12135. /**
  12136. * @param {!Corner} corner Default anchor corner alignment of top-left menu corner.
  12137. */
  12138. }, {
  12139. key: 'setAnchorCorner',
  12140. value: function setAnchorCorner(corner) {
  12141. this.anchorCorner_ = corner;
  12142. }
  12143. /**
  12144. * @param {!AnchorMargin} margin 4-plet of margins from anchor.
  12145. */
  12146. }, {
  12147. key: 'setAnchorMargin',
  12148. value: function setAnchorMargin(margin) {
  12149. this.anchorMargin_.top = typeof margin.top === 'number' ? margin.top : 0;
  12150. this.anchorMargin_.right = typeof margin.right === 'number' ? margin.right : 0;
  12151. this.anchorMargin_.bottom = typeof margin.bottom === 'number' ? margin.bottom : 0;
  12152. this.anchorMargin_.left = typeof margin.left === 'number' ? margin.left : 0;
  12153. }
  12154. /** @param {boolean} rememberSelection */
  12155. }, {
  12156. key: 'setRememberSelection',
  12157. value: function setRememberSelection(rememberSelection) {
  12158. this.rememberSelection_ = rememberSelection;
  12159. this.setSelectedIndex(-1);
  12160. }
  12161. /** @param {boolean} quickOpen */
  12162. }, {
  12163. key: 'setQuickOpen',
  12164. value: function setQuickOpen(quickOpen) {
  12165. this.quickOpen_ = quickOpen;
  12166. }
  12167. /**
  12168. * @param {?number} focusIndex
  12169. * @private
  12170. */
  12171. }, {
  12172. key: 'focusOnOpen_',
  12173. value: function focusOnOpen_(focusIndex) {
  12174. if (focusIndex === null) {
  12175. // If this instance of MDCMenu remembers selections, and the user has
  12176. // made a selection, then focus the last selected item
  12177. if (this.rememberSelection_ && this.selectedIndex_ >= 0) {
  12178. this.adapter_.focusItemAtIndex(this.selectedIndex_);
  12179. return;
  12180. }
  12181. this.adapter_.focus();
  12182. // If that doesn't work, focus first item instead.
  12183. if (!this.adapter_.isFocused()) {
  12184. this.adapter_.focusItemAtIndex(0);
  12185. }
  12186. } else {
  12187. this.adapter_.focusItemAtIndex(focusIndex);
  12188. }
  12189. }
  12190. /**
  12191. * Handle clicks and cancel the menu if not a child list-item
  12192. * @param {!Event} evt
  12193. * @private
  12194. */
  12195. }, {
  12196. key: 'handleDocumentClick_',
  12197. value: function handleDocumentClick_(evt) {
  12198. var el = evt.target;
  12199. while (el && el !== document.documentElement) {
  12200. if (this.adapter_.getIndexForEventTarget(el) !== -1) {
  12201. return;
  12202. }
  12203. el = el.parentNode;
  12204. }
  12205. this.adapter_.notifyCancel();
  12206. this.close(evt);
  12207. }
  12208. }, {
  12209. key: 'handleKeyboardDown_',
  12210. /**
  12211. * Handle keys that we want to repeat on hold (tab and arrows).
  12212. * @param {!Event} evt
  12213. * @return {boolean}
  12214. * @private
  12215. */
  12216. value: function handleKeyboardDown_(evt) {
  12217. // Do nothing if Alt, Ctrl or Meta are pressed.
  12218. if (evt.altKey || evt.ctrlKey || evt.metaKey) {
  12219. return true;
  12220. }
  12221. var keyCode = evt.keyCode,
  12222. key = evt.key,
  12223. shiftKey = evt.shiftKey;
  12224. var isTab = key === 'Tab' || keyCode === 9;
  12225. var isArrowUp = key === 'ArrowUp' || keyCode === 38;
  12226. var isArrowDown = key === 'ArrowDown' || keyCode === 40;
  12227. var isSpace = key === 'Space' || keyCode === 32;
  12228. var isEnter = key === 'Enter' || keyCode === 13;
  12229. // The menu needs to know if the keydown event was triggered on the menu
  12230. this.keyDownWithinMenu_ = isEnter || isSpace;
  12231. var focusedItemIndex = this.adapter_.getFocusedItemIndex();
  12232. var lastItemIndex = this.adapter_.getNumberOfItems() - 1;
  12233. if (shiftKey && isTab && focusedItemIndex === 0) {
  12234. this.adapter_.focusItemAtIndex(lastItemIndex);
  12235. evt.preventDefault();
  12236. return false;
  12237. }
  12238. if (!shiftKey && isTab && focusedItemIndex === lastItemIndex) {
  12239. this.adapter_.focusItemAtIndex(0);
  12240. evt.preventDefault();
  12241. return false;
  12242. }
  12243. // Ensure Arrow{Up,Down} and space do not cause inadvertent scrolling
  12244. if (isArrowUp || isArrowDown || isSpace) {
  12245. evt.preventDefault();
  12246. }
  12247. if (isArrowUp) {
  12248. if (focusedItemIndex === 0 || this.adapter_.isFocused()) {
  12249. this.adapter_.focusItemAtIndex(lastItemIndex);
  12250. } else {
  12251. this.adapter_.focusItemAtIndex(focusedItemIndex - 1);
  12252. }
  12253. } else if (isArrowDown) {
  12254. if (focusedItemIndex === lastItemIndex || this.adapter_.isFocused()) {
  12255. this.adapter_.focusItemAtIndex(0);
  12256. } else {
  12257. this.adapter_.focusItemAtIndex(focusedItemIndex + 1);
  12258. }
  12259. }
  12260. return true;
  12261. }
  12262. /**
  12263. * Handle keys that we don't want to repeat on hold (Enter, Space, Escape).
  12264. * @param {!Event} evt
  12265. * @return {boolean}
  12266. * @private
  12267. */
  12268. }, {
  12269. key: 'handleKeyboardUp_',
  12270. value: function handleKeyboardUp_(evt) {
  12271. // Do nothing if Alt, Ctrl or Meta are pressed.
  12272. if (evt.altKey || evt.ctrlKey || evt.metaKey) {
  12273. return true;
  12274. }
  12275. var keyCode = evt.keyCode,
  12276. key = evt.key;
  12277. var isEnter = key === 'Enter' || keyCode === 13;
  12278. var isSpace = key === 'Space' || keyCode === 32;
  12279. var isEscape = key === 'Escape' || keyCode === 27;
  12280. if (isEnter || isSpace) {
  12281. // If the keydown event didn't occur on the menu, then it should
  12282. // disregard the possible selected event.
  12283. if (this.keyDownWithinMenu_) {
  12284. this.handlePossibleSelected_(evt);
  12285. }
  12286. this.keyDownWithinMenu_ = false;
  12287. }
  12288. if (isEscape) {
  12289. this.adapter_.notifyCancel();
  12290. this.close();
  12291. }
  12292. return true;
  12293. }
  12294. /**
  12295. * @param {!Event} evt
  12296. * @private
  12297. */
  12298. }, {
  12299. key: 'handlePossibleSelected_',
  12300. value: function handlePossibleSelected_(evt) {
  12301. var _this2 = this;
  12302. if (this.adapter_.getAttributeForEventTarget(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */].ARIA_DISABLED_ATTR) === 'true') {
  12303. return;
  12304. }
  12305. var targetIndex = this.adapter_.getIndexForEventTarget(evt.target);
  12306. if (targetIndex < 0) {
  12307. return;
  12308. }
  12309. // Debounce multiple selections
  12310. if (this.selectedTriggerTimerId_) {
  12311. return;
  12312. }
  12313. this.selectedTriggerTimerId_ = setTimeout(function () {
  12314. _this2.selectedTriggerTimerId_ = 0;
  12315. _this2.close();
  12316. if (_this2.rememberSelection_) {
  12317. _this2.setSelectedIndex(targetIndex);
  12318. }
  12319. _this2.adapter_.notifySelected({ index: targetIndex });
  12320. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].SELECTED_TRIGGER_DELAY);
  12321. }
  12322. /**
  12323. * @return {AutoLayoutMeasurements} Measurements used to position menu popup.
  12324. */
  12325. }, {
  12326. key: 'getAutoLayoutMeasurements_',
  12327. value: function getAutoLayoutMeasurements_() {
  12328. var anchorRect = this.adapter_.getAnchorDimensions();
  12329. var viewport = this.adapter_.getWindowDimensions();
  12330. return {
  12331. viewport: viewport,
  12332. viewportDistance: {
  12333. top: anchorRect.top,
  12334. right: viewport.width - anchorRect.right,
  12335. left: anchorRect.left,
  12336. bottom: viewport.height - anchorRect.bottom
  12337. },
  12338. anchorHeight: anchorRect.height,
  12339. anchorWidth: anchorRect.width,
  12340. menuHeight: this.dimensions_.height,
  12341. menuWidth: this.dimensions_.width
  12342. };
  12343. }
  12344. /**
  12345. * Computes the corner of the anchor from which to animate and position the menu.
  12346. * @return {Corner}
  12347. * @private
  12348. */
  12349. }, {
  12350. key: 'getOriginCorner_',
  12351. value: function getOriginCorner_() {
  12352. // Defaults: open from the top left.
  12353. var corner = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_LEFT;
  12354. var _measures_ = this.measures_,
  12355. viewportDistance = _measures_.viewportDistance,
  12356. anchorHeight = _measures_.anchorHeight,
  12357. anchorWidth = _measures_.anchorWidth,
  12358. menuHeight = _measures_.menuHeight,
  12359. menuWidth = _measures_.menuWidth;
  12360. var isBottomAligned = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  12361. var availableTop = isBottomAligned ? viewportDistance.top + anchorHeight + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
  12362. var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorHeight - this.anchorMargin_.top;
  12363. var topOverflow = menuHeight - availableTop;
  12364. var bottomOverflow = menuHeight - availableBottom;
  12365. if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
  12366. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM;
  12367. }
  12368. var isRtl = this.adapter_.isRtl();
  12369. var isFlipRtl = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].FLIP_RTL);
  12370. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  12371. var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
  12372. var availableLeft = isAlignedRight ? viewportDistance.left + anchorWidth + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
  12373. var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorWidth - this.anchorMargin_.left;
  12374. var leftOverflow = menuWidth - availableLeft;
  12375. var rightOverflow = menuWidth - availableRight;
  12376. if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
  12377. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT;
  12378. }
  12379. return corner;
  12380. }
  12381. /**
  12382. * @param {Corner} corner Origin corner of the menu.
  12383. * @return {number} Horizontal offset of menu origin corner from corresponding anchor corner.
  12384. * @private
  12385. */
  12386. }, {
  12387. key: 'getHorizontalOriginOffset_',
  12388. value: function getHorizontalOriginOffset_(corner) {
  12389. var anchorWidth = this.measures_.anchorWidth;
  12390. var isRightAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  12391. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  12392. var x = 0;
  12393. if (isRightAligned) {
  12394. var rightOffset = avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.left : this.anchorMargin_.right;
  12395. x = rightOffset;
  12396. } else {
  12397. var leftOffset = avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.right : this.anchorMargin_.left;
  12398. x = leftOffset;
  12399. }
  12400. return x;
  12401. }
  12402. /**
  12403. * @param {Corner} corner Origin corner of the menu.
  12404. * @return {number} Vertical offset of menu origin corner from corresponding anchor corner.
  12405. * @private
  12406. */
  12407. }, {
  12408. key: 'getVerticalOriginOffset_',
  12409. value: function getVerticalOriginOffset_(corner) {
  12410. var _measures_2 = this.measures_,
  12411. viewport = _measures_2.viewport,
  12412. viewportDistance = _measures_2.viewportDistance,
  12413. anchorHeight = _measures_2.anchorHeight,
  12414. menuHeight = _measures_2.menuHeight;
  12415. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  12416. var MARGIN_TO_EDGE = MDCMenuFoundation.numbers.MARGIN_TO_EDGE;
  12417. var avoidVerticalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  12418. var canOverlapVertically = !avoidVerticalOverlap;
  12419. var y = 0;
  12420. if (isBottomAligned) {
  12421. y = avoidVerticalOverlap ? anchorHeight - this.anchorMargin_.top : -this.anchorMargin_.bottom;
  12422. // adjust for when menu can overlap anchor, but too tall to be aligned to bottom
  12423. // anchor corner. Bottom margin is ignored in such cases.
  12424. if (canOverlapVertically && menuHeight > viewportDistance.top + anchorHeight) {
  12425. y = -(Math.min(menuHeight, viewport.height - MARGIN_TO_EDGE) - (viewportDistance.top + anchorHeight));
  12426. }
  12427. } else {
  12428. y = avoidVerticalOverlap ? anchorHeight + this.anchorMargin_.bottom : this.anchorMargin_.top;
  12429. // adjust for when menu can overlap anchor, but too tall to be aligned to top
  12430. // anchor corners. Top margin is ignored in that case.
  12431. if (canOverlapVertically && menuHeight > viewportDistance.bottom + anchorHeight) {
  12432. y = -(Math.min(menuHeight, viewport.height - MARGIN_TO_EDGE) - (viewportDistance.bottom + anchorHeight));
  12433. }
  12434. }
  12435. return y;
  12436. }
  12437. /**
  12438. * @param {Corner} corner Origin corner of the menu.
  12439. * @return {number} Maximum height of the menu, based on available space. 0 indicates should not be set.
  12440. * @private
  12441. */
  12442. }, {
  12443. key: 'getMenuMaxHeight_',
  12444. value: function getMenuMaxHeight_(corner) {
  12445. var maxHeight = 0;
  12446. var viewportDistance = this.measures_.viewportDistance;
  12447. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  12448. // When maximum height is not specified, it is handled from css.
  12449. if (this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) {
  12450. if (isBottomAligned) {
  12451. maxHeight = viewportDistance.top + this.anchorMargin_.top;
  12452. } else {
  12453. maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom;
  12454. }
  12455. }
  12456. return maxHeight;
  12457. }
  12458. /** @private */
  12459. }, {
  12460. key: 'autoPosition_',
  12461. value: function autoPosition_() {
  12462. var _position;
  12463. if (!this.adapter_.hasAnchor()) {
  12464. return;
  12465. }
  12466. // Compute measurements for autoposition methods reuse.
  12467. this.measures_ = this.getAutoLayoutMeasurements_();
  12468. var corner = this.getOriginCorner_();
  12469. var maxMenuHeight = this.getMenuMaxHeight_(corner);
  12470. var verticalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM ? 'bottom' : 'top';
  12471. var horizontalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT ? 'right' : 'left';
  12472. var horizontalOffset = this.getHorizontalOriginOffset_(corner);
  12473. var verticalOffset = this.getVerticalOriginOffset_(corner);
  12474. var position = (_position = {}, _defineProperty(_position, horizontalAlignment, horizontalOffset ? horizontalOffset + 'px' : '0'), _defineProperty(_position, verticalAlignment, verticalOffset ? verticalOffset + 'px' : '0'), _position);
  12475. var _measures_3 = this.measures_,
  12476. anchorWidth = _measures_3.anchorWidth,
  12477. menuHeight = _measures_3.menuHeight,
  12478. menuWidth = _measures_3.menuWidth;
  12479. // Center align when anchor width is comparable or greater than menu, otherwise keep corner.
  12480. if (anchorWidth / menuWidth > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].ANCHOR_TO_MENU_WIDTH_RATIO) {
  12481. horizontalAlignment = 'center';
  12482. }
  12483. // Adjust vertical origin when menu is positioned with significant offset from anchor. This is done so that
  12484. // scale animation is "anchored" on the anchor.
  12485. if (!(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) && Math.abs(verticalOffset / menuHeight) > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].OFFSET_TO_MENU_HEIGHT_RATIO) {
  12486. var verticalOffsetPercent = Math.abs(verticalOffset / menuHeight) * 100;
  12487. var originPercent = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM ? 100 - verticalOffsetPercent : verticalOffsetPercent;
  12488. verticalAlignment = Math.round(originPercent * 100) / 100 + '%';
  12489. }
  12490. this.adapter_.setTransformOrigin(horizontalAlignment + ' ' + verticalAlignment);
  12491. this.adapter_.setPosition(position);
  12492. this.adapter_.setMaxHeight(maxMenuHeight ? maxMenuHeight + 'px' : '');
  12493. // Clear measures after positioning is complete.
  12494. this.measures_ = null;
  12495. }
  12496. /**
  12497. * Open the menu.
  12498. * @param {{focusIndex: ?number}=} options
  12499. */
  12500. }, {
  12501. key: 'open',
  12502. value: function open() {
  12503. var _this3 = this;
  12504. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  12505. _ref$focusIndex = _ref.focusIndex,
  12506. focusIndex = _ref$focusIndex === undefined ? null : _ref$focusIndex;
  12507. this.adapter_.saveFocus();
  12508. if (!this.quickOpen_) {
  12509. this.adapter_.addClass(MDCMenuFoundation.cssClasses.ANIMATING_OPEN);
  12510. }
  12511. this.animationRequestId_ = requestAnimationFrame(function () {
  12512. _this3.dimensions_ = _this3.adapter_.getInnerDimensions();
  12513. _this3.autoPosition_();
  12514. _this3.adapter_.addClass(MDCMenuFoundation.cssClasses.OPEN);
  12515. _this3.focusOnOpen_(focusIndex);
  12516. _this3.adapter_.registerBodyClickHandler(_this3.documentClickHandler_);
  12517. if (!_this3.quickOpen_) {
  12518. _this3.openAnimationEndTimerId_ = setTimeout(function () {
  12519. _this3.openAnimationEndTimerId_ = 0;
  12520. _this3.adapter_.removeClass(MDCMenuFoundation.cssClasses.ANIMATING_OPEN);
  12521. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_OPEN_DURATION);
  12522. }
  12523. });
  12524. this.isOpen_ = true;
  12525. }
  12526. /**
  12527. * Closes the menu.
  12528. * @param {Event=} evt
  12529. */
  12530. }, {
  12531. key: 'close',
  12532. value: function close() {
  12533. var _this4 = this;
  12534. var evt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  12535. var targetIsDisabled = evt ? this.adapter_.getAttributeForEventTarget(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */].ARIA_DISABLED_ATTR) === 'true' : false;
  12536. if (targetIsDisabled) {
  12537. return;
  12538. }
  12539. this.adapter_.deregisterBodyClickHandler(this.documentClickHandler_);
  12540. if (!this.quickOpen_) {
  12541. this.adapter_.addClass(MDCMenuFoundation.cssClasses.ANIMATING_CLOSED);
  12542. }
  12543. requestAnimationFrame(function () {
  12544. _this4.adapter_.removeClass(MDCMenuFoundation.cssClasses.OPEN);
  12545. if (!_this4.quickOpen_) {
  12546. _this4.closeAnimationEndTimerId_ = setTimeout(function () {
  12547. _this4.closeAnimationEndTimerId_ = 0;
  12548. _this4.adapter_.removeClass(MDCMenuFoundation.cssClasses.ANIMATING_CLOSED);
  12549. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_CLOSE_DURATION);
  12550. }
  12551. });
  12552. this.isOpen_ = false;
  12553. this.adapter_.restoreFocus();
  12554. }
  12555. /** @return {boolean} */
  12556. }, {
  12557. key: 'isOpen',
  12558. value: function isOpen() {
  12559. return this.isOpen_;
  12560. }
  12561. /** @return {number} */
  12562. }, {
  12563. key: 'getSelectedIndex',
  12564. value: function getSelectedIndex() {
  12565. return this.selectedIndex_;
  12566. }
  12567. /**
  12568. * @param {number} index Index of the item to set as selected.
  12569. */
  12570. }, {
  12571. key: 'setSelectedIndex',
  12572. value: function setSelectedIndex(index) {
  12573. if (index === this.selectedIndex_) {
  12574. return;
  12575. }
  12576. var prevSelectedIndex = this.selectedIndex_;
  12577. if (prevSelectedIndex >= 0) {
  12578. this.adapter_.rmAttrForOptionAtIndex(prevSelectedIndex, 'aria-selected');
  12579. this.adapter_.rmClassForOptionAtIndex(prevSelectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].SELECTED_LIST_ITEM);
  12580. }
  12581. this.selectedIndex_ = index >= 0 && index < this.adapter_.getNumberOfItems() ? index : -1;
  12582. if (this.selectedIndex_ >= 0) {
  12583. this.adapter_.setAttrForOptionAtIndex(this.selectedIndex_, 'aria-selected', 'true');
  12584. this.adapter_.addClassForOptionAtIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */].SELECTED_LIST_ITEM);
  12585. }
  12586. }
  12587. }]);
  12588. return MDCMenuFoundation;
  12589. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12590. /***/ }),
  12591. /* 102 */
  12592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12593. "use strict";
  12594. /* unused harmony export MDCMenuAdapter */
  12595. 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; }; }();
  12596. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12597. /**
  12598. * @license
  12599. * Copyright 2016 Google Inc. All Rights Reserved.
  12600. *
  12601. * Licensed under the Apache License, Version 2.0 (the "License");
  12602. * you may not use this file except in compliance with the License.
  12603. * You may obtain a copy of the License at
  12604. *
  12605. * http://www.apache.org/licenses/LICENSE-2.0
  12606. *
  12607. * Unless required by applicable law or agreed to in writing, software
  12608. * distributed under the License is distributed on an "AS IS" BASIS,
  12609. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12610. * See the License for the specific language governing permissions and
  12611. * limitations under the License.
  12612. */
  12613. /* eslint no-unused-vars: [2, {"args": "none"}] */
  12614. /**
  12615. * Adapter for MDC Menu. Provides an interface for managing
  12616. * - classes
  12617. * - dom
  12618. * - focus
  12619. * - position
  12620. * - dimensions
  12621. * - event handlers
  12622. *
  12623. * Additionally, provides type information for the adapter to the Closure
  12624. * compiler.
  12625. *
  12626. * Implement this adapter for your framework of choice to delegate updates to
  12627. * the component in your framework of choice. See architecture documentation
  12628. * for more details.
  12629. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  12630. *
  12631. * @record
  12632. */
  12633. var MDCMenuAdapter = function () {
  12634. function MDCMenuAdapter() {
  12635. _classCallCheck(this, MDCMenuAdapter);
  12636. }
  12637. _createClass(MDCMenuAdapter, [{
  12638. key: "addClass",
  12639. /** @param {string} className */
  12640. value: function addClass(className) {}
  12641. /** @param {string} className */
  12642. }, {
  12643. key: "removeClass",
  12644. value: function removeClass(className) {}
  12645. /**
  12646. * @param {string} className
  12647. * @return {boolean}
  12648. */
  12649. }, {
  12650. key: "hasClass",
  12651. value: function hasClass(className) {}
  12652. /** @return {boolean} */
  12653. }, {
  12654. key: "hasNecessaryDom",
  12655. value: function hasNecessaryDom() {}
  12656. /**
  12657. * @param {EventTarget} target
  12658. * @param {string} attributeName
  12659. * @return {string}
  12660. */
  12661. }, {
  12662. key: "getAttributeForEventTarget",
  12663. value: function getAttributeForEventTarget(target, attributeName) {}
  12664. /** @return {{ width: number, height: number }} */
  12665. }, {
  12666. key: "getInnerDimensions",
  12667. value: function getInnerDimensions() {}
  12668. /** @return {boolean} */
  12669. }, {
  12670. key: "hasAnchor",
  12671. value: function hasAnchor() {}
  12672. /** @return {{width: number, height: number, top: number, right: number, bottom: number, left: number}} */
  12673. }, {
  12674. key: "getAnchorDimensions",
  12675. value: function getAnchorDimensions() {}
  12676. /** @return {{ width: number, height: number }} */
  12677. }, {
  12678. key: "getWindowDimensions",
  12679. value: function getWindowDimensions() {}
  12680. /** @return {number} */
  12681. }, {
  12682. key: "getNumberOfItems",
  12683. value: function getNumberOfItems() {}
  12684. /**
  12685. * @param {string} type
  12686. * @param {function(!Event)} handler
  12687. */
  12688. }, {
  12689. key: "registerInteractionHandler",
  12690. value: function registerInteractionHandler(type, handler) {}
  12691. /**
  12692. * @param {string} type
  12693. * @param {function(!Event)} handler
  12694. */
  12695. }, {
  12696. key: "deregisterInteractionHandler",
  12697. value: function deregisterInteractionHandler(type, handler) {}
  12698. /** @param {function(!Event)} handler */
  12699. }, {
  12700. key: "registerBodyClickHandler",
  12701. value: function registerBodyClickHandler(handler) {}
  12702. /** @param {function(!Event)} handler */
  12703. }, {
  12704. key: "deregisterBodyClickHandler",
  12705. value: function deregisterBodyClickHandler(handler) {}
  12706. /**
  12707. * @param {EventTarget} target
  12708. * @return {number}
  12709. */
  12710. }, {
  12711. key: "getIndexForEventTarget",
  12712. value: function getIndexForEventTarget(target) {}
  12713. /** @param {{index: number}} evtData */
  12714. }, {
  12715. key: "notifySelected",
  12716. value: function notifySelected(evtData) {}
  12717. }, {
  12718. key: "notifyCancel",
  12719. value: function notifyCancel() {}
  12720. }, {
  12721. key: "saveFocus",
  12722. value: function saveFocus() {}
  12723. }, {
  12724. key: "restoreFocus",
  12725. value: function restoreFocus() {}
  12726. /** @return {boolean} */
  12727. }, {
  12728. key: "isFocused",
  12729. value: function isFocused() {}
  12730. }, {
  12731. key: "focus",
  12732. value: function focus() {}
  12733. /** @return {number} */
  12734. }, {
  12735. key: "getFocusedItemIndex",
  12736. value: function getFocusedItemIndex() /* number */{}
  12737. /** @param {number} index */
  12738. }, {
  12739. key: "focusItemAtIndex",
  12740. value: function focusItemAtIndex(index) {}
  12741. /** @return {boolean} */
  12742. }, {
  12743. key: "isRtl",
  12744. value: function isRtl() {}
  12745. /** @param {string} origin */
  12746. }, {
  12747. key: "setTransformOrigin",
  12748. value: function setTransformOrigin(origin) {}
  12749. /** @param {{
  12750. * top: (string|undefined),
  12751. * right: (string|undefined),
  12752. * bottom: (string|undefined),
  12753. * left: (string|undefined)
  12754. * }} position */
  12755. }, {
  12756. key: "setPosition",
  12757. value: function setPosition(position) {}
  12758. /** @param {string} height */
  12759. }, {
  12760. key: "setMaxHeight",
  12761. value: function setMaxHeight(height) {}
  12762. /**
  12763. * @param {number} index
  12764. * @param {string} attr
  12765. * @param {string} value
  12766. */
  12767. }, {
  12768. key: "setAttrForOptionAtIndex",
  12769. value: function setAttrForOptionAtIndex(index, attr, value) {}
  12770. /**
  12771. * @param {number} index
  12772. * @param {string} attr
  12773. */
  12774. }, {
  12775. key: "rmAttrForOptionAtIndex",
  12776. value: function rmAttrForOptionAtIndex(index, attr) {}
  12777. /**
  12778. * @param {number} index
  12779. * @param {string} className
  12780. */
  12781. }, {
  12782. key: "addClassForOptionAtIndex",
  12783. value: function addClassForOptionAtIndex(index, className) {}
  12784. /**
  12785. * @param {number} index
  12786. * @param {string} className
  12787. */
  12788. }, {
  12789. key: "rmClassForOptionAtIndex",
  12790. value: function rmClassForOptionAtIndex(index, className) {}
  12791. }]);
  12792. return MDCMenuAdapter;
  12793. }();
  12794. /***/ }),
  12795. /* 103 */
  12796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12797. "use strict";
  12798. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  12799. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(33);
  12800. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(34);
  12801. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  12802. 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; }; }();
  12803. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12804. 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; }
  12805. 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; }
  12806. /**
  12807. * @license
  12808. * Copyright 2017 Google Inc. All Rights Reserved.
  12809. *
  12810. * Licensed under the Apache License, Version 2.0 (the "License");
  12811. * you may not use this file except in compliance with the License.
  12812. * You may obtain a copy of the License at
  12813. *
  12814. * http://www.apache.org/licenses/LICENSE-2.0
  12815. *
  12816. * Unless required by applicable law or agreed to in writing, software
  12817. * distributed under the License is distributed on an "AS IS" BASIS,
  12818. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12819. * See the License for the specific language governing permissions and
  12820. * limitations under the License.
  12821. */
  12822. /**
  12823. * @extends {MDCFoundation<!MDCNotchedOutlineAdapter>}
  12824. * @final
  12825. */
  12826. var MDCNotchedOutlineFoundation = function (_MDCFoundation) {
  12827. _inherits(MDCNotchedOutlineFoundation, _MDCFoundation);
  12828. _createClass(MDCNotchedOutlineFoundation, null, [{
  12829. key: 'strings',
  12830. /** @return enum {string} */
  12831. get: function get() {
  12832. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  12833. }
  12834. /** @return enum {string} */
  12835. }, {
  12836. key: 'cssClasses',
  12837. get: function get() {
  12838. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12839. }
  12840. /**
  12841. * {@see MDCNotchedOutlineAdapter} for typing information on parameters and return
  12842. * types.
  12843. * @return {!MDCNotchedOutlineAdapter}
  12844. */
  12845. }, {
  12846. key: 'defaultAdapter',
  12847. get: function get() {
  12848. return (/** @type {!MDCNotchedOutlineAdapter} */{
  12849. getWidth: function getWidth() {},
  12850. getHeight: function getHeight() {},
  12851. addClass: function addClass() {},
  12852. removeClass: function removeClass() {},
  12853. setOutlinePathAttr: function setOutlinePathAttr() {},
  12854. getIdleOutlineStyleValue: function getIdleOutlineStyleValue() {}
  12855. }
  12856. );
  12857. }
  12858. /**
  12859. * @param {!MDCNotchedOutlineAdapter} adapter
  12860. */
  12861. }]);
  12862. function MDCNotchedOutlineFoundation(adapter) {
  12863. _classCallCheck(this, MDCNotchedOutlineFoundation);
  12864. return _possibleConstructorReturn(this, (MDCNotchedOutlineFoundation.__proto__ || Object.getPrototypeOf(MDCNotchedOutlineFoundation)).call(this, _extends(MDCNotchedOutlineFoundation.defaultAdapter, adapter)));
  12865. }
  12866. /**
  12867. * Adds the outline notched selector and updates the notch width
  12868. * calculated based off of notchWidth and isRtl.
  12869. * @param {number} notchWidth
  12870. * @param {boolean=} isRtl
  12871. */
  12872. _createClass(MDCNotchedOutlineFoundation, [{
  12873. key: 'notch',
  12874. value: function notch(notchWidth) {
  12875. var isRtl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  12876. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  12877. this.adapter_.addClass(OUTLINE_NOTCHED);
  12878. this.updateSvgPath_(notchWidth, isRtl);
  12879. }
  12880. /**
  12881. * Removes notched outline selector to close the notch in the outline.
  12882. */
  12883. }, {
  12884. key: 'closeNotch',
  12885. value: function closeNotch() {
  12886. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  12887. this.adapter_.removeClass(OUTLINE_NOTCHED);
  12888. }
  12889. /**
  12890. * Updates the SVG path of the focus outline element based on the notchWidth
  12891. * and the RTL context.
  12892. * @param {number} notchWidth
  12893. * @param {boolean=} isRtl
  12894. * @private
  12895. */
  12896. }, {
  12897. key: 'updateSvgPath_',
  12898. value: function updateSvgPath_(notchWidth, isRtl) {
  12899. // Fall back to reading a specific corner's style because Firefox doesn't report the style on border-radius.
  12900. var radiusStyleValue = this.adapter_.getIdleOutlineStyleValue('border-radius') || this.adapter_.getIdleOutlineStyleValue('border-top-left-radius');
  12901. var radius = parseFloat(radiusStyleValue);
  12902. var width = this.adapter_.getWidth();
  12903. var height = this.adapter_.getHeight();
  12904. var cornerWidth = radius + 1.2;
  12905. var leadingStrokeLength = Math.abs(11 - cornerWidth);
  12906. var paddedNotchWidth = notchWidth + 8;
  12907. // The right, bottom, and left sides of the outline follow the same SVG path.
  12908. var pathMiddle = 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + radius + 'v' + (height - 2 * cornerWidth) + 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + radius + 'h' + (-width + 2 * cornerWidth) + 'a' + radius + ',' + radius + ' 0 0 1 ' + -radius + ',' + -radius + 'v' + (-height + 2 * cornerWidth) + 'a' + radius + ',' + radius + ' 0 0 1 ' + radius + ',' + -radius;
  12909. var path = void 0;
  12910. if (!isRtl) {
  12911. path = 'M' + (cornerWidth + leadingStrokeLength + paddedNotchWidth) + ',' + 1 + 'h' + (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength) + pathMiddle + 'h' + leadingStrokeLength;
  12912. } else {
  12913. path = 'M' + (width - cornerWidth - leadingStrokeLength) + ',' + 1 + 'h' + leadingStrokeLength + pathMiddle + 'h' + (width - 2 * cornerWidth - paddedNotchWidth - leadingStrokeLength);
  12914. }
  12915. this.adapter_.setOutlinePathAttr(path);
  12916. }
  12917. }]);
  12918. return MDCNotchedOutlineFoundation;
  12919. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12920. /* harmony default export */ __webpack_exports__["a"] = (MDCNotchedOutlineFoundation);
  12921. /***/ }),
  12922. /* 104 */
  12923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12924. "use strict";
  12925. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadio", function() { return MDCRadio; });
  12927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  12928. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  12929. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(105);
  12930. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(3);
  12931. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadioFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  12932. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  12933. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  12934. 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; }; }();
  12935. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12936. 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; }
  12937. 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; }
  12938. /**
  12939. * @license
  12940. * Copyright 2016 Google Inc. All Rights Reserved.
  12941. *
  12942. * Licensed under the Apache License, Version 2.0 (the "License");
  12943. * you may not use this file except in compliance with the License.
  12944. * You may obtain a copy of the License at
  12945. *
  12946. * http://www.apache.org/licenses/LICENSE-2.0
  12947. *
  12948. * Unless required by applicable law or agreed to in writing, software
  12949. * distributed under the License is distributed on an "AS IS" BASIS,
  12950. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12951. * See the License for the specific language governing permissions and
  12952. * limitations under the License.
  12953. */
  12954. /* eslint-disable no-unused-vars */
  12955. /* eslint-enable no-unused-vars */
  12956. /**
  12957. * @extends MDCComponent<!MDCRadioFoundation>
  12958. * @implements {MDCSelectionControl}
  12959. */
  12960. var MDCRadio = function (_MDCComponent) {
  12961. _inherits(MDCRadio, _MDCComponent);
  12962. _createClass(MDCRadio, [{
  12963. key: 'checked',
  12964. /** @return {boolean} */
  12965. get: function get() {
  12966. return this.foundation_.isChecked();
  12967. }
  12968. /** @param {boolean} checked */
  12969. ,
  12970. set: function set(checked) {
  12971. this.foundation_.setChecked(checked);
  12972. }
  12973. /** @return {boolean} */
  12974. }, {
  12975. key: 'disabled',
  12976. get: function get() {
  12977. return this.foundation_.isDisabled();
  12978. }
  12979. /** @param {boolean} disabled */
  12980. ,
  12981. set: function set(disabled) {
  12982. this.foundation_.setDisabled(disabled);
  12983. }
  12984. /** @return {?string} */
  12985. }, {
  12986. key: 'value',
  12987. get: function get() {
  12988. return this.foundation_.getValue();
  12989. }
  12990. /** @param {?string} value */
  12991. ,
  12992. set: function set(value) {
  12993. this.foundation_.setValue(value);
  12994. }
  12995. /** @return {!MDCRipple} */
  12996. }, {
  12997. key: 'ripple',
  12998. get: function get() {
  12999. return this.ripple_;
  13000. }
  13001. }], [{
  13002. key: 'attachTo',
  13003. value: function attachTo(root) {
  13004. return new MDCRadio(root);
  13005. }
  13006. }]);
  13007. function MDCRadio() {
  13008. var _ref;
  13009. _classCallCheck(this, MDCRadio);
  13010. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13011. args[_key] = arguments[_key];
  13012. }
  13013. /** @private {!MDCRipple} */
  13014. var _this = _possibleConstructorReturn(this, (_ref = MDCRadio.__proto__ || Object.getPrototypeOf(MDCRadio)).call.apply(_ref, [this].concat(args)));
  13015. _this.ripple_ = _this.initRipple_();
  13016. return _this;
  13017. }
  13018. /**
  13019. * @return {!MDCRipple}
  13020. * @private
  13021. */
  13022. _createClass(MDCRadio, [{
  13023. key: 'initRipple_',
  13024. value: function initRipple_() {
  13025. var _this2 = this;
  13026. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  13027. isUnbounded: function isUnbounded() {
  13028. return true;
  13029. },
  13030. // Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
  13031. // UI we desire.
  13032. isSurfaceActive: function isSurfaceActive() {
  13033. return false;
  13034. },
  13035. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  13036. return _this2.nativeControl_.addEventListener(type, handler);
  13037. },
  13038. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  13039. return _this2.nativeControl_.removeEventListener(type, handler);
  13040. }
  13041. });
  13042. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  13043. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  13044. }
  13045. /**
  13046. * Returns the state of the native control element, or null if the native control element is not present.
  13047. * @return {?MDCSelectionControlState}
  13048. * @private
  13049. */
  13050. }, {
  13051. key: 'destroy',
  13052. value: function destroy() {
  13053. this.ripple_.destroy();
  13054. _get(MDCRadio.prototype.__proto__ || Object.getPrototypeOf(MDCRadio.prototype), 'destroy', this).call(this);
  13055. }
  13056. /** @return {!MDCRadioFoundation} */
  13057. }, {
  13058. key: 'getDefaultFoundation',
  13059. value: function getDefaultFoundation() {
  13060. var _this3 = this;
  13061. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  13062. addClass: function addClass(className) {
  13063. return _this3.root_.classList.add(className);
  13064. },
  13065. removeClass: function removeClass(className) {
  13066. return _this3.root_.classList.remove(className);
  13067. },
  13068. getNativeControl: function getNativeControl() {
  13069. return _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR);
  13070. }
  13071. });
  13072. }
  13073. }, {
  13074. key: 'nativeControl_',
  13075. get: function get() {
  13076. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  13077. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  13078. return el;
  13079. }
  13080. }]);
  13081. return MDCRadio;
  13082. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13083. /***/ }),
  13084. /* 105 */
  13085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13086. "use strict";
  13087. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13088. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  13089. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(106);
  13090. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(107);
  13091. 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; }; }();
  13092. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13093. 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; }
  13094. 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; }
  13095. /**
  13096. * @license
  13097. * Copyright 2016 Google Inc. All Rights Reserved.
  13098. *
  13099. * Licensed under the Apache License, Version 2.0 (the "License");
  13100. * you may not use this file except in compliance with the License.
  13101. * You may obtain a copy of the License at
  13102. *
  13103. * http://www.apache.org/licenses/LICENSE-2.0
  13104. *
  13105. * Unless required by applicable law or agreed to in writing, software
  13106. * distributed under the License is distributed on an "AS IS" BASIS,
  13107. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13108. * See the License for the specific language governing permissions and
  13109. * limitations under the License.
  13110. */
  13111. /* eslint-disable no-unused-vars */
  13112. /* eslint-enable no-unused-vars */
  13113. /**
  13114. * @extends {MDCFoundation<!MDCRadioAdapter>}
  13115. */
  13116. var MDCRadioFoundation = function (_MDCFoundation) {
  13117. _inherits(MDCRadioFoundation, _MDCFoundation);
  13118. function MDCRadioFoundation() {
  13119. _classCallCheck(this, MDCRadioFoundation);
  13120. return _possibleConstructorReturn(this, (MDCRadioFoundation.__proto__ || Object.getPrototypeOf(MDCRadioFoundation)).apply(this, arguments));
  13121. }
  13122. _createClass(MDCRadioFoundation, [{
  13123. key: 'isChecked',
  13124. /** @return {boolean} */
  13125. value: function isChecked() {
  13126. return this.getNativeControl_().checked;
  13127. }
  13128. /** @param {boolean} checked */
  13129. }, {
  13130. key: 'setChecked',
  13131. value: function setChecked(checked) {
  13132. this.getNativeControl_().checked = checked;
  13133. }
  13134. /** @return {boolean} */
  13135. }, {
  13136. key: 'isDisabled',
  13137. value: function isDisabled() {
  13138. return this.getNativeControl_().disabled;
  13139. }
  13140. /** @param {boolean} disabled */
  13141. }, {
  13142. key: 'setDisabled',
  13143. value: function setDisabled(disabled) {
  13144. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  13145. this.getNativeControl_().disabled = disabled;
  13146. if (disabled) {
  13147. this.adapter_.addClass(DISABLED);
  13148. } else {
  13149. this.adapter_.removeClass(DISABLED);
  13150. }
  13151. }
  13152. /** @return {?string} */
  13153. }, {
  13154. key: 'getValue',
  13155. value: function getValue() {
  13156. return this.getNativeControl_().value;
  13157. }
  13158. /** @param {?string} value */
  13159. }, {
  13160. key: 'setValue',
  13161. value: function setValue(value) {
  13162. this.getNativeControl_().value = value;
  13163. }
  13164. /**
  13165. * @return {!MDCSelectionControlState}
  13166. * @private
  13167. */
  13168. }, {
  13169. key: 'getNativeControl_',
  13170. value: function getNativeControl_() {
  13171. return this.adapter_.getNativeControl() || {
  13172. checked: false,
  13173. disabled: false,
  13174. value: null
  13175. };
  13176. }
  13177. }], [{
  13178. key: 'cssClasses',
  13179. /** @return enum {cssClasses} */
  13180. get: function get() {
  13181. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  13182. }
  13183. /** @return enum {strings} */
  13184. }, {
  13185. key: 'strings',
  13186. get: function get() {
  13187. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  13188. }
  13189. /** @return {!MDCRadioAdapter} */
  13190. }, {
  13191. key: 'defaultAdapter',
  13192. get: function get() {
  13193. return (/** @type {!MDCRadioAdapter} */{
  13194. addClass: function addClass() /* className: string */{},
  13195. removeClass: function removeClass() /* className: string */{},
  13196. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{}
  13197. }
  13198. );
  13199. }
  13200. }]);
  13201. return MDCRadioFoundation;
  13202. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13203. /* harmony default export */ __webpack_exports__["a"] = (MDCRadioFoundation);
  13204. /***/ }),
  13205. /* 106 */
  13206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13207. "use strict";
  13208. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  13209. 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; }; }();
  13210. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13211. /**
  13212. * @license
  13213. * Copyright 2016 Google Inc. All Rights Reserved.
  13214. *
  13215. * Licensed under the Apache License, Version 2.0 (the "License");
  13216. * you may not use this file except in compliance with the License.
  13217. * You may obtain a copy of the License at
  13218. *
  13219. * http://www.apache.org/licenses/LICENSE-2.0
  13220. *
  13221. * Unless required by applicable law or agreed to in writing, software
  13222. * distributed under the License is distributed on an "AS IS" BASIS,
  13223. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13224. * See the License for the specific language governing permissions and
  13225. * limitations under the License.
  13226. */
  13227. /* eslint-disable no-unused-vars */
  13228. /* eslint no-unused-vars: [2, {"args": "none"}] */
  13229. /**
  13230. * Adapter for MDC Radio. Provides an interface for managing
  13231. * - classes
  13232. * - dom
  13233. *
  13234. * Additionally, provides type information for the adapter to the Closure
  13235. * compiler.
  13236. *
  13237. * Implement this adapter for your framework of choice to delegate updates to
  13238. * the component in your framework of choice. See architecture documentation
  13239. * for more details.
  13240. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  13241. *
  13242. * @record
  13243. */
  13244. var MDCRadioAdapter = function () {
  13245. function MDCRadioAdapter() {
  13246. _classCallCheck(this, MDCRadioAdapter);
  13247. }
  13248. _createClass(MDCRadioAdapter, [{
  13249. key: 'addClass',
  13250. /** @param {string} className */
  13251. value: function addClass(className) {}
  13252. /** @param {string} className */
  13253. }, {
  13254. key: 'removeClass',
  13255. value: function removeClass(className) {}
  13256. /** @return {!MDCSelectionControlState} */
  13257. }, {
  13258. key: 'getNativeControl',
  13259. value: function getNativeControl() {}
  13260. }]);
  13261. return MDCRadioAdapter;
  13262. }();
  13263. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioAdapter);
  13264. /***/ }),
  13265. /* 107 */
  13266. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13267. "use strict";
  13268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  13269. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  13270. /**
  13271. * @license
  13272. * Copyright 2016 Google Inc. All Rights Reserved.
  13273. *
  13274. * Licensed under the Apache License, Version 2.0 (the "License");
  13275. * you may not use this file except in compliance with the License.
  13276. * You may obtain a copy of the License at
  13277. *
  13278. * http://www.apache.org/licenses/LICENSE-2.0
  13279. *
  13280. * Unless required by applicable law or agreed to in writing, software
  13281. * distributed under the License is distributed on an "AS IS" BASIS,
  13282. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13283. * See the License for the specific language governing permissions and
  13284. * limitations under the License.
  13285. */
  13286. /** @enum {string} */
  13287. var strings = {
  13288. NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
  13289. };
  13290. /** @enum {string} */
  13291. var cssClasses = {
  13292. ROOT: 'mdc-radio',
  13293. DISABLED: 'mdc-radio--disabled'
  13294. };
  13295. /***/ }),
  13296. /* 108 */
  13297. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13298. "use strict";
  13299. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13300. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelect", function() { return MDCSelect; });
  13301. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  13302. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__ = __webpack_require__(16);
  13303. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__ = __webpack_require__(17);
  13304. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(3);
  13305. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_notched_outline_index__ = __webpack_require__(18);
  13306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(109);
  13307. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(35);
  13308. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  13309. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13310. 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; }; }();
  13311. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  13312. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13313. 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; }
  13314. 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; }
  13315. /**
  13316. * Copyright 2016 Google Inc. All Rights Reserved.
  13317. *
  13318. * Licensed under the Apache License, Version 2.0 (the "License");
  13319. * you may not use this file except in compliance with the License.
  13320. * You may obtain a copy of the License at
  13321. *
  13322. * http://www.apache.org/licenses/LICENSE-2.0
  13323. *
  13324. * Unless required by applicable law or agreed to in writing, software
  13325. * distributed under the License is distributed on an "AS IS" BASIS,
  13326. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13327. * See the License for the specific language governing permissions and
  13328. * limitations under the License.
  13329. */
  13330. var MDCSelect = function (_MDCComponent) {
  13331. _inherits(MDCSelect, _MDCComponent);
  13332. function MDCSelect() {
  13333. _classCallCheck(this, MDCSelect);
  13334. return _possibleConstructorReturn(this, (MDCSelect.__proto__ || Object.getPrototypeOf(MDCSelect)).apply(this, arguments));
  13335. }
  13336. _createClass(MDCSelect, [{
  13337. key: 'layout',
  13338. /**
  13339. * Recomputes the outline SVG path for the outline element.
  13340. */
  13341. value: function layout() {
  13342. var openNotch = this.nativeControl_.value.length > 0;
  13343. this.foundation_.notchOutline(openNotch);
  13344. }
  13345. }, {
  13346. key: 'initialize',
  13347. value: function initialize() {
  13348. var labelFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  13349. return new __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__["MDCFloatingLabel"](el);
  13350. };
  13351. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  13352. return new __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__["MDCLineRipple"](el);
  13353. };
  13354. var outlineFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  13355. return new __WEBPACK_IMPORTED_MODULE_4__material_notched_outline_index__["MDCNotchedOutline"](el);
  13356. };
  13357. this.nativeControl_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_6__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR);
  13358. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_6__constants__["c" /* strings */].LABEL_SELECTOR);
  13359. if (labelElement) {
  13360. this.label_ = labelFactory(labelElement);
  13361. }
  13362. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_6__constants__["c" /* strings */].LINE_RIPPLE_SELECTOR);
  13363. if (lineRippleElement) {
  13364. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  13365. }
  13366. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_6__constants__["c" /* strings */].OUTLINE_SELECTOR);
  13367. if (outlineElement) {
  13368. this.outline_ = outlineFactory(outlineElement);
  13369. }
  13370. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_6__constants__["a" /* cssClasses */].BOX)) {
  13371. this.ripple = this.initRipple_();
  13372. }
  13373. }
  13374. }, {
  13375. key: 'initRipple_',
  13376. value: function initRipple_() {
  13377. var _this2 = this;
  13378. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  13379. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  13380. return _this2.nativeControl_.addEventListener(type, handler);
  13381. },
  13382. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  13383. return _this2.nativeControl_.removeEventListener(type, handler);
  13384. }
  13385. });
  13386. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  13387. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  13388. }
  13389. }, {
  13390. key: 'initialSyncWithDOM',
  13391. value: function initialSyncWithDOM() {
  13392. var _this3 = this;
  13393. this.handleChange_ = function () {
  13394. return _this3.foundation_.handleChange();
  13395. };
  13396. this.handleFocus_ = function () {
  13397. return _this3.foundation_.handleFocus();
  13398. };
  13399. this.handleBlur_ = function () {
  13400. return _this3.foundation_.handleBlur();
  13401. };
  13402. this.nativeControl_.addEventListener('change', this.handleChange_);
  13403. this.nativeControl_.addEventListener('focus', this.handleFocus_);
  13404. this.nativeControl_.addEventListener('blur', this.handleBlur_);
  13405. // Initially sync floating label
  13406. this.foundation_.handleChange();
  13407. if (this.nativeControl_.disabled) {
  13408. this.disabled = true;
  13409. }
  13410. }
  13411. }, {
  13412. key: 'destroy',
  13413. value: function destroy() {
  13414. this.nativeControl_.removeEventListener('change', this.handleChange_);
  13415. this.nativeControl_.removeEventListener('focus', this.handleFocus_);
  13416. this.nativeControl_.removeEventListener('blur', this.handleBlur_);
  13417. if (this.ripple) {
  13418. this.ripple.destroy();
  13419. }
  13420. if (this.outline_) {
  13421. this.outline_.destroy();
  13422. }
  13423. _get(MDCSelect.prototype.__proto__ || Object.getPrototypeOf(MDCSelect.prototype), 'destroy', this).call(this);
  13424. }
  13425. }, {
  13426. key: 'getDefaultFoundation',
  13427. value: function getDefaultFoundation() {
  13428. var _this4 = this;
  13429. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](_extends({
  13430. addClass: function addClass(className) {
  13431. return _this4.root_.classList.add(className);
  13432. },
  13433. removeClass: function removeClass(className) {
  13434. return _this4.root_.classList.remove(className);
  13435. },
  13436. hasClass: function hasClass(className) {
  13437. return _this4.root_.classList.contains(className);
  13438. },
  13439. activateBottomLine: function activateBottomLine() {
  13440. if (_this4.lineRipple_) {
  13441. _this4.lineRipple_.activate();
  13442. }
  13443. },
  13444. deactivateBottomLine: function deactivateBottomLine() {
  13445. if (_this4.lineRipple_) {
  13446. _this4.lineRipple_.deactivate();
  13447. }
  13448. },
  13449. isRtl: function isRtl() {
  13450. return window.getComputedStyle(_this4.root_).getPropertyValue('direction') === 'rtl';
  13451. },
  13452. getValue: function getValue() {
  13453. return _this4.nativeControl_.value;
  13454. }
  13455. }, this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_()));
  13456. }
  13457. /**
  13458. * @return {!{
  13459. * notchOutline: function(number, boolean): undefined,
  13460. * hasOutline: function(): boolean,
  13461. * }}
  13462. */
  13463. }, {
  13464. key: 'getOutlineAdapterMethods_',
  13465. value: function getOutlineAdapterMethods_() {
  13466. var _this5 = this;
  13467. return {
  13468. notchOutline: function notchOutline(labelWidth, isRtl) {
  13469. if (_this5.outline_) {
  13470. _this5.outline_.notch(labelWidth, isRtl);
  13471. }
  13472. },
  13473. closeOutline: function closeOutline() {
  13474. if (_this5.outline_) {
  13475. _this5.outline_.closeNotch();
  13476. }
  13477. },
  13478. hasOutline: function hasOutline() {
  13479. return !!_this5.outline_;
  13480. }
  13481. };
  13482. }
  13483. /**
  13484. * @return {!{
  13485. * floatLabel: function(boolean): undefined,
  13486. * hasLabel: function(): boolean,
  13487. * getLabelWidth: function(): number,
  13488. * }}
  13489. */
  13490. }, {
  13491. key: 'getLabelAdapterMethods_',
  13492. value: function getLabelAdapterMethods_() {
  13493. var _this6 = this;
  13494. return {
  13495. floatLabel: function floatLabel(shouldFloat) {
  13496. if (_this6.label_) {
  13497. _this6.label_.float(shouldFloat);
  13498. }
  13499. },
  13500. hasLabel: function hasLabel() {
  13501. return !!_this6.label_;
  13502. },
  13503. getLabelWidth: function getLabelWidth() {
  13504. if (_this6.label_) {
  13505. return _this6.label_.getWidth();
  13506. }
  13507. }
  13508. };
  13509. }
  13510. }, {
  13511. key: 'value',
  13512. get: function get() {
  13513. return this.nativeControl_.value;
  13514. },
  13515. set: function set(value) {
  13516. this.nativeControl_.value = value;
  13517. this.foundation_.handleChange();
  13518. }
  13519. }, {
  13520. key: 'selectedIndex',
  13521. get: function get() {
  13522. return this.nativeControl_.selectedIndex;
  13523. },
  13524. set: function set(selectedIndex) {
  13525. this.nativeControl_.selectedIndex = selectedIndex;
  13526. this.foundation_.handleChange();
  13527. }
  13528. }, {
  13529. key: 'disabled',
  13530. get: function get() {
  13531. return this.nativeControl_.disabled;
  13532. },
  13533. set: function set(disabled) {
  13534. this.nativeControl_.disabled = disabled;
  13535. this.foundation_.updateDisabledStyle(disabled);
  13536. }
  13537. }], [{
  13538. key: 'attachTo',
  13539. value: function attachTo(root) {
  13540. return new MDCSelect(root);
  13541. }
  13542. }]);
  13543. return MDCSelect;
  13544. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  13545. /***/ }),
  13546. /* 109 */
  13547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13548. "use strict";
  13549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  13550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(35);
  13551. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13552. 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; }; }();
  13553. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13554. 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; }
  13555. 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; }
  13556. /**
  13557. * Copyright 2016 Google Inc. All Rights Reserved.
  13558. *
  13559. * Licensed under the Apache License, Version 2.0 (the "License");
  13560. * you may not use this file except in compliance with the License.
  13561. * You may obtain a copy of the License at
  13562. *
  13563. * http://www.apache.org/licenses/LICENSE-2.0
  13564. *
  13565. * Unless required by applicable law or agreed to in writing, software
  13566. * distributed under the License is distributed on an "AS IS" BASIS,
  13567. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13568. * See the License for the specific language governing permissions and
  13569. * limitations under the License.
  13570. */
  13571. var MDCSelectFoundation = function (_MDCFoundation) {
  13572. _inherits(MDCSelectFoundation, _MDCFoundation);
  13573. _createClass(MDCSelectFoundation, null, [{
  13574. key: 'cssClasses',
  13575. get: function get() {
  13576. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  13577. }
  13578. }, {
  13579. key: 'numbers',
  13580. get: function get() {
  13581. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  13582. }
  13583. }, {
  13584. key: 'strings',
  13585. get: function get() {
  13586. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  13587. }
  13588. }, {
  13589. key: 'defaultAdapter',
  13590. get: function get() {
  13591. return {
  13592. addClass: function addClass() /* className: string */{},
  13593. removeClass: function removeClass() /* className: string */{},
  13594. hasClass: function hasClass() {
  13595. return (/* className: string */false
  13596. );
  13597. },
  13598. floatLabel: function floatLabel() /* value: boolean */{},
  13599. activateBottomLine: function activateBottomLine() {},
  13600. deactivateBottomLine: function deactivateBottomLine() {},
  13601. getValue: function getValue() {},
  13602. isRtl: function isRtl() {
  13603. return false;
  13604. },
  13605. hasLabel: function hasLabel() {},
  13606. getLabelWidth: function getLabelWidth() {},
  13607. hasOutline: function hasOutline() {},
  13608. notchOutline: function notchOutline() {},
  13609. closeOutline: function closeOutline() {}
  13610. };
  13611. }
  13612. }]);
  13613. function MDCSelectFoundation(adapter) {
  13614. _classCallCheck(this, MDCSelectFoundation);
  13615. var _this = _possibleConstructorReturn(this, (MDCSelectFoundation.__proto__ || Object.getPrototypeOf(MDCSelectFoundation)).call(this, _extends(MDCSelectFoundation.defaultAdapter, adapter)));
  13616. _this.focusHandler_ = function (evt) {
  13617. return _this.handleFocus_(evt);
  13618. };
  13619. _this.blurHandler_ = function (evt) {
  13620. return _this.handleBlur_(evt);
  13621. };
  13622. return _this;
  13623. }
  13624. _createClass(MDCSelectFoundation, [{
  13625. key: 'updateDisabledStyle',
  13626. value: function updateDisabledStyle(disabled) {
  13627. var DISABLED = MDCSelectFoundation.cssClasses.DISABLED;
  13628. if (disabled) {
  13629. this.adapter_.addClass(DISABLED);
  13630. } else {
  13631. this.adapter_.removeClass(DISABLED);
  13632. }
  13633. }
  13634. }, {
  13635. key: 'handleChange',
  13636. value: function handleChange() {
  13637. var optionHasValue = this.adapter_.getValue().length > 0;
  13638. this.adapter_.floatLabel(optionHasValue);
  13639. this.notchOutline(optionHasValue);
  13640. }
  13641. }, {
  13642. key: 'handleFocus',
  13643. value: function handleFocus() {
  13644. this.adapter_.floatLabel(true);
  13645. this.notchOutline(true);
  13646. this.adapter_.activateBottomLine();
  13647. }
  13648. }, {
  13649. key: 'handleBlur',
  13650. value: function handleBlur() {
  13651. this.handleChange();
  13652. this.adapter_.deactivateBottomLine();
  13653. }
  13654. /**
  13655. * Opens/closes the notched outline.
  13656. * @param {boolean} openNotch
  13657. */
  13658. }, {
  13659. key: 'notchOutline',
  13660. value: function notchOutline(openNotch) {
  13661. if (!this.adapter_.hasOutline() || !this.adapter_.hasLabel()) {
  13662. return;
  13663. }
  13664. if (openNotch) {
  13665. var labelScale = __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].LABEL_SCALE;
  13666. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  13667. var isRtl = this.adapter_.isRtl();
  13668. this.adapter_.notchOutline(labelWidth, isRtl);
  13669. } else {
  13670. this.adapter_.closeOutline();
  13671. }
  13672. }
  13673. }]);
  13674. return MDCSelectFoundation;
  13675. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  13676. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectFoundation);
  13677. /***/ }),
  13678. /* 110 */
  13679. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13680. "use strict";
  13681. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13682. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
  13683. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(36);
  13685. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(37);
  13686. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(111);
  13687. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  13688. 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; }; }();
  13689. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13690. 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; }
  13691. 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; }
  13692. /**
  13693. * @license
  13694. * Copyright 2017 Google Inc. All Rights Reserved.
  13695. *
  13696. * Licensed under the Apache License, Version 2.0 (the "License");
  13697. * you may not use this file except in compliance with the License.
  13698. * You may obtain a copy of the License at
  13699. *
  13700. * http://www.apache.org/licenses/LICENSE-2.0
  13701. *
  13702. * Unless required by applicable law or agreed to in writing, software
  13703. * distributed under the License is distributed on an "AS IS" BASIS,
  13704. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13705. * See the License for the specific language governing permissions and
  13706. * limitations under the License.
  13707. */
  13708. /**
  13709. * @extends MDCComponent<!MDCSliderFoundation>
  13710. */
  13711. var MDCSlider = function (_MDCComponent) {
  13712. _inherits(MDCSlider, _MDCComponent);
  13713. _createClass(MDCSlider, null, [{
  13714. key: 'attachTo',
  13715. value: function attachTo(root) {
  13716. return new MDCSlider(root);
  13717. }
  13718. }]);
  13719. function MDCSlider() {
  13720. var _ref;
  13721. _classCallCheck(this, MDCSlider);
  13722. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13723. args[_key] = arguments[_key];
  13724. }
  13725. /** @type {?Element} */
  13726. var _this = _possibleConstructorReturn(this, (_ref = MDCSlider.__proto__ || Object.getPrototypeOf(MDCSlider)).call.apply(_ref, [this].concat(args)));
  13727. _this.thumbContainer_;
  13728. /** @type {?Element} */
  13729. _this.track_;
  13730. /** @type {?Element} */
  13731. _this.pinValueMarker_;
  13732. /** @type {?Element} */
  13733. _this.trackMarkerContainer_;
  13734. return _this;
  13735. }
  13736. /** @return {number} */
  13737. _createClass(MDCSlider, [{
  13738. key: 'initialize',
  13739. value: function initialize() {
  13740. this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR);
  13741. this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_SELECTOR);
  13742. this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR);
  13743. this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR);
  13744. }
  13745. /**
  13746. * @return {!MDCSliderFoundation}
  13747. */
  13748. }, {
  13749. key: 'getDefaultFoundation',
  13750. value: function getDefaultFoundation() {
  13751. var _this2 = this;
  13752. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */](
  13753. /** @type {!MDCSliderAdapter} */{
  13754. hasClass: function hasClass(className) {
  13755. return _this2.root_.classList.contains(className);
  13756. },
  13757. addClass: function addClass(className) {
  13758. return _this2.root_.classList.add(className);
  13759. },
  13760. removeClass: function removeClass(className) {
  13761. return _this2.root_.classList.remove(className);
  13762. },
  13763. getAttribute: function getAttribute(name) {
  13764. return _this2.root_.getAttribute(name);
  13765. },
  13766. setAttribute: function setAttribute(name, value) {
  13767. return _this2.root_.setAttribute(name, value);
  13768. },
  13769. removeAttribute: function removeAttribute(name) {
  13770. return _this2.root_.removeAttribute(name);
  13771. },
  13772. computeBoundingRect: function computeBoundingRect() {
  13773. return _this2.root_.getBoundingClientRect();
  13774. },
  13775. getTabIndex: function getTabIndex() {
  13776. return _this2.root_.tabIndex;
  13777. },
  13778. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  13779. _this2.root_.addEventListener(type, handler);
  13780. },
  13781. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  13782. _this2.root_.removeEventListener(type, handler);
  13783. },
  13784. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(type, handler) {
  13785. _this2.thumbContainer_.addEventListener(type, handler);
  13786. },
  13787. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(type, handler) {
  13788. _this2.thumbContainer_.removeEventListener(type, handler);
  13789. },
  13790. registerBodyInteractionHandler: function registerBodyInteractionHandler(type, handler) {
  13791. document.body.addEventListener(type, handler);
  13792. },
  13793. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(type, handler) {
  13794. document.body.removeEventListener(type, handler);
  13795. },
  13796. registerResizeHandler: function registerResizeHandler(handler) {
  13797. window.addEventListener('resize', handler);
  13798. },
  13799. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  13800. window.removeEventListener('resize', handler);
  13801. },
  13802. notifyInput: function notifyInput() {
  13803. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].INPUT_EVENT, _this2);
  13804. },
  13805. notifyChange: function notifyChange() {
  13806. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].CHANGE_EVENT, _this2);
  13807. },
  13808. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  13809. _this2.thumbContainer_.style.setProperty(propertyName, value);
  13810. },
  13811. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  13812. _this2.track_.style.setProperty(propertyName, value);
  13813. },
  13814. setMarkerValue: function setMarkerValue(value) {
  13815. _this2.pinValueMarker_.innerText = value;
  13816. },
  13817. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  13818. var frag = document.createDocumentFragment();
  13819. for (var i = 0; i < numMarkers; i++) {
  13820. var marker = document.createElement('div');
  13821. marker.classList.add('mdc-slider__track-marker');
  13822. frag.appendChild(marker);
  13823. }
  13824. _this2.trackMarkerContainer_.appendChild(frag);
  13825. },
  13826. removeTrackMarkers: function removeTrackMarkers() {
  13827. while (_this2.trackMarkerContainer_.firstChild) {
  13828. _this2.trackMarkerContainer_.removeChild(_this2.trackMarkerContainer_.firstChild);
  13829. }
  13830. },
  13831. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  13832. // We remove and append new nodes, thus, the last track marker must be dynamically found.
  13833. var lastTrackMarker = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR);
  13834. lastTrackMarker.style.setProperty(propertyName, value);
  13835. },
  13836. isRTL: function isRTL() {
  13837. return getComputedStyle(_this2.root_).direction === 'rtl';
  13838. }
  13839. });
  13840. }
  13841. }, {
  13842. key: 'initialSyncWithDOM',
  13843. value: function initialSyncWithDOM() {
  13844. var origValueNow = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUENOW));
  13845. this.min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  13846. this.max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  13847. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  13848. this.value = origValueNow || this.value;
  13849. this.disabled = this.root_.hasAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_DISABLED) && this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_DISABLED) !== 'false';
  13850. this.foundation_.setupTrackMarker();
  13851. }
  13852. }, {
  13853. key: 'layout',
  13854. value: function layout() {
  13855. this.foundation_.layout();
  13856. }
  13857. /** @param {number=} amount */
  13858. }, {
  13859. key: 'stepUp',
  13860. value: function stepUp() {
  13861. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  13862. this.value += amount;
  13863. }
  13864. /** @param {number=} amount */
  13865. }, {
  13866. key: 'stepDown',
  13867. value: function stepDown() {
  13868. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  13869. this.value -= amount;
  13870. }
  13871. }, {
  13872. key: 'value',
  13873. get: function get() {
  13874. return this.foundation_.getValue();
  13875. }
  13876. /** @param {number} value */
  13877. ,
  13878. set: function set(value) {
  13879. this.foundation_.setValue(value);
  13880. }
  13881. /** @return {number} */
  13882. }, {
  13883. key: 'min',
  13884. get: function get() {
  13885. return this.foundation_.getMin();
  13886. }
  13887. /** @param {number} min */
  13888. ,
  13889. set: function set(min) {
  13890. this.foundation_.setMin(min);
  13891. }
  13892. /** @return {number} */
  13893. }, {
  13894. key: 'max',
  13895. get: function get() {
  13896. return this.foundation_.getMax();
  13897. }
  13898. /** @param {number} max */
  13899. ,
  13900. set: function set(max) {
  13901. this.foundation_.setMax(max);
  13902. }
  13903. /** @return {number} */
  13904. }, {
  13905. key: 'step',
  13906. get: function get() {
  13907. return this.foundation_.getStep();
  13908. }
  13909. /** @param {number} step */
  13910. ,
  13911. set: function set(step) {
  13912. this.foundation_.setStep(step);
  13913. }
  13914. /** @return {boolean} */
  13915. }, {
  13916. key: 'disabled',
  13917. get: function get() {
  13918. return this.foundation_.isDisabled();
  13919. }
  13920. /** @param {boolean} disabled */
  13921. ,
  13922. set: function set(disabled) {
  13923. this.foundation_.setDisabled(disabled);
  13924. }
  13925. }]);
  13926. return MDCSlider;
  13927. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13928. /***/ }),
  13929. /* 111 */
  13930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13931. "use strict";
  13932. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(36);
  13933. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(37);
  13934. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  13935. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_base_foundation__ = __webpack_require__(0);
  13936. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  13937. 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; }; }();
  13938. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13939. 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; }
  13940. 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; }
  13941. /**
  13942. * @license
  13943. * Copyright 2017 Google Inc. All Rights Reserved.
  13944. *
  13945. * Licensed under the Apache License, Version 2.0 (the "License");
  13946. *you may not use this file except in compliance with the License.
  13947. * You may obtain a copy of the License at
  13948. *
  13949. * http://www.apache.org/licenses/LICENSE-2.0
  13950. *
  13951. * Unless required by applicable law or agreed to in writing, software
  13952. * distributed under the License is distributed on an "AS IS" BASIS,
  13953. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13954. * See the License for the specific language governing permissions and
  13955. * limitations under the License.
  13956. */
  13957. /** @enum {string} */
  13958. var KEY_IDS = {
  13959. ARROW_LEFT: 'ArrowLeft',
  13960. ARROW_RIGHT: 'ArrowRight',
  13961. ARROW_UP: 'ArrowUp',
  13962. ARROW_DOWN: 'ArrowDown',
  13963. HOME: 'Home',
  13964. END: 'End',
  13965. PAGE_UP: 'PageUp',
  13966. PAGE_DOWN: 'PageDown'
  13967. };
  13968. /** @enum {string} */
  13969. var MOVE_EVENT_MAP = {
  13970. 'mousedown': 'mousemove',
  13971. 'touchstart': 'touchmove',
  13972. 'pointerdown': 'pointermove'
  13973. };
  13974. var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart'];
  13975. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  13976. /**
  13977. * @extends {MDCFoundation<!MDCSliderAdapter>}
  13978. */
  13979. var MDCSliderFoundation = function (_MDCFoundation) {
  13980. _inherits(MDCSliderFoundation, _MDCFoundation);
  13981. _createClass(MDCSliderFoundation, null, [{
  13982. key: 'cssClasses',
  13983. /** @return enum {cssClasses} */
  13984. get: function get() {
  13985. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  13986. }
  13987. /** @return enum {strings} */
  13988. }, {
  13989. key: 'strings',
  13990. get: function get() {
  13991. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  13992. }
  13993. /** @return enum {numbers} */
  13994. }, {
  13995. key: 'numbers',
  13996. get: function get() {
  13997. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  13998. }
  13999. /** @return {!MDCSliderAdapter} */
  14000. }, {
  14001. key: 'defaultAdapter',
  14002. get: function get() {
  14003. return (/** @type {!MDCSliderAdapter} */{
  14004. hasClass: function hasClass() {
  14005. return (/* className: string */ /* boolean */false
  14006. );
  14007. },
  14008. addClass: function addClass() /* className: string */{},
  14009. removeClass: function removeClass() /* className: string */{},
  14010. getAttribute: function getAttribute() {
  14011. return (/* name: string */ /* string|null */null
  14012. );
  14013. },
  14014. setAttribute: function setAttribute() /* name: string, value: string */{},
  14015. removeAttribute: function removeAttribute() /* name: string */{},
  14016. computeBoundingRect: function computeBoundingRect() {
  14017. return (/* ClientRect */{
  14018. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  14019. }
  14020. );
  14021. },
  14022. getTabIndex: function getTabIndex() {
  14023. return (/* number */0
  14024. );
  14025. },
  14026. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  14027. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  14028. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  14029. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  14030. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  14031. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  14032. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  14033. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  14034. notifyInput: function notifyInput() {},
  14035. notifyChange: function notifyChange() {},
  14036. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  14037. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  14038. setMarkerValue: function setMarkerValue() /* value: number */{},
  14039. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  14040. removeTrackMarkers: function removeTrackMarkers() {},
  14041. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  14042. isRTL: function isRTL() {
  14043. return (/* boolean */false
  14044. );
  14045. }
  14046. }
  14047. );
  14048. }
  14049. /**
  14050. * Creates a new instance of MDCSliderFoundation
  14051. * @param {?MDCSliderAdapter} adapter
  14052. */
  14053. }]);
  14054. function MDCSliderFoundation(adapter) {
  14055. _classCallCheck(this, MDCSliderFoundation);
  14056. /** @private {?ClientRect} */
  14057. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  14058. _this.rect_ = null;
  14059. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  14060. // because those could be valid tabindices set by the client code.
  14061. _this.savedTabIndex_ = NaN;
  14062. _this.active_ = false;
  14063. _this.inTransit_ = false;
  14064. _this.isDiscrete_ = false;
  14065. _this.hasTrackMarker_ = false;
  14066. _this.handlingThumbTargetEvt_ = false;
  14067. _this.min_ = 0;
  14068. _this.max_ = 100;
  14069. _this.step_ = 0;
  14070. _this.value_ = 0;
  14071. _this.disabled_ = false;
  14072. _this.preventFocusState_ = false;
  14073. _this.updateUIFrame_ = 0;
  14074. _this.thumbContainerPointerHandler_ = function () {
  14075. _this.handlingThumbTargetEvt_ = true;
  14076. };
  14077. _this.interactionStartHandler_ = function (evt) {
  14078. return _this.handleDown_(evt);
  14079. };
  14080. _this.keydownHandler_ = function (evt) {
  14081. return _this.handleKeydown_(evt);
  14082. };
  14083. _this.focusHandler_ = function () {
  14084. return _this.handleFocus_();
  14085. };
  14086. _this.blurHandler_ = function () {
  14087. return _this.handleBlur_();
  14088. };
  14089. _this.resizeHandler_ = function () {
  14090. return _this.layout();
  14091. };
  14092. return _this;
  14093. }
  14094. _createClass(MDCSliderFoundation, [{
  14095. key: 'init',
  14096. value: function init() {
  14097. var _this2 = this;
  14098. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  14099. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  14100. DOWN_EVENTS.forEach(function (evtName) {
  14101. return _this2.adapter_.registerInteractionHandler(evtName, _this2.interactionStartHandler_);
  14102. });
  14103. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  14104. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  14105. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  14106. DOWN_EVENTS.forEach(function (evtName) {
  14107. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  14108. });
  14109. this.adapter_.registerResizeHandler(this.resizeHandler_);
  14110. this.layout();
  14111. // At last step, provide a reasonable default value to discrete slider
  14112. if (this.isDiscrete_ && this.getStep() == 0) {
  14113. this.step_ = 1;
  14114. }
  14115. }
  14116. }, {
  14117. key: 'destroy',
  14118. value: function destroy() {
  14119. var _this3 = this;
  14120. DOWN_EVENTS.forEach(function (evtName) {
  14121. _this3.adapter_.deregisterInteractionHandler(evtName, _this3.interactionStartHandler_);
  14122. });
  14123. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  14124. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  14125. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  14126. DOWN_EVENTS.forEach(function (evtName) {
  14127. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  14128. });
  14129. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  14130. }
  14131. }, {
  14132. key: 'setupTrackMarker',
  14133. value: function setupTrackMarker() {
  14134. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  14135. var min = this.getMin();
  14136. var max = this.getMax();
  14137. var step = this.getStep();
  14138. var numMarkers = (max - min) / step;
  14139. // In case distance between max & min is indivisible to step,
  14140. // we place the secondary to last marker proportionally at where thumb
  14141. // could reach and place the last marker at max value
  14142. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  14143. if (indivisible) {
  14144. numMarkers = Math.ceil(numMarkers);
  14145. }
  14146. this.adapter_.removeTrackMarkers();
  14147. this.adapter_.appendTrackMarkers(numMarkers);
  14148. if (indivisible) {
  14149. var lastStepRatio = (max - numMarkers * step) / step + 1;
  14150. var flex = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'flex');
  14151. this.adapter_.setLastTrackMarkersStyleProperty(flex, String(lastStepRatio));
  14152. }
  14153. }
  14154. }
  14155. }, {
  14156. key: 'layout',
  14157. value: function layout() {
  14158. this.rect_ = this.adapter_.computeBoundingRect();
  14159. this.updateUIForCurrentValue_();
  14160. }
  14161. /** @return {number} */
  14162. }, {
  14163. key: 'getValue',
  14164. value: function getValue() {
  14165. return this.value_;
  14166. }
  14167. /** @param {number} value */
  14168. }, {
  14169. key: 'setValue',
  14170. value: function setValue(value) {
  14171. this.setValue_(value, false);
  14172. }
  14173. /** @return {number} */
  14174. }, {
  14175. key: 'getMax',
  14176. value: function getMax() {
  14177. return this.max_;
  14178. }
  14179. /** @param {number} max */
  14180. }, {
  14181. key: 'setMax',
  14182. value: function setMax(max) {
  14183. if (max < this.min_) {
  14184. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  14185. }
  14186. this.max_ = max;
  14187. this.setValue_(this.value_, false, true);
  14188. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  14189. this.setupTrackMarker();
  14190. }
  14191. /** @return {number} */
  14192. }, {
  14193. key: 'getMin',
  14194. value: function getMin() {
  14195. return this.min_;
  14196. }
  14197. /** @param {number} min */
  14198. }, {
  14199. key: 'setMin',
  14200. value: function setMin(min) {
  14201. if (min > this.max_) {
  14202. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  14203. }
  14204. this.min_ = min;
  14205. this.setValue_(this.value_, false, true);
  14206. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  14207. this.setupTrackMarker();
  14208. }
  14209. /** @return {number} */
  14210. }, {
  14211. key: 'getStep',
  14212. value: function getStep() {
  14213. return this.step_;
  14214. }
  14215. /** @param {number} step */
  14216. }, {
  14217. key: 'setStep',
  14218. value: function setStep(step) {
  14219. if (step < 0) {
  14220. throw new Error('Step cannot be set to a negative number');
  14221. }
  14222. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  14223. step = 1;
  14224. }
  14225. this.step_ = step;
  14226. this.setValue_(this.value_, false, true);
  14227. this.setupTrackMarker();
  14228. }
  14229. /** @return {boolean} */
  14230. }, {
  14231. key: 'isDisabled',
  14232. value: function isDisabled() {
  14233. return this.disabled_;
  14234. }
  14235. /** @param {boolean} disabled */
  14236. }, {
  14237. key: 'setDisabled',
  14238. value: function setDisabled(disabled) {
  14239. this.disabled_ = disabled;
  14240. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  14241. if (this.disabled_) {
  14242. this.savedTabIndex_ = this.adapter_.getTabIndex();
  14243. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  14244. this.adapter_.removeAttribute('tabindex');
  14245. } else {
  14246. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  14247. if (!isNaN(this.savedTabIndex_)) {
  14248. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  14249. }
  14250. }
  14251. }
  14252. /**
  14253. * Called when the user starts interacting with the slider
  14254. * @param {!Event} evt
  14255. * @private
  14256. */
  14257. }, {
  14258. key: 'handleDown_',
  14259. value: function handleDown_(evt) {
  14260. var _this4 = this;
  14261. if (this.disabled_) {
  14262. return;
  14263. }
  14264. this.preventFocusState_ = true;
  14265. this.setInTransit_(!this.handlingThumbTargetEvt_);
  14266. this.handlingThumbTargetEvt_ = false;
  14267. this.setActive_(true);
  14268. var moveHandler = function moveHandler(evt) {
  14269. _this4.handleMove_(evt);
  14270. };
  14271. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  14272. // do not always fire these consistently in pairs.
  14273. // (See https://github.com/material-components/material-components-web/issues/1192)
  14274. var upHandler = function upHandler() {
  14275. _this4.handleUp_();
  14276. _this4.adapter_.deregisterBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  14277. UP_EVENTS.forEach(function (evtName) {
  14278. return _this4.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  14279. });
  14280. };
  14281. this.adapter_.registerBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  14282. UP_EVENTS.forEach(function (evtName) {
  14283. return _this4.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  14284. });
  14285. this.setValueFromEvt_(evt);
  14286. }
  14287. /**
  14288. * Called when the user moves the slider
  14289. * @param {!Event} evt
  14290. * @private
  14291. */
  14292. }, {
  14293. key: 'handleMove_',
  14294. value: function handleMove_(evt) {
  14295. evt.preventDefault();
  14296. this.setValueFromEvt_(evt);
  14297. }
  14298. /**
  14299. * Called when the user's interaction with the slider ends
  14300. * @private
  14301. */
  14302. }, {
  14303. key: 'handleUp_',
  14304. value: function handleUp_() {
  14305. this.setActive_(false);
  14306. this.adapter_.notifyChange();
  14307. }
  14308. /**
  14309. * Returns the pageX of the event
  14310. * @param {!Event} evt
  14311. * @return {number}
  14312. * @private
  14313. */
  14314. }, {
  14315. key: 'getPageX_',
  14316. value: function getPageX_(evt) {
  14317. if (evt.targetTouches && evt.targetTouches.length > 0) {
  14318. return evt.targetTouches[0].pageX;
  14319. }
  14320. return evt.pageX;
  14321. }
  14322. /**
  14323. * Sets the slider value from an event
  14324. * @param {!Event} evt
  14325. * @private
  14326. */
  14327. }, {
  14328. key: 'setValueFromEvt_',
  14329. value: function setValueFromEvt_(evt) {
  14330. var pageX = this.getPageX_(evt);
  14331. var value = this.computeValueFromPageX_(pageX);
  14332. this.setValue_(value, true);
  14333. }
  14334. /**
  14335. * Computes the new value from the pageX position
  14336. * @param {number} pageX
  14337. * @return {number}
  14338. */
  14339. }, {
  14340. key: 'computeValueFromPageX_',
  14341. value: function computeValueFromPageX_(pageX) {
  14342. var max = this.max_,
  14343. min = this.min_;
  14344. var xPos = pageX - this.rect_.left;
  14345. var pctComplete = xPos / this.rect_.width;
  14346. if (this.adapter_.isRTL()) {
  14347. pctComplete = 1 - pctComplete;
  14348. }
  14349. // Fit the percentage complete between the range [min,max]
  14350. // by remapping from [0, 1] to [min, min+(max-min)].
  14351. return min + pctComplete * (max - min);
  14352. }
  14353. /**
  14354. * Handles keydown events
  14355. * @param {!Event} evt
  14356. */
  14357. }, {
  14358. key: 'handleKeydown_',
  14359. value: function handleKeydown_(evt) {
  14360. var keyId = this.getKeyId_(evt);
  14361. var value = this.getValueForKeyId_(keyId);
  14362. if (isNaN(value)) {
  14363. return;
  14364. }
  14365. // Prevent page from scrolling due to key presses that would normally scroll the page
  14366. evt.preventDefault();
  14367. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  14368. this.setValue_(value, true);
  14369. this.adapter_.notifyChange();
  14370. }
  14371. /**
  14372. * Returns the computed name of the event
  14373. * @param {!Event} kbdEvt
  14374. * @return {string}
  14375. */
  14376. }, {
  14377. key: 'getKeyId_',
  14378. value: function getKeyId_(kbdEvt) {
  14379. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  14380. return KEY_IDS.ARROW_LEFT;
  14381. }
  14382. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  14383. return KEY_IDS.ARROW_RIGHT;
  14384. }
  14385. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  14386. return KEY_IDS.ARROW_UP;
  14387. }
  14388. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  14389. return KEY_IDS.ARROW_DOWN;
  14390. }
  14391. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  14392. return KEY_IDS.HOME;
  14393. }
  14394. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  14395. return KEY_IDS.END;
  14396. }
  14397. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  14398. return KEY_IDS.PAGE_UP;
  14399. }
  14400. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  14401. return KEY_IDS.PAGE_DOWN;
  14402. }
  14403. return '';
  14404. }
  14405. /**
  14406. * Computes the value given a keyboard key ID
  14407. * @param {string} keyId
  14408. * @return {number}
  14409. */
  14410. }, {
  14411. key: 'getValueForKeyId_',
  14412. value: function getValueForKeyId_(keyId) {
  14413. var max = this.max_,
  14414. min = this.min_,
  14415. step = this.step_;
  14416. var delta = step || (max - min) / 100;
  14417. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  14418. if (valueNeedsToBeFlipped) {
  14419. delta = -delta;
  14420. }
  14421. switch (keyId) {
  14422. case KEY_IDS.ARROW_LEFT:
  14423. case KEY_IDS.ARROW_DOWN:
  14424. return this.value_ - delta;
  14425. case KEY_IDS.ARROW_RIGHT:
  14426. case KEY_IDS.ARROW_UP:
  14427. return this.value_ + delta;
  14428. case KEY_IDS.HOME:
  14429. return this.min_;
  14430. case KEY_IDS.END:
  14431. return this.max_;
  14432. case KEY_IDS.PAGE_UP:
  14433. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  14434. case KEY_IDS.PAGE_DOWN:
  14435. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  14436. default:
  14437. return NaN;
  14438. }
  14439. }
  14440. }, {
  14441. key: 'handleFocus_',
  14442. value: function handleFocus_() {
  14443. if (this.preventFocusState_) {
  14444. return;
  14445. }
  14446. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  14447. }
  14448. }, {
  14449. key: 'handleBlur_',
  14450. value: function handleBlur_() {
  14451. this.preventFocusState_ = false;
  14452. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  14453. }
  14454. /**
  14455. * Sets the value of the slider
  14456. * @param {number} value
  14457. * @param {boolean} shouldFireInput
  14458. * @param {boolean=} force
  14459. */
  14460. }, {
  14461. key: 'setValue_',
  14462. value: function setValue_(value, shouldFireInput) {
  14463. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14464. if (value === this.value_ && !force) {
  14465. return;
  14466. }
  14467. var min = this.min_,
  14468. max = this.max_;
  14469. var valueSetToBoundary = value === min || value === max;
  14470. if (this.step_ && !valueSetToBoundary) {
  14471. value = this.quantize_(value);
  14472. }
  14473. if (value < min) {
  14474. value = min;
  14475. } else if (value > max) {
  14476. value = max;
  14477. }
  14478. this.value_ = value;
  14479. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  14480. this.updateUIForCurrentValue_();
  14481. if (shouldFireInput) {
  14482. this.adapter_.notifyInput();
  14483. if (this.isDiscrete_) {
  14484. this.adapter_.setMarkerValue(value);
  14485. }
  14486. }
  14487. }
  14488. /**
  14489. * Calculates the quantized value
  14490. * @param {number} value
  14491. * @return {number}
  14492. */
  14493. }, {
  14494. key: 'quantize_',
  14495. value: function quantize_(value) {
  14496. var numSteps = Math.round(value / this.step_);
  14497. var quantizedVal = numSteps * this.step_;
  14498. return quantizedVal;
  14499. }
  14500. }, {
  14501. key: 'updateUIForCurrentValue_',
  14502. value: function updateUIForCurrentValue_() {
  14503. var _this5 = this;
  14504. var max = this.max_,
  14505. min = this.min_,
  14506. value = this.value_;
  14507. var pctComplete = (value - min) / (max - min);
  14508. var translatePx = pctComplete * this.rect_.width;
  14509. if (this.adapter_.isRTL()) {
  14510. translatePx = this.rect_.width - translatePx;
  14511. }
  14512. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'transform');
  14513. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend');
  14514. if (this.inTransit_) {
  14515. var onTransitionEnd = function onTransitionEnd() {
  14516. _this5.setInTransit_(false);
  14517. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  14518. };
  14519. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  14520. }
  14521. this.updateUIFrame_ = requestAnimationFrame(function () {
  14522. // NOTE(traviskaufman): It would be nice to use calc() here,
  14523. // but IE cannot handle calcs in transforms correctly.
  14524. // See: https://goo.gl/NC2itk
  14525. // Also note that the -50% offset is used to center the slider thumb.
  14526. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  14527. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  14528. });
  14529. }
  14530. /**
  14531. * Toggles the active state of the slider
  14532. * @param {boolean} active
  14533. */
  14534. }, {
  14535. key: 'setActive_',
  14536. value: function setActive_(active) {
  14537. this.active_ = active;
  14538. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  14539. }
  14540. /**
  14541. * Toggles the inTransit state of the slider
  14542. * @param {boolean} inTransit
  14543. */
  14544. }, {
  14545. key: 'setInTransit_',
  14546. value: function setInTransit_(inTransit) {
  14547. this.inTransit_ = inTransit;
  14548. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  14549. }
  14550. /**
  14551. * Conditionally adds or removes a class based on shouldBePresent
  14552. * @param {string} className
  14553. * @param {boolean} shouldBePresent
  14554. */
  14555. }, {
  14556. key: 'toggleClass_',
  14557. value: function toggleClass_(className, shouldBePresent) {
  14558. if (shouldBePresent) {
  14559. this.adapter_.addClass(className);
  14560. } else {
  14561. this.adapter_.removeClass(className);
  14562. }
  14563. }
  14564. }]);
  14565. return MDCSliderFoundation;
  14566. }(__WEBPACK_IMPORTED_MODULE_3__material_base_foundation__["a" /* default */]);
  14567. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  14568. /***/ }),
  14569. /* 112 */
  14570. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14571. "use strict";
  14572. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  14574. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  14575. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(113);
  14576. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  14577. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  14578. 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; }; }();
  14579. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14580. 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; }
  14581. 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; }
  14582. /**
  14583. * Copyright 2016 Google Inc. All Rights Reserved.
  14584. *
  14585. * Licensed under the Apache License, Version 2.0 (the "License");
  14586. * you may not use this file except in compliance with the License.
  14587. * You may obtain a copy of the License at
  14588. *
  14589. * http://www.apache.org/licenses/LICENSE-2.0
  14590. *
  14591. * Unless required by applicable law or agreed to in writing, software
  14592. * distributed under the License is distributed on an "AS IS" BASIS,
  14593. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14594. * See the License for the specific language governing permissions and
  14595. * limitations under the License.
  14596. */
  14597. var MDCSnackbar = function (_MDCComponent) {
  14598. _inherits(MDCSnackbar, _MDCComponent);
  14599. function MDCSnackbar() {
  14600. _classCallCheck(this, MDCSnackbar);
  14601. return _possibleConstructorReturn(this, (MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).apply(this, arguments));
  14602. }
  14603. _createClass(MDCSnackbar, [{
  14604. key: 'show',
  14605. value: function show(data) {
  14606. this.foundation_.show(data);
  14607. }
  14608. }, {
  14609. key: 'getDefaultFoundation',
  14610. value: function getDefaultFoundation() {
  14611. var _this2 = this;
  14612. var _MDCSnackbarFoundatio = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  14613. TEXT_SELECTOR = _MDCSnackbarFoundatio.TEXT_SELECTOR,
  14614. ACTION_BUTTON_SELECTOR = _MDCSnackbarFoundatio.ACTION_BUTTON_SELECTOR;
  14615. var getText = function getText() {
  14616. return _this2.root_.querySelector(TEXT_SELECTOR);
  14617. };
  14618. var getActionButton = function getActionButton() {
  14619. return _this2.root_.querySelector(ACTION_BUTTON_SELECTOR);
  14620. };
  14621. /* eslint brace-style: "off" */
  14622. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  14623. addClass: function addClass(className) {
  14624. return _this2.root_.classList.add(className);
  14625. },
  14626. removeClass: function removeClass(className) {
  14627. return _this2.root_.classList.remove(className);
  14628. },
  14629. setAriaHidden: function setAriaHidden() {
  14630. return _this2.root_.setAttribute('aria-hidden', 'true');
  14631. },
  14632. unsetAriaHidden: function unsetAriaHidden() {
  14633. return _this2.root_.removeAttribute('aria-hidden');
  14634. },
  14635. setActionAriaHidden: function setActionAriaHidden() {
  14636. return getActionButton().setAttribute('aria-hidden', 'true');
  14637. },
  14638. unsetActionAriaHidden: function unsetActionAriaHidden() {
  14639. return getActionButton().removeAttribute('aria-hidden');
  14640. },
  14641. setActionText: function setActionText(text) {
  14642. getActionButton().textContent = text;
  14643. },
  14644. setMessageText: function setMessageText(text) {
  14645. getText().textContent = text;
  14646. },
  14647. setFocus: function setFocus() {
  14648. return getActionButton().focus();
  14649. },
  14650. visibilityIsHidden: function visibilityIsHidden() {
  14651. return document.hidden;
  14652. },
  14653. registerCapturedBlurHandler: function registerCapturedBlurHandler(handler) {
  14654. return getActionButton().addEventListener('blur', handler, true);
  14655. },
  14656. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler(handler) {
  14657. return getActionButton().removeEventListener('blur', handler, true);
  14658. },
  14659. registerVisibilityChangeHandler: function registerVisibilityChangeHandler(handler) {
  14660. return document.addEventListener('visibilitychange', handler);
  14661. },
  14662. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler(handler) {
  14663. return document.removeEventListener('visibilitychange', handler);
  14664. },
  14665. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  14666. return document.body.addEventListener(evt, handler, true);
  14667. },
  14668. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  14669. return document.body.removeEventListener(evt, handler, true);
  14670. },
  14671. registerActionClickHandler: function registerActionClickHandler(handler) {
  14672. return getActionButton().addEventListener('click', handler);
  14673. },
  14674. deregisterActionClickHandler: function deregisterActionClickHandler(handler) {
  14675. return getActionButton().removeEventListener('click', handler);
  14676. },
  14677. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  14678. return _this2.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  14679. },
  14680. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  14681. return _this2.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  14682. },
  14683. notifyShow: function notifyShow() {
  14684. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.SHOW_EVENT);
  14685. },
  14686. notifyHide: function notifyHide() {
  14687. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.HIDE_EVENT);
  14688. }
  14689. });
  14690. }
  14691. }, {
  14692. key: 'dismissesOnAction',
  14693. get: function get() {
  14694. return this.foundation_.dismissesOnAction();
  14695. },
  14696. set: function set(dismissesOnAction) {
  14697. this.foundation_.setDismissOnAction(dismissesOnAction);
  14698. }
  14699. }], [{
  14700. key: 'attachTo',
  14701. value: function attachTo(root) {
  14702. return new MDCSnackbar(root);
  14703. }
  14704. }]);
  14705. return MDCSnackbar;
  14706. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  14707. /***/ }),
  14708. /* 113 */
  14709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14710. "use strict";
  14711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  14712. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(114);
  14713. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  14714. 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; }; }();
  14715. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14716. 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; }
  14717. 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; }
  14718. /**
  14719. * Copyright 2016 Google Inc. All Rights Reserved.
  14720. *
  14721. * Licensed under the Apache License, Version 2.0 (the "License");
  14722. * you may not use this file except in compliance with the License.
  14723. * You may obtain a copy of the License at
  14724. *
  14725. * http://www.apache.org/licenses/LICENSE-2.0
  14726. *
  14727. * Unless required by applicable law or agreed to in writing, software
  14728. * distributed under the License is distributed on an "AS IS" BASIS,
  14729. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14730. * See the License for the specific language governing permissions and
  14731. * limitations under the License.
  14732. */
  14733. var MDCSnackbarFoundation = function (_MDCFoundation) {
  14734. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  14735. _createClass(MDCSnackbarFoundation, [{
  14736. key: 'active',
  14737. get: function get() {
  14738. return this.active_;
  14739. }
  14740. }], [{
  14741. key: 'cssClasses',
  14742. get: function get() {
  14743. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  14744. }
  14745. }, {
  14746. key: 'strings',
  14747. get: function get() {
  14748. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  14749. }
  14750. }, {
  14751. key: 'defaultAdapter',
  14752. get: function get() {
  14753. return {
  14754. addClass: function addClass() /* className: string */{},
  14755. removeClass: function removeClass() /* className: string */{},
  14756. setAriaHidden: function setAriaHidden() {},
  14757. unsetAriaHidden: function unsetAriaHidden() {},
  14758. setActionAriaHidden: function setActionAriaHidden() {},
  14759. unsetActionAriaHidden: function unsetActionAriaHidden() {},
  14760. setActionText: function setActionText() /* actionText: string */{},
  14761. setMessageText: function setMessageText() /* message: string */{},
  14762. setFocus: function setFocus() {},
  14763. visibilityIsHidden: function visibilityIsHidden() {
  14764. return (/* boolean */false
  14765. );
  14766. },
  14767. registerCapturedBlurHandler: function registerCapturedBlurHandler() /* handler: EventListener */{},
  14768. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler() /* handler: EventListener */{},
  14769. registerVisibilityChangeHandler: function registerVisibilityChangeHandler() /* handler: EventListener */{},
  14770. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler() /* handler: EventListener */{},
  14771. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  14772. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  14773. registerActionClickHandler: function registerActionClickHandler() /* handler: EventListener */{},
  14774. deregisterActionClickHandler: function deregisterActionClickHandler() /* handler: EventListener */{},
  14775. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  14776. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  14777. notifyShow: function notifyShow() {},
  14778. notifyHide: function notifyHide() {}
  14779. };
  14780. }
  14781. }]);
  14782. function MDCSnackbarFoundation(adapter) {
  14783. _classCallCheck(this, MDCSnackbarFoundation);
  14784. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  14785. _this.active_ = false;
  14786. _this.actionWasClicked_ = false;
  14787. _this.dismissOnAction_ = true;
  14788. _this.firstFocus_ = true;
  14789. _this.pointerDownRecognized_ = false;
  14790. _this.snackbarHasFocus_ = false;
  14791. _this.snackbarData_ = null;
  14792. _this.queue_ = [];
  14793. _this.actionClickHandler_ = function () {
  14794. _this.actionWasClicked_ = true;
  14795. _this.invokeAction_();
  14796. };
  14797. _this.visibilitychangeHandler_ = function () {
  14798. clearTimeout(_this.timeoutId_);
  14799. _this.snackbarHasFocus_ = true;
  14800. if (!_this.adapter_.visibilityIsHidden()) {
  14801. setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  14802. }
  14803. };
  14804. _this.interactionHandler_ = function (evt) {
  14805. if (evt.type == 'touchstart' || evt.type == 'mousedown') {
  14806. _this.pointerDownRecognized_ = true;
  14807. }
  14808. _this.handlePossibleTabKeyboardFocus_(evt);
  14809. if (evt.type == 'focus') {
  14810. _this.pointerDownRecognized_ = false;
  14811. }
  14812. };
  14813. _this.blurHandler_ = function () {
  14814. clearTimeout(_this.timeoutId_);
  14815. _this.snackbarHasFocus_ = false;
  14816. _this.timeoutId_ = setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  14817. };
  14818. return _this;
  14819. }
  14820. _createClass(MDCSnackbarFoundation, [{
  14821. key: 'init',
  14822. value: function init() {
  14823. this.adapter_.registerActionClickHandler(this.actionClickHandler_);
  14824. this.adapter_.setAriaHidden();
  14825. this.adapter_.setActionAriaHidden();
  14826. }
  14827. }, {
  14828. key: 'destroy',
  14829. value: function destroy() {
  14830. var _this2 = this;
  14831. this.adapter_.deregisterActionClickHandler(this.actionClickHandler_);
  14832. this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_);
  14833. this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_);
  14834. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  14835. _this2.adapter_.deregisterCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  14836. });
  14837. }
  14838. }, {
  14839. key: 'dismissesOnAction',
  14840. value: function dismissesOnAction() {
  14841. return this.dismissOnAction_;
  14842. }
  14843. }, {
  14844. key: 'setDismissOnAction',
  14845. value: function setDismissOnAction(dismissOnAction) {
  14846. this.dismissOnAction_ = !!dismissOnAction;
  14847. }
  14848. }, {
  14849. key: 'show',
  14850. value: function show(data) {
  14851. var _this3 = this;
  14852. if (!data) {
  14853. throw new Error('Please provide a data object with at least a message to display.');
  14854. }
  14855. if (!data.message) {
  14856. throw new Error('Please provide a message to be displayed.');
  14857. }
  14858. if (data.actionHandler && !data.actionText) {
  14859. throw new Error('Please provide action text with the handler.');
  14860. }
  14861. if (this.active) {
  14862. this.queue_.push(data);
  14863. return;
  14864. }
  14865. clearTimeout(this.timeoutId_);
  14866. this.snackbarData_ = data;
  14867. this.firstFocus_ = true;
  14868. this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_);
  14869. this.adapter_.registerCapturedBlurHandler(this.blurHandler_);
  14870. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  14871. _this3.adapter_.registerCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  14872. });
  14873. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  14874. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  14875. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  14876. this.adapter_.setMessageText(this.snackbarData_.message);
  14877. if (this.snackbarData_.multiline) {
  14878. this.adapter_.addClass(MULTILINE);
  14879. if (this.snackbarData_.actionOnBottom) {
  14880. this.adapter_.addClass(ACTION_ON_BOTTOM);
  14881. }
  14882. }
  14883. if (this.snackbarData_.actionHandler) {
  14884. this.adapter_.setActionText(this.snackbarData_.actionText);
  14885. this.actionHandler_ = this.snackbarData_.actionHandler;
  14886. this.setActionHidden_(false);
  14887. } else {
  14888. this.setActionHidden_(true);
  14889. this.actionHandler_ = null;
  14890. this.adapter_.setActionText(null);
  14891. }
  14892. this.active_ = true;
  14893. this.adapter_.addClass(ACTIVE);
  14894. this.adapter_.unsetAriaHidden();
  14895. this.adapter_.notifyShow();
  14896. this.timeoutId_ = setTimeout(this.cleanup_.bind(this), this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  14897. }
  14898. }, {
  14899. key: 'handlePossibleTabKeyboardFocus_',
  14900. value: function handlePossibleTabKeyboardFocus_() {
  14901. var hijackFocus = this.firstFocus_ && !this.pointerDownRecognized_;
  14902. if (hijackFocus) {
  14903. this.setFocusOnAction_();
  14904. }
  14905. this.firstFocus_ = false;
  14906. }
  14907. }, {
  14908. key: 'setFocusOnAction_',
  14909. value: function setFocusOnAction_() {
  14910. this.adapter_.setFocus();
  14911. this.snackbarHasFocus_ = true;
  14912. this.firstFocus_ = false;
  14913. }
  14914. }, {
  14915. key: 'invokeAction_',
  14916. value: function invokeAction_() {
  14917. try {
  14918. if (!this.actionHandler_) {
  14919. return;
  14920. }
  14921. this.actionHandler_();
  14922. } finally {
  14923. if (this.dismissOnAction_) {
  14924. this.cleanup_();
  14925. }
  14926. }
  14927. }
  14928. }, {
  14929. key: 'cleanup_',
  14930. value: function cleanup_() {
  14931. var _this4 = this;
  14932. var allowDismissal = !this.snackbarHasFocus_ || this.actionWasClicked_;
  14933. if (allowDismissal) {
  14934. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  14935. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  14936. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  14937. this.adapter_.removeClass(ACTIVE);
  14938. var handler = function handler() {
  14939. clearTimeout(_this4.timeoutId_);
  14940. _this4.adapter_.deregisterTransitionEndHandler(handler);
  14941. _this4.adapter_.removeClass(MULTILINE);
  14942. _this4.adapter_.removeClass(ACTION_ON_BOTTOM);
  14943. _this4.setActionHidden_(true);
  14944. _this4.adapter_.setAriaHidden();
  14945. _this4.active_ = false;
  14946. _this4.snackbarHasFocus_ = false;
  14947. _this4.adapter_.notifyHide();
  14948. _this4.showNext_();
  14949. };
  14950. this.adapter_.registerTransitionEndHandler(handler);
  14951. }
  14952. }
  14953. }, {
  14954. key: 'showNext_',
  14955. value: function showNext_() {
  14956. if (!this.queue_.length) {
  14957. return;
  14958. }
  14959. this.show(this.queue_.shift());
  14960. }
  14961. }, {
  14962. key: 'setActionHidden_',
  14963. value: function setActionHidden_(isHidden) {
  14964. if (isHidden) {
  14965. this.adapter_.setActionAriaHidden();
  14966. } else {
  14967. this.adapter_.unsetActionAriaHidden();
  14968. }
  14969. }
  14970. }]);
  14971. return MDCSnackbarFoundation;
  14972. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  14973. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  14974. /***/ }),
  14975. /* 114 */
  14976. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14977. "use strict";
  14978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  14980. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  14981. /**
  14982. * Copyright 2016 Google Inc. All Rights Reserved.
  14983. *
  14984. * Licensed under the Apache License, Version 2.0 (the "License");
  14985. * you may not use this file except in compliance with the License.
  14986. * You may obtain a copy of the License at
  14987. *
  14988. * http://www.apache.org/licenses/LICENSE-2.0
  14989. *
  14990. * Unless required by applicable law or agreed to in writing, software
  14991. * distributed under the License is distributed on an "AS IS" BASIS,
  14992. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14993. * See the License for the specific language governing permissions and
  14994. * limitations under the License.
  14995. */
  14996. var cssClasses = {
  14997. ROOT: 'mdc-snackbar',
  14998. TEXT: 'mdc-snackbar__text',
  14999. ACTION_WRAPPER: 'mdc-snackbar__action-wrapper',
  15000. ACTION_BUTTON: 'mdc-snackbar__action-button',
  15001. ACTIVE: 'mdc-snackbar--active',
  15002. MULTILINE: 'mdc-snackbar--multiline',
  15003. ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'
  15004. };
  15005. var strings = {
  15006. TEXT_SELECTOR: '.mdc-snackbar__text',
  15007. ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper',
  15008. ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button',
  15009. SHOW_EVENT: 'MDCSnackbar:show',
  15010. HIDE_EVENT: 'MDCSnackbar:hide'
  15011. };
  15012. var numbers = {
  15013. MESSAGE_TIMEOUT: 2750
  15014. };
  15015. /***/ }),
  15016. /* 115 */
  15017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15018. "use strict";
  15019. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitch", function() { return MDCSwitch; });
  15021. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  15022. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  15023. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(116);
  15024. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(3);
  15025. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_util__ = __webpack_require__(6);
  15026. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitchFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  15027. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15028. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  15029. 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; }; }();
  15030. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15031. 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; }
  15032. 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; }
  15033. /**
  15034. * @license
  15035. * Copyright 2018 Google Inc. All Rights Reserved.
  15036. *
  15037. * Licensed under the Apache License, Version 2.0 (the "License");
  15038. * you may not use this file except in compliance with the License.
  15039. * You may obtain a copy of the License at
  15040. *
  15041. * http://www.apache.org/licenses/LICENSE-2.0
  15042. *
  15043. * Unless required by applicable law or agreed to in writing, software
  15044. * distributed under the License is distributed on an "AS IS" BASIS,
  15045. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15046. * See the License for the specific language governing permissions and
  15047. * limitations under the License.
  15048. */
  15049. /* eslint-disable no-unused-vars */
  15050. /* eslint-enable no-unused-vars */
  15051. /**
  15052. * @extends MDCComponent<!MDCSwitchFoundation>
  15053. * @implements {MDCSelectionControl}
  15054. */
  15055. var MDCSwitch = function (_MDCComponent) {
  15056. _inherits(MDCSwitch, _MDCComponent);
  15057. _createClass(MDCSwitch, null, [{
  15058. key: 'attachTo',
  15059. value: function attachTo(root) {
  15060. return new MDCSwitch(root);
  15061. }
  15062. }]);
  15063. function MDCSwitch() {
  15064. var _ref;
  15065. _classCallCheck(this, MDCSwitch);
  15066. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15067. args[_key] = arguments[_key];
  15068. }
  15069. /** @private {!MDCRipple} */
  15070. var _this = _possibleConstructorReturn(this, (_ref = MDCSwitch.__proto__ || Object.getPrototypeOf(MDCSwitch)).call.apply(_ref, [this].concat(args)));
  15071. _this.ripple_ = _this.initRipple_();
  15072. /** @private {!Function} */
  15073. _this.changeHandler_;
  15074. return _this;
  15075. }
  15076. _createClass(MDCSwitch, [{
  15077. key: 'destroy',
  15078. value: function destroy() {
  15079. _get(MDCSwitch.prototype.__proto__ || Object.getPrototypeOf(MDCSwitch.prototype), 'destroy', this).call(this);
  15080. this.ripple_.destroy();
  15081. this.nativeControl_.removeEventListener('change', this.changeHandler_);
  15082. }
  15083. }, {
  15084. key: 'initialSyncWithDOM',
  15085. value: function initialSyncWithDOM() {
  15086. this.changeHandler_ = this.foundation_.handleChange.bind(this.foundation_);
  15087. this.nativeControl_.addEventListener('change', this.changeHandler_);
  15088. }
  15089. /**
  15090. * Returns the state of the native control element, or null if the native control element is not present.
  15091. * @return {?MDCSelectionControlState}
  15092. * @private
  15093. */
  15094. }, {
  15095. key: 'initRipple_',
  15096. /**
  15097. * @return {!MDCRipple}
  15098. * @private
  15099. */
  15100. value: function initRipple_() {
  15101. var _this2 = this;
  15102. var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.RIPPLE_SURFACE_SELECTOR;
  15103. var rippleSurface = /** @type {!Element} */this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  15104. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_4__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  15105. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  15106. isUnbounded: function isUnbounded() {
  15107. return true;
  15108. },
  15109. isSurfaceActive: function isSurfaceActive() {
  15110. return _this2.nativeControl_[MATCHES](':active');
  15111. },
  15112. addClass: function addClass(className) {
  15113. return rippleSurface.classList.add(className);
  15114. },
  15115. removeClass: function removeClass(className) {
  15116. return rippleSurface.classList.remove(className);
  15117. },
  15118. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15119. return _this2.nativeControl_.addEventListener(type, handler);
  15120. },
  15121. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15122. return _this2.nativeControl_.removeEventListener(type, handler);
  15123. },
  15124. updateCssVariable: function updateCssVariable(varName, value) {
  15125. return rippleSurface.style.setProperty(varName, value);
  15126. },
  15127. computeBoundingRect: function computeBoundingRect() {
  15128. return rippleSurface.getBoundingClientRect();
  15129. }
  15130. });
  15131. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  15132. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  15133. }
  15134. /** @return {!MDCSwitchFoundation} */
  15135. }, {
  15136. key: 'getDefaultFoundation',
  15137. value: function getDefaultFoundation() {
  15138. var _this3 = this;
  15139. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  15140. addClass: function addClass(className) {
  15141. return _this3.root_.classList.add(className);
  15142. },
  15143. removeClass: function removeClass(className) {
  15144. return _this3.root_.classList.remove(className);
  15145. },
  15146. setNativeControlChecked: function setNativeControlChecked(checked) {
  15147. return _this3.nativeControl_.checked = checked;
  15148. },
  15149. isNativeControlChecked: function isNativeControlChecked() {
  15150. return _this3.nativeControl_.checked;
  15151. },
  15152. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  15153. return _this3.nativeControl_.disabled = disabled;
  15154. },
  15155. isNativeControlDisabled: function isNativeControlDisabled() {
  15156. return _this3.nativeControl_.disabled;
  15157. }
  15158. });
  15159. }
  15160. /** @return {!MDCRipple} */
  15161. }, {
  15162. key: 'nativeControl_',
  15163. get: function get() {
  15164. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  15165. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  15166. return el;
  15167. }
  15168. }, {
  15169. key: 'ripple',
  15170. get: function get() {
  15171. return this.ripple_;
  15172. }
  15173. /** @return {boolean} */
  15174. }, {
  15175. key: 'checked',
  15176. get: function get() {
  15177. return this.foundation_.isChecked();
  15178. }
  15179. /** @param {boolean} checked */
  15180. ,
  15181. set: function set(checked) {
  15182. this.foundation_.setChecked(checked);
  15183. }
  15184. /** @return {boolean} */
  15185. }, {
  15186. key: 'disabled',
  15187. get: function get() {
  15188. return this.foundation_.isDisabled();
  15189. }
  15190. /** @param {boolean} disabled */
  15191. ,
  15192. set: function set(disabled) {
  15193. this.foundation_.setDisabled(disabled);
  15194. }
  15195. }]);
  15196. return MDCSwitch;
  15197. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  15198. /***/ }),
  15199. /* 116 */
  15200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15201. "use strict";
  15202. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(117);
  15204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(118);
  15205. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15206. 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; }; }();
  15207. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15208. 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; }
  15209. 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; }
  15210. /**
  15211. * @license
  15212. * Copyright 2018 Google Inc. All Rights Reserved.
  15213. *
  15214. * Licensed under the Apache License, Version 2.0 (the "License");
  15215. * you may not use this file except in compliance with the License.
  15216. * You may obtain a copy of the License at
  15217. *
  15218. * http://www.apache.org/licenses/LICENSE-2.0
  15219. *
  15220. * Unless required by applicable law or agreed to in writing, software
  15221. * distributed under the License is distributed on an "AS IS" BASIS,
  15222. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15223. * See the License for the specific language governing permissions and
  15224. * limitations under the License.
  15225. */
  15226. /* eslint-enable no-unused-vars */
  15227. /**
  15228. * @extends {MDCFoundation<!MDCSwitchAdapter>}
  15229. */
  15230. var MDCSwitchFoundation = function (_MDCFoundation) {
  15231. _inherits(MDCSwitchFoundation, _MDCFoundation);
  15232. _createClass(MDCSwitchFoundation, null, [{
  15233. key: 'strings',
  15234. /** @return enum {string} */
  15235. get: function get() {
  15236. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  15237. }
  15238. /** @return enum {string} */
  15239. }, {
  15240. key: 'cssClasses',
  15241. get: function get() {
  15242. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  15243. }
  15244. /** @return {!MDCSwitchAdapter} */
  15245. }, {
  15246. key: 'defaultAdapter',
  15247. get: function get() {
  15248. return (/** @type {!MDCSwitchAdapter} */{
  15249. addClass: function addClass() /* className: string */{},
  15250. removeClass: function removeClass() /* className: string */{},
  15251. setNativeControlChecked: function setNativeControlChecked() /* checked: boolean */{},
  15252. isNativeControlChecked: function isNativeControlChecked() /* boolean */{},
  15253. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{},
  15254. isNativeControlDisabled: function isNativeControlDisabled() /* boolean */{}
  15255. }
  15256. );
  15257. }
  15258. }]);
  15259. function MDCSwitchFoundation(adapter) {
  15260. _classCallCheck(this, MDCSwitchFoundation);
  15261. return _possibleConstructorReturn(this, (MDCSwitchFoundation.__proto__ || Object.getPrototypeOf(MDCSwitchFoundation)).call(this, _extends(MDCSwitchFoundation.defaultAdapter, adapter)));
  15262. }
  15263. /** @override */
  15264. _createClass(MDCSwitchFoundation, [{
  15265. key: 'init',
  15266. value: function init() {
  15267. // Do an initial state update based on the state of the native control.
  15268. this.handleChange();
  15269. }
  15270. /** @return {boolean} */
  15271. }, {
  15272. key: 'isChecked',
  15273. value: function isChecked() {
  15274. return this.adapter_.isNativeControlChecked();
  15275. }
  15276. /** @param {boolean} checked */
  15277. }, {
  15278. key: 'setChecked',
  15279. value: function setChecked(checked) {
  15280. this.adapter_.setNativeControlChecked(checked);
  15281. this.updateCheckedStyling_(checked);
  15282. }
  15283. /** @return {boolean} */
  15284. }, {
  15285. key: 'isDisabled',
  15286. value: function isDisabled() {
  15287. return this.adapter_.isNativeControlDisabled();
  15288. }
  15289. /** @param {boolean} disabled */
  15290. }, {
  15291. key: 'setDisabled',
  15292. value: function setDisabled(disabled) {
  15293. this.adapter_.setNativeControlDisabled(disabled);
  15294. if (disabled) {
  15295. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  15296. } else {
  15297. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  15298. }
  15299. }
  15300. /**
  15301. * Handles the change event for the switch native control.
  15302. */
  15303. }, {
  15304. key: 'handleChange',
  15305. value: function handleChange() {
  15306. this.updateCheckedStyling_(this.isChecked());
  15307. }
  15308. /**
  15309. * Updates the styling of the switch based on its checked state.
  15310. * @param {boolean} checked
  15311. * @private
  15312. */
  15313. }, {
  15314. key: 'updateCheckedStyling_',
  15315. value: function updateCheckedStyling_(checked) {
  15316. if (checked) {
  15317. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  15318. } else {
  15319. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  15320. }
  15321. }
  15322. }]);
  15323. return MDCSwitchFoundation;
  15324. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15325. /* harmony default export */ __webpack_exports__["a"] = (MDCSwitchFoundation);
  15326. /***/ }),
  15327. /* 117 */
  15328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15329. "use strict";
  15330. 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; }; }();
  15331. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15332. /**
  15333. * @license
  15334. * Copyright 2018 Google Inc. All Rights Reserved.
  15335. *
  15336. * Licensed under the Apache License, Version 2.0 (the "License");
  15337. * you may not use this file except in compliance with the License.
  15338. * You may obtain a copy of the License at
  15339. *
  15340. * http://www.apache.org/licenses/LICENSE-2.0
  15341. *
  15342. * Unless required by applicable law or agreed to in writing, software
  15343. * distributed under the License is distributed on an "AS IS" BASIS,
  15344. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15345. * See the License for the specific language governing permissions and
  15346. * limitations under the License.
  15347. */
  15348. /* eslint no-unused-vars: [2, {"args": "none"}] */
  15349. /**
  15350. * Adapter for MDC Switch. Provides an interface for managing
  15351. * - classes
  15352. * - dom
  15353. *
  15354. * Additionally, provides type information for the adapter to the Closure
  15355. * compiler.
  15356. *
  15357. * Implement this adapter for your framework of choice to delegate updates to
  15358. * the component in your framework of choice. See architecture documentation
  15359. * for more details.
  15360. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  15361. *
  15362. * @record
  15363. */
  15364. var MDCSwitchAdapter = function () {
  15365. function MDCSwitchAdapter() {
  15366. _classCallCheck(this, MDCSwitchAdapter);
  15367. }
  15368. _createClass(MDCSwitchAdapter, [{
  15369. key: "addClass",
  15370. /** @param {string} className */
  15371. value: function addClass(className) {}
  15372. /** @param {string} className */
  15373. }, {
  15374. key: "removeClass",
  15375. value: function removeClass(className) {}
  15376. /** @param {boolean} checked */
  15377. }, {
  15378. key: "setNativeControlChecked",
  15379. value: function setNativeControlChecked(checked) {}
  15380. /** @return {boolean} checked */
  15381. }, {
  15382. key: "isNativeControlChecked",
  15383. value: function isNativeControlChecked() {}
  15384. /** @param {boolean} disabled */
  15385. }, {
  15386. key: "setNativeControlDisabled",
  15387. value: function setNativeControlDisabled(disabled) {}
  15388. /** @return {boolean} disabled */
  15389. }, {
  15390. key: "isNativeControlDisabled",
  15391. value: function isNativeControlDisabled() {}
  15392. }]);
  15393. return MDCSwitchAdapter;
  15394. }();
  15395. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchAdapter);
  15396. /***/ }),
  15397. /* 118 */
  15398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15399. "use strict";
  15400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  15402. /**
  15403. * @license
  15404. * Copyright 2018 Google Inc. All Rights Reserved.
  15405. *
  15406. * Licensed under the Apache License, Version 2.0 (the "License");
  15407. * you may not use this file except in compliance with the License.
  15408. * You may obtain a copy of the License at
  15409. *
  15410. * http://www.apache.org/licenses/LICENSE-2.0
  15411. *
  15412. * Unless required by applicable law or agreed to in writing, software
  15413. * distributed under the License is distributed on an "AS IS" BASIS,
  15414. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15415. * See the License for the specific language governing permissions and
  15416. * limitations under the License.
  15417. */
  15418. /** @enum {string} */
  15419. var cssClasses = {
  15420. CHECKED: 'mdc-switch--checked',
  15421. DISABLED: 'mdc-switch--disabled'
  15422. };
  15423. /** @enum {string} */
  15424. var strings = {
  15425. NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',
  15426. RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay'
  15427. };
  15428. /***/ }),
  15429. /* 119 */
  15430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15431. "use strict";
  15432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  15434. /**
  15435. * @license
  15436. * Copyright 2018 Google Inc. All Rights Reserved.
  15437. *
  15438. * Licensed under the Apache License, Version 2.0 (the "License")
  15439. * you may not use this file except in compliance with the License.
  15440. * You may obtain a copy of the License at
  15441. *
  15442. * http://www.apache.org/licenses/LICENSE-2.0
  15443. *
  15444. * Unless required by applicable law or agreed to in writing, software
  15445. * distributed under the License is distributed on an "AS IS" BASIS,
  15446. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15447. * See the License for the specific language governing permissions and
  15448. * limitations under the License.
  15449. */
  15450. /** @enum {string} */
  15451. var cssClasses = {
  15452. ACTIVE: 'mdc-tab-indicator--active',
  15453. FADE: 'mdc-tab-indicator--fade',
  15454. FADING_ACTIVATE: 'mdc-tab-indicator--fading-activate',
  15455. FADING_DEACTIVATE: 'mdc-tab-indicator--fading-deactivate',
  15456. SLIDING_ACTIVATE: 'mdc-tab-indicator--sliding-activate'
  15457. };
  15458. /** @enum {string} */
  15459. var strings = {
  15460. CONTENT_SELECTOR: '.mdc-tab-indicator__content'
  15461. };
  15462. /***/ }),
  15463. /* 120 */
  15464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15465. "use strict";
  15466. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(20);
  15467. 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; }; }();
  15468. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15469. 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; }
  15470. 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; }
  15471. /**
  15472. * @license
  15473. * Copyright 2018 Google Inc. All Rights Reserved.
  15474. *
  15475. * Licensed under the Apache License, Version 2.0 (the "License")
  15476. * you may not use this file except in compliance with the License.
  15477. * You may obtain a copy of the License at
  15478. *
  15479. * http://www.apache.org/licenses/LICENSE-2.0
  15480. *
  15481. * Unless required by applicable law or agreed to in writing, software
  15482. * distributed under the License is distributed on an "AS IS" BASIS,
  15483. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15484. * See the License for the specific language governing permissions and
  15485. * limitations under the License.
  15486. */
  15487. /**
  15488. * @extends {MDCTabIndicatorFoundation}
  15489. * @final
  15490. */
  15491. var MDCSlidingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  15492. _inherits(MDCSlidingTabIndicatorFoundation, _MDCTabIndicatorFound);
  15493. /** @param {...?} args */
  15494. function MDCSlidingTabIndicatorFoundation() {
  15495. var _ref;
  15496. _classCallCheck(this, MDCSlidingTabIndicatorFoundation);
  15497. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15498. args[_key] = arguments[_key];
  15499. }
  15500. /** @private {function(?Event): undefined} */
  15501. var _this = _possibleConstructorReturn(this, (_ref = MDCSlidingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCSlidingTabIndicatorFoundation)).call.apply(_ref, [this].concat(args)));
  15502. _this.handleTransitionEnd_ = function () {
  15503. return _this.handleTransitionEnd();
  15504. };
  15505. return _this;
  15506. }
  15507. /** Handles the transitionend event */
  15508. _createClass(MDCSlidingTabIndicatorFoundation, [{
  15509. key: 'handleTransitionEnd',
  15510. value: function handleTransitionEnd() {
  15511. this.adapter_.deregisterEventHandler('transitionend', this.handleTransitionEnd_);
  15512. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.SLIDING_ACTIVATE);
  15513. }
  15514. /** @param {!ClientRect=} previousIndicatorClientRect */
  15515. }, {
  15516. key: 'activate',
  15517. value: function activate(previousIndicatorClientRect) {
  15518. var _this2 = this;
  15519. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  15520. // Early exit if no indicator is present to handle cases where an indicator
  15521. // may be activated without a prior indicator state
  15522. if (!previousIndicatorClientRect) {
  15523. return;
  15524. }
  15525. // This animation uses the FLIP approach. You can read more about it at the link below:
  15526. // https://aerotwist.com/blog/flip-your-animations/
  15527. // Calculate the dimensions based on the dimensions of the previous indicator
  15528. var currentClientRect = this.computeContentClientRect();
  15529. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  15530. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  15531. this.adapter_.setContentStyleProperty('transform', 'translateX(' + xPosition + 'px) scaleX(' + widthDelta + ')');
  15532. // Force repaint
  15533. this.computeContentClientRect();
  15534. // Add animating class and remove transformation in a new frame
  15535. requestAnimationFrame(function () {
  15536. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.SLIDING_ACTIVATE);
  15537. _this2.adapter_.setContentStyleProperty('transform', '');
  15538. });
  15539. this.adapter_.registerEventHandler('transitionend', this.handleTransitionEnd_);
  15540. }
  15541. }, {
  15542. key: 'deactivate',
  15543. value: function deactivate() {
  15544. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  15545. // We remove the animating class in deactivate in case the Tab is deactivated before the animation completes and
  15546. // the "transitionend" handler isn't called.
  15547. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.SLIDING_ACTIVATE);
  15548. this.adapter_.deregisterEventHandler('transitionend', this.handleTransitionEnd_);
  15549. }
  15550. }]);
  15551. return MDCSlidingTabIndicatorFoundation;
  15552. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  15553. /* harmony default export */ __webpack_exports__["a"] = (MDCSlidingTabIndicatorFoundation);
  15554. /***/ }),
  15555. /* 121 */
  15556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15557. "use strict";
  15558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(20);
  15559. 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; }; }();
  15560. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15561. 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; }
  15562. 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; }
  15563. /**
  15564. * @license
  15565. * Copyright 2018 Google Inc. All Rights Reserved.
  15566. *
  15567. * Licensed under the Apache License, Version 2.0 (the "License")
  15568. * you may not use this file except in compliance with the License.
  15569. * You may obtain a copy of the License at
  15570. *
  15571. * http://www.apache.org/licenses/LICENSE-2.0
  15572. *
  15573. * Unless required by applicable law or agreed to in writing, software
  15574. * distributed under the License is distributed on an "AS IS" BASIS,
  15575. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15576. * See the License for the specific language governing permissions and
  15577. * limitations under the License.
  15578. */
  15579. /**
  15580. * @extends {MDCTabIndicatorFoundation}
  15581. * @final
  15582. */
  15583. var MDCFadingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  15584. _inherits(MDCFadingTabIndicatorFoundation, _MDCTabIndicatorFound);
  15585. /** @param {...?} args */
  15586. function MDCFadingTabIndicatorFoundation() {
  15587. var _ref;
  15588. _classCallCheck(this, MDCFadingTabIndicatorFoundation);
  15589. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15590. args[_key] = arguments[_key];
  15591. }
  15592. /** @private {function(?Event): undefined} */
  15593. var _this = _possibleConstructorReturn(this, (_ref = MDCFadingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCFadingTabIndicatorFoundation)).call.apply(_ref, [this].concat(args)));
  15594. _this.handleTransitionEnd_ = function () {
  15595. return _this.handleTransitionEnd();
  15596. };
  15597. return _this;
  15598. }
  15599. /** Handles the transitionend event */
  15600. _createClass(MDCFadingTabIndicatorFoundation, [{
  15601. key: 'handleTransitionEnd',
  15602. value: function handleTransitionEnd() {
  15603. this.adapter_.deregisterEventHandler('transitionend', this.handleTransitionEnd_);
  15604. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.FADING_ACTIVATE);
  15605. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.FADING_DEACTIVATE);
  15606. }
  15607. }, {
  15608. key: 'activate',
  15609. value: function activate() {
  15610. this.adapter_.registerEventHandler('transitionend', this.handleTransitionEnd_);
  15611. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.FADING_ACTIVATE);
  15612. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  15613. }
  15614. }, {
  15615. key: 'deactivate',
  15616. value: function deactivate() {
  15617. this.adapter_.registerEventHandler('transitionend', this.handleTransitionEnd_);
  15618. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.FADING_DEACTIVATE);
  15619. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  15620. }
  15621. }]);
  15622. return MDCFadingTabIndicatorFoundation;
  15623. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  15624. /* harmony default export */ __webpack_exports__["a"] = (MDCFadingTabIndicatorFoundation);
  15625. /***/ }),
  15626. /* 122 */
  15627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15628. "use strict";
  15629. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  15631. /**
  15632. * @license
  15633. * Copyright 2018 Google Inc. All Rights Reserved.
  15634. *
  15635. * Licensed under the Apache License, Version 2.0 (the "License");
  15636. * you may not use this file except in compliance with the License.
  15637. * You may obtain a copy of the License at
  15638. *
  15639. * http://www.apache.org/licenses/LICENSE-2.0
  15640. *
  15641. * Unless required by applicable law or agreed to in writing, software
  15642. * distributed under the License is distributed on an "AS IS" BASIS,
  15643. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15644. * See the License for the specific language governing permissions and
  15645. * limitations under the License.
  15646. */
  15647. /** @enum {string} */
  15648. var cssClasses = {
  15649. ACTIVE: 'mdc-tab--active',
  15650. ANIMATING_ACTIVATE: 'mdc-tab--animating-activate',
  15651. ANIMATING_DEACTIVATE: 'mdc-tab--animating-deactivate'
  15652. };
  15653. /** @enum {string} */
  15654. var strings = {
  15655. ARIA_SELECTED: 'aria-selected',
  15656. RIPPLE_SELECTOR: '.mdc-tab__ripple',
  15657. CONTENT_SELECTOR: '.mdc-tab__content',
  15658. TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
  15659. TABINDEX: 'tabIndex',
  15660. INTERACTED_EVENT: 'MDCTab:interacted'
  15661. };
  15662. /***/ }),
  15663. /* 123 */
  15664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15665. "use strict";
  15666. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15667. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return MDCTabBar; });
  15668. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  15669. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(19);
  15670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__ = __webpack_require__(41);
  15671. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(43);
  15672. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(129);
  15673. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  15674. 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; }; }();
  15675. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  15676. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15677. 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; }
  15678. 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; }
  15679. /**
  15680. * @license
  15681. * Copyright 2018 Google Inc. All Rights Reserved.
  15682. *
  15683. * Licensed under the Apache License, Version 2.0 (the "License")
  15684. * you may not use this file except in compliance with the License.
  15685. * You may obtain a copy of the License at
  15686. *
  15687. * http://www.apache.org/licenses/LICENSE-2.0
  15688. *
  15689. * Unless required by applicable law or agreed to in writing, software
  15690. * distributed under the License is distributed on an "AS IS" BASIS,
  15691. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15692. * See the License for the specific language governing permissions and
  15693. * limitations under the License.
  15694. */
  15695. /**
  15696. * @extends {MDCComponent<!MDCTabBarFoundation>}
  15697. * @final
  15698. */
  15699. var MDCTabBar = function (_MDCComponent) {
  15700. _inherits(MDCTabBar, _MDCComponent);
  15701. /**
  15702. * @param {...?} args
  15703. */
  15704. function MDCTabBar() {
  15705. var _ref;
  15706. _classCallCheck(this, MDCTabBar);
  15707. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15708. args[_key] = arguments[_key];
  15709. }
  15710. /** @private {!Array<!MDCTab>} */
  15711. var _this = _possibleConstructorReturn(this, (_ref = MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).call.apply(_ref, [this].concat(args)));
  15712. _this.tabList_;
  15713. /** @type {(function(!Element): !MDCTab)} */
  15714. _this.tabFactory_;
  15715. /** @private {?MDCTabScroller} */
  15716. _this.tabScroller_;
  15717. /** @type {(function(!Element): !MDCTabScroller)} */
  15718. _this.tabScrollerFactory_;
  15719. /** @private {?function(?Event): undefined} */
  15720. _this.handleTabInteraction_;
  15721. /** @private {?function(?Event): undefined} */
  15722. _this.handleKeyDown_;
  15723. return _this;
  15724. }
  15725. /**
  15726. * @param {!Element} root
  15727. * @return {!MDCTabBar}
  15728. */
  15729. _createClass(MDCTabBar, [{
  15730. key: 'initialize',
  15731. /**
  15732. * @param {(function(!Element): !MDCTab)=} tabFactory A function which creates a new MDCTab
  15733. * @param {(function(!Element): !MDCTabScroller)=} tabScrollerFactory A function which creates a new MDCTabScroller
  15734. */
  15735. value: function initialize() {
  15736. var _this2 = this;
  15737. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  15738. return new __WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTab"](el);
  15739. };
  15740. var tabScrollerFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  15741. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__["MDCTabScroller"](el);
  15742. };
  15743. this.tabFactory_ = tabFactory;
  15744. this.tabScrollerFactory_ = tabScrollerFactory;
  15745. var tabElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SELECTOR));
  15746. this.tabList_ = tabElements.map(function (el) {
  15747. return _this2.tabFactory_(el);
  15748. });
  15749. var tabScrollerElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SCROLLER_SELECTOR);
  15750. if (tabScrollerElement) {
  15751. this.tabScroller_ = this.tabScrollerFactory_(tabScrollerElement);
  15752. }
  15753. }
  15754. }, {
  15755. key: 'initialSyncWithDOM',
  15756. value: function initialSyncWithDOM() {
  15757. var _this3 = this;
  15758. this.handleTabInteraction_ = function (evt) {
  15759. return _this3.foundation_.handleTabInteraction(evt);
  15760. };
  15761. this.handleKeyDown_ = function (evt) {
  15762. return _this3.foundation_.handleKeyDown(evt);
  15763. };
  15764. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  15765. this.root_.addEventListener('keydown', this.handleKeyDown_);
  15766. }
  15767. }, {
  15768. key: 'destroy',
  15769. value: function destroy() {
  15770. _get(MDCTabBar.prototype.__proto__ || Object.getPrototypeOf(MDCTabBar.prototype), 'destroy', this).call(this);
  15771. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  15772. this.root_.removeEventListener('keydown', this.handleKeyDown_);
  15773. this.tabList_.forEach(function (tab) {
  15774. return tab.destroy();
  15775. });
  15776. this.tabScroller_.destroy();
  15777. }
  15778. /**
  15779. * @return {!MDCTabBarFoundation}
  15780. */
  15781. }, {
  15782. key: 'getDefaultFoundation',
  15783. value: function getDefaultFoundation() {
  15784. var _this4 = this;
  15785. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  15786. /** @type {!MDCTabBarAdapter} */{
  15787. scrollTo: function scrollTo(scrollX) {
  15788. return _this4.tabScroller_.scrollTo(scrollX);
  15789. },
  15790. incrementScroll: function incrementScroll(scrollXIncrement) {
  15791. return _this4.tabScroller_.incrementScroll(scrollXIncrement);
  15792. },
  15793. getScrollPosition: function getScrollPosition() {
  15794. return _this4.tabScroller_.getScrollPosition();
  15795. },
  15796. getScrollContentWidth: function getScrollContentWidth() {
  15797. return _this4.tabScroller_.getScrollContentWidth();
  15798. },
  15799. getOffsetWidth: function getOffsetWidth() {
  15800. return _this4.root_.offsetWidth;
  15801. },
  15802. isRTL: function isRTL() {
  15803. return window.getComputedStyle(_this4.root_).getPropertyValue('direction') === 'rtl';
  15804. },
  15805. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  15806. return _this4.tabList_[index].activate(clientRect);
  15807. },
  15808. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  15809. return _this4.tabList_[index].deactivate();
  15810. },
  15811. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  15812. return _this4.tabList_[index].computeIndicatorClientRect();
  15813. },
  15814. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  15815. return _this4.tabList_[index].computeDimensions();
  15816. },
  15817. getActiveTabIndex: function getActiveTabIndex() {
  15818. for (var i = 0; i < _this4.tabList_.length; i++) {
  15819. if (_this4.tabList_[i].active) {
  15820. return i;
  15821. }
  15822. }
  15823. return -1;
  15824. },
  15825. getIndexOfTab: function getIndexOfTab(tabToFind) {
  15826. return _this4.tabList_.indexOf(tabToFind);
  15827. },
  15828. getTabListLength: function getTabListLength() {
  15829. return _this4.tabList_.length;
  15830. },
  15831. notifyTabActivated: function notifyTabActivated(index) {
  15832. return _this4.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_ACTIVATED_EVENT, { index: index }, true);
  15833. }
  15834. });
  15835. }
  15836. /**
  15837. * Activates the tab at the given index
  15838. * @param {number} index The index of the tab
  15839. */
  15840. }, {
  15841. key: 'activateTab',
  15842. value: function activateTab(index) {
  15843. this.foundation_.activateTab(index);
  15844. }
  15845. /**
  15846. * Scrolls the tab at the given index into view
  15847. * @param {number} index THe index of the tab
  15848. */
  15849. }, {
  15850. key: 'scrollIntoView',
  15851. value: function scrollIntoView(index) {
  15852. this.foundation_.scrollIntoView(index);
  15853. }
  15854. }], [{
  15855. key: 'attachTo',
  15856. value: function attachTo(root) {
  15857. return new MDCTabBar(root);
  15858. }
  15859. }]);
  15860. return MDCTabBar;
  15861. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  15862. /***/ }),
  15863. /* 124 */
  15864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15865. "use strict";
  15866. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15867. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(42);
  15868. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(5);
  15869. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_scroller__ = __webpack_require__(12);
  15870. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__ = __webpack_require__(125);
  15871. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__ = __webpack_require__(126);
  15872. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__ = __webpack_require__(127);
  15873. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  15874. 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; }; }();
  15875. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15876. 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; }
  15877. 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; }
  15878. /**
  15879. * @license
  15880. * Copyright 2018 Google Inc. All Rights Reserved.
  15881. *
  15882. * Licensed under the Apache License, Version 2.0 (the "License")
  15883. * you may not use this file except in compliance with the License.
  15884. * You may obtain a copy of the License at
  15885. *
  15886. * http://www.apache.org/licenses/LICENSE-2.0
  15887. *
  15888. * Unless required by applicable law or agreed to in writing, software
  15889. * distributed under the License is distributed on an "AS IS" BASIS,
  15890. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15891. * See the License for the specific language governing permissions and
  15892. * limitations under the License.
  15893. */
  15894. /* eslint-disable no-unused-vars */
  15895. /* eslint-enable no-unused-vars */
  15896. /**
  15897. * @extends {MDCFoundation<!MDCTabScrollerAdapter>}
  15898. * @final
  15899. */
  15900. var MDCTabScrollerFoundation = function (_MDCFoundation) {
  15901. _inherits(MDCTabScrollerFoundation, _MDCFoundation);
  15902. _createClass(MDCTabScrollerFoundation, null, [{
  15903. key: 'cssClasses',
  15904. /** @return enum {string} */
  15905. get: function get() {
  15906. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  15907. }
  15908. /** @return enum {string} */
  15909. }, {
  15910. key: 'strings',
  15911. get: function get() {
  15912. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  15913. }
  15914. /**
  15915. * @see MDCTabScrollerAdapter for typing information
  15916. * @return {!MDCTabScrollerAdapter}
  15917. */
  15918. }, {
  15919. key: 'defaultAdapter',
  15920. get: function get() {
  15921. return (/** @type {!MDCTabScrollerAdapter} */{
  15922. eventTargetMatchesSelector: function eventTargetMatchesSelector() {},
  15923. addClass: function addClass() {},
  15924. removeClass: function removeClass() {},
  15925. addScrollAreaClass: function addScrollAreaClass() {},
  15926. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {},
  15927. setScrollContentStyleProperty: function setScrollContentStyleProperty() {},
  15928. getScrollContentStyleValue: function getScrollContentStyleValue() {},
  15929. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {},
  15930. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {},
  15931. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {},
  15932. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {},
  15933. computeScrollAreaClientRect: function computeScrollAreaClientRect() {},
  15934. computeScrollContentClientRect: function computeScrollContentClientRect() {},
  15935. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {}
  15936. }
  15937. );
  15938. }
  15939. /** @param {!MDCTabScrollerAdapter} adapter */
  15940. }]);
  15941. function MDCTabScrollerFoundation(adapter) {
  15942. _classCallCheck(this, MDCTabScrollerFoundation);
  15943. /**
  15944. * This boolean controls whether we should handle the transitionend and interaction events during the animation.
  15945. * @private {boolean}
  15946. */
  15947. var _this = _possibleConstructorReturn(this, (MDCTabScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabScrollerFoundation)).call(this, _extends(MDCTabScrollerFoundation.defaultAdapter, adapter)));
  15948. _this.isAnimating_ = false;
  15949. /**
  15950. * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior
  15951. * of RTL scrolling in it's own class.
  15952. * @private {?MDCTabScrollerRTL}
  15953. */
  15954. _this.rtlScrollerInstance_;
  15955. return _this;
  15956. }
  15957. _createClass(MDCTabScrollerFoundation, [{
  15958. key: 'init',
  15959. value: function init() {
  15960. // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
  15961. // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
  15962. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  15963. this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
  15964. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  15965. }
  15966. /**
  15967. * Computes the current visual scroll position
  15968. * @return {number}
  15969. */
  15970. }, {
  15971. key: 'getScrollPosition',
  15972. value: function getScrollPosition() {
  15973. if (this.isRTL_()) {
  15974. return this.computeCurrentScrollPositionRTL_();
  15975. }
  15976. var currentTranslateX = this.calculateCurrentTranslateX_();
  15977. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  15978. return scrollLeft - currentTranslateX;
  15979. }
  15980. /**
  15981. * Handles interaction events that occur during transition
  15982. */
  15983. }, {
  15984. key: 'handleInteraction',
  15985. value: function handleInteraction() {
  15986. // Early exit if we aren't animating
  15987. if (!this.isAnimating_) {
  15988. return;
  15989. }
  15990. // Prevent other event listeners from handling this event
  15991. this.stopScrollAnimation_();
  15992. }
  15993. /**
  15994. * Handles the transitionend event
  15995. * @param {!Event} evt
  15996. */
  15997. }, {
  15998. key: 'handleTransitionEnd',
  15999. value: function handleTransitionEnd(evt) {
  16000. // Early exit if we aren't animating or the event was triggered by a different element.
  16001. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evt.target, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  16002. return;
  16003. }
  16004. this.isAnimating_ = false;
  16005. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  16006. }
  16007. /**
  16008. * Increment the scroll value by the scrollXIncrement
  16009. * @param {number} scrollXIncrement The value by which to increment the scroll position
  16010. */
  16011. }, {
  16012. key: 'incrementScroll',
  16013. value: function incrementScroll(scrollXIncrement) {
  16014. // Early exit for non-operational increment values
  16015. if (scrollXIncrement === 0) {
  16016. return;
  16017. }
  16018. if (this.isRTL_()) {
  16019. return this.incrementScrollRTL_(scrollXIncrement);
  16020. }
  16021. this.incrementScroll_(scrollXIncrement);
  16022. }
  16023. /**
  16024. * Scrolls to the given scrollX value
  16025. * @param {number} scrollX
  16026. */
  16027. }, {
  16028. key: 'scrollTo',
  16029. value: function scrollTo(scrollX) {
  16030. if (this.isRTL_()) {
  16031. return this.scrollToRTL_(scrollX);
  16032. }
  16033. this.scrollTo_(scrollX);
  16034. }
  16035. /**
  16036. * Returns the appropriate version of the MDCTabScrollerRTL
  16037. * @return {!MDCTabScrollerRTL}
  16038. */
  16039. }, {
  16040. key: 'getRTLScroller',
  16041. value: function getRTLScroller() {
  16042. if (!this.rtlScrollerInstance_) {
  16043. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  16044. }
  16045. return this.rtlScrollerInstance_;
  16046. }
  16047. /**
  16048. * Returns the translateX value from a CSS matrix transform function string
  16049. * @return {number}
  16050. * @private
  16051. */
  16052. }, {
  16053. key: 'calculateCurrentTranslateX_',
  16054. value: function calculateCurrentTranslateX_() {
  16055. var transformValue = this.adapter_.getScrollContentStyleValue('transform');
  16056. // Early exit if no transform is present
  16057. if (transformValue === 'none') {
  16058. return 0;
  16059. }
  16060. // The transform value comes back as a matrix transformation in the form
  16061. // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
  16062. // we're going to grab all the parenthesized values, strip out tx, and
  16063. // parse it.
  16064. var results = /\((.+)\)/.exec(transformValue)[1];
  16065. var parts = results.split(',');
  16066. return parseFloat(parts[4]);
  16067. }
  16068. /**
  16069. * Calculates a safe scroll value that is > 0 and < the max scroll value
  16070. * @param {number} scrollX The distance to scroll
  16071. * @return {number}
  16072. * @private
  16073. */
  16074. }, {
  16075. key: 'clampScrollValue_',
  16076. value: function clampScrollValue_(scrollX) {
  16077. var edges = this.calculateScrollEdges_();
  16078. return Math.min(Math.max(edges.left, scrollX), edges.right);
  16079. }
  16080. /**
  16081. * @return {number}
  16082. * @private
  16083. */
  16084. }, {
  16085. key: 'computeCurrentScrollPositionRTL_',
  16086. value: function computeCurrentScrollPositionRTL_() {
  16087. var translateX = this.calculateCurrentTranslateX_();
  16088. return this.getRTLScroller().getScrollPositionRTL(translateX);
  16089. }
  16090. /**
  16091. * @return {!MDCTabScrollerHorizontalEdges}
  16092. * @private
  16093. */
  16094. }, {
  16095. key: 'calculateScrollEdges_',
  16096. value: function calculateScrollEdges_() {
  16097. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  16098. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  16099. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  16100. left: 0,
  16101. right: contentWidth - rootWidth
  16102. }
  16103. );
  16104. }
  16105. /**
  16106. * Internal scroll method
  16107. * @param {number} scrollX The new scroll position
  16108. * @private
  16109. */
  16110. }, {
  16111. key: 'scrollTo_',
  16112. value: function scrollTo_(scrollX) {
  16113. var currentScrollX = this.getScrollPosition();
  16114. var safeScrollX = this.clampScrollValue_(scrollX);
  16115. var scrollDelta = safeScrollX - currentScrollX;
  16116. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  16117. finalScrollPosition: safeScrollX,
  16118. scrollDelta: scrollDelta
  16119. });
  16120. }
  16121. /**
  16122. * Internal RTL scroll method
  16123. * @param {number} scrollX The new scroll position
  16124. * @private
  16125. */
  16126. }, {
  16127. key: 'scrollToRTL_',
  16128. value: function scrollToRTL_(scrollX) {
  16129. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  16130. this.animate_(animation);
  16131. }
  16132. /**
  16133. * Internal increment scroll method
  16134. * @param {number} scrollX The new scroll position increment
  16135. * @private
  16136. */
  16137. }, {
  16138. key: 'incrementScroll_',
  16139. value: function incrementScroll_(scrollX) {
  16140. var currentScrollX = this.getScrollPosition();
  16141. var targetScrollX = scrollX + currentScrollX;
  16142. var safeScrollX = this.clampScrollValue_(targetScrollX);
  16143. var scrollDelta = safeScrollX - currentScrollX;
  16144. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  16145. finalScrollPosition: safeScrollX,
  16146. scrollDelta: scrollDelta
  16147. });
  16148. }
  16149. /**
  16150. * Internal incremenet scroll RTL method
  16151. * @param {number} scrollX The new scroll position RTL increment
  16152. * @private
  16153. */
  16154. }, {
  16155. key: 'incrementScrollRTL_',
  16156. value: function incrementScrollRTL_(scrollX) {
  16157. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  16158. this.animate_(animation);
  16159. }
  16160. /**
  16161. * Animates the tab scrolling
  16162. * @param {!MDCTabScrollerAnimation} animation The animation to apply
  16163. * @private
  16164. */
  16165. }, {
  16166. key: 'animate_',
  16167. value: function animate_(animation) {
  16168. var _this2 = this;
  16169. // Early exit if translateX is 0, which means there's no animation to perform
  16170. if (animation.scrollDelta === 0) {
  16171. return;
  16172. }
  16173. this.stopScrollAnimation_();
  16174. // This animation uses the FLIP approach.
  16175. // Read more here: https://aerotwist.com/blog/flip-your-animations/
  16176. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  16177. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(' + animation.scrollDelta + 'px)');
  16178. // Force repaint
  16179. this.adapter_.computeScrollAreaClientRect();
  16180. requestAnimationFrame(function () {
  16181. _this2.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  16182. _this2.adapter_.setScrollContentStyleProperty('transform', 'none');
  16183. });
  16184. this.isAnimating_ = true;
  16185. }
  16186. /**
  16187. * Stops scroll animation
  16188. * @private
  16189. */
  16190. }, {
  16191. key: 'stopScrollAnimation_',
  16192. value: function stopScrollAnimation_() {
  16193. this.isAnimating_ = false;
  16194. var currentScrollPosition = this.getAnimatingScrollPosition_();
  16195. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  16196. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');
  16197. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  16198. }
  16199. /**
  16200. * Gets the current scroll position during animation
  16201. * @return {number}
  16202. * @private
  16203. */
  16204. }, {
  16205. key: 'getAnimatingScrollPosition_',
  16206. value: function getAnimatingScrollPosition_() {
  16207. var currentTranslateX = this.calculateCurrentTranslateX_();
  16208. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16209. if (this.isRTL_()) {
  16210. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  16211. }
  16212. return scrollLeft - currentTranslateX;
  16213. }
  16214. /**
  16215. * Determines the RTL Scroller to use
  16216. * @return {!MDCTabScrollerRTL}
  16217. * @private
  16218. */
  16219. }, {
  16220. key: 'rtlScrollerFactory_',
  16221. value: function rtlScrollerFactory_() {
  16222. // Browsers have three different implementations of scrollLeft in RTL mode,
  16223. // dependent on the browser. The behavior is based off the max LTR
  16224. // scrollleft value and 0.
  16225. //
  16226. // * Default scrolling in RTL *
  16227. // - Left-most value: 0
  16228. // - Right-most value: Max LTR scrollLeft value
  16229. //
  16230. // * Negative scrolling in RTL *
  16231. // - Left-most value: Negated max LTR scrollLeft value
  16232. // - Right-most value: 0
  16233. //
  16234. // * Reverse scrolling in RTL *
  16235. // - Left-most value: Max LTR scrollLeft value
  16236. // - Right-most value: 0
  16237. //
  16238. // We use those principles below to determine which RTL scrollLeft
  16239. // behavior is implemented in the current browser.
  16240. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16241. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  16242. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16243. // If the newScrollLeft value is negative,then we know that the browser has
  16244. // implemented negative RTL scrolling, since all other implementations have
  16245. // only positive values.
  16246. if (newScrollLeft < 0) {
  16247. // Undo the scrollLeft test check
  16248. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  16249. return new __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__["a" /* default */](this.adapter_);
  16250. }
  16251. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  16252. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  16253. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  16254. // Undo the scrollLeft test check
  16255. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  16256. // By calculating the clientRect of the root element and the clientRect of
  16257. // the content element, we can determine how much the scroll value changed
  16258. // when we performed the scrollLeft subtraction above.
  16259. if (rightEdgeDelta === newScrollLeft) {
  16260. return new __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__["a" /* default */](this.adapter_);
  16261. }
  16262. return new __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__["a" /* default */](this.adapter_);
  16263. }
  16264. /**
  16265. * @return {boolean}
  16266. * @private
  16267. */
  16268. }, {
  16269. key: 'isRTL_',
  16270. value: function isRTL_() {
  16271. return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';
  16272. }
  16273. }]);
  16274. return MDCTabScrollerFoundation;
  16275. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  16276. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerFoundation);
  16277. /***/ }),
  16278. /* 125 */
  16279. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16280. "use strict";
  16281. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  16282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  16283. 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; }; }();
  16284. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16285. 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; }
  16286. 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; }
  16287. /**
  16288. * @license
  16289. * Copyright 2018 Google Inc. All Rights Reserved.
  16290. *
  16291. * Licensed under the Apache License, Version 2.0 (the "License")
  16292. * you may not use this file except in compliance with the License.
  16293. * You may obtain a copy of the License at
  16294. *
  16295. * http://www.apache.org/licenses/LICENSE-2.0
  16296. *
  16297. * Unless required by applicable law or agreed to in writing, software
  16298. * distributed under the License is distributed on an "AS IS" BASIS,
  16299. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16300. * See the License for the specific language governing permissions and
  16301. * limitations under the License.
  16302. */
  16303. /* eslint-disable no-unused-vars */
  16304. /* eslint-enable no-unused-vars */
  16305. /**
  16306. * @extends {MDCTabScrollerRTL}
  16307. * @final
  16308. */
  16309. var MDCTabScrollerRTLDefault = function (_MDCTabScrollerRTL) {
  16310. _inherits(MDCTabScrollerRTLDefault, _MDCTabScrollerRTL);
  16311. function MDCTabScrollerRTLDefault() {
  16312. _classCallCheck(this, MDCTabScrollerRTLDefault);
  16313. return _possibleConstructorReturn(this, (MDCTabScrollerRTLDefault.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLDefault)).apply(this, arguments));
  16314. }
  16315. _createClass(MDCTabScrollerRTLDefault, [{
  16316. key: 'getScrollPositionRTL',
  16317. /**
  16318. * @return {number}
  16319. */
  16320. value: function getScrollPositionRTL() {
  16321. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16322. var _calculateScrollEdges = this.calculateScrollEdges_(),
  16323. right = _calculateScrollEdges.right;
  16324. // Scroll values on most browsers are ints instead of floats so we round
  16325. return Math.round(right - currentScrollLeft);
  16326. }
  16327. /**
  16328. * @param {number} scrollX
  16329. * @return {!MDCTabScrollerAnimation}
  16330. */
  16331. }, {
  16332. key: 'scrollToRTL',
  16333. value: function scrollToRTL(scrollX) {
  16334. var edges = this.calculateScrollEdges_();
  16335. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16336. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  16337. return (/** @type {!MDCTabScrollerAnimation} */{
  16338. finalScrollPosition: clampedScrollLeft,
  16339. scrollDelta: clampedScrollLeft - currentScrollLeft
  16340. }
  16341. );
  16342. }
  16343. /**
  16344. * @param {number} scrollX
  16345. * @return {!MDCTabScrollerAnimation}
  16346. */
  16347. }, {
  16348. key: 'incrementScrollRTL',
  16349. value: function incrementScrollRTL(scrollX) {
  16350. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16351. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  16352. return (/** @type {!MDCTabScrollerAnimation} */{
  16353. finalScrollPosition: clampedScrollLeft,
  16354. scrollDelta: clampedScrollLeft - currentScrollLeft
  16355. }
  16356. );
  16357. }
  16358. /**
  16359. * @param {number} scrollX
  16360. * @return {number}
  16361. */
  16362. }, {
  16363. key: 'getAnimatingScrollPosition',
  16364. value: function getAnimatingScrollPosition(scrollX) {
  16365. return scrollX;
  16366. }
  16367. /**
  16368. * @return {!MDCTabScrollerHorizontalEdges}
  16369. * @private
  16370. */
  16371. }, {
  16372. key: 'calculateScrollEdges_',
  16373. value: function calculateScrollEdges_() {
  16374. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  16375. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  16376. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  16377. left: 0,
  16378. right: contentWidth - rootWidth
  16379. }
  16380. );
  16381. }
  16382. /**
  16383. * @param {number} scrollX
  16384. * @return {number}
  16385. * @private
  16386. */
  16387. }, {
  16388. key: 'clampScrollValue_',
  16389. value: function clampScrollValue_(scrollX) {
  16390. var edges = this.calculateScrollEdges_();
  16391. return Math.min(Math.max(edges.left, scrollX), edges.right);
  16392. }
  16393. }]);
  16394. return MDCTabScrollerRTLDefault;
  16395. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  16396. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLDefault);
  16397. /***/ }),
  16398. /* 126 */
  16399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16400. "use strict";
  16401. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  16402. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  16403. 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; }; }();
  16404. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16405. 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; }
  16406. 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; }
  16407. /**
  16408. * @license
  16409. * Copyright 2018 Google Inc. All Rights Reserved.
  16410. *
  16411. * Licensed under the Apache License, Version 2.0 (the "License")
  16412. * you may not use this file except in compliance with the License.
  16413. * You may obtain a copy of the License at
  16414. *
  16415. * http://www.apache.org/licenses/LICENSE-2.0
  16416. *
  16417. * Unless required by applicable law or agreed to in writing, software
  16418. * distributed under the License is distributed on an "AS IS" BASIS,
  16419. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16420. * See the License for the specific language governing permissions and
  16421. * limitations under the License.
  16422. */
  16423. /* eslint-disable no-unused-vars */
  16424. /* eslint-enable no-unused-vars */
  16425. /**
  16426. * @extends {MDCTabScrollerRTL}
  16427. * @final
  16428. */
  16429. var MDCTabScrollerRTLNegative = function (_MDCTabScrollerRTL) {
  16430. _inherits(MDCTabScrollerRTLNegative, _MDCTabScrollerRTL);
  16431. function MDCTabScrollerRTLNegative() {
  16432. _classCallCheck(this, MDCTabScrollerRTLNegative);
  16433. return _possibleConstructorReturn(this, (MDCTabScrollerRTLNegative.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLNegative)).apply(this, arguments));
  16434. }
  16435. _createClass(MDCTabScrollerRTLNegative, [{
  16436. key: 'getScrollPositionRTL',
  16437. /**
  16438. * @param {number} translateX The current translateX position
  16439. * @return {number}
  16440. */
  16441. value: function getScrollPositionRTL(translateX) {
  16442. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16443. return Math.round(translateX - currentScrollLeft);
  16444. }
  16445. /**
  16446. * @param {number} scrollX
  16447. * @return {!MDCTabScrollerAnimation}
  16448. */
  16449. }, {
  16450. key: 'scrollToRTL',
  16451. value: function scrollToRTL(scrollX) {
  16452. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16453. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  16454. return (/** @type {!MDCTabScrollerAnimation} */{
  16455. finalScrollPosition: clampedScrollLeft,
  16456. scrollDelta: clampedScrollLeft - currentScrollLeft
  16457. }
  16458. );
  16459. }
  16460. /**
  16461. * @param {number} scrollX
  16462. * @return {!MDCTabScrollerAnimation}
  16463. */
  16464. }, {
  16465. key: 'incrementScrollRTL',
  16466. value: function incrementScrollRTL(scrollX) {
  16467. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16468. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  16469. return (/** @type {!MDCTabScrollerAnimation} */{
  16470. finalScrollPosition: clampedScrollLeft,
  16471. scrollDelta: clampedScrollLeft - currentScrollLeft
  16472. }
  16473. );
  16474. }
  16475. /**
  16476. * @param {number} scrollX
  16477. * @param {number} translateX
  16478. * @return {number}
  16479. */
  16480. }, {
  16481. key: 'getAnimatingScrollPosition',
  16482. value: function getAnimatingScrollPosition(scrollX, translateX) {
  16483. return scrollX - translateX;
  16484. }
  16485. /**
  16486. * @return {!MDCTabScrollerHorizontalEdges}
  16487. * @private
  16488. */
  16489. }, {
  16490. key: 'calculateScrollEdges_',
  16491. value: function calculateScrollEdges_() {
  16492. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  16493. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  16494. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  16495. left: rootWidth - contentWidth,
  16496. right: 0
  16497. }
  16498. );
  16499. }
  16500. /**
  16501. * @param {number} scrollX
  16502. * @return {number}
  16503. * @private
  16504. */
  16505. }, {
  16506. key: 'clampScrollValue_',
  16507. value: function clampScrollValue_(scrollX) {
  16508. var edges = this.calculateScrollEdges_();
  16509. return Math.max(Math.min(edges.right, scrollX), edges.left);
  16510. }
  16511. }]);
  16512. return MDCTabScrollerRTLNegative;
  16513. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  16514. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLNegative);
  16515. /***/ }),
  16516. /* 127 */
  16517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16518. "use strict";
  16519. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  16520. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  16521. 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; }; }();
  16522. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16523. 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; }
  16524. 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; }
  16525. /**
  16526. * @license
  16527. * Copyright 2018 Google Inc. All Rights Reserved.
  16528. *
  16529. * Licensed under the Apache License, Version 2.0 (the "License")
  16530. * you may not use this file except in compliance with the License.
  16531. * You may obtain a copy of the License at
  16532. *
  16533. * http://www.apache.org/licenses/LICENSE-2.0
  16534. *
  16535. * Unless required by applicable law or agreed to in writing, software
  16536. * distributed under the License is distributed on an "AS IS" BASIS,
  16537. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16538. * See the License for the specific language governing permissions and
  16539. * limitations under the License.
  16540. */
  16541. /* eslint-disable no-unused-vars */
  16542. /* eslint-enable no-unused-vars */
  16543. /**
  16544. * @extends {MDCTabScrollerRTL}
  16545. * @final
  16546. */
  16547. var MDCTabScrollerRTLReverse = function (_MDCTabScrollerRTL) {
  16548. _inherits(MDCTabScrollerRTLReverse, _MDCTabScrollerRTL);
  16549. function MDCTabScrollerRTLReverse() {
  16550. _classCallCheck(this, MDCTabScrollerRTLReverse);
  16551. return _possibleConstructorReturn(this, (MDCTabScrollerRTLReverse.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLReverse)).apply(this, arguments));
  16552. }
  16553. _createClass(MDCTabScrollerRTLReverse, [{
  16554. key: 'getScrollPositionRTL',
  16555. /**
  16556. * @param {number} translateX
  16557. * @return {number}
  16558. */
  16559. value: function getScrollPositionRTL(translateX) {
  16560. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16561. // Scroll values on most browsers are ints instead of floats so we round
  16562. return Math.round(currentScrollLeft - translateX);
  16563. }
  16564. /**
  16565. * @param {number} scrollX
  16566. * @return {!MDCTabScrollerAnimation}
  16567. */
  16568. }, {
  16569. key: 'scrollToRTL',
  16570. value: function scrollToRTL(scrollX) {
  16571. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16572. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  16573. return (/** @type {!MDCTabScrollerAnimation} */{
  16574. finalScrollPosition: clampedScrollLeft,
  16575. scrollDelta: currentScrollLeft - clampedScrollLeft
  16576. }
  16577. );
  16578. }
  16579. /**
  16580. * @param {number} scrollX
  16581. * @return {!MDCTabScrollerAnimation}
  16582. */
  16583. }, {
  16584. key: 'incrementScrollRTL',
  16585. value: function incrementScrollRTL(scrollX) {
  16586. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  16587. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  16588. return (/** @type {!MDCTabScrollerAnimation} */{
  16589. finalScrollPosition: clampedScrollLeft,
  16590. scrollDelta: currentScrollLeft - clampedScrollLeft
  16591. }
  16592. );
  16593. }
  16594. /**
  16595. * @param {number} scrollX
  16596. * @return {number}
  16597. */
  16598. }, {
  16599. key: 'getAnimatingScrollPosition',
  16600. value: function getAnimatingScrollPosition(scrollX, translateX) {
  16601. return scrollX + translateX;
  16602. }
  16603. /**
  16604. * @return {!MDCTabScrollerHorizontalEdges}
  16605. * @private
  16606. */
  16607. }, {
  16608. key: 'calculateScrollEdges_',
  16609. value: function calculateScrollEdges_() {
  16610. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  16611. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  16612. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  16613. left: contentWidth - rootWidth,
  16614. right: 0
  16615. }
  16616. );
  16617. }
  16618. /**
  16619. * @param {number} scrollX
  16620. * @return {number}
  16621. * @private
  16622. */
  16623. }, {
  16624. key: 'clampScrollValue_',
  16625. value: function clampScrollValue_(scrollX) {
  16626. var edges = this.calculateScrollEdges_();
  16627. return Math.min(Math.max(edges.right, scrollX), edges.left);
  16628. }
  16629. }]);
  16630. return MDCTabScrollerRTLReverse;
  16631. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  16632. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLReverse);
  16633. /***/ }),
  16634. /* 128 */
  16635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16636. "use strict";
  16637. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  16638. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHorizontalScrollbarHeight", function() { return computeHorizontalScrollbarHeight; });
  16639. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  16640. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(42);
  16641. /**
  16642. * @license
  16643. * Copyright 2018 Google Inc. All Rights Reserved.
  16644. *
  16645. * Licensed under the Apache License, Version 2.0 (the "License");
  16646. * you may not use this file except in compliance with the License.
  16647. * You may obtain a copy of the License at
  16648. *
  16649. * http://www.apache.org/licenses/LICENSE-2.0
  16650. *
  16651. * Unless required by applicable law or agreed to in writing, software
  16652. * distributed under the License is distributed on an "AS IS" BASIS,
  16653. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16654. * See the License for the specific language governing permissions and
  16655. * limitations under the License.
  16656. */
  16657. /**
  16658. * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
  16659. * @private {number|undefined}
  16660. */
  16661. var horizontalScrollbarHeight_ = void 0;
  16662. /**
  16663. * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
  16664. * May return 0 (e.g. on OS X browsers under default configuration).
  16665. * @param {!Document} documentObj
  16666. * @param {boolean=} shouldCacheResult
  16667. * @return {number}
  16668. */
  16669. function computeHorizontalScrollbarHeight(documentObj) {
  16670. var shouldCacheResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  16671. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
  16672. return horizontalScrollbarHeight_;
  16673. }
  16674. var el = documentObj.createElement('div');
  16675. el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST);
  16676. documentObj.body.appendChild(el);
  16677. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  16678. documentObj.body.removeChild(el);
  16679. if (shouldCacheResult) {
  16680. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  16681. }
  16682. return horizontalScrollbarHeight;
  16683. }
  16684. /**
  16685. * @param {!Object} HTMLElementPrototype
  16686. * @return {!Array<string>}
  16687. */
  16688. function getMatchesProperty(HTMLElementPrototype) {
  16689. return ['msMatchesSelector', 'matches'].filter(function (p) {
  16690. return p in HTMLElementPrototype;
  16691. }).pop();
  16692. }
  16693. /***/ }),
  16694. /* 129 */
  16695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16696. "use strict";
  16697. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16698. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(130);
  16699. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(43);
  16700. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_foundation__ = __webpack_require__(40);
  16701. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_tab_adapter__ = __webpack_require__(11);
  16702. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  16703. 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; }; }();
  16704. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16705. 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; }
  16706. 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; }
  16707. /**
  16708. * @license
  16709. * Copyright 2018 Google Inc. All Rights Reserved.
  16710. *
  16711. * Licensed under the Apache License, Version 2.0 (the "License")
  16712. * you may not use this file except in compliance with the License.
  16713. * You may obtain a copy of the License at
  16714. *
  16715. * http://www.apache.org/licenses/LICENSE-2.0
  16716. *
  16717. * Unless required by applicable law or agreed to in writing, software
  16718. * distributed under the License is distributed on an "AS IS" BASIS,
  16719. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16720. * See the License for the specific language governing permissions and
  16721. * limitations under the License.
  16722. */
  16723. /* eslint-disable no-unused-vars */
  16724. /* eslint-enable no-unused-vars */
  16725. /**
  16726. * @type {Set<string>}
  16727. */
  16728. var ACCEPTABLE_KEYS = new Set();
  16729. // IE11 has no support for new Set with iterable so we need to initialize this by hand
  16730. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  16731. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  16732. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  16733. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  16734. /**
  16735. * @type {Map<number, string>}
  16736. */
  16737. var KEYCODE_MAP = new Map();
  16738. // IE11 has no support for new Map with iterable so we need to initialize this by hand
  16739. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  16740. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  16741. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  16742. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  16743. /**
  16744. * @extends {MDCFoundation<!MDCTabBarAdapter>}
  16745. * @final
  16746. */
  16747. var MDCTabBarFoundation = function (_MDCFoundation) {
  16748. _inherits(MDCTabBarFoundation, _MDCFoundation);
  16749. _createClass(MDCTabBarFoundation, null, [{
  16750. key: 'strings',
  16751. /** @return enum {string} */
  16752. get: function get() {
  16753. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  16754. }
  16755. /** @return enum {number} */
  16756. }, {
  16757. key: 'numbers',
  16758. get: function get() {
  16759. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */];
  16760. }
  16761. /**
  16762. * @see MDCTabBarAdapter for typing information
  16763. * @return {!MDCTabBarAdapter}
  16764. */
  16765. }, {
  16766. key: 'defaultAdapter',
  16767. get: function get() {
  16768. return (/** @type {!MDCTabBarAdapter} */{
  16769. scrollTo: function scrollTo() {},
  16770. incrementScroll: function incrementScroll() {},
  16771. getScrollPosition: function getScrollPosition() {},
  16772. getScrollContentWidth: function getScrollContentWidth() {},
  16773. getOffsetWidth: function getOffsetWidth() {},
  16774. isRTL: function isRTL() {},
  16775. activateTabAtIndex: function activateTabAtIndex() {},
  16776. deactivateTabAtIndex: function deactivateTabAtIndex() {},
  16777. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {},
  16778. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {},
  16779. getActiveTabIndex: function getActiveTabIndex() {},
  16780. getIndexOfTab: function getIndexOfTab() {},
  16781. getTabListLength: function getTabListLength() {},
  16782. notifyTabActivated: function notifyTabActivated() {}
  16783. }
  16784. );
  16785. }
  16786. /**
  16787. * @param {!MDCTabBarAdapter} adapter
  16788. * */
  16789. }]);
  16790. function MDCTabBarFoundation(adapter) {
  16791. _classCallCheck(this, MDCTabBarFoundation);
  16792. return _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  16793. }
  16794. _createClass(MDCTabBarFoundation, [{
  16795. key: 'init',
  16796. value: function init() {
  16797. var activeIndex = this.adapter_.getActiveTabIndex();
  16798. this.scrollIntoView(activeIndex);
  16799. }
  16800. /**
  16801. * Activates the tab at the given index
  16802. * @param {number} index
  16803. */
  16804. }, {
  16805. key: 'activateTab',
  16806. value: function activateTab(index) {
  16807. var previousActiveIndex = this.adapter_.getActiveTabIndex();
  16808. if (!this.indexIsInRange_(index)) {
  16809. return;
  16810. }
  16811. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  16812. this.adapter_.activateTabAtIndex(index, this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex));
  16813. this.scrollIntoView(index);
  16814. // Only notify the tab activation if the index is different than the previously active index
  16815. if (index !== previousActiveIndex) {
  16816. this.adapter_.notifyTabActivated(index);
  16817. }
  16818. }
  16819. /**
  16820. * Handles the keydown event
  16821. * @param {!Event} evt
  16822. */
  16823. }, {
  16824. key: 'handleKeyDown',
  16825. value: function handleKeyDown(evt) {
  16826. // Get the key from the event
  16827. var key = this.getKeyFromEvent_(evt);
  16828. // Early exit if the event key isn't one of the keyboard navigation keys
  16829. if (key === undefined) {
  16830. return;
  16831. }
  16832. evt.preventDefault();
  16833. this.activateTabFromKey_(key);
  16834. }
  16835. /**
  16836. * Handles the MDCTab:interacted event
  16837. * @param {!Event} evt
  16838. */
  16839. }, {
  16840. key: 'handleTabInteraction',
  16841. value: function handleTabInteraction(evt) {
  16842. this.activateTab(this.adapter_.getIndexOfTab(evt.detail.tab));
  16843. }
  16844. /**
  16845. * Scrolls the tab at the given index into view
  16846. * @param {number} index The tab index to make visible
  16847. */
  16848. }, {
  16849. key: 'scrollIntoView',
  16850. value: function scrollIntoView(index) {
  16851. // Early exit if the index is out of range
  16852. if (!this.indexIsInRange_(index)) {
  16853. return;
  16854. }
  16855. // Always scroll to 0 if scrolling to the 0th index
  16856. if (index === 0) {
  16857. return this.adapter_.scrollTo(0);
  16858. }
  16859. // Always scroll to the max value if scrolling to the Nth index
  16860. // MDCTabScroller.scrollTo() will never scroll past the max possible value
  16861. if (index === this.adapter_.getTabListLength() - 1) {
  16862. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  16863. }
  16864. if (this.isRTL_()) {
  16865. return this.scrollIntoViewRTL_(index);
  16866. }
  16867. this.scrollIntoView_(index);
  16868. }
  16869. /**
  16870. * Private method for activating a tab from a key
  16871. * @param {string} key The name of the key
  16872. * @private
  16873. */
  16874. }, {
  16875. key: 'activateTabFromKey_',
  16876. value: function activateTabFromKey_(key) {
  16877. var isRTL = this.isRTL_();
  16878. var maxTabIndex = this.adapter_.getTabListLength() - 1;
  16879. var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY;
  16880. var shouldDecrement = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY && !isRTL || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY && isRTL;
  16881. var shouldIncrement = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY && !isRTL || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY && isRTL;
  16882. var tabIndex = this.adapter_.getActiveTabIndex();
  16883. if (shouldGoToEnd) {
  16884. tabIndex = maxTabIndex;
  16885. } else if (shouldDecrement) {
  16886. tabIndex -= 1;
  16887. } else if (shouldIncrement) {
  16888. tabIndex += 1;
  16889. } else {
  16890. tabIndex = 0;
  16891. }
  16892. if (tabIndex < 0) {
  16893. tabIndex = maxTabIndex;
  16894. } else if (tabIndex > maxTabIndex) {
  16895. tabIndex = 0;
  16896. }
  16897. this.activateTab(tabIndex);
  16898. }
  16899. /**
  16900. * Calculates the scroll increment that will make the tab at the given index visible
  16901. * @param {number} index The index of the tab
  16902. * @param {number} nextIndex The index of the next tab
  16903. * @param {number} scrollPosition The current scroll position
  16904. * @param {number} barWidth The width of the Tab Bar
  16905. * @return {number}
  16906. * @private
  16907. */
  16908. }, {
  16909. key: 'calculateScrollIncrement_',
  16910. value: function calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth) {
  16911. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  16912. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  16913. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  16914. var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  16915. var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  16916. if (nextIndex < index) {
  16917. return Math.min(leftIncrement, 0);
  16918. }
  16919. return Math.max(rightIncrement, 0);
  16920. }
  16921. /**
  16922. * Calculates the scroll increment that will make the tab at the given index visible in RTL
  16923. * @param {number} index The index of the tab
  16924. * @param {number} nextIndex The index of the next tab
  16925. * @param {number} scrollPosition The current scroll position
  16926. * @param {number} barWidth The width of the Tab Bar
  16927. * @param {number} scrollContentWidth The width of the scroll content
  16928. * @return {number}
  16929. * @private
  16930. */
  16931. }, {
  16932. key: 'calculateScrollIncrementRTL_',
  16933. value: function calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  16934. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  16935. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  16936. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  16937. var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  16938. var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  16939. if (nextIndex > index) {
  16940. return Math.max(leftIncrement, 0);
  16941. }
  16942. return Math.min(rightIncrement, 0);
  16943. }
  16944. /**
  16945. * Determines the index of the adjacent tab closest to either edge of the Tab Bar
  16946. * @param {number} index The index of the tab
  16947. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  16948. * @param {number} scrollPosition The current scroll position
  16949. * @param {number} barWidth The width of the tab bar
  16950. * @return {number}
  16951. * @private
  16952. */
  16953. }, {
  16954. key: 'findAdjacentTabIndexClosestToEdge_',
  16955. value: function findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth) {
  16956. /**
  16957. * Tabs are laid out in the Tab Scroller like this:
  16958. *
  16959. * Scroll Position
  16960. * +---+
  16961. * | | Bar Width
  16962. * | +-----------------------------------+
  16963. * | | |
  16964. * | V V
  16965. * | +-----------------------------------+
  16966. * V | Tab Scroller |
  16967. * +------------+--------------+-------------------+
  16968. * | Tab | Tab | Tab |
  16969. * +------------+--------------+-------------------+
  16970. * | |
  16971. * +-----------------------------------+
  16972. *
  16973. * To determine the next adjacent index, we look at the Tab root left and
  16974. * Tab root right, both relative to the scroll position. If the Tab root
  16975. * left is less than 0, then we know it's out of view to the left. If the
  16976. * Tab root right minus the bar width is greater than 0, we know the Tab is
  16977. * out of view to the right. From there, we either increment or decrement
  16978. * the index.
  16979. */
  16980. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  16981. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  16982. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  16983. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  16984. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  16985. if (leftEdgeIsCloser) {
  16986. return index - 1;
  16987. }
  16988. if (rightEdgeIsCloser) {
  16989. return index + 1;
  16990. }
  16991. return -1;
  16992. }
  16993. /**
  16994. * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
  16995. * @param {number} index The index of the tab
  16996. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  16997. * @param {number} scrollPosition The current scroll position
  16998. * @param {number} barWidth The width of the tab bar
  16999. * @param {number} scrollContentWidth The width of the scroller content
  17000. * @return {number}
  17001. * @private
  17002. */
  17003. }, {
  17004. key: 'findAdjacentTabIndexClosestToEdgeRTL_',
  17005. value: function findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  17006. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  17007. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  17008. var rootDelta = rootLeft + rootRight;
  17009. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  17010. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  17011. if (leftEdgeIsCloser) {
  17012. return index + 1;
  17013. }
  17014. if (rightEdgeIsCloser) {
  17015. return index - 1;
  17016. }
  17017. return -1;
  17018. }
  17019. /**
  17020. * Returns the key associated with a keydown event
  17021. * @param {!Event} evt The keydown event
  17022. * @return {string}
  17023. * @private
  17024. */
  17025. }, {
  17026. key: 'getKeyFromEvent_',
  17027. value: function getKeyFromEvent_(evt) {
  17028. if (ACCEPTABLE_KEYS.has(evt.key)) {
  17029. return evt.key;
  17030. }
  17031. return KEYCODE_MAP.get(evt.keyCode);
  17032. }
  17033. /**
  17034. * Returns whether a given index is inclusively between the ends
  17035. * @param {number} index The index to test
  17036. * @private
  17037. */
  17038. }, {
  17039. key: 'indexIsInRange_',
  17040. value: function indexIsInRange_(index) {
  17041. return index >= 0 && index < this.adapter_.getTabListLength();
  17042. }
  17043. /**
  17044. * Returns the view's RTL property
  17045. * @return {boolean}
  17046. * @private
  17047. */
  17048. }, {
  17049. key: 'isRTL_',
  17050. value: function isRTL_() {
  17051. return this.adapter_.isRTL();
  17052. }
  17053. /**
  17054. * Scrolls the tab at the given index into view for left-to-right useragents
  17055. * @param {number} index The index of the tab to scroll into view
  17056. * @private
  17057. */
  17058. }, {
  17059. key: 'scrollIntoView_',
  17060. value: function scrollIntoView_(index) {
  17061. var scrollPosition = this.adapter_.getScrollPosition();
  17062. var barWidth = this.adapter_.getOffsetWidth();
  17063. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  17064. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  17065. if (!this.indexIsInRange_(nextIndex)) {
  17066. return;
  17067. }
  17068. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  17069. this.adapter_.incrementScroll(scrollIncrement);
  17070. }
  17071. /**
  17072. * Scrolls the tab at the given index into view in RTL
  17073. * @param {number} index The tab index to make visible
  17074. * @private
  17075. */
  17076. }, {
  17077. key: 'scrollIntoViewRTL_',
  17078. value: function scrollIntoViewRTL_(index) {
  17079. var scrollPosition = this.adapter_.getScrollPosition();
  17080. var barWidth = this.adapter_.getOffsetWidth();
  17081. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  17082. var scrollWidth = this.adapter_.getScrollContentWidth();
  17083. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  17084. if (!this.indexIsInRange_(nextIndex)) {
  17085. return;
  17086. }
  17087. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  17088. this.adapter_.incrementScroll(scrollIncrement);
  17089. }
  17090. }]);
  17091. return MDCTabBarFoundation;
  17092. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  17093. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  17094. /***/ }),
  17095. /* 130 */
  17096. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17097. "use strict";
  17098. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; });
  17099. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  17100. /**
  17101. * @license
  17102. * Copyright 2018 Google Inc. All Rights Reserved.
  17103. *
  17104. * Licensed under the Apache License, Version 2.0 (the "License")
  17105. * you may not use this file except in compliance with the License.
  17106. * You may obtain a copy of the License at
  17107. *
  17108. * http://www.apache.org/licenses/LICENSE-2.0
  17109. *
  17110. * Unless required by applicable law or agreed to in writing, software
  17111. * distributed under the License is distributed on an "AS IS" BASIS,
  17112. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17113. * See the License for the specific language governing permissions and
  17114. * limitations under the License.
  17115. */
  17116. /** @enum {string} */
  17117. var strings = {
  17118. TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
  17119. TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
  17120. TAB_SELECTOR: '.mdc-tab',
  17121. END_KEY: 'End',
  17122. HOME_KEY: 'Home',
  17123. ARROW_LEFT_KEY: 'ArrowLeft',
  17124. ARROW_RIGHT_KEY: 'ArrowRight'
  17125. };
  17126. /** @enum {number} */
  17127. var numbers = {
  17128. EXTRA_SCROLL_AMOUNT: 20,
  17129. END_KEYCODE: 35,
  17130. HOME_KEYCODE: 36,
  17131. ARROW_LEFT_KEYCODE: 37,
  17132. ARROW_RIGHT_KEYCODE: 39
  17133. };
  17134. /***/ }),
  17135. /* 131 */
  17136. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17137. "use strict";
  17138. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  17139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  17140. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  17141. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(3);
  17142. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(6);
  17143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(44);
  17144. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(45);
  17145. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(134);
  17146. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__ = __webpack_require__(17);
  17147. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text_index__ = __webpack_require__(135);
  17148. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__icon_index__ = __webpack_require__(136);
  17149. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__ = __webpack_require__(16);
  17150. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__ = __webpack_require__(18);
  17151. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  17152. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a"]; });
  17153. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b"]; });
  17154. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIcon", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["a"]; });
  17155. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["b"]; });
  17156. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  17157. 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; }; }();
  17158. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  17159. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17160. 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; }
  17161. 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; }
  17162. /**
  17163. * @license
  17164. * Copyright 2016 Google Inc. All Rights Reserved.
  17165. *
  17166. * Licensed under the Apache License, Version 2.0 (the "License");
  17167. * you may not use this file except in compliance with the License.
  17168. * You may obtain a copy of the License at
  17169. *
  17170. * http://www.apache.org/licenses/LICENSE-2.0
  17171. *
  17172. * Unless required by applicable law or agreed to in writing, software
  17173. * distributed under the License is distributed on an "AS IS" BASIS,
  17174. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17175. * See the License for the specific language governing permissions and
  17176. * limitations under the License.
  17177. */
  17178. /* eslint-disable no-unused-vars */
  17179. /* eslint-enable no-unused-vars */
  17180. /* eslint-disable no-unused-vars */
  17181. /* eslint-enable no-unused-vars */
  17182. /**
  17183. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  17184. * @final
  17185. */
  17186. var MDCTextField = function (_MDCComponent) {
  17187. _inherits(MDCTextField, _MDCComponent);
  17188. /**
  17189. * @param {...?} args
  17190. */
  17191. function MDCTextField() {
  17192. var _ref;
  17193. _classCallCheck(this, MDCTextField);
  17194. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  17195. args[_key] = arguments[_key];
  17196. }
  17197. /** @private {?Element} */
  17198. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  17199. _this.input_;
  17200. /** @type {?MDCRipple} */
  17201. _this.ripple;
  17202. /** @private {?MDCLineRipple} */
  17203. _this.lineRipple_;
  17204. /** @private {?MDCTextFieldHelperText} */
  17205. _this.helperText_;
  17206. /** @private {?MDCTextFieldIcon} */
  17207. _this.icon_;
  17208. /** @private {?MDCFloatingLabel} */
  17209. _this.label_;
  17210. /** @private {?MDCNotchedOutline} */
  17211. _this.outline_;
  17212. return _this;
  17213. }
  17214. /**
  17215. * @param {!Element} root
  17216. * @return {!MDCTextField}
  17217. */
  17218. _createClass(MDCTextField, [{
  17219. key: 'initialize',
  17220. /**
  17221. * @param {(function(!Element): !MDCRipple)=} rippleFactory A function which
  17222. * creates a new MDCRipple.
  17223. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which
  17224. * creates a new MDCLineRipple.
  17225. * @param {(function(!Element): !MDCTextFieldHelperText)=} helperTextFactory A function which
  17226. * creates a new MDCTextFieldHelperText.
  17227. * @param {(function(!Element): !MDCTextFieldIcon)=} iconFactory A function which
  17228. * creates a new MDCTextFieldIcon.
  17229. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which
  17230. * creates a new MDCFloatingLabel.
  17231. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which
  17232. * creates a new MDCNotchedOutline.
  17233. */
  17234. value: function initialize() {
  17235. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  17236. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  17237. };
  17238. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  17239. return new __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__["MDCLineRipple"](el);
  17240. };
  17241. var helperTextFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  17242. return new __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a" /* MDCTextFieldHelperText */](el);
  17243. };
  17244. var iconFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  17245. return new __WEBPACK_IMPORTED_MODULE_8__icon_index__["a" /* MDCTextFieldIcon */](el);
  17246. };
  17247. var _this2 = this;
  17248. var labelFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  17249. return new __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__["MDCFloatingLabel"](el);
  17250. };
  17251. var outlineFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  17252. return new __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__["MDCNotchedOutline"](el);
  17253. };
  17254. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].INPUT_SELECTOR);
  17255. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].LABEL_SELECTOR);
  17256. if (labelElement) {
  17257. this.label_ = labelFactory(labelElement);
  17258. }
  17259. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].LINE_RIPPLE_SELECTOR);
  17260. if (lineRippleElement) {
  17261. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  17262. }
  17263. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].OUTLINE_SELECTOR);
  17264. if (outlineElement) {
  17265. this.outline_ = outlineFactory(outlineElement);
  17266. }
  17267. if (this.input_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].ARIA_CONTROLS)) {
  17268. var helperTextElement = document.getElementById(this.input_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].ARIA_CONTROLS));
  17269. if (helperTextElement) {
  17270. this.helperText_ = helperTextFactory(helperTextElement);
  17271. }
  17272. }
  17273. var iconElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].ICON_SELECTOR);
  17274. if (iconElement) {
  17275. this.icon_ = iconFactory(iconElement);
  17276. }
  17277. this.ripple = null;
  17278. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* cssClasses */].BOX)) {
  17279. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  17280. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  17281. isSurfaceActive: function isSurfaceActive() {
  17282. return _this2.input_[MATCHES](':active');
  17283. },
  17284. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  17285. return _this2.input_.addEventListener(type, handler);
  17286. },
  17287. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  17288. return _this2.input_.removeEventListener(type, handler);
  17289. }
  17290. });
  17291. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter);
  17292. this.ripple = rippleFactory(this.root_, foundation);
  17293. }
  17294. }
  17295. }, {
  17296. key: 'destroy',
  17297. value: function destroy() {
  17298. if (this.ripple) {
  17299. this.ripple.destroy();
  17300. }
  17301. if (this.lineRipple_) {
  17302. this.lineRipple_.destroy();
  17303. }
  17304. if (this.helperText_) {
  17305. this.helperText_.destroy();
  17306. }
  17307. if (this.icon_) {
  17308. this.icon_.destroy();
  17309. }
  17310. if (this.label_) {
  17311. this.label_.destroy();
  17312. }
  17313. if (this.outline_) {
  17314. this.outline_.destroy();
  17315. }
  17316. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  17317. }
  17318. /**
  17319. * Initiliazes the Text Field's internal state based on the environment's
  17320. * state.
  17321. */
  17322. }, {
  17323. key: 'initialSyncWithDom',
  17324. value: function initialSyncWithDom() {
  17325. this.disabled = this.input_.disabled;
  17326. }
  17327. /**
  17328. * @return {string} The value of the input.
  17329. */
  17330. }, {
  17331. key: 'layout',
  17332. /**
  17333. * Recomputes the outline SVG path for the outline element.
  17334. */
  17335. value: function layout() {
  17336. var openNotch = this.foundation_.shouldFloat;
  17337. this.foundation_.notchOutline(openNotch);
  17338. }
  17339. /**
  17340. * @return {!MDCTextFieldFoundation}
  17341. */
  17342. }, {
  17343. key: 'getDefaultFoundation',
  17344. value: function getDefaultFoundation() {
  17345. var _this3 = this;
  17346. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  17347. /** @type {!MDCTextFieldAdapter} */_extends({
  17348. addClass: function addClass(className) {
  17349. return _this3.root_.classList.add(className);
  17350. },
  17351. removeClass: function removeClass(className) {
  17352. return _this3.root_.classList.remove(className);
  17353. },
  17354. hasClass: function hasClass(className) {
  17355. return _this3.root_.classList.contains(className);
  17356. },
  17357. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  17358. return _this3.root_.addEventListener(evtType, handler);
  17359. },
  17360. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  17361. return _this3.root_.removeEventListener(evtType, handler);
  17362. },
  17363. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  17364. var getAttributesList = function getAttributesList(mutationsList) {
  17365. return mutationsList.map(function (mutation) {
  17366. return mutation.attributeName;
  17367. });
  17368. };
  17369. var observer = new MutationObserver(function (mutationsList) {
  17370. return handler(getAttributesList(mutationsList));
  17371. });
  17372. var targetNode = _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].INPUT_SELECTOR);
  17373. var config = { attributes: true };
  17374. observer.observe(targetNode, config);
  17375. return observer;
  17376. },
  17377. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  17378. return observer.disconnect();
  17379. },
  17380. isFocused: function isFocused() {
  17381. return document.activeElement === _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["d" /* strings */].INPUT_SELECTOR);
  17382. },
  17383. isRtl: function isRtl() {
  17384. return window.getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  17385. }
  17386. }, this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()), this.getFoundationMap_());
  17387. }
  17388. /**
  17389. * @return {!{
  17390. * shakeLabel: function(boolean): undefined,
  17391. * floatLabel: function(boolean): undefined,
  17392. * hasLabel: function(): boolean,
  17393. * getLabelWidth: function(): number,
  17394. * }}
  17395. */
  17396. }, {
  17397. key: 'getLabelAdapterMethods_',
  17398. value: function getLabelAdapterMethods_() {
  17399. var _this4 = this;
  17400. return {
  17401. shakeLabel: function shakeLabel(shouldShake) {
  17402. return _this4.label_.shake(shouldShake);
  17403. },
  17404. floatLabel: function floatLabel(shouldFloat) {
  17405. return _this4.label_.float(shouldFloat);
  17406. },
  17407. hasLabel: function hasLabel() {
  17408. return !!_this4.label_;
  17409. },
  17410. getLabelWidth: function getLabelWidth() {
  17411. return _this4.label_.getWidth();
  17412. }
  17413. };
  17414. }
  17415. /**
  17416. * @return {!{
  17417. * activateLineRipple: function(): undefined,
  17418. * deactivateLineRipple: function(): undefined,
  17419. * setLineRippleTransformOrigin: function(number): undefined,
  17420. * }}
  17421. */
  17422. }, {
  17423. key: 'getLineRippleAdapterMethods_',
  17424. value: function getLineRippleAdapterMethods_() {
  17425. var _this5 = this;
  17426. return {
  17427. activateLineRipple: function activateLineRipple() {
  17428. if (_this5.lineRipple_) {
  17429. _this5.lineRipple_.activate();
  17430. }
  17431. },
  17432. deactivateLineRipple: function deactivateLineRipple() {
  17433. if (_this5.lineRipple_) {
  17434. _this5.lineRipple_.deactivate();
  17435. }
  17436. },
  17437. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  17438. if (_this5.lineRipple_) {
  17439. _this5.lineRipple_.setRippleCenter(normalizedX);
  17440. }
  17441. }
  17442. };
  17443. }
  17444. /**
  17445. * @return {!{
  17446. * notchOutline: function(number, boolean): undefined,
  17447. * hasOutline: function(): boolean,
  17448. * }}
  17449. */
  17450. }, {
  17451. key: 'getOutlineAdapterMethods_',
  17452. value: function getOutlineAdapterMethods_() {
  17453. var _this6 = this;
  17454. return {
  17455. notchOutline: function notchOutline(labelWidth, isRtl) {
  17456. return _this6.outline_.notch(labelWidth, isRtl);
  17457. },
  17458. closeOutline: function closeOutline() {
  17459. return _this6.outline_.closeNotch();
  17460. },
  17461. hasOutline: function hasOutline() {
  17462. return !!_this6.outline_;
  17463. }
  17464. };
  17465. }
  17466. /**
  17467. * @return {!{
  17468. * registerInputInteractionHandler: function(string, function()): undefined,
  17469. * deregisterInputInteractionHandler: function(string, function()): undefined,
  17470. * getNativeInput: function(): ?Element,
  17471. * }}
  17472. */
  17473. }, {
  17474. key: 'getInputAdapterMethods_',
  17475. value: function getInputAdapterMethods_() {
  17476. var _this7 = this;
  17477. return {
  17478. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  17479. return _this7.input_.addEventListener(evtType, handler);
  17480. },
  17481. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  17482. return _this7.input_.removeEventListener(evtType, handler);
  17483. },
  17484. getNativeInput: function getNativeInput() {
  17485. return _this7.input_;
  17486. }
  17487. };
  17488. }
  17489. /**
  17490. * Returns a map of all subcomponents to subfoundations.
  17491. * @return {!FoundationMapType}
  17492. */
  17493. }, {
  17494. key: 'getFoundationMap_',
  17495. value: function getFoundationMap_() {
  17496. return {
  17497. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  17498. icon: this.icon_ ? this.icon_.foundation : undefined
  17499. };
  17500. }
  17501. }, {
  17502. key: 'value',
  17503. get: function get() {
  17504. return this.foundation_.getValue();
  17505. }
  17506. /**
  17507. * @param {string} value The value to set on the input.
  17508. */
  17509. ,
  17510. set: function set(value) {
  17511. this.foundation_.setValue(value);
  17512. }
  17513. /**
  17514. * @return {boolean} True if the Text Field is disabled.
  17515. */
  17516. }, {
  17517. key: 'disabled',
  17518. get: function get() {
  17519. return this.foundation_.isDisabled();
  17520. }
  17521. /**
  17522. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  17523. */
  17524. ,
  17525. set: function set(disabled) {
  17526. this.foundation_.setDisabled(disabled);
  17527. }
  17528. /**
  17529. * @return {boolean} valid True if the Text Field is valid.
  17530. */
  17531. }, {
  17532. key: 'valid',
  17533. get: function get() {
  17534. return this.foundation_.isValid();
  17535. }
  17536. /**
  17537. * @param {boolean} valid Sets the Text Field valid or invalid.
  17538. */
  17539. ,
  17540. set: function set(valid) {
  17541. this.foundation_.setValid(valid);
  17542. }
  17543. /**
  17544. * @return {boolean} True if the Text Field is required.
  17545. */
  17546. }, {
  17547. key: 'required',
  17548. get: function get() {
  17549. return this.input_.required;
  17550. }
  17551. /**
  17552. * @param {boolean} required Sets the Text Field to required.
  17553. */
  17554. ,
  17555. set: function set(required) {
  17556. this.input_.required = required;
  17557. }
  17558. /**
  17559. * @return {string} The input element's validation pattern.
  17560. */
  17561. }, {
  17562. key: 'pattern',
  17563. get: function get() {
  17564. return this.input_.pattern;
  17565. }
  17566. /**
  17567. * @param {string} pattern Sets the input element's validation pattern.
  17568. */
  17569. ,
  17570. set: function set(pattern) {
  17571. this.input_.pattern = pattern;
  17572. }
  17573. /**
  17574. * @return {number} The input element's minLength.
  17575. */
  17576. }, {
  17577. key: 'minLength',
  17578. get: function get() {
  17579. return this.input_.minLength;
  17580. }
  17581. /**
  17582. * @param {number} minLength Sets the input element's minLength.
  17583. */
  17584. ,
  17585. set: function set(minLength) {
  17586. this.input_.minLength = minLength;
  17587. }
  17588. /**
  17589. * @return {number} The input element's maxLength.
  17590. */
  17591. }, {
  17592. key: 'maxLength',
  17593. get: function get() {
  17594. return this.input_.maxLength;
  17595. }
  17596. /**
  17597. * @param {number} maxLength Sets the input element's maxLength.
  17598. */
  17599. ,
  17600. set: function set(maxLength) {
  17601. // Chrome throws exception if maxLength is set < 0
  17602. if (maxLength < 0) {
  17603. this.input_.removeAttribute('maxLength');
  17604. } else {
  17605. this.input_.maxLength = maxLength;
  17606. }
  17607. }
  17608. /**
  17609. * @return {string} The input element's min.
  17610. */
  17611. }, {
  17612. key: 'min',
  17613. get: function get() {
  17614. return this.input_.min;
  17615. }
  17616. /**
  17617. * @param {string} min Sets the input element's min.
  17618. */
  17619. ,
  17620. set: function set(min) {
  17621. this.input_.min = min;
  17622. }
  17623. /**
  17624. * @return {string} The input element's max.
  17625. */
  17626. }, {
  17627. key: 'max',
  17628. get: function get() {
  17629. return this.input_.max;
  17630. }
  17631. /**
  17632. * @param {string} max Sets the input element's max.
  17633. */
  17634. ,
  17635. set: function set(max) {
  17636. this.input_.max = max;
  17637. }
  17638. /**
  17639. * @return {string} The input element's step.
  17640. */
  17641. }, {
  17642. key: 'step',
  17643. get: function get() {
  17644. return this.input_.step;
  17645. }
  17646. /**
  17647. * @param {string} step Sets the input element's step.
  17648. */
  17649. ,
  17650. set: function set(step) {
  17651. this.input_.step = step;
  17652. }
  17653. /**
  17654. * Sets the helper text element content.
  17655. * @param {string} content
  17656. */
  17657. }, {
  17658. key: 'helperTextContent',
  17659. set: function set(content) {
  17660. this.foundation_.setHelperTextContent(content);
  17661. }
  17662. /**
  17663. * Sets the aria label of the icon.
  17664. * @param {string} label
  17665. */
  17666. }, {
  17667. key: 'iconAriaLabel',
  17668. set: function set(label) {
  17669. this.foundation_.setIconAriaLabel(label);
  17670. }
  17671. /**
  17672. * Sets the text content of the icon.
  17673. * @param {string} content
  17674. */
  17675. }, {
  17676. key: 'iconContent',
  17677. set: function set(content) {
  17678. this.foundation_.setIconContent(content);
  17679. }
  17680. }], [{
  17681. key: 'attachTo',
  17682. value: function attachTo(root) {
  17683. return new MDCTextField(root);
  17684. }
  17685. }]);
  17686. return MDCTextField;
  17687. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  17688. /***/ }),
  17689. /* 132 */
  17690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17691. "use strict";
  17692. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  17693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  17694. /**
  17695. * @license
  17696. * Copyright 2016 Google Inc. All Rights Reserved.
  17697. *
  17698. * Licensed under the Apache License, Version 2.0 (the "License");
  17699. * you may not use this file except in compliance with the License.
  17700. * You may obtain a copy of the License at
  17701. *
  17702. * http://www.apache.org/licenses/LICENSE-2.0
  17703. *
  17704. * Unless required by applicable law or agreed to in writing, software
  17705. * distributed under the License is distributed on an "AS IS" BASIS,
  17706. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17707. * See the License for the specific language governing permissions and
  17708. * limitations under the License.
  17709. */
  17710. /** @enum {string} */
  17711. var strings = {
  17712. ARIA_HIDDEN: 'aria-hidden',
  17713. ROLE: 'role'
  17714. };
  17715. /** @enum {string} */
  17716. var cssClasses = {
  17717. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  17718. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  17719. };
  17720. /***/ }),
  17721. /* 133 */
  17722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17723. "use strict";
  17724. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  17725. /**
  17726. * @license
  17727. * Copyright 2016 Google Inc. All Rights Reserved.
  17728. *
  17729. * Licensed under the Apache License, Version 2.0 (the "License");
  17730. * you may not use this file except in compliance with the License.
  17731. * You may obtain a copy of the License at
  17732. *
  17733. * http://www.apache.org/licenses/LICENSE-2.0
  17734. *
  17735. * Unless required by applicable law or agreed to in writing, software
  17736. * distributed under the License is distributed on an "AS IS" BASIS,
  17737. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17738. * See the License for the specific language governing permissions and
  17739. * limitations under the License.
  17740. */
  17741. /** @enum {string} */
  17742. var strings = {
  17743. ICON_EVENT: 'MDCTextField:icon',
  17744. ICON_ROLE: 'button'
  17745. };
  17746. /***/ }),
  17747. /* 134 */
  17748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17749. "use strict";
  17750. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  17751. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(21);
  17752. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_foundation__ = __webpack_require__(22);
  17753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(45);
  17754. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(44);
  17755. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  17756. 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; }; }();
  17757. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17758. 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; }
  17759. 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; }
  17760. /**
  17761. * @license
  17762. * Copyright 2016 Google Inc. All Rights Reserved.
  17763. *
  17764. * Licensed under the Apache License, Version 2.0 (the "License");
  17765. * you may not use this file except in compliance with the License.
  17766. * You may obtain a copy of the License at
  17767. *
  17768. * http://www.apache.org/licenses/LICENSE-2.0
  17769. *
  17770. * Unless required by applicable law or agreed to in writing, software
  17771. * distributed under the License is distributed on an "AS IS" BASIS,
  17772. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17773. * See the License for the specific language governing permissions and
  17774. * limitations under the License.
  17775. */
  17776. /* eslint-disable no-unused-vars */
  17777. /* eslint-enable no-unused-vars */
  17778. /**
  17779. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  17780. * @final
  17781. */
  17782. var MDCTextFieldFoundation = function (_MDCFoundation) {
  17783. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  17784. _createClass(MDCTextFieldFoundation, [{
  17785. key: 'shouldShake',
  17786. /** @return {boolean} */
  17787. get: function get() {
  17788. return !this.isValid() && !this.isFocused_;
  17789. }
  17790. /** @return {boolean} */
  17791. }, {
  17792. key: 'shouldFloat',
  17793. get: function get() {
  17794. return this.isFocused_ || !!this.getValue() || this.isBadInput_();
  17795. }
  17796. /**
  17797. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  17798. * types.
  17799. * @return {!MDCTextFieldAdapter}
  17800. */
  17801. }], [{
  17802. key: 'cssClasses',
  17803. /** @return enum {string} */
  17804. get: function get() {
  17805. return __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* cssClasses */];
  17806. }
  17807. /** @return enum {string} */
  17808. }, {
  17809. key: 'strings',
  17810. get: function get() {
  17811. return __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* strings */];
  17812. }
  17813. /** @return enum {string} */
  17814. }, {
  17815. key: 'numbers',
  17816. get: function get() {
  17817. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* numbers */];
  17818. }
  17819. }, {
  17820. key: 'defaultAdapter',
  17821. get: function get() {
  17822. return (/** @type {!MDCTextFieldAdapter} */{
  17823. addClass: function addClass() {},
  17824. removeClass: function removeClass() {},
  17825. hasClass: function hasClass() {},
  17826. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  17827. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  17828. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  17829. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  17830. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {},
  17831. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {},
  17832. getNativeInput: function getNativeInput() {},
  17833. isFocused: function isFocused() {},
  17834. isRtl: function isRtl() {},
  17835. activateLineRipple: function activateLineRipple() {},
  17836. deactivateLineRipple: function deactivateLineRipple() {},
  17837. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {},
  17838. shakeLabel: function shakeLabel() {},
  17839. floatLabel: function floatLabel() {},
  17840. hasLabel: function hasLabel() {},
  17841. getLabelWidth: function getLabelWidth() {},
  17842. hasOutline: function hasOutline() {},
  17843. notchOutline: function notchOutline() {},
  17844. closeOutline: function closeOutline() {}
  17845. }
  17846. );
  17847. }
  17848. /**
  17849. * @param {!MDCTextFieldAdapter} adapter
  17850. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  17851. */
  17852. }]);
  17853. function MDCTextFieldFoundation(adapter) {
  17854. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  17855. _classCallCheck(this, MDCTextFieldFoundation);
  17856. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  17857. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  17858. _this.helperText_ = foundationMap.helperText;
  17859. /** @type {!MDCTextFieldIconFoundation|undefined} */
  17860. _this.icon_ = foundationMap.icon;
  17861. /** @private {boolean} */
  17862. _this.isFocused_ = false;
  17863. /** @private {boolean} */
  17864. _this.receivedUserInput_ = false;
  17865. /** @private {boolean} */
  17866. _this.useCustomValidityChecking_ = false;
  17867. /** @private {boolean} */
  17868. _this.isValid_ = true;
  17869. /** @private {function(): undefined} */
  17870. _this.inputFocusHandler_ = function () {
  17871. return _this.activateFocus();
  17872. };
  17873. /** @private {function(): undefined} */
  17874. _this.inputBlurHandler_ = function () {
  17875. return _this.deactivateFocus();
  17876. };
  17877. /** @private {function(): undefined} */
  17878. _this.inputInputHandler_ = function () {
  17879. return _this.autoCompleteFocus();
  17880. };
  17881. /** @private {function(!Event): undefined} */
  17882. _this.setPointerXOffset_ = function (evt) {
  17883. return _this.setTransformOrigin(evt);
  17884. };
  17885. /** @private {function(!Event): undefined} */
  17886. _this.textFieldInteractionHandler_ = function () {
  17887. return _this.handleTextFieldInteraction();
  17888. };
  17889. /** @private {function(!Array): undefined} */
  17890. _this.validationAttributeChangeHandler_ = function (attributesList) {
  17891. return _this.handleValidationAttributeChange(attributesList);
  17892. };
  17893. /** @private {!MutationObserver} */
  17894. _this.validationObserver_;
  17895. return _this;
  17896. }
  17897. _createClass(MDCTextFieldFoundation, [{
  17898. key: 'init',
  17899. value: function init() {
  17900. var _this2 = this;
  17901. this.adapter_.addClass(MDCTextFieldFoundation.cssClasses.UPGRADED);
  17902. // Ensure label does not collide with any pre-filled value.
  17903. if (this.adapter_.hasLabel() && (this.getValue() || this.isBadInput_())) {
  17904. this.adapter_.floatLabel(this.shouldFloat);
  17905. this.notchOutline(this.shouldFloat);
  17906. }
  17907. if (this.adapter_.isFocused()) {
  17908. this.inputFocusHandler_();
  17909. }
  17910. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  17911. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  17912. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  17913. ['mousedown', 'touchstart'].forEach(function (evtType) {
  17914. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  17915. });
  17916. ['click', 'keydown'].forEach(function (evtType) {
  17917. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  17918. });
  17919. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  17920. }
  17921. }, {
  17922. key: 'destroy',
  17923. value: function destroy() {
  17924. var _this3 = this;
  17925. this.adapter_.removeClass(MDCTextFieldFoundation.cssClasses.UPGRADED);
  17926. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  17927. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  17928. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  17929. ['mousedown', 'touchstart'].forEach(function (evtType) {
  17930. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  17931. });
  17932. ['click', 'keydown'].forEach(function (evtType) {
  17933. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  17934. });
  17935. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  17936. }
  17937. /**
  17938. * Handles user interactions with the Text Field.
  17939. */
  17940. }, {
  17941. key: 'handleTextFieldInteraction',
  17942. value: function handleTextFieldInteraction() {
  17943. if (this.adapter_.getNativeInput().disabled) {
  17944. return;
  17945. }
  17946. this.receivedUserInput_ = true;
  17947. }
  17948. /**
  17949. * Handles validation attribute changes
  17950. * @param {!Array<string>} attributesList
  17951. */
  17952. }, {
  17953. key: 'handleValidationAttributeChange',
  17954. value: function handleValidationAttributeChange(attributesList) {
  17955. var _this4 = this;
  17956. attributesList.some(function (attributeName) {
  17957. if (__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) {
  17958. _this4.styleValidity_(true);
  17959. return true;
  17960. }
  17961. });
  17962. }
  17963. /**
  17964. * Opens/closes the notched outline.
  17965. * @param {boolean} openNotch
  17966. */
  17967. }, {
  17968. key: 'notchOutline',
  17969. value: function notchOutline(openNotch) {
  17970. if (!this.adapter_.hasOutline() || !this.adapter_.hasLabel()) {
  17971. return;
  17972. }
  17973. if (openNotch) {
  17974. var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* cssClasses */].DENSE);
  17975. var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* numbers */].LABEL_SCALE;
  17976. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  17977. var isRtl = this.adapter_.isRtl();
  17978. this.adapter_.notchOutline(labelWidth, isRtl);
  17979. } else {
  17980. this.adapter_.closeOutline();
  17981. }
  17982. }
  17983. /**
  17984. * Activates the text field focus state.
  17985. */
  17986. }, {
  17987. key: 'activateFocus',
  17988. value: function activateFocus() {
  17989. this.isFocused_ = true;
  17990. this.styleFocused_(this.isFocused_);
  17991. this.adapter_.activateLineRipple();
  17992. this.notchOutline(this.shouldFloat);
  17993. if (this.adapter_.hasLabel()) {
  17994. this.adapter_.shakeLabel(this.shouldShake);
  17995. this.adapter_.floatLabel(this.shouldFloat);
  17996. }
  17997. if (this.helperText_) {
  17998. this.helperText_.showToScreenReader();
  17999. }
  18000. }
  18001. /**
  18002. * Sets the line ripple's transform origin, so that the line ripple activate
  18003. * animation will animate out from the user's click location.
  18004. * @param {!Event} evt
  18005. */
  18006. }, {
  18007. key: 'setTransformOrigin',
  18008. value: function setTransformOrigin(evt) {
  18009. var targetClientRect = evt.target.getBoundingClientRect();
  18010. var evtCoords = { x: evt.clientX, y: evt.clientY };
  18011. var normalizedX = evtCoords.x - targetClientRect.left;
  18012. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  18013. }
  18014. /**
  18015. * Activates the Text Field's focus state in cases when the input value
  18016. * changes without user input (e.g. programatically).
  18017. */
  18018. }, {
  18019. key: 'autoCompleteFocus',
  18020. value: function autoCompleteFocus() {
  18021. if (!this.receivedUserInput_) {
  18022. this.activateFocus();
  18023. }
  18024. }
  18025. /**
  18026. * Deactivates the Text Field's focus state.
  18027. */
  18028. }, {
  18029. key: 'deactivateFocus',
  18030. value: function deactivateFocus() {
  18031. this.isFocused_ = false;
  18032. this.adapter_.deactivateLineRipple();
  18033. var input = this.getNativeInput_();
  18034. var shouldRemoveLabelFloat = !input.value && !this.isBadInput_();
  18035. var isValid = this.isValid();
  18036. this.styleValidity_(isValid);
  18037. this.styleFocused_(this.isFocused_);
  18038. if (this.adapter_.hasLabel()) {
  18039. this.adapter_.shakeLabel(this.shouldShake);
  18040. this.adapter_.floatLabel(this.shouldFloat);
  18041. this.notchOutline(this.shouldFloat);
  18042. }
  18043. if (shouldRemoveLabelFloat) {
  18044. this.receivedUserInput_ = false;
  18045. }
  18046. }
  18047. /**
  18048. * @return {string} The value of the input Element.
  18049. */
  18050. }, {
  18051. key: 'getValue',
  18052. value: function getValue() {
  18053. return this.getNativeInput_().value;
  18054. }
  18055. /**
  18056. * @param {string} value The value to set on the input Element.
  18057. */
  18058. }, {
  18059. key: 'setValue',
  18060. value: function setValue(value) {
  18061. this.getNativeInput_().value = value;
  18062. var isValid = this.isValid();
  18063. this.styleValidity_(isValid);
  18064. if (this.adapter_.hasLabel()) {
  18065. this.adapter_.shakeLabel(this.shouldShake);
  18066. this.adapter_.floatLabel(this.shouldFloat);
  18067. this.notchOutline(this.shouldFloat);
  18068. }
  18069. }
  18070. /**
  18071. * @return {boolean} If a custom validity is set, returns that value.
  18072. * Otherwise, returns the result of native validity checks.
  18073. */
  18074. }, {
  18075. key: 'isValid',
  18076. value: function isValid() {
  18077. return this.useCustomValidityChecking_ ? this.isValid_ : this.isNativeInputValid_();
  18078. }
  18079. /**
  18080. * @param {boolean} isValid Sets the validity state of the Text Field.
  18081. */
  18082. }, {
  18083. key: 'setValid',
  18084. value: function setValid(isValid) {
  18085. this.useCustomValidityChecking_ = true;
  18086. this.isValid_ = isValid;
  18087. // Retrieve from the getter to ensure correct logic is applied.
  18088. isValid = this.isValid();
  18089. this.styleValidity_(isValid);
  18090. if (this.adapter_.hasLabel()) {
  18091. this.adapter_.shakeLabel(this.shouldShake);
  18092. }
  18093. }
  18094. /**
  18095. * @return {boolean} True if the Text Field is disabled.
  18096. */
  18097. }, {
  18098. key: 'isDisabled',
  18099. value: function isDisabled() {
  18100. return this.getNativeInput_().disabled;
  18101. }
  18102. /**
  18103. * @param {boolean} disabled Sets the text-field disabled or enabled.
  18104. */
  18105. }, {
  18106. key: 'setDisabled',
  18107. value: function setDisabled(disabled) {
  18108. this.getNativeInput_().disabled = disabled;
  18109. this.styleDisabled_(disabled);
  18110. }
  18111. /**
  18112. * @param {string} content Sets the content of the helper text.
  18113. */
  18114. }, {
  18115. key: 'setHelperTextContent',
  18116. value: function setHelperTextContent(content) {
  18117. if (this.helperText_) {
  18118. this.helperText_.setContent(content);
  18119. }
  18120. }
  18121. /**
  18122. * Sets the aria label of the icon.
  18123. * @param {string} label
  18124. */
  18125. }, {
  18126. key: 'setIconAriaLabel',
  18127. value: function setIconAriaLabel(label) {
  18128. if (this.icon_) {
  18129. this.icon_.setAriaLabel(label);
  18130. }
  18131. }
  18132. /**
  18133. * Sets the text content of the icon.
  18134. * @param {string} content
  18135. */
  18136. }, {
  18137. key: 'setIconContent',
  18138. value: function setIconContent(content) {
  18139. if (this.icon_) {
  18140. this.icon_.setContent(content);
  18141. }
  18142. }
  18143. /**
  18144. * @return {boolean} True if the Text Field input fails in converting the
  18145. * user-supplied value.
  18146. * @private
  18147. */
  18148. }, {
  18149. key: 'isBadInput_',
  18150. value: function isBadInput_() {
  18151. return this.getNativeInput_().validity.badInput;
  18152. }
  18153. /**
  18154. * @return {boolean} The result of native validity checking
  18155. * (ValidityState.valid).
  18156. */
  18157. }, {
  18158. key: 'isNativeInputValid_',
  18159. value: function isNativeInputValid_() {
  18160. return this.getNativeInput_().validity.valid;
  18161. }
  18162. /**
  18163. * Styles the component based on the validity state.
  18164. * @param {boolean} isValid
  18165. * @private
  18166. */
  18167. }, {
  18168. key: 'styleValidity_',
  18169. value: function styleValidity_(isValid) {
  18170. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  18171. if (isValid) {
  18172. this.adapter_.removeClass(INVALID);
  18173. } else {
  18174. this.adapter_.addClass(INVALID);
  18175. }
  18176. if (this.helperText_) {
  18177. this.helperText_.setValidity(isValid);
  18178. }
  18179. }
  18180. /**
  18181. * Styles the component based on the focused state.
  18182. * @param {boolean} isFocused
  18183. * @private
  18184. */
  18185. }, {
  18186. key: 'styleFocused_',
  18187. value: function styleFocused_(isFocused) {
  18188. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  18189. if (isFocused) {
  18190. this.adapter_.addClass(FOCUSED);
  18191. } else {
  18192. this.adapter_.removeClass(FOCUSED);
  18193. }
  18194. }
  18195. /**
  18196. * Styles the component based on the disabled state.
  18197. * @param {boolean} isDisabled
  18198. * @private
  18199. */
  18200. }, {
  18201. key: 'styleDisabled_',
  18202. value: function styleDisabled_(isDisabled) {
  18203. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  18204. DISABLED = _MDCTextFieldFoundati.DISABLED,
  18205. INVALID = _MDCTextFieldFoundati.INVALID;
  18206. if (isDisabled) {
  18207. this.adapter_.addClass(DISABLED);
  18208. this.adapter_.removeClass(INVALID);
  18209. } else {
  18210. this.adapter_.removeClass(DISABLED);
  18211. }
  18212. if (this.icon_) {
  18213. this.icon_.setDisabled(isDisabled);
  18214. }
  18215. }
  18216. /**
  18217. * @return {!Element|!NativeInputType} The native text input from the
  18218. * host environment, or a dummy if none exists.
  18219. * @private
  18220. */
  18221. }, {
  18222. key: 'getNativeInput_',
  18223. value: function getNativeInput_() {
  18224. return this.adapter_.getNativeInput() ||
  18225. /** @type {!NativeInputType} */{
  18226. value: '',
  18227. disabled: false,
  18228. validity: {
  18229. badInput: false,
  18230. valid: true
  18231. }
  18232. };
  18233. }
  18234. }]);
  18235. return MDCTextFieldFoundation;
  18236. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18237. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  18238. /***/ }),
  18239. /* 135 */
  18240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18241. "use strict";
  18242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  18243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  18245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(21);
  18246. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  18247. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  18248. 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; }; }();
  18249. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18250. 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; }
  18251. 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; }
  18252. /**
  18253. * @license
  18254. * Copyright 2017 Google Inc. All Rights Reserved.
  18255. *
  18256. * Licensed under the Apache License, Version 2.0 (the "License");
  18257. * you may not use this file except in compliance with the License.
  18258. * You may obtain a copy of the License at
  18259. *
  18260. * http://www.apache.org/licenses/LICENSE-2.0
  18261. *
  18262. * Unless required by applicable law or agreed to in writing, software
  18263. * distributed under the License is distributed on an "AS IS" BASIS,
  18264. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18265. * See the License for the specific language governing permissions and
  18266. * limitations under the License.
  18267. */
  18268. /**
  18269. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  18270. * @final
  18271. */
  18272. var MDCTextFieldHelperText = function (_MDCComponent) {
  18273. _inherits(MDCTextFieldHelperText, _MDCComponent);
  18274. function MDCTextFieldHelperText() {
  18275. _classCallCheck(this, MDCTextFieldHelperText);
  18276. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  18277. }
  18278. _createClass(MDCTextFieldHelperText, [{
  18279. key: 'getDefaultFoundation',
  18280. /**
  18281. * @return {!MDCTextFieldHelperTextFoundation}
  18282. */
  18283. value: function getDefaultFoundation() {
  18284. var _this2 = this;
  18285. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  18286. addClass: function addClass(className) {
  18287. return _this2.root_.classList.add(className);
  18288. },
  18289. removeClass: function removeClass(className) {
  18290. return _this2.root_.classList.remove(className);
  18291. },
  18292. hasClass: function hasClass(className) {
  18293. return _this2.root_.classList.contains(className);
  18294. },
  18295. setAttr: function setAttr(attr, value) {
  18296. return _this2.root_.setAttribute(attr, value);
  18297. },
  18298. removeAttr: function removeAttr(attr) {
  18299. return _this2.root_.removeAttribute(attr);
  18300. },
  18301. setContent: function setContent(content) {
  18302. _this2.root_.textContent = content;
  18303. }
  18304. }));
  18305. }
  18306. }, {
  18307. key: 'foundation',
  18308. /**
  18309. * @return {!MDCTextFieldHelperTextFoundation}
  18310. */
  18311. get: function get() {
  18312. return this.foundation_;
  18313. }
  18314. }], [{
  18315. key: 'attachTo',
  18316. /**
  18317. * @param {!Element} root
  18318. * @return {!MDCTextFieldHelperText}
  18319. */
  18320. value: function attachTo(root) {
  18321. return new MDCTextFieldHelperText(root);
  18322. }
  18323. }]);
  18324. return MDCTextFieldHelperText;
  18325. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  18326. /***/ }),
  18327. /* 136 */
  18328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18329. "use strict";
  18330. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; });
  18331. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18332. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(47);
  18333. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(22);
  18334. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  18335. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  18336. 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; }; }();
  18337. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18338. 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; }
  18339. 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; }
  18340. /**
  18341. * @license
  18342. * Copyright 2017 Google Inc. All Rights Reserved.
  18343. *
  18344. * Licensed under the Apache License, Version 2.0 (the "License");
  18345. * you may not use this file except in compliance with the License.
  18346. * You may obtain a copy of the License at
  18347. *
  18348. * http://www.apache.org/licenses/LICENSE-2.0
  18349. *
  18350. * Unless required by applicable law or agreed to in writing, software
  18351. * distributed under the License is distributed on an "AS IS" BASIS,
  18352. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18353. * See the License for the specific language governing permissions and
  18354. * limitations under the License.
  18355. */
  18356. /**
  18357. * @extends {MDCComponent<!MDCTextFieldIconFoundation>}
  18358. * @final
  18359. */
  18360. var MDCTextFieldIcon = function (_MDCComponent) {
  18361. _inherits(MDCTextFieldIcon, _MDCComponent);
  18362. function MDCTextFieldIcon() {
  18363. _classCallCheck(this, MDCTextFieldIcon);
  18364. return _possibleConstructorReturn(this, (MDCTextFieldIcon.__proto__ || Object.getPrototypeOf(MDCTextFieldIcon)).apply(this, arguments));
  18365. }
  18366. _createClass(MDCTextFieldIcon, [{
  18367. key: 'getDefaultFoundation',
  18368. /**
  18369. * @return {!MDCTextFieldIconFoundation}
  18370. */
  18371. value: function getDefaultFoundation() {
  18372. var _this2 = this;
  18373. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldIconAdapter} */_extends({
  18374. getAttr: function getAttr(attr) {
  18375. return _this2.root_.getAttribute(attr);
  18376. },
  18377. setAttr: function setAttr(attr, value) {
  18378. return _this2.root_.setAttribute(attr, value);
  18379. },
  18380. removeAttr: function removeAttr(attr) {
  18381. return _this2.root_.removeAttribute(attr);
  18382. },
  18383. setContent: function setContent(content) {
  18384. _this2.root_.textContent = content;
  18385. },
  18386. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  18387. return _this2.root_.addEventListener(evtType, handler);
  18388. },
  18389. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  18390. return _this2.root_.removeEventListener(evtType, handler);
  18391. },
  18392. notifyIconAction: function notifyIconAction() {
  18393. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  18394. }
  18395. }));
  18396. }
  18397. }, {
  18398. key: 'foundation',
  18399. /**
  18400. * @return {!MDCTextFieldIconFoundation}
  18401. */
  18402. get: function get() {
  18403. return this.foundation_;
  18404. }
  18405. }], [{
  18406. key: 'attachTo',
  18407. /**
  18408. * @param {!Element} root
  18409. * @return {!MDCTextFieldIcon}
  18410. */
  18411. value: function attachTo(root) {
  18412. return new MDCTextFieldIcon(root);
  18413. }
  18414. }]);
  18415. return MDCTextFieldIcon;
  18416. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  18417. /***/ }),
  18418. /* 137 */
  18419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18420. "use strict";
  18421. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18422. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  18423. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(2);
  18424. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(3);
  18425. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(138);
  18426. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  18427. 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; }; }();
  18428. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  18429. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18430. 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; }
  18431. 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; }
  18432. /**
  18433. * Copyright 2017 Google Inc. All Rights Reserved.
  18434. *
  18435. * Licensed under the Apache License, Version 2.0 (the "License");
  18436. * you may not use this file except in compliance with the License.
  18437. * You may obtain a copy of the License at
  18438. *
  18439. * http://www.apache.org/licenses/LICENSE-2.0
  18440. *
  18441. * Unless required by applicable law or agreed to in writing, software
  18442. * distributed under the License is distributed on an "AS IS" BASIS,
  18443. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18444. * See the License for the specific language governing permissions and
  18445. * limitations under the License.
  18446. */
  18447. var MDCToolbar = function (_MDCComponent) {
  18448. _inherits(MDCToolbar, _MDCComponent);
  18449. function MDCToolbar() {
  18450. _classCallCheck(this, MDCToolbar);
  18451. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  18452. }
  18453. _createClass(MDCToolbar, [{
  18454. key: 'initialize',
  18455. value: function initialize() {
  18456. this.ripples_ = [].map.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_SELECTOR), function (icon) {
  18457. var ripple = __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].attachTo(icon);
  18458. ripple.unbounded = true;
  18459. return ripple;
  18460. });
  18461. }
  18462. }, {
  18463. key: 'destroy',
  18464. value: function destroy() {
  18465. this.ripples_.forEach(function (ripple) {
  18466. ripple.destroy();
  18467. });
  18468. _get(MDCToolbar.prototype.__proto__ || Object.getPrototypeOf(MDCToolbar.prototype), 'destroy', this).call(this);
  18469. }
  18470. }, {
  18471. key: 'getDefaultFoundation',
  18472. value: function getDefaultFoundation() {
  18473. var _this2 = this;
  18474. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  18475. hasClass: function hasClass(className) {
  18476. return _this2.root_.classList.contains(className);
  18477. },
  18478. addClass: function addClass(className) {
  18479. return _this2.root_.classList.add(className);
  18480. },
  18481. removeClass: function removeClass(className) {
  18482. return _this2.root_.classList.remove(className);
  18483. },
  18484. registerScrollHandler: function registerScrollHandler(handler) {
  18485. return window.addEventListener('scroll', handler);
  18486. },
  18487. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  18488. return window.removeEventListener('scroll', handler);
  18489. },
  18490. registerResizeHandler: function registerResizeHandler(handler) {
  18491. return window.addEventListener('resize', handler);
  18492. },
  18493. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  18494. return window.removeEventListener('resize', handler);
  18495. },
  18496. getViewportWidth: function getViewportWidth() {
  18497. return window.innerWidth;
  18498. },
  18499. getViewportScrollY: function getViewportScrollY() {
  18500. return window.pageYOffset;
  18501. },
  18502. getOffsetHeight: function getOffsetHeight() {
  18503. return _this2.root_.offsetHeight;
  18504. },
  18505. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  18506. return _this2.firstRowElement_.offsetHeight;
  18507. },
  18508. notifyChange: function notifyChange(evtData) {
  18509. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  18510. },
  18511. setStyle: function setStyle(property, value) {
  18512. return _this2.root_.style.setProperty(property, value);
  18513. },
  18514. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  18515. return _this2.titleElement_.style.setProperty(property, value);
  18516. },
  18517. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  18518. return _this2.firstRowElement_.style.setProperty(property, value);
  18519. },
  18520. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  18521. if (_this2.fixedAdjustElement) {
  18522. _this2.fixedAdjustElement.style.setProperty(property, value);
  18523. }
  18524. }
  18525. });
  18526. }
  18527. }, {
  18528. key: 'firstRowElement_',
  18529. get: function get() {
  18530. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  18531. }
  18532. }, {
  18533. key: 'titleElement_',
  18534. get: function get() {
  18535. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  18536. }
  18537. }, {
  18538. key: 'fixedAdjustElement',
  18539. set: function set(fixedAdjustElement) {
  18540. this.fixedAdjustElement_ = fixedAdjustElement;
  18541. this.foundation_.updateAdjustElementStyles();
  18542. },
  18543. get: function get() {
  18544. return this.fixedAdjustElement_;
  18545. }
  18546. }], [{
  18547. key: 'attachTo',
  18548. value: function attachTo(root) {
  18549. return new MDCToolbar(root);
  18550. }
  18551. }]);
  18552. return MDCToolbar;
  18553. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  18554. /***/ }),
  18555. /* 138 */
  18556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18557. "use strict";
  18558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(139);
  18560. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  18561. 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; }; }();
  18562. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18563. 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; }
  18564. 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; }
  18565. /**
  18566. * Copyright 2017 Google Inc. All Rights Reserved.
  18567. *
  18568. * Licensed under the Apache License, Version 2.0 (the "License");
  18569. * you may not use this file except in compliance with the License.
  18570. * You may obtain a copy of the License at
  18571. *
  18572. * http://www.apache.org/licenses/LICENSE-2.0
  18573. *
  18574. * Unless required by applicable law or agreed to in writing, software
  18575. * distributed under the License is distributed on an "AS IS" BASIS,
  18576. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18577. * See the License for the specific language governing permissions and
  18578. * limitations under the License.
  18579. */
  18580. var MDCToolbarFoundation = function (_MDCFoundation) {
  18581. _inherits(MDCToolbarFoundation, _MDCFoundation);
  18582. _createClass(MDCToolbarFoundation, null, [{
  18583. key: 'cssClasses',
  18584. get: function get() {
  18585. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  18586. }
  18587. }, {
  18588. key: 'strings',
  18589. get: function get() {
  18590. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  18591. }
  18592. }, {
  18593. key: 'numbers',
  18594. get: function get() {
  18595. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  18596. }
  18597. }, {
  18598. key: 'defaultAdapter',
  18599. get: function get() {
  18600. return {
  18601. hasClass: function hasClass() {
  18602. return (/* className: string */ /* boolean */false
  18603. );
  18604. },
  18605. addClass: function addClass() /* className: string */{},
  18606. removeClass: function removeClass() /* className: string */{},
  18607. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  18608. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  18609. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  18610. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  18611. getViewportWidth: function getViewportWidth() {
  18612. return (/* number */0
  18613. );
  18614. },
  18615. getViewportScrollY: function getViewportScrollY() {
  18616. return (/* number */0
  18617. );
  18618. },
  18619. getOffsetHeight: function getOffsetHeight() {
  18620. return (/* number */0
  18621. );
  18622. },
  18623. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  18624. return (/* number */0
  18625. );
  18626. },
  18627. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  18628. setStyle: function setStyle() /* property: string, value: string */{},
  18629. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  18630. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  18631. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  18632. };
  18633. }
  18634. }]);
  18635. function MDCToolbarFoundation(adapter) {
  18636. _classCallCheck(this, MDCToolbarFoundation);
  18637. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  18638. _this.resizeHandler_ = function () {
  18639. return _this.checkRowHeight_();
  18640. };
  18641. _this.scrollHandler_ = function () {
  18642. return _this.updateToolbarStyles_();
  18643. };
  18644. _this.checkRowHeightFrame_ = 0;
  18645. _this.scrollFrame_ = 0;
  18646. _this.executedLastChange_ = false;
  18647. _this.calculations_ = {
  18648. toolbarRowHeight: 0,
  18649. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  18650. toolbarRatio: 0, // The ratio of toolbar height to row height
  18651. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  18652. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  18653. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  18654. // Derived Heights based on the above key ratios.
  18655. toolbarHeight: 0,
  18656. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  18657. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  18658. scrollThreshold: 0
  18659. };
  18660. // Toolbar fixed behavior
  18661. // If toolbar is fixed
  18662. _this.fixed_ = false;
  18663. // If fixed is targeted only at the last row
  18664. _this.fixedLastrow_ = false;
  18665. // Toolbar flexible behavior
  18666. // If the first row is flexible
  18667. _this.hasFlexibleRow_ = false;
  18668. // If use the default behavior
  18669. _this.useFlexDefaultBehavior_ = false;
  18670. return _this;
  18671. }
  18672. _createClass(MDCToolbarFoundation, [{
  18673. key: 'init',
  18674. value: function init() {
  18675. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  18676. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  18677. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  18678. if (this.hasFlexibleRow_) {
  18679. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  18680. }
  18681. this.initKeyRatio_();
  18682. this.setKeyHeights_();
  18683. this.adapter_.registerResizeHandler(this.resizeHandler_);
  18684. this.adapter_.registerScrollHandler(this.scrollHandler_);
  18685. }
  18686. }, {
  18687. key: 'destroy',
  18688. value: function destroy() {
  18689. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  18690. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  18691. }
  18692. }, {
  18693. key: 'updateAdjustElementStyles',
  18694. value: function updateAdjustElementStyles() {
  18695. if (this.fixed_) {
  18696. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  18697. }
  18698. }
  18699. }, {
  18700. key: 'getFlexibleExpansionRatio_',
  18701. value: function getFlexibleExpansionRatio_(scrollTop) {
  18702. // To prevent division by zero when there is no flexibleExpansionHeight
  18703. var delta = 0.0001;
  18704. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  18705. }
  18706. }, {
  18707. key: 'checkRowHeight_',
  18708. value: function checkRowHeight_() {
  18709. var _this2 = this;
  18710. cancelAnimationFrame(this.checkRowHeightFrame_);
  18711. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  18712. return _this2.setKeyHeights_();
  18713. });
  18714. }
  18715. }, {
  18716. key: 'setKeyHeights_',
  18717. value: function setKeyHeights_() {
  18718. var newToolbarRowHeight = this.getRowHeight_();
  18719. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  18720. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  18721. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  18722. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  18723. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  18724. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  18725. this.updateAdjustElementStyles();
  18726. this.updateToolbarStyles_();
  18727. }
  18728. }
  18729. }, {
  18730. key: 'updateToolbarStyles_',
  18731. value: function updateToolbarStyles_() {
  18732. var _this3 = this;
  18733. cancelAnimationFrame(this.scrollFrame_);
  18734. this.scrollFrame_ = requestAnimationFrame(function () {
  18735. var scrollTop = _this3.adapter_.getViewportScrollY();
  18736. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  18737. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  18738. return;
  18739. }
  18740. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  18741. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  18742. if (_this3.fixedLastrow_) {
  18743. _this3.updateToolbarFixedState_(scrollTop);
  18744. }
  18745. if (_this3.hasFlexibleRow_) {
  18746. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  18747. }
  18748. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  18749. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  18750. });
  18751. }
  18752. }, {
  18753. key: 'scrolledOutOfThreshold_',
  18754. value: function scrolledOutOfThreshold_(scrollTop) {
  18755. return scrollTop > this.calculations_.scrollThreshold;
  18756. }
  18757. }, {
  18758. key: 'initKeyRatio_',
  18759. value: function initKeyRatio_() {
  18760. var toolbarRowHeight = this.getRowHeight_();
  18761. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  18762. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  18763. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  18764. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  18765. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  18766. }
  18767. }, {
  18768. key: 'getRowHeight_',
  18769. value: function getRowHeight_() {
  18770. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  18771. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  18772. }
  18773. }, {
  18774. key: 'updateToolbarFlexibleState_',
  18775. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  18776. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  18777. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  18778. if (flexibleExpansionRatio === 1) {
  18779. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  18780. } else if (flexibleExpansionRatio === 0) {
  18781. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  18782. }
  18783. }
  18784. }, {
  18785. key: 'updateToolbarFixedState_',
  18786. value: function updateToolbarFixedState_(scrollTop) {
  18787. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  18788. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  18789. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  18790. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  18791. } else {
  18792. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  18793. }
  18794. }
  18795. }, {
  18796. key: 'updateFlexibleRowElementStyles_',
  18797. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  18798. if (this.fixed_) {
  18799. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  18800. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  18801. }
  18802. if (this.useFlexDefaultBehavior_) {
  18803. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  18804. }
  18805. }
  18806. }, {
  18807. key: 'updateElementStylesDefaultBehavior_',
  18808. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  18809. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  18810. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  18811. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  18812. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  18813. }
  18814. }]);
  18815. return MDCToolbarFoundation;
  18816. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18817. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  18818. /***/ }),
  18819. /* 139 */
  18820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18821. "use strict";
  18822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  18824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  18825. /**
  18826. * Copyright 2017 Google Inc. All Rights Reserved.
  18827. *
  18828. * Licensed under the Apache License, Version 2.0 (the "License");
  18829. * you may not use this file except in compliance with the License.
  18830. * You may obtain a copy of the License at
  18831. *
  18832. * http://www.apache.org/licenses/LICENSE-2.0
  18833. *
  18834. * Unless required by applicable law or agreed to in writing, software
  18835. * distributed under the License is distributed on an "AS IS" BASIS,
  18836. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18837. * See the License for the specific language governing permissions and
  18838. * limitations under the License.
  18839. */
  18840. var cssClasses = {
  18841. FIXED: 'mdc-toolbar--fixed',
  18842. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  18843. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  18844. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  18845. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  18846. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  18847. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  18848. };
  18849. var strings = {
  18850. TITLE_SELECTOR: '.mdc-toolbar__title',
  18851. ICON_SELECTOR: '.mdc-toolbar__icon',
  18852. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  18853. CHANGE_EVENT: 'MDCToolbar:change'
  18854. };
  18855. var numbers = {
  18856. MAX_TITLE_SIZE: 2.125,
  18857. MIN_TITLE_SIZE: 1.25,
  18858. TOOLBAR_ROW_HEIGHT: 64,
  18859. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  18860. TOOLBAR_MOBILE_BREAKPOINT: 600
  18861. };
  18862. /***/ }),
  18863. /* 140 */
  18864. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18865. "use strict";
  18866. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBar", function() { return MDCTopAppBar; });
  18868. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  18869. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  18870. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(3);
  18871. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(8);
  18872. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(13);
  18873. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__ = __webpack_require__(141);
  18874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__short_foundation__ = __webpack_require__(142);
  18875. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__standard_foundation__ = __webpack_require__(143);
  18876. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarBaseFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  18877. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a"]; });
  18878. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFixedTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a"]; });
  18879. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCShortTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a"]; });
  18880. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  18881. 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; }; }();
  18882. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  18883. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18884. 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; }
  18885. 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; }
  18886. /**
  18887. * @license
  18888. * Copyright 2018 Google Inc. All Rights Reserved.
  18889. *
  18890. * Licensed under the Apache License, Version 2.0 (the "License");
  18891. * you may not use this file except in compliance with the License.
  18892. * You may obtain a copy of the License at
  18893. *
  18894. * http://www.apache.org/licenses/LICENSE-2.0
  18895. *
  18896. * Unless required by applicable law or agreed to in writing, software
  18897. * distributed under the License is distributed on an "AS IS" BASIS,
  18898. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18899. * See the License for the specific language governing permissions and
  18900. * limitations under the License.
  18901. */
  18902. /**
  18903. * @extends {MDCComponent<!MDCTopAppBarBaseFoundation>}
  18904. * @final
  18905. */
  18906. var MDCTopAppBar = function (_MDCComponent) {
  18907. _inherits(MDCTopAppBar, _MDCComponent);
  18908. /**
  18909. * @param {...?} args
  18910. */
  18911. function MDCTopAppBar() {
  18912. var _ref;
  18913. _classCallCheck(this, MDCTopAppBar);
  18914. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18915. args[_key] = arguments[_key];
  18916. }
  18917. /** @private {?Element} */
  18918. var _this = _possibleConstructorReturn(this, (_ref = MDCTopAppBar.__proto__ || Object.getPrototypeOf(MDCTopAppBar)).call.apply(_ref, [this].concat(args)));
  18919. _this.navIcon_;
  18920. /** @type {?Array<MDCRipple>} */
  18921. _this.iconRipples_;
  18922. return _this;
  18923. }
  18924. _createClass(MDCTopAppBar, [{
  18925. key: 'initialize',
  18926. value: function initialize() {
  18927. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  18928. return __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].attachTo(el);
  18929. };
  18930. this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR);
  18931. // Get all icons in the toolbar and instantiate the ripples
  18932. var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR));
  18933. if (this.navIcon_) {
  18934. icons.push(this.navIcon_);
  18935. }
  18936. this.iconRipples_ = icons.map(function (icon) {
  18937. var ripple = rippleFactory(icon);
  18938. ripple.unbounded = true;
  18939. return ripple;
  18940. });
  18941. }
  18942. }, {
  18943. key: 'destroy',
  18944. value: function destroy() {
  18945. this.iconRipples_.forEach(function (iconRipple) {
  18946. return iconRipple.destroy();
  18947. });
  18948. _get(MDCTopAppBar.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBar.prototype), 'destroy', this).call(this);
  18949. }
  18950. /**
  18951. * @param {!Element} root
  18952. * @return {!MDCTopAppBar}
  18953. */
  18954. }, {
  18955. key: 'getDefaultFoundation',
  18956. /**
  18957. * @return {!MDCTopAppBarBaseFoundation}
  18958. */
  18959. value: function getDefaultFoundation() {
  18960. var _this2 = this;
  18961. /** @type {!MDCTopAppBarAdapter} */
  18962. var adapter = /** @type {!MDCTopAppBarAdapter} */_extends({
  18963. hasClass: function hasClass(className) {
  18964. return _this2.root_.classList.contains(className);
  18965. },
  18966. addClass: function addClass(className) {
  18967. return _this2.root_.classList.add(className);
  18968. },
  18969. removeClass: function removeClass(className) {
  18970. return _this2.root_.classList.remove(className);
  18971. },
  18972. setStyle: function setStyle(property, value) {
  18973. return _this2.root_.style.setProperty(property, value);
  18974. },
  18975. getTopAppBarHeight: function getTopAppBarHeight() {
  18976. return _this2.root_.clientHeight;
  18977. },
  18978. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  18979. if (_this2.navIcon_) {
  18980. _this2.navIcon_.addEventListener(evtType, handler);
  18981. }
  18982. },
  18983. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  18984. if (_this2.navIcon_) {
  18985. _this2.navIcon_.removeEventListener(evtType, handler);
  18986. }
  18987. },
  18988. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  18989. _this2.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {});
  18990. },
  18991. registerScrollHandler: function registerScrollHandler(handler) {
  18992. return window.addEventListener('scroll', handler);
  18993. },
  18994. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  18995. return window.removeEventListener('scroll', handler);
  18996. },
  18997. registerResizeHandler: function registerResizeHandler(handler) {
  18998. return window.addEventListener('resize', handler);
  18999. },
  19000. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  19001. return window.removeEventListener('resize', handler);
  19002. },
  19003. getViewportScrollY: function getViewportScrollY() {
  19004. return window.pageYOffset;
  19005. },
  19006. getTotalActionItems: function getTotalActionItems() {
  19007. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length;
  19008. }
  19009. });
  19010. /** @type {!MDCTopAppBarBaseFoundation} */
  19011. var foundation = void 0;
  19012. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) {
  19013. foundation = new __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a" /* default */](adapter);
  19014. } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) {
  19015. foundation = new __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a" /* default */](adapter);
  19016. } else {
  19017. foundation = new __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a" /* default */](adapter);
  19018. }
  19019. return foundation;
  19020. }
  19021. }], [{
  19022. key: 'attachTo',
  19023. value: function attachTo(root) {
  19024. return new MDCTopAppBar(root);
  19025. }
  19026. }]);
  19027. return MDCTopAppBar;
  19028. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  19029. /***/ }),
  19030. /* 141 */
  19031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19032. "use strict";
  19033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  19034. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  19035. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(13);
  19036. 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; }; }();
  19037. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  19038. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19039. 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; }
  19040. 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; }
  19041. /**
  19042. * @license
  19043. * Copyright 2018 Google Inc. All Rights Reserved.
  19044. *
  19045. * Licensed under the Apache License, Version 2.0 (the "License");
  19046. * you may not use this file except in compliance with the License.
  19047. * You may obtain a copy of the License at
  19048. *
  19049. * http://www.apache.org/licenses/LICENSE-2.0
  19050. *
  19051. * Unless required by applicable law or agreed to in writing, software
  19052. * distributed under the License is distributed on an "AS IS" BASIS,
  19053. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19054. * See the License for the specific language governing permissions and
  19055. * limitations under the License.
  19056. */
  19057. /**
  19058. * @extends {MDCTopAppBarFoundation<!MDCFixedTopAppBarFoundation>}
  19059. * @final
  19060. */
  19061. var MDCFixedTopAppBarFoundation = function (_MDCTopAppBarFoundati) {
  19062. _inherits(MDCFixedTopAppBarFoundation, _MDCTopAppBarFoundati);
  19063. /**
  19064. * @param {!MDCTopAppBarAdapter} adapter
  19065. */
  19066. function MDCFixedTopAppBarFoundation(adapter) {
  19067. _classCallCheck(this, MDCFixedTopAppBarFoundation);
  19068. /** State variable for the previous scroll iteration top app bar state */
  19069. var _this = _possibleConstructorReturn(this, (MDCFixedTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation)).call(this, adapter));
  19070. _this.wasScrolled_ = false;
  19071. _this.scrollHandler_ = function () {
  19072. return _this.fixedScrollHandler_();
  19073. };
  19074. return _this;
  19075. }
  19076. _createClass(MDCFixedTopAppBarFoundation, [{
  19077. key: 'init',
  19078. value: function init() {
  19079. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'init', this).call(this);
  19080. this.adapter_.registerScrollHandler(this.scrollHandler_);
  19081. }
  19082. }, {
  19083. key: 'destroy',
  19084. value: function destroy() {
  19085. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'destroy', this).call(this);
  19086. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  19087. }
  19088. /**
  19089. * Scroll handler for applying/removing the modifier class
  19090. * on the fixed top app bar.
  19091. */
  19092. }, {
  19093. key: 'fixedScrollHandler_',
  19094. value: function fixedScrollHandler_() {
  19095. var currentScroll = this.adapter_.getViewportScrollY();
  19096. if (currentScroll <= 0) {
  19097. if (this.wasScrolled_) {
  19098. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  19099. this.wasScrolled_ = false;
  19100. }
  19101. } else {
  19102. if (!this.wasScrolled_) {
  19103. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  19104. this.wasScrolled_ = true;
  19105. }
  19106. }
  19107. }
  19108. }]);
  19109. return MDCFixedTopAppBarFoundation;
  19110. }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]);
  19111. /* harmony default export */ __webpack_exports__["a"] = (MDCFixedTopAppBarFoundation);
  19112. /***/ }),
  19113. /* 142 */
  19114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19115. "use strict";
  19116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  19117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(13);
  19118. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  19119. 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; }; }();
  19120. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  19121. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19122. 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; }
  19123. 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; }
  19124. /**
  19125. * @license
  19126. * Copyright 2018 Google Inc. All Rights Reserved.
  19127. *
  19128. * Licensed under the Apache License, Version 2.0 (the "License");
  19129. * you may not use this file except in compliance with the License.
  19130. * You may obtain a copy of the License at
  19131. *
  19132. * http://www.apache.org/licenses/LICENSE-2.0
  19133. *
  19134. * Unless required by applicable law or agreed to in writing, software
  19135. * distributed under the License is distributed on an "AS IS" BASIS,
  19136. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19137. * See the License for the specific language governing permissions and
  19138. * limitations under the License.
  19139. */
  19140. /**
  19141. * @extends {MDCTopAppBarBaseFoundation<!MDCShortTopAppBarFoundation>}
  19142. * @final
  19143. */
  19144. var MDCShortTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  19145. _inherits(MDCShortTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  19146. /**
  19147. * @param {!MDCTopAppBarAdapter} adapter
  19148. */
  19149. function MDCShortTopAppBarFoundation(adapter) {
  19150. _classCallCheck(this, MDCShortTopAppBarFoundation);
  19151. // State variable for the current top app bar state
  19152. var _this = _possibleConstructorReturn(this, (MDCShortTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation)).call(this, adapter));
  19153. _this.isCollapsed = false;
  19154. _this.scrollHandler_ = function () {
  19155. return _this.shortAppBarScrollHandler_();
  19156. };
  19157. return _this;
  19158. }
  19159. _createClass(MDCShortTopAppBarFoundation, [{
  19160. key: 'init',
  19161. value: function init() {
  19162. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'init', this).call(this);
  19163. var isAlwaysCollapsed = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  19164. if (this.adapter_.getTotalActionItems() > 0) {
  19165. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS);
  19166. }
  19167. if (!isAlwaysCollapsed) {
  19168. this.adapter_.registerScrollHandler(this.scrollHandler_);
  19169. this.shortAppBarScrollHandler_();
  19170. }
  19171. }
  19172. }, {
  19173. key: 'destroy',
  19174. value: function destroy() {
  19175. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'destroy', this).call(this);
  19176. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  19177. }
  19178. /**
  19179. * Scroll handler for applying/removing the collapsed modifier class
  19180. * on the short top app bar.
  19181. * @private
  19182. */
  19183. }, {
  19184. key: 'shortAppBarScrollHandler_',
  19185. value: function shortAppBarScrollHandler_() {
  19186. var currentScroll = this.adapter_.getViewportScrollY();
  19187. if (currentScroll <= 0) {
  19188. if (this.isCollapsed) {
  19189. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  19190. this.isCollapsed = false;
  19191. }
  19192. } else {
  19193. if (!this.isCollapsed) {
  19194. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  19195. this.isCollapsed = true;
  19196. }
  19197. }
  19198. }
  19199. }]);
  19200. return MDCShortTopAppBarFoundation;
  19201. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  19202. /* harmony default export */ __webpack_exports__["a"] = (MDCShortTopAppBarFoundation);
  19203. /***/ }),
  19204. /* 143 */
  19205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19206. "use strict";
  19207. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  19208. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(13);
  19209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  19210. 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; }; }();
  19211. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  19212. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19213. 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; }
  19214. 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; }
  19215. /**
  19216. * @license
  19217. * Copyright 2018 Google Inc. All Rights Reserved.
  19218. *
  19219. * Licensed under the Apache License, Version 2.0 (the "License");
  19220. * you may not use this file except in compliance with the License.
  19221. * You may obtain a copy of the License at
  19222. *
  19223. * http://www.apache.org/licenses/LICENSE-2.0
  19224. *
  19225. * Unless required by applicable law or agreed to in writing, software
  19226. * distributed under the License is distributed on an "AS IS" BASIS,
  19227. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19228. * See the License for the specific language governing permissions and
  19229. * limitations under the License.
  19230. */
  19231. var INITIAL_VALUE = 0;
  19232. /**
  19233. * @extends {MDCTopAppBarBaseFoundation<!MDCTopAppBarFoundation>}
  19234. * @final
  19235. */
  19236. var MDCTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  19237. _inherits(MDCTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  19238. /**
  19239. * @param {!MDCTopAppBarAdapter} adapter
  19240. */
  19241. function MDCTopAppBarFoundation(adapter) {
  19242. _classCallCheck(this, MDCTopAppBarFoundation);
  19243. /**
  19244. * Used for diffs of current scroll position vs previous scroll position
  19245. * @private {number}
  19246. */
  19247. var _this = _possibleConstructorReturn(this, (MDCTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation)).call(this, adapter));
  19248. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  19249. /**
  19250. * Used to verify when the top app bar is completely showing or completely hidden
  19251. * @private {number}
  19252. */
  19253. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  19254. /**
  19255. * wasDocked_ is used to indicate if the top app bar was docked in the previous
  19256. * scroll handler iteration.
  19257. * @private {boolean}
  19258. */
  19259. _this.wasDocked_ = true;
  19260. /**
  19261. * isDockedShowing_ is used to indicate if the top app bar is docked in the fully
  19262. * shown position.
  19263. * @private {boolean}
  19264. */
  19265. _this.isDockedShowing_ = true;
  19266. /**
  19267. * Variable for current scroll position of the top app bar
  19268. * @private {number}
  19269. */
  19270. _this.currentAppBarOffsetTop_ = 0;
  19271. /**
  19272. * Used to prevent the top app bar from being scrolled out of view during resize events
  19273. * @private {boolean} */
  19274. _this.isCurrentlyBeingResized_ = false;
  19275. /**
  19276. * The timeout that's used to throttle the resize events
  19277. * @private {number}
  19278. */
  19279. _this.resizeThrottleId_ = INITIAL_VALUE;
  19280. /**
  19281. * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize
  19282. * @private {number}
  19283. */
  19284. _this.resizeDebounceId_ = INITIAL_VALUE;
  19285. _this.scrollHandler_ = function () {
  19286. return _this.topAppBarScrollHandler_();
  19287. };
  19288. _this.resizeHandler_ = function () {
  19289. return _this.topAppBarResizeHandler_();
  19290. };
  19291. return _this;
  19292. }
  19293. _createClass(MDCTopAppBarFoundation, [{
  19294. key: 'init',
  19295. value: function init() {
  19296. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'init', this).call(this);
  19297. this.adapter_.registerScrollHandler(this.scrollHandler_);
  19298. this.adapter_.registerResizeHandler(this.resizeHandler_);
  19299. }
  19300. }, {
  19301. key: 'destroy',
  19302. value: function destroy() {
  19303. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'destroy', this).call(this);
  19304. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  19305. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  19306. this.adapter_.setStyle('top', '');
  19307. }
  19308. /**
  19309. * Function to determine if the DOM needs to update.
  19310. * @return {boolean}
  19311. * @private
  19312. */
  19313. }, {
  19314. key: 'checkForUpdate_',
  19315. value: function checkForUpdate_() {
  19316. var offscreenBoundaryTop = -this.topAppBarHeight_;
  19317. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  19318. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  19319. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  19320. // If it's partially showing, it can't be docked.
  19321. if (partiallyShowing) {
  19322. this.wasDocked_ = false;
  19323. } else {
  19324. // Not previously docked and not partially showing, it's now docked.
  19325. if (!this.wasDocked_) {
  19326. this.wasDocked_ = true;
  19327. return true;
  19328. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  19329. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  19330. return true;
  19331. }
  19332. }
  19333. return partiallyShowing;
  19334. }
  19335. /**
  19336. * Function to move the top app bar if needed.
  19337. * @private
  19338. */
  19339. }, {
  19340. key: 'moveTopAppBar_',
  19341. value: function moveTopAppBar_() {
  19342. if (this.checkForUpdate_()) {
  19343. // Once the top app bar is fully hidden we use the max potential top app bar height as our offset
  19344. // so the top app bar doesn't show if the window resizes and the new height > the old height.
  19345. var offset = this.currentAppBarOffsetTop_;
  19346. if (Math.abs(offset) >= this.topAppBarHeight_) {
  19347. offset = -__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT;
  19348. }
  19349. this.adapter_.setStyle('top', offset + 'px');
  19350. }
  19351. }
  19352. /**
  19353. * Scroll handler for the default scroll behavior of the top app bar.
  19354. * @private
  19355. */
  19356. }, {
  19357. key: 'topAppBarScrollHandler_',
  19358. value: function topAppBarScrollHandler_() {
  19359. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  19360. var diff = currentScrollPosition - this.lastScrollPosition_;
  19361. this.lastScrollPosition_ = currentScrollPosition;
  19362. // If the window is being resized the lastScrollPosition_ needs to be updated but the
  19363. // current scroll of the top app bar should stay in the same position.
  19364. if (!this.isCurrentlyBeingResized_) {
  19365. this.currentAppBarOffsetTop_ -= diff;
  19366. if (this.currentAppBarOffsetTop_ > 0) {
  19367. this.currentAppBarOffsetTop_ = 0;
  19368. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  19369. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  19370. }
  19371. this.moveTopAppBar_();
  19372. }
  19373. }
  19374. /**
  19375. * Top app bar resize handler that throttle/debounce functions that execute updates.
  19376. * @private
  19377. */
  19378. }, {
  19379. key: 'topAppBarResizeHandler_',
  19380. value: function topAppBarResizeHandler_() {
  19381. var _this2 = this;
  19382. // Throttle resize events 10 p/s
  19383. if (!this.resizeThrottleId_) {
  19384. this.resizeThrottleId_ = setTimeout(function () {
  19385. _this2.resizeThrottleId_ = INITIAL_VALUE;
  19386. _this2.throttledResizeHandler_();
  19387. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  19388. }
  19389. this.isCurrentlyBeingResized_ = true;
  19390. if (this.resizeDebounceId_) {
  19391. clearTimeout(this.resizeDebounceId_);
  19392. }
  19393. this.resizeDebounceId_ = setTimeout(function () {
  19394. _this2.topAppBarScrollHandler_();
  19395. _this2.isCurrentlyBeingResized_ = false;
  19396. _this2.resizeDebounceId_ = INITIAL_VALUE;
  19397. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  19398. }
  19399. /**
  19400. * Throttled function that updates the top app bar scrolled values if the
  19401. * top app bar height changes.
  19402. * @private
  19403. */
  19404. }, {
  19405. key: 'throttledResizeHandler_',
  19406. value: function throttledResizeHandler_() {
  19407. var currentHeight = this.adapter_.getTopAppBarHeight();
  19408. if (this.topAppBarHeight_ !== currentHeight) {
  19409. this.wasDocked_ = false;
  19410. // Since the top app bar has a different height depending on the screen width, this
  19411. // will ensure that the top app bar remains in the correct location if
  19412. // completely hidden and a resize makes the top app bar a different height.
  19413. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  19414. this.topAppBarHeight_ = currentHeight;
  19415. }
  19416. this.topAppBarScrollHandler_();
  19417. }
  19418. }]);
  19419. return MDCTopAppBarFoundation;
  19420. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  19421. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarFoundation);
  19422. /***/ })
  19423. /******/ ]);
  19424. });
  19425. //# sourceMappingURL=material-components-web.js.map